Abnormality detection method and device based on power sample matching, medium and equipment
Patent Information
- Application Number
- CN202610988314.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-03
- Publication Date
- 2026-10-23
AI Technical Summary
[0005]本发明提供了一种基于电力样本匹配的异常检测方法、装置、介质及设备,以解决现有技术中无法准确高效地对电力系统的异常进行检测的问题
[0017]本申请通过从样本匹配结果中提取第二深度表征向量,并利用预设的高斯混合模型(GMM)和变分自编码器(VAE)进行异常检测。具体来说,将第二深度表征向量输入高斯混合模型进行概率分布拟合,计算各向量的负对数似然值,得到密度量化异常分数,这一分数反映了样本在特征空间分布密度上的异常程度。同时,将第二深度表征向量输入变分自编码器进行特征重构,并计算原始向量与重构向量之间的误差,得到重构量化异常度,这一度量反映了样本特征的重构误差,用于识别特征空间中的异常。通过结合密度量化异常分数和重构量化异常度,本发明能够从不同角度全面评估样本的异常程度,有效降低误报率和漏检风险,提高电力系统异常检测的准确性和可靠性。
Smart Images

Figure CN122964599A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of anomaly detection, and in particular to an anomaly detection method, apparatus, medium and equipment based on power sample matching. Background Technology
[0002] With the deep integration of smart grid and power Internet of Things technologies, power system status perception, equipment health management and cross-scenario intelligent operation and maintenance have become core requirements for ensuring the safe and stable operation of the power grid. Whether it is power equipment fault early warning, power grid operation status assessment or resource optimization and scheduling, it all depends on the accurate correlation analysis and anomaly identification of multi-source heterogeneous power samples (such as generator parameters, transmission line electrical quantities, distribution equipment status data and load information on the power consumption side).
[0003] However, existing power sample matching and anomaly detection technologies still have significant shortcomings and are difficult to meet the needs of practical applications: First, at the sample association analysis level, traditional methods are mostly based on preset rules or simple similarity measures (such as Euclidean distance and cosine similarity), which cannot effectively distinguish the semantically ambiguous states of power equipment (such as the feature differences between early minor anomalies and normal fluctuations), leading to false or missed matching in sample association, which directly affects the reliability of subsequent anomaly analysis; Second, at the anomaly detection level, existing technologies often rely on single rules or shallow models (such as threshold judgment and support vector machines), which have weak ability to identify the weak features of early faults and the coupling relationship of multi-dimensional anomalies. Not only is the false alarm rate high, but there is also a serious risk of missed detection, making it difficult to predict equipment faults or potential grid operation hazards in advance; Third, in terms of model adaptability and deployment efficiency, traditional feature extraction models lack interactive feedback mechanisms and cannot be iteratively optimized according to the dynamic operating conditions of the power system (such as load fluctuations, equipment aging, and regional grid expansion). Moreover, when deploying across scenarios, the model needs to be retrained for new scenarios, which not only consumes a lot of computing resources but also seriously affects the scheduling response efficiency.
[0004] These shortcomings prevent existing technologies from accurately and efficiently detecting anomalies in power systems. Summary of the Invention
[0005] This invention provides an anomaly detection method, apparatus, medium, and equipment based on power sample matching to solve the problem that existing technologies cannot accurately and efficiently detect anomalies in power systems.
[0006] Firstly, this application provides an anomaly detection method based on power sample matching, comprising: Acquire multi-source sample data of the power system; Based on the multi-source sample data, and combined with a preset feature extraction model that integrates temporal and spatial feature extraction capabilities, the multi-source sample data is deeply represented and encoded to obtain an initial deep representation vector containing power system operating status information. The initial depth representation vector is subjected to cross-domain distribution difference elimination processing to obtain the first depth representation vector; Based on the first deep representation vector, a sample matching result with quantified confidence is generated by using a pre-set power scenario constraint contrast learning mechanism, combined with a pre-set dynamic threshold similarity judgment method and a pre-set confidence screening method. Based on the sample matching results, the feature space distribution density is quantized using a preset Gaussian mixture model to obtain the density quantization anomaly score, and the feature reconstruction error is calculated using a preset variational autoencoder to obtain the reconstruction quantization anomaly degree. The density quantization anomaly score and the reconstruction quantization anomaly degree are fused to obtain the anomaly detection results of the power system.
[0007] This application acquires multi-source sample data from the power system and uses a model integrating temporal and spatial feature extraction capabilities to perform deep representation encoding, obtaining an initial deep representation vector containing power system operating status information. This process comprehensively captures the dynamic and static characteristics of the power system, providing a rich information foundation for subsequent analysis. Next, through cross-domain distribution difference elimination processing, a first deep representation vector is obtained, effectively solving the distribution difference problem caused by different sources of multi-source data and improving data consistency and usability. Based on the first deep representation vector, a power scenario-constrained contrastive learning mechanism is adopted, combined with dynamic threshold similarity judgment and confidence screening methods, to generate sample matching results with quantized confidence. This not only improves the accuracy of sample matching but also enhances the reliability and interpretability of the results. Furthermore, density quantization anomaly scores and reconstructed quantization anomaly degrees are calculated using a Gaussian mixture model and a variational autoencoder, respectively, and then fused to obtain the power system anomaly detection results. This dual-stream anomaly detection mechanism can capture anomaly features from different angles, effectively reducing false alarm rates and missed detection risks, and improving the sensitivity and accuracy of anomaly detection. This application effectively solves the problem that existing technologies cannot accurately and efficiently detect anomalies in power systems.
[0008] Furthermore, after obtaining the anomaly detection results of the power system, the process also includes: Obtain feedback information on the anomaly detection results of the power system; Based on the feedback information and the preset feature extraction model that integrates temporal and spatial feature extraction capabilities, the parameters and structure of the feature extraction model that integrates temporal and spatial feature extraction capabilities are optimized in combination with the preset interactive calibration strategy to obtain the updated feature extraction model.
[0009] After obtaining the anomaly detection results of the power system, this application further obtains the feedback information of these results. Based on this feedback information and a pre-set model with integrated temporal and spatial feature extraction capabilities, combined with a pre-set interactive calibration strategy, the parameters and structure of the feature extraction model are optimized to obtain an updated feature extraction model. This process, by introducing a feedback mechanism, realizes the dynamic adjustment and optimization of the model, enabling the feature extraction model to self-correct and improve based on actual detection results. This interactive calibration strategy not only improves the model's adaptability and accuracy in power system anomaly detection but also enhances the model's generalization ability and iterative optimization efficiency, thereby better coping with various complex situations and dynamic changes in power system operation, further improving the reliability and stability of power system anomaly detection.
[0010] Furthermore, based on the multi-source sample data, and combined with a preset feature extraction model integrating temporal and spatial feature extraction capabilities, the multi-source sample data is subjected to deep representation encoding to obtain a deep representation vector containing power system operating status information, specifically as follows: Obtain the pre-trained deep model parameters in the power field and historical sample data of the power system; Based on a pre-defined spatiotemporal convolutional neural network and a pre-defined gated recurrent unit, combined with the parameters of the pre-trained deep model in the power field and historical sample data of the power system, a feature extraction model integrating temporal and spatial feature extraction capabilities is constructed. The spatiotemporal convolutional neural network is used to extract spatial correlation features of samples, and the gated recurrent unit is used to extract temporal dynamic features of samples. The multi-source sample data is input into the feature extraction model, so that the feature extraction model extracts spatial correlation features from the multi-source sample data through a spatiotemporal convolutional neural network and extracts temporal dynamic features from the multi-source sample data through a gated recurrent unit; and fuses the spatial correlation features and the temporal dynamic features to output a deep representation vector containing power system operating status information.
[0011] This application constructs a feature extraction model integrating temporal and spatial feature extraction capabilities by acquiring pre-trained deep model parameters in the power field and historical sample data of the power system, combined with a spatiotemporal convolutional neural network (STCNN) and a gated recurrent unit (GRU). STCNN is responsible for extracting the spatial correlation features of the samples, while GRU focuses on extracting the temporal dynamic features. After inputting multi-source sample data into the model, it can simultaneously extract features in both spatial and temporal dimensions, fuse them, and output a deep representation vector containing information about the power system's operating state. This process not only fully utilizes the knowledge transfer from the pre-trained model but also achieves comprehensive feature extraction from multi-source sample data of the power system through the synergistic effect of STCNN and GRU. This deep representation vector can more accurately reflect the operating state of the power system, providing a high-quality feature foundation for subsequent anomaly detection and analysis, thereby improving the accuracy and reliability of power system anomaly detection.
[0012] Furthermore, the process of performing cross-domain distribution difference elimination processing on the initial depth representation vector to obtain the first depth representation vector specifically involves: A domain adversarial training mechanism is constructed, which includes a feature extraction submodule and a domain discrimination submodule, and a gradient inversion layer is deployed between the feature extraction submodule and the domain discrimination submodule; The initial deep representation vector is input into the feature extraction submodule of the domain adversarial training mechanism, so that the feature extraction submodule performs feature transformation on the deep representation vector to obtain a preliminary transformed vector. The initial transformation vector is input into the domain discrimination submodule so that the feature extraction submodule and the domain discrimination submodule can perform adversarial training to obtain an intermediate processing vector; Acquire operating parameter deviation data of the power system; the operating parameter deviation data includes voltage deviation range and current fluctuation range. Based on the operational parameter deviation data, the constraint weights of the preset domain adaptation loss function are optimized, and the intermediate processing vector is input into the optimized domain adaptation loss function for secondary optimization to obtain the first depth representation vector.
[0013] This application constructs a domain adversarial training mechanism, specifically including a feature extraction submodule and a domain discrimination submodule, with a gradient inversion layer deployed between them to process the initial deep representation vector. First, the feature extraction submodule performs feature transformation on the initial deep representation vector to obtain a preliminary transformed vector. Then, the domain discrimination submodule and the feature extraction submodule undergo adversarial training to further optimize the preliminary transformed vector, obtaining an intermediate processed vector. Next, the operating parameter deviation data of the power system are acquired, including voltage deviation range and current fluctuation interval, and the constraint weights of a preset domain adaptation loss function are optimized based on this data. Finally, the intermediate processed vector is input into the optimized domain adaptation loss function for secondary optimization to obtain the first deep representation vector. This process, through domain adversarial training and the optimized domain adaptation loss function, effectively eliminates cross-domain distribution differences, improves the consistency and stability of feature vectors, thereby providing a more accurate feature basis for subsequent anomaly detection and enhancing the reliability and accuracy of power system anomaly detection.
[0014] Furthermore, based on the first deep representation vector, a sample matching result with quantified confidence is generated through a pre-defined power scenario constraint-based contrastive learning mechanism, combined with a pre-defined dynamic threshold similarity determination method and a pre-defined confidence screening method. Specifically: Obtain category label information for equipment status samples in the power system; the category label information includes normal operation label, abnormal warning label, and fault status label; Based on the category label information, sample pairs of similar device states are selected from the first deep representation vector; Based on the first deep representation vector and the state sample pairs of the same type of equipment, a contrastive learning loss function incorporating power scenario operating condition features is constructed; the power scenario operating condition features include load level and ambient temperature influence coefficient. The contrastive learning loss function is optimized to make the state samples of similar devices clustered in the feature space, thereby obtaining the sample clustering distribution features; A dynamic threshold similarity determination method is used to measure the semantic association of the clustering distribution features of the samples, and a sample similarity matrix is generated. The sample association pairs in the sample similarity matrix are filtered according to the quantified confidence threshold, and the sample association pairs with the confidence level reaching the preset threshold are retained to generate sample matching results with quantified confidence. The quantitative confidence screening threshold is determined based on the power system anomaly risk level.
[0015] This application obtains category label information of equipment status samples in a power system, including normal operation labels, anomaly warning labels, and fault status labels, and filters out similar equipment status sample pairs from a first deep representation vector. Based on these sample pairs and the first deep representation vector, a contrastive learning loss function incorporating power scenario operating condition features (such as load level and ambient temperature influence coefficient) is constructed and optimized to cluster similar equipment status samples in the feature space, obtaining sample clustering distribution features. Furthermore, a dynamic threshold similarity determination method is used to semantically associate the sample clustering distribution features, generating a sample similarity matrix. Finally, sample association pairs in the sample similarity matrix are filtered according to a quantified confidence threshold (determined based on the power system anomaly risk level), retaining sample association pairs with a confidence level reaching a preset threshold, generating sample matching results with quantified confidence. This process, through a contrastive learning mechanism constrained by the power scenario and a dynamic threshold similarity determination method, improves the accuracy and reliability of sample matching. Simultaneously, the introduction of quantified confidence makes the matching results more interpretable and practical, effectively improving the accuracy and efficiency of power system anomaly detection.
[0016] Furthermore, based on the sample matching results, the feature space distribution density is quantized using a preset Gaussian mixture model to obtain a density quantization anomaly score, and the feature reconstruction error is calculated using a preset variational autoencoder to obtain a reconstruction quantization anomaly degree, specifically as follows: Extract the second depth representation vector from the sample matching results; The second depth representation vector is input into a preset Gaussian mixture model for probability distribution fitting, and the negative log-likelihood value of each second depth representation vector is calculated to obtain the density quantization anomaly score. The second deep representation vector is input into a preset variational autoencoder for feature reconstruction. The error between the second deep representation vector and the reconstructed vector is calculated to obtain the reconstruction quantization anomaly degree.
[0017] This application extracts a second deep representation vector from sample matching results and uses a pre-defined Gaussian Mixture Model (GMM) and Variational Autoencoder (VAE) for anomaly detection. Specifically, the second deep representation vector is input into the Gaussian Mixture Model for probability distribution fitting, and the negative log-likelihood value of each vector is calculated to obtain a density-quantized anomaly score. This score reflects the degree of anomaly of the sample in terms of feature space distribution density. Simultaneously, the second deep representation vector is input into the Variational Autoencoder for feature reconstruction, and the error between the original vector and the reconstructed vector is calculated to obtain a reconstruction-quantized anomaly degree. This metric reflects the reconstruction error of the sample features and is used to identify anomalies in the feature space. By combining the density-quantized anomaly score and the reconstruction-quantized anomaly degree, this invention can comprehensively evaluate the degree of anomaly of samples from different perspectives, effectively reducing false alarm rates and missed detection risks, and improving the accuracy and reliability of power system anomaly detection.
[0018] Furthermore, the multi-source sample data of the power system includes electrical parameter data of each link of the power system, equipment status monitoring data, and environmental correlation data; The electrical parameter data includes the output voltage data of the generating units on the generating side, the real-time current data of the transmission lines on the transmission side, the power data of the bus on the distribution side, and the voltage and current data of the user load on the power consumption side. The equipment status monitoring data includes transformer oil temperature data, circuit breaker opening and closing status data, transmission line tower vibration data, and power distribution equipment insulation performance monitoring data. The environmental data includes real-time temperature, humidity, and wind speed data for the area where the power equipment is deployed.
[0019] This application integrates multi-source sample data from the power system, including electrical parameter data from the generation, transmission, distribution, and consumption sides, as well as condition monitoring data from transformers, circuit breakers, transmission lines, and distribution equipment, and environmental data (temperature, humidity, wind speed) from the deployment area, achieving comprehensive monitoring of the entire power system. This comprehensive data acquisition method enables the anomaly detection model to capture the operating status of the power system from multiple dimensions, thereby more accurately identifying abnormal situations. For example, voltage data from the generation side and current data from the transmission side can reflect the stability of power transmission, while equipment condition monitoring data can directly reflect the health status of critical equipment. The inclusion of environmental data further considers the impact of external factors on the power system, allowing the model to more comprehensively assess anomaly risks. In this way, this application not only improves the accuracy of anomaly detection but also enhances the reliability and stability of power system operation, providing strong support for intelligent operation and maintenance of the power system.
[0020] Secondly, this application provides an anomaly detection device based on power sample matching. The anomaly detection device based on power sample matching includes: The acquisition module is used to acquire multi-source sample data of the power system; The encoding module is used to perform deep representation encoding on the multi-source sample data based on the multi-source sample data and combined with a preset feature extraction model that integrates temporal and spatial feature extraction capabilities, so as to obtain an initial deep representation vector containing power system operating status information. The first processing module is used to perform cross-domain distribution difference elimination processing on the initial depth representation vector to obtain the first depth representation vector. The second processing module is used to generate sample matching results with quantified confidence based on the first deep representation vector, through a preset power scenario constraint contrast learning mechanism, combined with a preset dynamic threshold similarity judgment method and a preset confidence screening method. The calculation module is used to quantify the feature space distribution density based on the sample matching results using a preset Gaussian mixture model to obtain the density quantization anomaly score, and to calculate the feature reconstruction error using a preset variational autoencoder to obtain the reconstruction quantization anomaly degree. The fusion module is used to fuse the density quantization anomaly score and the reconstruction quantization anomaly degree to obtain the anomaly detection result of the power system.
[0021] This application's anomaly detection device based on power sample matching achieves accurate detection of power system anomalies through the collaborative work of multiple modules. The acquisition module collects multi-source sample data from the power system, providing comprehensive raw information for subsequent processing. The encoding module uses a pre-defined feature extraction model to perform deep representation encoding on this data, obtaining an initial deep representation vector. This process effectively extracts key features of the power system's operating state. The first processing module further optimizes the feature vector through cross-domain distribution difference elimination processing, making it more consistent and stable. The second processing module, based on the optimized feature vector, uses a contrastive learning mechanism constrained by power scenarios and a dynamic threshold similarity judgment method to generate sample matching results with quantized confidence, improving the accuracy and reliability of sample matching. The calculation module uses a Gaussian mixture model and a variational autoencoder to calculate the density quantization anomaly score and the reconstructed quantization anomaly degree, respectively, evaluating the anomaly degree of the sample from different perspectives. Finally, the fusion module fuses these two quantization anomaly degrees to obtain the final anomaly detection result. This orderly combination and collaborative work of the modules not only improves the accuracy and reliability of anomaly detection but also enhances the system's generalization ability and adaptability, providing strong support for the stable operation of the power system.
[0022] Thirdly, this application provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the described anomaly detection method based on power sample matching. Its beneficial effects are the same as those of the anomaly detection method based on power sample matching provided in the first aspect of this application.
[0023] Fourthly, this application provides a terminal device including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement any of the anomaly detection methods based on power sample matching as described in the first aspect. Attached Figure Description
[0024] Figure 1 : A schematic flowchart of an embodiment of the anomaly detection method based on power sample matching provided in this application; Figure 2 : A schematic diagram of an embodiment of the anomaly detection device based on power sample matching provided in this application. Detailed Implementation
[0025] 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 some embodiments of the present invention, and not all embodiments. 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.
[0026] Example 1 Please refer to Figure 1 In order to solve the problem that existing technologies cannot accurately and efficiently detect anomalies in power systems, this invention provides an anomaly detection method based on power sample matching, including steps S01-S06.
[0027] S01: Obtain multi-source sample data of the power system.
[0028] In a preferred embodiment of this invention, the acquisition of multi-source sample data of the power system specifically includes: In the anomaly detection process of this embodiment, the first step is to complete the collection and preprocessing of multi-source sample data from the power system to ensure the accuracy of subsequent deep characterization coding and anomaly analysis. The multi-source sample data covers all aspects of power system operation, equipment status, and external influencing factors. The specific collection methods and data categories are as follows: From the perspective of electrical parameters at various stages of the power system, output voltage data of thermal power units, hydropower units, or new energy generator units are collected in real time through unit monitoring devices deployed on the generation side; real-time current data of transmission lines is obtained using current transformers and voltage transformers along the transmission lines; bus power data is recorded using bus monitoring units in distribution-side substations; and load voltage and current data of residential, industrial, and commercial users are collected through user metering devices on the consumption side. The above electrical parameter data directly reflect the real-time status of energy transmission and consumption in the power system.
[0029] From the perspective of power equipment condition monitoring, for transformers, oil temperature sensors collect oil temperature data during operation to determine the equipment's heat dissipation and insulation status; for circuit breakers, condition monitoring modules record opening and closing operation signals and operating status data to ensure the reliability of switching equipment operation; for transmission lines, vibration sensors on the towers collect tower vibration data to avoid safety hazards caused by line galloping or icing; for power distribution equipment (such as switchgear and cables), insulation performance testing devices obtain monitoring data such as insulation resistance and dielectric loss to prevent insulation breakdown faults.
[0030] From an environmental perspective, temperature and humidity sensors and wind speed monitors are deployed on power equipment (such as substations, transmission towers, and distribution substations) to collect real-time temperature, humidity, and wind speed data of the equipment deployment area. Environmental factors (such as high temperature, high humidity, and strong wind) directly affect the heat dissipation efficiency and insulation performance of the equipment. This data can help determine whether abnormal power system operation is caused by external environmental interference.
[0031] After completing the above multi-source data collection, the data needs to be preprocessed: invalid data caused by sensor failures are removed, redundant records in the data collection process are corrected, and the measurement units and formats of different types of data are unified through data standardization processing. Finally, a well-structured and complete multi-source sample dataset is formed, which provides high-quality input for subsequent deep representation encoding based on feature extraction models.
[0032] S02: Based on the multi-source sample data, and combined with a preset feature extraction model that integrates temporal and spatial feature extraction capabilities, the multi-source sample data is subjected to deep representation encoding to obtain an initial deep representation vector containing power system operating status information.
[0033] In a preferred embodiment of this invention, the step of performing deep representation encoding on the multi-source sample data based on the multi-source sample data and combining it with a preset feature extraction model that integrates temporal and spatial feature extraction capabilities to obtain an initial deep representation vector containing power system operating status information is as follows: After completing the collection and preprocessing of multi-source sample data of the power system, a feature extraction model with the ability to extract time-series and spatial features is needed to perform deep representation encoding on the multi-source sample data, so as to transform the raw data into an initial deep representation vector that can accurately reflect the operating status of the power system.
[0034] The construction and configuration of this feature extraction model must be tailored to the characteristics of power data: First, the model is initialized using pre-trained deep model parameters obtained from publicly available sources in the power field. These pre-trained parameters have been validated by a large amount of power scenario data, enabling the model to initially possess the ability to identify basic features of power data, avoiding the inefficiency and insufficient accuracy caused by training from scratch. Second, the core of the model adopts an architecture that integrates spatiotemporal convolutional neural networks and gated recurrent units. The spatiotemporal convolutional neural network is responsible for mining spatial correlation features in multi-source sample data. For example, from transmission line current data and substation bus power data, it identifies the power transmission correlation between different regional power grid nodes and the parameter coordination relationship of different monitoring points of the same equipment. The gated recurrent unit focuses on capturing the temporal dynamic features of the data. For example, from user load voltage data and transformer oil temperature change data, it extracts the fluctuation pattern of load over time and the gradual trend of equipment status with operating time.
[0035] After model configuration, preprocessed multi-source sample data is input into the feature extraction model according to the model input specifications: the spatiotemporal convolutional neural network parses the spatial dimension information in the data layer by layer through multi-layer convolution operations, and outputs a feature matrix that can characterize the spatial correlation attributes of the data; the gated recurrent unit receives multi-source sample data in the form of sequence data, and selectively retains key temporal information and filters redundant fluctuations through gating mechanisms (input gate, forget gate, output gate), and outputs feature vectors that reflect the temporal dynamic characteristics of the data. Subsequently, the model performs dimensional unification and information integration on the spatial correlation feature matrix and the temporal dynamic feature vector through the feature fusion module, transforming the two types of features into a high-dimensional, compact vector form. The final vector is the initial deep representation vector, which not only contains real-time operating parameter information of each link of the power system, but also incorporates deep features such as equipment status correlation and operating trends, which can directly provide high-quality feature input for subsequent cross-domain distribution difference elimination processing.
[0036] More specifically, the specific implementation of this embodiment of a deep encoder that fuses a spatiotemporal convolutional neural network with a gated recurrent unit is as follows: A deep encoder integrating a spatiotemporal convolutional neural network and a gated recurrent unit is constructed as the core structure of the feature extraction model. The spatiotemporal convolutional neural network is responsible for extracting spatial correlation features from multi-source sample data of the power system, such as topological relationships between power grid nodes in different regions and the operational coordination of equipment clusters. The gated recurrent unit focuses on capturing temporal dynamic features in the data, such as the periodicity of load fluctuations and the gradual change trend of equipment status over time. Through the structural fusion of these two components, the model is able to simultaneously handle spatial correlation and temporal evolution features, thus completing the functional configuration of the feature extraction model.
[0037] Furthermore, multi-source sample data from the power system are input into the configured feature extraction model to extract temporal dynamic features and spatial correlation features, thereby obtaining a deep representation vector.
[0038] After preprocessing, the multi-source sample data of the power system is converted to the required format according to the feature extraction model, it is input into the configured feature extraction model. The model uses a spatiotemporal convolutional neural network layer to perform spatial feature analysis on the data, identifying the correlation features between different devices and nodes. Then, a gated recurrent unit layer performs temporal sequence analysis on the data to capture the dynamic trends and evolution patterns of state changes. Finally, the model's feature fusion module integrates the spatial correlation features and temporal dynamic features, transforming them into a high-dimensional, compact vector form that comprehensively reflects the core attributes of the samples, resulting in a deep representation vector.
[0039] S03: Perform cross-domain distribution difference elimination processing on the initial depth representation vector to obtain the first depth representation vector.
[0040] In a preferred embodiment of this invention, the step of performing cross-domain distribution difference elimination processing on the initial depth representation vector to obtain the first depth representation vector specifically involves: In power systems, initial deep representation vectors may originate from different application scenarios (such as distribution networks in different regions or monitoring scenarios for different types of power generation equipment). These vectors from different scenarios often exhibit cross-domain distribution differences. For example, the load feature vector of a city's core area power grid and the load feature vector of a suburban power grid may have significant deviations in their distribution patterns in the feature space due to differences in user structure and equipment configuration. If directly used for subsequent sample matching and anomaly detection, this can easily lead to feature failure and distorted analysis results. Therefore, it is necessary to perform cross-domain distribution difference elimination processing on the initial deep representation vectors to obtain a first deep representation vector with consistent feature distribution.
[0041] This processing method centers on a domain adversarial training mechanism. First, it constructs an adversarial framework comprising a feature extraction submodule and a domain discrimination submodule, deploying a gradient inversion layer between the two submodules. The feature extraction submodule transforms the input initial deep representation vector, preserving as much core information reflecting the power system's operating state as possible. The domain discrimination submodule determines the original scene (i.e., the "domain") to which the transformed vector belongs, creating a game-theoretic relationship between the two. Specifically, after the initial deep representation vector is input into the feature extraction submodule, it outputs a preliminary transformed vector. This vector is then input into the domain discrimination submodule, which determines the domain origin based on the vector features and outputs a discrimination result. Simultaneously, the gradient inversion layer propagates the gradient of the discrimination loss back to the feature extraction submodule. The gradient inversion layer does not change the feature data during forward propagation but reverses the gradient direction during backward propagation. This allows the feature extraction submodule to adjust its parameters under loss feedback, gradually generating feature vectors whose domain origin is difficult for the domain discrimination submodule to identify, ultimately resulting in an intermediate processed vector that reduces the cross-domain feature distribution difference metric.
[0042] Considering the operating characteristics of the power system, further optimization is needed based on actual operating parameter deviations. Operating parameter deviation data (such as voltage deviation ranges and current fluctuation intervals under different scenarios) can be obtained through the power monitoring system. This data reflects the physical operational differences of the power system under different domain scenarios. The constraint weights of the domain adaptation loss function are adjusted based on this data. For example, for scenarios with large voltage deviations, the constraint weights of voltage-related features are appropriately increased to ensure that key features related to the safe operation of the power system are not lost while eliminating cross-domain distribution differences. The intermediate processing vector is then input into the optimized domain adaptation loss function for a second iteration of optimization. By minimizing the difference in inter-domain feature distributions and the constraint loss of operating parameter deviations, a first deep representation vector with consistent cross-domain distribution and retaining complete power system operating state information is finally obtained, laying the foundation for subsequent sample matching based on a unified feature distribution.
[0043] More specifically, (1) construct a domain adversarial training mechanism and deploy a gradient inversion layer.
[0044] For example, a domain adversarial framework adapted to the power industry is designed, clarifying the collaborative logic between the feature extraction module and the domain discrimination module. The feature extraction module is responsible for maintaining the core semantics of the deep representation vector, while the domain discrimination module focuses on identifying the domain origin attributes of the vector. A gradient inversion layer is deployed between the two modules. This layer keeps the feature data unchanged during forward propagation and inverts the gradient during backward propagation, thus realizing the core mechanism of adversarial training and providing a structural foundation for subsequent inter-domain feature alignment. (2) Adversarial training is performed on the initial deep representation vector through a domain adversarial training mechanism.
[0045] For example, the initial deep representation vectors are adversarially trained using a constructed domain adversarial training mechanism to reduce the feature distribution difference metric. Deep representation vectors from different domains are input into the adversarial framework. The feature extraction module generates vector representations containing the core features of the electricity sample, and the domain discrimination module determines the domain category based on these representations. Through backpropagation adjustment using a gradient reversal layer, the feature extraction module continuously optimizes to generate representation vectors whose domain origin is difficult to discriminate, gradually bringing the distributions of vectors from different domains in the feature space closer together, resulting in intermediate processed vectors.
[0046] (3) Based on the deviation characteristics between the intermediate processing vector and the power system operating parameters, optimize the domain adaptation loss function to obtain the first deep representation vector after eliminating cross-domain distribution differences.
[0047] For example, the unique operating parameter deviation characteristics of the power system are analyzed, such as differences in load benchmarks between different regional power grids and differences in parameter ranges caused by equipment types. These characteristics are then transformed into constraints for the loss function. By adjusting the constraints, the sensitivity of the loss function to inter-domain differences is adjusted, so that the function reduces inter-domain distribution deviations while retaining the key features related to the power samples and operating parameters during the optimization process. Based on the optimized loss function, the vector is iteratively adjusted until the vector exhibits a consistent inter-domain distribution and complete core semantics in the feature space, resulting in the first deep representation vector after eliminating cross-domain distribution differences.
[0048] S04: Based on the first deep representation vector, through a pre-set power scenario constraint comparison learning mechanism, combined with a pre-set dynamic threshold similarity determination method and a pre-set confidence screening method, a sample matching result with quantified confidence is generated.
[0049] In a preferred embodiment of this example, the step of generating sample matching results with quantified confidence based on the first deep representation vector, through a preset power scenario constraint contrastive learning mechanism, combined with a preset dynamic threshold similarity determination method and a preset confidence screening method, specifically involves: After obtaining the first deep representation vector, the samples need to be accurately associated and matched through an analysis process that fits the actual operation scenario of the power system. The specific process revolves around the comparative learning mechanism of power scenario constraints, dynamic threshold similarity judgment and confidence screening, and finally generates sample matching results with quantified confidence.
[0050] First, based on the actual operating status of equipment in the power system, category label information for each equipment status sample is obtained. These labels cover typical scenarios such as normal operation, abnormal warnings, and fault states, and can be determined through historical operation and maintenance records and real-time monitoring alarm information of power equipment. Based on the category labels, sample pairs belonging to the same equipment state (i.e., similar equipment state sample pairs) are selected from the first deep representation vector, providing basic data for subsequent comparative learning. Then, a comparative learning loss function incorporating power scenario operating condition characteristics is constructed: combining power system load levels (such as peak load, flat load, and off-peak load) and environmental temperature influence coefficients (such as the impact of high temperature on equipment heat dissipation and the impact of low temperature on insulation performance) as constraints into the loss function, ensuring that the comparative learning process conforms to the actual operating characteristics of the power scenario. By optimizing this loss function, similar equipment state samples are forced to exhibit a clustered distribution pattern in the feature space; that is, sample vectors of normal operation states cluster in the same feature region, while sample vectors of abnormal states form independent clusters, ultimately obtaining sample clustering distribution characteristics that clearly reflect the association between sample categories.
[0051] Next, a dynamic threshold similarity determination method is used to measure the semantic association of sample clustering distribution features: the similarity determination threshold is dynamically adjusted according to the clustering density of samples in the feature space. For example, in densely clustered regions (such as areas with a large number of normally functioning equipment samples), the similarity threshold is appropriately increased to avoid mismatches of low-association samples; in sparsely clustered regions (such as areas with a small number of anomaly warning samples), the threshold is moderately decreased to ensure that effectively associated samples are not missed. Based on the adjusted dynamic threshold, the semantic association degree between any two sample vectors is calculated (e.g., through cosine similarity, Euclidean distance, etc.), and the association degree values of all samples are organized into a sample similarity matrix, where each element corresponds to the association strength of a pair of samples.
[0052] Finally, the quantitative confidence threshold is determined based on the anomaly risk level of the power system: for scenarios involving core power supply equipment (such as main transformers and hub substations), where anomalies may lead to large-scale power outages, a higher confidence threshold is required to ensure the reliability of the matching results; for scenarios involving ordinary power distribution equipment, the threshold can be appropriately lowered to balance matching efficiency and accuracy. Based on this threshold, sample association pairs in the sample similarity matrix are filtered, retaining those whose association degree meets the threshold requirement. The association degree value of each pair is used as its quantitative confidence degree; for example, a sample pair with an association degree of 0.95 has a quantitative confidence degree of 0.95. Through this process, a sample matching result containing sample association relationships and corresponding quantitative confidence degrees is finally generated. This result can directly provide accurate sample association basis for subsequent anomaly detection.
[0053] More specifically, based on the first deep representation vector after eliminating cross-domain distribution differences, a contrastive learning loss function constrained by the power scenario is constructed to force state samples of similar equipment to cluster in the feature space, obtaining cluster distribution features, including: (1) Obtain the category label information of the power equipment status sample.
[0054] For example, category label information for power equipment status samples is collected, including status identifiers for various equipment such as transformers and circuit breakers at different operating stages. The label information is then verified and standardized, eliminating ambiguous labels and contradictory records. Simultaneously, the data is correlated with basic equipment parameters and operating environment information to generate a standardized category label dataset, providing a more accurate basis for subsequent sample classification. Ambiguous labels include undefined abnormal states, and contradictory records include labels that conflict with actual equipment monitoring data.
[0055] (2) Determine the status sample pairs of similar devices based on category label information.
[0056] For example, based on the standardized category label information, the samples are grouped and classified according to the dual criteria of equipment type consistency and state attribute uniformity. Sample pairs are selected from each group, taking into account the diversity of operating conditions and data completeness, excluding samples with missing data or excessive repetition of operating conditions, and determining the same equipment state sample pairs consisting of samples of the same type of equipment, the same state attributes, and complementary operating conditions.
[0057] (3) Using the following formula, a contrastive learning loss function incorporating the operating conditions of the power scenario is constructed based on the deep representation vector after eliminating cross-domain distribution differences and the state sample pairs of similar equipment: in, This represents the contrastive learning loss function. Indicates the number of samples in the batch. Indicates the first A deep representation vector of a device state. Indicates and Positive sample representation vectors of the same type This represents the similarity calculation function. Temperature parameters are used to control the sharpness of the distribution. This represents the total number of all comparison samples. For example, based on the first deep representation vector after eliminating cross-domain distribution differences, and combined with identified similar equipment state sample pairs, a contrastive learning loss function incorporating the operating characteristics of the power scenario is constructed. During function construction, power system-specific constraints are incorporated, clarifying the core components of the function, including a batch sample quantity parameter reflecting the total number of training samples in a single session, the deep representation vector of the corresponding individual sample, the positive sample representation vector within the same group, a similarity calculation function adapted to the temporal correlation of power data, a temperature parameter used to adjust the density of feature distribution, and a parameter representing the total number of all samples participating in the comparison. This ensures that the function can both realize the core logic of contrastive learning and accurately characterize the operating characteristics of the power scenario. Power system-specific constraints include equipment rated parameter ranges and feature fluctuation thresholds under typical operating conditions. The temperature parameter value needs to be dynamically adapted with reference to the feature dispersion of the power samples.
[0058] (4) By optimizing the contrastive learning loss function, the state samples of similar devices are forced to cluster in the feature space to obtain the clustering distribution features.
[0059] For example, the constructed contrastive learning loss function is iteratively optimized. The optimization process aims to reduce the distance between similar equipment state samples in the feature space and increase the interval between samples of different categories, while introducing physical constraints of power equipment operation. By adjusting the optimization step size and the number of iterations, and combining sample distribution monitoring to dynamically correct key variables such as temperature parameters, the process continues until the function output value converges and stabilizes, and similar equipment state samples exhibit a compact and clearly defined clustering pattern in the feature space, thus obtaining the clustering distribution characteristics. Physical constraints, such as ensuring that the feature vectors do not exceed the parameter mapping range during normal equipment operation, are also included. Sample distribution monitoring includes the clustering density of similar samples and the separation degree of samples of different categories.
[0060] S05: Based on the sample matching results, the feature space distribution density is quantized using a preset Gaussian mixture model to obtain the density quantization anomaly score, and the feature reconstruction error is calculated using a preset variational autoencoder to obtain the reconstruction quantization anomaly degree.
[0061] In a preferred embodiment of this example, based on the sample matching results, the feature space distribution density is quantized using a preset Gaussian mixture model to obtain a density quantization anomaly score, and the feature reconstruction error is calculated using a preset variational autoencoder to obtain a reconstruction quantization anomaly degree. Specifically: After obtaining the sample matching results with quantified confidence, it is necessary to extract the feature vectors with analytical value from the results, namely the second deep representation vectors corresponding to the high-confidence samples (these vectors have been filtered by sample matching to exclude invalid data with low correlation and can more accurately reflect the core characteristics of power system samples). These vectors are used as inputs for subsequent anomaly quantification analysis, and the calculation of two types of anomaly quantification indicators is completed by Gaussian mixture model and variational autoencoder, respectively.
[0062] The quantization process for Gaussian mixture models is as follows: First, the Gaussian mixture model is trained using the second-depth representation vectors corresponding to historical normal operating samples of the power system. This allows the model to learn and fit the probability distribution of normal samples in the feature space. For example, the feature vectors of equipment under normal operating conditions will form a specific distribution pattern in the feature space. The model determines parameters such as the mean, covariance, and mixing coefficients of the distribution by learning this pattern. After training, the second-depth representation vectors to be analyzed are input into the model. Based on the learned normal distribution parameters, the model calculates the probability of each vector appearing in this distribution. Since the feature vectors of anomalous samples deviate from the normal distribution and have a lower probability of occurrence, the degree of anomalousness is quantified by calculating the negative log-likelihood value of this probability. The larger the negative log-likelihood value, the more significant the deviation of the vector from the normal feature distribution, and the higher the corresponding anomalous risk. This negative log-likelihood value is the density-quantified anomalous score.
[0063] The quantization process of a variational autoencoder (VAE) consists of an encoder and a decoder. First, the model is trained using the second-depth representation vector of historical normal samples. This allows the encoder to map normal feature vectors to a low-dimensional latent space, forming a compact latent feature representation. Simultaneously, the decoder can accurately reconstruct a feature vector highly similar to the original vector based on this latent feature. After training, the second-depth representation vector to be analyzed is input into the encoder to obtain the corresponding latent feature. Then, the latent feature is input into the decoder, which reconstructs a new feature vector (i.e., the reconstructed vector) based on the latent feature. The reconstruction effect is measured by calculating the difference between the original second-depth representation vector and the reconstructed vector (e.g., mean squared error, cosine distance). Features of normal samples conform to the model's learning patterns, resulting in a small difference between the reconstructed vector and the original vector, and a low error value. However, features of abnormal samples deviate from normal patterns, making accurate reconstruction difficult for the decoder, and the error value increases significantly. This error value is the reconstruction quantization anomaly degree.
[0064] More specifically, based on the characteristic distribution patterns of power equipment state samples, the core parameters of the Gaussian mixture model are determined to ensure that the model can accurately fit the distribution pattern of power samples in the feature space. The basic structure of the Gaussian mixture model is clarified, and the number of Gaussian components in the model is determined according to the typical state categories of the power samples, ensuring that the number of components matches the number of peaks in the characteristic distribution corresponding to different states of the samples. Deep representation vectors are input into the model for training. Through iterative optimization, the model gradually adapts to the actual distribution pattern of the vectors, learning and generating probability distribution parameters. These parameters include the mean, covariance, and mixing coefficient of each Gaussian component. The mean reflects the distribution center of the corresponding state feature, the covariance reflects the correlation between feature dimensions, and the mixing coefficient reflects the proportion of each component in the overall distribution, thus ensuring that the parameters can accurately characterize the probability distribution pattern of the vectors in the feature space. The acquired second deep representation vector is input into the model, and the model calculates the probability density value of each vector in the feature space. This density value is compared with the density distribution interval of normal state samples, and the degree of deviation from the normal interval is converted into a numerical anomaly representation, generating a density quantification anomaly score that reflects the degree of anomaly in the vector space distribution. The higher the score, the more significant the deviation of the vector from the normal distribution. Among them, the feature distribution pattern is the feature clustering range of normal state samples and the dispersion trend of fault state samples. A likelihood function is constructed based on the probability distribution parameters. This function reflects the probability of a single sample occurring under the probability distribution characterized by the current model. The closer a sample is to the distribution center of its corresponding Gaussian component, the larger the likelihood function value, indicating that the sample conforms more closely to the normal distribution pattern. The farther a sample deviates from the distribution center, the smaller the likelihood function value, indicating that the sample has an abnormal tendency. Taking the negative logarithm of the likelihood function value transforms the probability of sample occurrence into an intuitive numerical indicator. A large likelihood function value corresponds to a small negative log-likelihood value, indicating high sample distribution density and low anomaly. Conversely, a small likelihood function value corresponds to a large negative log-likelihood value, indicating low sample distribution density and high anomaly. Through this transformation, a density-quantified anomaly score is obtained, which quantifies the degree of anomaly in the spatial distribution of samples.
[0065] Combining the dimensionality of power deep representation vectors with the complexity of equipment state features, a variational autoencoder network structure is designed to ensure that the network can effectively capture the semantic information of equipment state and the correlation features of operating conditions in the vectors. The acquired deep representation vectors are input into the encoder, where the core latent features of the vectors are extracted through the encoding process. The decoder then reconstructs a reconstructed vector with the same dimension as the original vector based on these latent features. The difference between the original vector and the reconstructed vector is calculated, and considering the anomaly sensitivity requirements of the power scenario, this difference is transformed into a standardized value to obtain the reconstruction quantization anomaly degree, which reflects the degree of vector reconstruction deviation. The variational autoencoder network structure includes parameters such as the number of layers in the encoder and decoder, the number of neurons, and the type of activation function.
[0066] S06: The density quantization anomaly score and the reconstruction quantization anomaly degree are fused to obtain the anomaly detection result of the power system.
[0067] In a preferred embodiment of this invention, the fusion of the density quantization anomaly score and the reconstruction quantization anomaly degree to obtain the power system anomaly detection result specifically involves: After obtaining the density-quantified anomaly score and the reconstructed quantified anomaly degree, a fusion strategy adapted to the operating characteristics of the power system is needed to integrate the two types of quantitative indicators into a comprehensive result that fully reflects the abnormal state, ultimately generating the power system anomaly detection result. This fusion process needs to take into account the complementarity of the two types of indicators. The density-quantified anomaly score focuses on the degree of deviation of the sample features from the normal pattern in spatial distribution, and has high sensitivity to identify faults with significantly abnormal feature distribution (such as feature mutations caused by sudden short circuits in equipment). The reconstructed quantified anomaly degree focuses on the magnitude of the error in the sample features during the reconstruction process, and has a stronger ability to capture faults with insignificant differences in feature distribution but abnormal internal patterns (such as subtle parameter drifts caused by equipment aging). The combination of the two can avoid the limitations of single-indicator detection.
[0068] First, the fusion weights of the two types of quantitative indicators need to be determined: combining historical anomaly case data of the power system, the contribution of the two types of indicators in different types of anomalies (such as short-circuit faults, insulation aging, load overload, etc.) is statistically analyzed. For example, for short-circuit faults, the density quantification anomaly score has a higher discriminative contribution and can be given a higher weight; for insulation aging faults, the reconstruction quantification anomaly score has a more prominent identification value and its weight ratio can be appropriately increased. Through multiple rounds of verification and adjustment, a fixed fusion weight adapted to the target application scenario is determined, or the weight is dynamically adjusted according to the equipment type and operating conditions (such as peak load period, equipment maintenance period) of the real-time detection scenario to ensure that the fusion result can accurately match the anomaly identification needs of the current scenario.
[0069] Subsequently, based on the determined fusion weights, the density quantization anomaly score and the reconstruction quantization anomaly degree are weighted and calculated to obtain a comprehensive anomaly value. To make the anomaly detection results more practical, multiple anomaly level thresholds need to be preset in conjunction with the power system's safe operation standards. For example, a comprehensive anomaly value in the low range corresponds to "minor anomaly" (such as slight fluctuations in equipment parameters that do not currently affect safe operation), in the middle range it corresponds to "moderate anomaly" (such as significant parameter deviations that require enhanced monitoring), and in the high range it corresponds to "severe anomaly" (such as severely exceeded parameters that pose a safety risk). The calculated comprehensive anomaly value is compared with the preset thresholds to determine the anomaly level corresponding to the current sample.
[0070] Simultaneously, it is necessary to associate the equipment identification, operating scenario, and other information in the sample matching results. Based on the anomaly level, additional dimensions such as "name of the associated equipment," "time period of the anomaly," and "associated operating condition" should be added. For example, clearly labeling "#1 main transformer (peak load period) minor anomaly" and "10kV line (thunderstorm weather) severe anomaly." Finally, integrating the anomaly level, associated information, and two types of original quantitative indicators, a power system anomaly detection result containing multi-dimensional information is formed. This result can be directly used to guide maintenance personnel in conducting targeted investigations or as decision input for the power dispatch system, ensuring the safe and stable operation of the power grid.
[0071] After obtaining the anomaly detection results of the power system, in order to further improve the accuracy and adaptability of subsequent anomaly detection, it is necessary to iteratively optimize the feature extraction model based on the feedback information of the detection results. The specific process is as follows: First, obtain feedback information on anomaly detection results. This feedback comes from two sources: one is the verification conclusions drawn by maintenance personnel after conducting on-site investigations based on the anomaly detection results. For example, confirming that "#1 main transformer slight anomaly" is actually a minor fault in the equipment's cooling fan (accurate detection result), or that "10kV line severe anomaly" is actually temporary sensor interference (false alarm). The second is the matching data between detection results and actual equipment status accumulated during the long-term operation of the power system. For example, statistics reveal patterns such as "higher false alarm rate for distribution network anomalies during off-peak load periods" and "easily missed anomalies related to insulation aging in older transformers." Classify and organize this feedback information to identify areas for optimization, such as "reducing the false alarm rate during off-peak load periods" and "improving the sensitivity of identifying insulation aging anomalies."
[0072] Subsequently, based on the above feedback information and the existing feature extraction model with integrated temporal and spatial feature extraction capabilities, an interactive calibration strategy was adopted to optimize parameters and structure: To address the issue of "inaccurate spatial feature extraction during off-peak periods leading to false alarms," the weights of the regional power grid node association features in the spatiotemporal convolutional neural network of the model were adjusted to enhance the ability to capture subtle spatial differences in equipment under low load conditions during off-peak periods; to address the issue of "insulation aging-related temporal features not being captured enough, leading to missed alarms," the forget gate parameters of the gated loop unit were optimized to extend the memory period for gradual changes in equipment status and avoid missing slowly changing aging features; if feedback showed that the anomaly detection accuracy for a certain type of new equipment (such as new energy inverters) was low, convolutional layers adapted to the data features of this type of equipment were added to the model structure to improve the model's adaptability to new equipment.
[0073] After multiple rounds of parameter adjustments and structural fine-tuning, the optimized model is validated. Historical multi-source sample data is input into the new model, and the differences between its output initial deep representation vector, anomaly detection results, and the original model are compared. Simultaneously, typical cases (such as false alarms and missed alarms) from the feedback information are used to verify the optimization effect. When the model's anomaly detection accuracy for historical cases improves to a preset threshold (e.g., from 92% to 98%), and its adaptability to new scenarios and equipment meets the operational requirements of the power system, the model can be identified as the "updated feature extraction model." This updated model can be used for the next round of deep representation encoding of multi-source sample data from the power system, forming a closed loop of "detection-feedback-optimization-re-detection," continuously improving the practicality and reliability of the anomaly detection method based on power sample matching.
[0074] This embodiment acquires multi-source sample data from the power system and uses a model integrating temporal and spatial feature extraction capabilities to perform deep representation encoding, obtaining an initial deep representation vector containing power system operating status information. This process comprehensively captures the dynamic and static characteristics of the power system, providing a rich information foundation for subsequent analysis. Next, through cross-domain distribution difference elimination processing, a first deep representation vector is obtained, effectively solving the distribution difference problem caused by different sources of multi-source data and improving data consistency and usability. Based on the first deep representation vector, a power scenario-constrained contrastive learning mechanism is adopted, combined with dynamic threshold similarity judgment and confidence screening methods, to generate sample matching results with quantized confidence. This not only improves the accuracy of sample matching but also enhances the reliability and interpretability of the results. Furthermore, density quantization anomaly scores and reconstructed quantization anomaly degrees are calculated using a Gaussian mixture model and a variational autoencoder, respectively, and then fused to obtain the power system anomaly detection results. This dual-stream anomaly detection mechanism can capture anomaly features from different angles, effectively reducing false alarm rates and missed detection risks, and improving the sensitivity and accuracy of anomaly detection. This application effectively solves the problem that existing technologies cannot accurately and efficiently detect anomalies in power systems.
[0075] Example 2 Please refer to Figure 2 This is an anomaly detection device based on power sample matching provided in the embodiments of this application.
[0076] In this embodiment, the anomaly detection device based on power sample matching includes an acquisition module 10, an encoding module 20, a first processing module 30, a second processing module 40, a calculation module 50, and a fusion module 60.
[0077] Acquisition module 10 is used to acquire multi-source sample data of the power system; Encoding module 20 is used to perform deep representation encoding on the multi-source sample data based on the multi-source sample data and combined with a preset feature extraction model that integrates temporal and spatial feature extraction capabilities, so as to obtain an initial deep representation vector containing power system operating status information. The first processing module 30 is used to perform cross-domain distribution difference elimination processing on the initial depth representation vector to obtain the first depth representation vector. The second processing module 40 is used to generate sample matching results with quantified confidence based on the first deep representation vector, through a preset power scenario constraint contrast learning mechanism, combined with a preset dynamic threshold similarity judgment method and a preset confidence screening method. The calculation module 50 is used to quantify the feature space distribution density based on the sample matching result using a preset Gaussian mixture model to obtain a density quantization anomaly score, and to calculate the feature reconstruction error using a preset variational autoencoder to obtain a reconstruction quantization anomaly degree. The fusion module 60 is used to fuse the density quantization anomaly score and the reconstruction quantization anomaly degree to obtain the anomaly detection result of the power system.
[0078] For ease of description and brevity, the embodiments of the device of the present invention include all the implementation methods in the above embodiments of the anomaly detection method based on power sample matching, and will not be repeated here.
[0079] Example 3: This application provides a computer-readable storage medium including a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to execute the aforementioned anomaly detection method based on power sample matching. The anomaly detection method based on power sample matching, when implemented as a software functional unit and used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0080] Example 4 This embodiment provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements any one of the anomaly detection methods based on power sample matching as described in Embodiment 1.
[0081] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. An anomaly detection method based on power sample matching, characterized in that, include: Acquire multi-source sample data of the power system; Based on the multi-source sample data, and combined with a preset feature extraction model that integrates temporal and spatial feature extraction capabilities, the multi-source sample data is deeply represented and encoded to obtain an initial deep representation vector containing power system operating status information. The initial depth representation vector is subjected to cross-domain distribution difference elimination processing to obtain the first depth representation vector; Based on the first deep representation vector, a sample matching result with quantified confidence is generated by using a pre-set power scenario constraint contrast learning mechanism, combined with a pre-set dynamic threshold similarity judgment method and a pre-set confidence screening method. Based on the sample matching results, the feature space distribution density is quantized using a preset Gaussian mixture model to obtain the density quantization anomaly score, and the feature reconstruction error is calculated using a preset variational autoencoder to obtain the reconstruction quantization anomaly degree. The density quantization anomaly score and the reconstruction quantization anomaly degree are fused to obtain the anomaly detection results of the power system.
2. The anomaly detection method based on power sample matching according to claim 1, characterized in that, After obtaining the anomaly detection results of the power system, the process also includes: Obtain feedback information on the anomaly detection results of the power system; Based on the feedback information and the preset feature extraction model that integrates temporal and spatial feature extraction capabilities, the parameters and structure of the feature extraction model that integrates temporal and spatial feature extraction capabilities are optimized in combination with the preset interactive calibration strategy to obtain the updated feature extraction model.
3. The anomaly detection method based on power sample matching according to claim 1, characterized in that, Based on the multi-source sample data, and combined with a preset feature extraction model integrating temporal and spatial feature extraction capabilities, the multi-source sample data is subjected to deep representation encoding to obtain a deep representation vector containing power system operating status information, specifically: Obtain the pre-trained deep model parameters in the power field and historical sample data of the power system; Based on a pre-defined spatiotemporal convolutional neural network and a pre-defined gated recurrent unit, combined with the parameters of the pre-trained deep model in the power field and historical sample data of the power system, a feature extraction model integrating temporal and spatial feature extraction capabilities is constructed. The spatiotemporal convolutional neural network is used to extract spatial correlation features of samples, and the gated recurrent unit is used to extract temporal dynamic features of samples. The multi-source sample data is input into the feature extraction model, so that the feature extraction model extracts spatial correlation features from the multi-source sample data through a spatiotemporal convolutional neural network and extracts temporal dynamic features from the multi-source sample data through a gated recurrent unit; and fuses the spatial correlation features and the temporal dynamic features to output a deep representation vector containing power system operating status information.
4. The anomaly detection method based on power sample matching according to claim 1, characterized in that, The process of eliminating cross-domain distribution differences in the initial depth representation vector to obtain the first depth representation vector is as follows: A domain adversarial training mechanism is constructed, which includes a feature extraction submodule and a domain discrimination submodule, and a gradient inversion layer is deployed between the feature extraction submodule and the domain discrimination submodule; The initial deep representation vector is input into the feature extraction submodule of the domain adversarial training mechanism, so that the feature extraction submodule performs feature transformation on the deep representation vector to obtain a preliminary transformed vector. The initial transformation vector is input into the domain discrimination submodule so that the feature extraction submodule and the domain discrimination submodule can perform adversarial training to obtain an intermediate processing vector; Acquire operating parameter deviation data of the power system; the operating parameter deviation data includes voltage deviation range and current fluctuation range. Based on the operational parameter deviation data, the constraint weights of the preset domain adaptation loss function are optimized, and the intermediate processing vector is input into the optimized domain adaptation loss function for secondary optimization to obtain the first depth representation vector.
5. The anomaly detection method based on power sample matching according to claim 1, characterized in that, Based on the first deep representation vector, a sample matching result with quantified confidence is generated through a pre-defined power scenario constraint-based contrastive learning mechanism, combined with a pre-defined dynamic threshold similarity determination method and a pre-defined confidence screening method. Specifically: Obtain category label information for equipment status samples in the power system; the category label information includes normal operation label, abnormal warning label, and fault status label; Based on the category label information, sample pairs of similar device states are selected from the first deep representation vector; Based on the first deep representation vector and the state sample pairs of the same type of equipment, a contrastive learning loss function incorporating power scenario operating condition features is constructed; the power scenario operating condition features include load level and ambient temperature influence coefficient. The contrastive learning loss function is optimized to make the state samples of similar devices clustered in the feature space, thereby obtaining the sample clustering distribution features; A dynamic threshold similarity determination method is used to measure the semantic association of the clustering distribution features of the samples, and a sample similarity matrix is generated. The sample association pairs in the sample similarity matrix are filtered according to the quantified confidence threshold, and the sample association pairs with the confidence level reaching the preset threshold are retained to generate sample matching results with quantified confidence. The quantitative confidence screening threshold is determined based on the power system anomaly risk level.
6. The anomaly detection method based on power sample matching according to claim 1, characterized in that, Based on the sample matching results, the feature space distribution density is quantized using a preset Gaussian mixture model to obtain a density quantization anomaly score, and the feature reconstruction error is calculated using a preset variational autoencoder to obtain the reconstruction quantization anomaly degree. Specifically: Extract the second depth representation vector from the sample matching results; The second depth representation vector is input into a preset Gaussian mixture model for probability distribution fitting, and the negative log-likelihood value of each second depth representation vector is calculated to obtain the density quantization anomaly score. The second deep representation vector is input into a preset variational autoencoder for feature reconstruction. The error between the second deep representation vector and the reconstructed vector is calculated to obtain the reconstruction quantization anomaly degree.
7. The anomaly detection method based on power sample matching according to claim 1, characterized in that, The multi-source sample data of the power system includes electrical parameter data of each link of the power system, equipment status monitoring data, and environmental correlation data. The electrical parameter data includes the output voltage data of the generating units on the generating side, the real-time current data of the transmission lines on the transmission side, the power data of the bus on the distribution side, and the voltage and current data of the user load on the power consumption side. The equipment status monitoring data includes transformer oil temperature data, circuit breaker opening and closing status data, transmission line tower vibration data, and power distribution equipment insulation performance monitoring data. The environmental data includes real-time temperature, humidity, and wind speed data for the area where the power equipment is deployed.
8. An anomaly detection device based on power sample matching, characterized in that, include: The acquisition module is used to acquire multi-source sample data of the power system; The encoding module is used to perform deep representation encoding on the multi-source sample data based on the multi-source sample data and combined with a preset feature extraction model that integrates temporal and spatial feature extraction capabilities, so as to obtain an initial deep representation vector containing power system operating status information. The first processing module is used to perform cross-domain distribution difference elimination processing on the initial depth representation vector to obtain the first depth representation vector. The second processing module is used to generate sample matching results with quantified confidence based on the first deep representation vector, through a preset power scenario constraint contrast learning mechanism, combined with a preset dynamic threshold similarity judgment method and a preset confidence screening method. The calculation module is used to quantify the feature space distribution density based on the sample matching results using a preset Gaussian mixture model to obtain the density quantization anomaly score, and to calculate the feature reconstruction error using a preset variational autoencoder to obtain the reconstruction quantization anomaly degree. The fusion module is used to fuse the density quantization anomaly score and the reconstruction quantization anomaly degree to obtain the anomaly detection result of the power system.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the anomaly detection method based on power sample matching as described in any one of claims 1 to 7.
10. A terminal device, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the anomaly detection method based on power sample matching as described in any one of claims 1 to 7.