An electric carbon data anomaly detection method, device, medium and equipment
Patent Information
- Application Number
- CN202610721394.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-25
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2046-05-25
AI Technical Summary
[0005]本发明提供了一种电碳数据的异常检测方法、装置、介质及设备,以解决现有技术中无法准确高效地对电碳数据的异常进行检测的问题
将所述异常拉远损失函数,与初始多尺度约束异常检测模型的重构误差损失函数和预设深度支持向量描述网络的训练损失函数进行联合,得到联合损失函数;
Smart Images

Figure CN122241546B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of anomaly detection, and more particularly to a method, apparatus, medium, and equipment for anomaly detection of electrocarbon data. Background Technology
[0002] With increasing global focus on environmental protection and sustainable development, electricity and carbon emission data (referred to as "electricity carbon" data) has become a crucial element for carbon quota accounting, trading pricing, and decision support. However, electricity carbon data is often characterized by high dimensionality, high frequency, multi-source heterogeneity, and strong time-series dependence, making it highly susceptible to interference from factors such as equipment failure, malicious attacks, transmission disturbances, system deficiencies, or data falsification, leading to the generation of anomalous data. This anomalous data not only affects the accuracy of carbon emission accounting but also weakens the fairness of the carbon market and the efficiency of electricity dispatch, seriously threatening the reliable operation of green energy systems.
[0003] Existing technologies for anomaly detection in electrocarbon data have several limitations. First, most mainstream anomaly detection methods employ single-timescale modeling, making it difficult to simultaneously capture multiple types of anomalous behavior, such as gradual changes, abrupt changes, and periodic perturbations, resulting in low detection accuracy. Second, existing methods primarily rely on normal samples for modeling, failing to incorporate known anomalous samples during the training phase to optimize the embedding space structure. This leads to blurred boundaries between normal and anomalous data, resulting in high false positive and false negative rates. Furthermore, the output of existing methods typically only provides anomaly scores, failing to provide specific variable attributions or temporal location identification for anomalies, lacking the ability to classify anomaly types, and thus hindering rapid localization and remediation of data problems. Finally, when facing complex data scenarios, existing methods often require numerous assumptions and approximations, demanding significant expertise and large datasets, making them unsuitable for diverse real-world applications.
[0004] These limitations prevent existing technologies from accurately and efficiently detecting anomalies in carbon dioxide data. Summary of the Invention
[0005] This invention provides a method, apparatus, medium, and device for detecting anomalies in carbon dioxide data, thereby solving the problem that existing technologies cannot accurately and efficiently detect anomalies in carbon dioxide data.
[0006] Firstly, this application provides a method for detecting anomalies in carbon dioxide data, including: Obtain multidimensional time-series data on electricity and carbon emissions, including both electricity and carbon emission indicators; The multi-dimensional time-series data of the electrocarbon is input into a preset multi-scale constrained anomaly detection model. After the time-series modeling and reconstruction submodule of the multi-scale constrained anomaly detection model extracts time-series embedding features and generates a data reconstruction sequence, the residual between the multi-dimensional time-series data of the electrocarbon and the reconstruction sequence is calculated to obtain the data reconstruction error. The multi-scale embedding calculation submodule calculates the multi-scale embedding offset score of the time-series embedding based on multiple preset time scales, and concatenates the data reconstruction error and the multi-scale embedding offset score into a joint feature. The joint feature is then mapped in a high dimension through a preset deep support vector description network, and the distance from the high-dimensional mapping result to the center of the preset minimum closed sphere is calculated to generate an adaptive anomaly score. The multi-scale constrained anomaly detection model is based on historical normal carbon dioxide time series data and a preset proportion of labeled anomaly data, combined with a preset deep support vector description network, and trained by multi-time scale embedding offset modeling and anomaly distance constraint on the initial multi-scale constrained anomaly detection model. Based on the adaptive anomaly score, combined with a preset percentile threshold, the anomaly detection result is obtained.
[0007] This application obtains multi-dimensional time-series data containing power indicators (voltage, current, load) and carbon emission indicators, and inputs it into a multi-scale constrained anomaly detection model. The multi-scale embedding calculation submodule explicitly calculates the time-series embedding offset score based on multiple preset time scales (covering different time dimensions such as short-term, medium-term, and long-term). This design directly targets the characteristics of power data in different time dimensions (such as real-time current fluctuations in the short-term dimension, load period changes in the medium-term dimension, and periodic electricity consumption patterns in the long-term dimension). Compared with the limitations of existing single-scale modeling techniques that can only adapt to data in a single time dimension, this design can comprehensively capture the abnormal characteristics of power data in various time dimensions (such as short-term sudden changes, medium-term gradual changes, and long-term periodic disturbances), and completely solve the problem of anomaly omissions caused by scale mismatch in power data in different time dimensions. First, the model identifies problems. Second, during the model training phase, it combines historical normal data with a preset proportion of labeled abnormal data. Through anomaly distance constraints (determining the minimum distance threshold based on the embedding offset statistical features of normal data across different time dimensions), optimization is achieved. This strengthens the feature boundaries of abnormal and normal samples in different time dimensions, addressing the normal fluctuation patterns of power data across different time dimensions. This avoids the defects of blurred anomaly boundaries and high false alarm rates caused by differences in data fluctuations across different time dimensions. Third, the model concatenates data reconstruction errors (reflecting the fitting bias of the data itself, adapting to the numerical characteristics of data across different time dimensions) with multi-scale embedding offset scores (reflecting feature deviations across different time dimensions) into joint features. An adaptive anomaly score is generated through a deep support vector description network, which can address both "numerical fitting" and "multi-time dimension features." This approach employs a dual-dimensional comprehensive anomaly detection method, further enhancing the accuracy of identifying anomalies in power data across different time dimensions. Finally, based on adaptive anomaly scoring and preset percentile thresholds, the percentile thresholds dynamically adapt to the distribution characteristics of power data across different time dimensions, avoiding the judgment bias caused by fixed thresholds due to differences in time dimensions. Ultimately, this achieves accurate and efficient identification of anomalies in power data across different time dimensions, including short-term, medium-term, and long-term periods. This provides reliable technical support for real-time monitoring and anomaly warning of multi-time-dimensional power data in collaborative power carbon management. This application effectively solves the problem that existing technologies cannot accurately and efficiently detect anomalies in power carbon data.
[0008] Furthermore, after generating the adaptive anomaly score, the process also includes: If the multidimensional time-series data of the electrocarbon carries anomaly type labels, the auxiliary classifier integrated by the multi-scale constrained anomaly detection model receives the high-dimensional mapping result output by the deep support vector description network, and calculates the prediction probability of each anomaly type through the softmax layer, and selects the type with the highest prediction probability as the anomaly type prediction result.
[0009] This application enhances the ability to identify anomaly types by building upon the generation of adaptive anomaly scores. Specifically, in the multi-scale constrained anomaly detection model, if the input multi-dimensional time-series data on electricity and carbon emissions carries anomaly type labels, the auxiliary classifier in the model receives the high-dimensional mapping results output by the deep support vector description network. Through the softmax layer, the auxiliary classifier can calculate the predicted probability of each anomaly type and select the type with the highest predicted probability as the final anomaly type prediction result. This process not only improves the accuracy of anomaly detection but also enhances the interpretability of the detection results, enabling users to more clearly understand the specific type of anomaly, thereby providing more accurate data support for the coordinated governance of power systems and carbon emissions.
[0010] Furthermore, the acquisition of multidimensional time-series data on electricity and carbon emissions, including both electricity and carbon emission indicators, specifically involves: The power indicators are generated by acquiring and using real-time voltage data, real-time current data, and real-time load data of the power system. Obtain carbon emission data of the power system, and generate the carbon emission index based on the carbon emission data; The electricity index and the carbon emission index are normalized to output the multidimensional time-series data of electricity and carbon emissions.
[0011] This application generates power indicators by acquiring real-time voltage, current, and load data from the power system, and generates carbon emission indicators by acquiring carbon emission data from the power system. These indicators are normalized to form multi-dimensional time-series data on electricity and carbon emissions. This process ensures data consistency and comparability, providing high-quality input for subsequent anomaly detection. In this way, this application effectively integrates power and carbon emission data, providing comprehensive data support for the coordinated governance of power systems and carbon emissions, thereby improving the accuracy and reliability of anomaly detection.
[0012] Furthermore, the multi-scale embedding calculation submodule calculates the multi-scale embedding offset score of the temporal embedding based on multiple preset time scales, specifically as follows: Obtain multi-scale calculation parameters, which include a preset minimum time scale, a preset maximum time scale, and a preset number of scales; Based on the preset geometric series rules, a corresponding number of time scales are selected from the smallest time scale to the largest time scale to form a set of time scales for calculation. Obtain the temporal embedding features output by the temporal modeling and reconstruction submodule; For each time scale and each time step in the time scale set, with the current time step as the endpoint, a window is truncated according to the length of the corresponding time scale, and a preset averaging calculation rule is called to aggregate the temporal embedding features obtained within the window to obtain the average embedding value of all temporal embedding features within the window. Calculate the distance between the average embedding value at each time scale and the preset embedding center. The distance is the multi-scale embedding offset score for the corresponding time scale and time step. The preset embedding center is the normal mode center at each scale calculated from historical normal carbon electrochemical time series data.
[0013] The multi-scale embedding calculation submodule of this application significantly improves the accuracy of anomaly detection in multi-dimensional time-series data of electrochemical carbon through refined multi-scale analysis. Specifically, the module first obtains multi-scale calculation parameters, including the preset minimum time scale, maximum time scale, and number of scales. Following a geometric progression rule, a corresponding number of time scales are selected from the minimum to the maximum time scale to form a time scale set. Subsequently, the module obtains the time-series embedding features output by the time-series modeling and reconstruction submodule. For each time scale and each time step in the time scale set, a window is truncated according to the length of the corresponding time scale, with the current time step as the endpoint. A preset averaging calculation rule is then applied to aggregate the time-series embedding features within the window, yielding the average embedding value of all time-series embedding features within the window. Finally, the distance between the average embedding value at each time scale and the preset embedding center is calculated; this distance is the multi-scale embedding offset score for the corresponding time scale and time step. The preset embedding center is the normal pattern center at each scale, calculated based on historical normal electrochemical carbon time-series data. This process not only captures anomalous behavior at different time scales, but also quantifies the degree of anomaly by comparing it with normal pattern centers, thus providing a more accurate and reliable means of anomaly detection for the coordinated governance of power systems and carbon emissions.
[0014] Furthermore, the anomaly detection result is obtained based on the adaptive anomaly score and a preset percentile threshold, specifically as follows: Obtain the adaptive anomaly scores corresponding to all time steps output by the multi-scale constrained anomaly detection model to form a complete set of anomaly scores; Based on a preset ratio parameter, the corresponding percentile of the abnormal score set is calculated, and the percentile is used as the preset percentile threshold for abnormal judgment. The adaptive anomaly score for each time step is compared with the preset percentile threshold: if the adaptive anomaly score for a time step is greater than the preset percentile threshold, the corresponding carbon data for that time step is determined to be abnormal; if the adaptive anomaly score for a time step is less than or equal to the preset percentile threshold, the corresponding carbon data for that time step is determined to be normal. The judgment results of all time steps are integrated to form an anomaly detection result that includes both abnormal time step location information and normal time step location information.
[0015] This application achieves accurate anomaly detection in electrical carbon data through adaptive anomaly scoring and a preset percentile threshold. Specifically, it first acquires the adaptive anomaly scores for all time steps output by the multi-scale constrained anomaly detection model, forming a complete anomaly score set. Then, based on preset proportional parameters, it calculates the corresponding quantile of the anomaly score set and uses this quantile as the preset percentile threshold for anomaly determination. Next, it compares the adaptive anomaly score for each time step with the preset percentile threshold: if the adaptive anomaly score for a time step is greater than the preset percentile threshold, the electrical carbon data for that time step is determined to be abnormal; if the adaptive anomaly score for a time step is less than or equal to the preset percentile threshold, the electrical carbon data for that time step is determined to be normal. Finally, the determination results for all time steps are integrated to form an anomaly detection result containing information on the location of abnormal and normal time steps. This process not only improves the accuracy of anomaly detection but also enhances the adaptability of detection through dynamic threshold adjustment, providing reliable data support for the coordinated governance of power systems and carbon emissions.
[0016] Furthermore, the preset proportion of labeled abnormal data specifically refers to: The anomaly data annotations cover three types of anomalies in the carbon dioxide data. The first type of anomaly is data mutation anomaly; the data mutation anomaly is when the change in the index value of a single time step exceeds a first preset multiple of the historical normal fluctuation range. The second type of anomaly is the slow data variation anomaly; the slow data variation anomaly is when the index value of multiple consecutive time steps shows monotonic changes and the total change exceeds the second preset multiple of the historical normal fluctuation range. The third type of anomaly is periodic disturbance anomaly; the periodic disturbance anomaly is when the periodic fluctuation amplitude of the indicator value deviates from the historical normal periodic fluctuation amplitude by a third preset multiple.
[0017] This application, by using a pre-defined proportion of anomaly-labeled data, ensures that the anomaly detection model can effectively identify three main types of anomalies in power carbon data, thereby significantly improving the accuracy and comprehensiveness of anomaly detection. Specifically, the first anomaly type is the data mutation anomaly, characterized by the index value changing by more than a first pre-defined multiple of the historical normal fluctuation range at a single time step. This anomaly typically indicates sudden and significant data changes. The second anomaly type is the data gradual change anomaly, characterized by the index value exhibiting monotonous changes over multiple consecutive time steps, with the total change exceeding a second pre-defined multiple of the historical normal fluctuation range. This anomaly reflects long-term trend changes in the data. The third anomaly type is the periodic disturbance anomaly, characterized by the periodic fluctuation amplitude of the index value deviating from a third pre-defined multiple of the historical normal periodic fluctuation amplitude. This anomaly reveals abnormal changes in the periodic patterns of the data. By covering these three anomaly types, the anomaly-labeled data in this application not only enriches the model's training samples but also enhances the model's ability to identify different types of anomalies, providing a more accurate and reliable anomaly detection method for the coordinated governance of power systems and carbon emissions.
[0018] Furthermore, the training of the initial multi-scale constrained anomaly detection model through anomaly distance constraints specifically involves: The system obtains the temporal modeling and reconstruction submodule and the multi-scale embedding calculation submodule of the initial multi-scale constrained anomaly detection model, extracts the temporal embedding features of the labeled anomaly data at a preset ratio, and calculates the multi-scale embedding offset score corresponding to the temporal embedding features. Based on the embedding offset statistical characteristics and preset adjustment coefficients of historical normal carbon dioxide time series data, a preset minimum distance threshold for abnormal distance constraint is determined; if the multi-scale embedding offset score is less than the preset minimum distance threshold, an abnormal distance loss function is constructed. The anomaly distance loss function is combined with the reconstruction error loss function of the initial multi-scale constrained anomaly detection model and the training loss function of the preset deep support vector description network to obtain the joint loss function. The parameters of the initial multi-scale constrained anomaly detection model are adjusted iteratively through backpropagation until the joint loss function converges, thus obtaining the multi-scale constrained anomaly detection model.
[0019] This application trains an initial multi-scale constrained anomaly detection model using anomaly distance constraints, significantly improving the model's ability to identify and detect anomalous data. Specifically, firstly, temporal embedding features of a predetermined proportion of labeled anomalous data are extracted, and the corresponding multi-scale embedding offset scores are calculated. Based on the embedding offset statistical features of historical normal electricity and carbon time-series data and a predetermined adjustment coefficient, a predetermined minimum distance threshold for the anomaly distance constraint is determined. If the multi-scale embedding offset score is less than this threshold, an anomaly distance loss function is constructed. This anomaly distance loss function is then combined with the initial model's reconstruction error loss function and the training loss function of a predetermined deep support vector description network to form a joint loss function. The model parameters are iteratively adjusted through backpropagation until the joint loss function converges, ultimately yielding the optimized multi-scale constrained anomaly detection model. This process not only enhances the model's ability to distinguish anomalous data but also effectively reduces the false alarm rate through the anomaly distance constraint mechanism, improving the model's robustness and detection accuracy, and providing more reliable technical support for the coordinated governance of power systems and carbon emissions.
[0020] Secondly, this application provides an anomaly detection device for electrocarbon data. The anomaly detection device for electrocarbon data includes: The acquisition module is used to acquire multidimensional time-series data on electricity and carbon emissions, including electricity indicators and carbon emission indicators. The model scoring module is used to input the multi-dimensional time-series data of the electrocarbon into a preset multi-scale constrained anomaly detection model. After the time-series modeling and reconstruction submodule of the multi-scale constrained anomaly detection model extracts the time-series embedding features and generates a data reconstruction sequence, it calculates the residual between the multi-dimensional time-series data of the electrocarbon and the reconstruction sequence to obtain the data reconstruction error. The multi-scale embedding calculation submodule calculates the multi-scale embedding offset score of the time-series embedding based on multiple preset time scales, and concatenates the data reconstruction error and the multi-scale embedding offset score into a joint feature. The joint feature is then mapped in a high dimension through a preset deep support vector description network, and the distance from the high-dimensional mapping result to the center of the preset minimum closed sphere is calculated to generate an adaptive anomaly score. The multi-scale constrained anomaly detection model is based on historical normal carbon dioxide time series data and a preset proportion of labeled anomaly data, combined with a preset deep support vector description network, and trained by multi-time scale embedding offset modeling and anomaly distance constraint on the initial multi-scale constrained anomaly detection model. An anomaly detection module is used to obtain anomaly detection results based on the adaptive anomaly score and a preset percentile threshold.
[0021] This application's anomaly detection device for electricity carbon data achieves efficient and accurate anomaly detection through collaborative operation. The acquisition module collects multi-dimensional time-series electricity carbon data, including electricity and carbon emission indicators, providing a foundation for subsequent processing. The model scoring module utilizes a multi-scale constrained anomaly detection model to perform in-depth analysis of this data. This model extracts temporal embedding features and generates a data reconstruction sequence through a temporal modeling and reconstruction submodule, then calculates the data reconstruction error. Simultaneously, a multi-scale embedding calculation submodule calculates the offset scores of temporal embeddings based on multiple time scales and combines these scores with the data reconstruction error to form joint features. These joint features are then mapped in a high-dimensional manner by a deep support vector description network, and their distance to the center of the smallest closed sphere is calculated, thereby generating an adaptive anomaly score. Notably, the multi-scale constrained anomaly detection model is obtained by combining historical normal data and a preset proportion of labeled anomaly data, utilizing a deep support vector description network, and training with multi-time-scale embedding offset modeling and anomaly distance constraints. This significantly improves the model's detection accuracy and robustness. Finally, the anomaly detection module accurately determines anomalies and outputs the anomaly detection results based on the adaptive anomaly score and a preset percentile threshold. The entire device has a reasonable process design, with clearly defined functions for each module, and they work together to improve the accuracy of anomaly detection and enhance the ability to identify different types of anomalies, providing strong technical support for the coordinated governance of power systems and carbon emissions.
[0022] Thirdly, this application provides a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device containing the computer-readable storage medium to perform an anomaly detection method for electrocarbon data as described above. Its beneficial effects are the same as those of the anomaly detection method for electrocarbon data 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, when executing the computer program, implements any of the abnormal detection methods for electrocarbon data as described in the first aspect. Attached Figure Description
[0024] Figure 1 : A schematic flowchart of an embodiment of the method for detecting anomalies in carbon dioxide data provided in this application; Figure 2 : A schematic diagram of an embodiment of the abnormal detection device for carbon dioxide data 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 carbon dioxide data, this invention provides an anomaly detection method for carbon dioxide data, including steps S01-S03.
[0027] S01: Obtain multidimensional time-series data on electricity and carbon emissions, including electricity indicators and carbon emission indicators.
[0028] In a preferred embodiment of this invention, the acquisition of multidimensional time-series data on electricity and carbon emissions, including electricity indicators and carbon emission indicators, specifically involves: In the actual implementation of this method for detecting anomalies in carbon dioxide data, the acquisition of multidimensional time-series carbon dioxide data needs to be combined with the actual data sources, indicator selection, and data standardization processing of the carbon dioxide collaborative monitoring scenario to ensure that the data dimensions are complete, the format is uniform, and it is compatible with the subsequent model calculation requirements. The specific implementation steps are as follows: First, the core indicators of the multidimensional time-series data on electricity and carbon emissions were determined. Among them, the electricity indicators were selected from three categories: voltage, current and load, which are directly related to the grid operation status. The carbon emission indicators were selected from two categories: carbon factor and carbon intensity, which reflect the carbon emission level. For power indicators, voltage data is collected through intelligent voltage monitoring instruments deployed at key nodes of the distribution network lines. The sampling frequency is set to 15 minutes per sampling based on the required monitoring accuracy. The collected data must include the collection timestamp, monitoring node number, and actual line voltage value (unit: kV), for example, "2025-09-01 08:00-#103 node- 10.3kV". Current data is collected synchronously through electronic current transformers in the distribution network lines, maintaining the same sampling frequency as voltage data. The collected data includes the collection timestamp, line number, and effective value of three-phase current (unit: A), for example, "2025-09-01 08:00-L105 line- 420A". Load data is obtained from the real-time load statistics module of the power grid dispatching system, covering both active and reactive load parameters. The sampling frequency is consistent with voltage and current, and the data format is "collection timestamp-monitoring area number-active load (unit: MW)-reactive load (unit: Mvar)", for example, "2025-09-01". 08:00 - Industrial Park C-32MW-9.5Mvar”; Secondly, the acquisition of carbon emission data needs to combine authoritative accounting standards with actual energy consumption data. Specifically, carbon factor data references the "Guidelines for Compiling Provincial Greenhouse Gas Inventories" and the annual regional power grid baseline carbon factor published by local ecological and environmental departments. It also considers the energy consumption type of the monitored objects (such as purchased grid electricity, self-owned gas turbine power supply, renewable energy generation, etc.) to determine differentiated carbon factors. For example, the carbon factor for purchased grid electricity in the monitoring area is 0.58 tCO2 / MWh, and the carbon factor for self-owned gas turbine power is 0.21 tCO2 / MWh. This data is updated daily and linked to the corresponding electricity consumption data. Carbon intensity data is obtained by dividing the total carbon emissions during the monitoring period by the total emissions during the same period. The total electricity consumption is calculated, where the total carbon emissions are taken from the sum of the products of the consumption of each energy type (such as coal, gas, and purchased electricity) and the corresponding energy type emission factor in the enterprise's carbon management ledger, and the total electricity consumption is taken from the periodic electricity consumption statistics of the power grid dispatch system. For example, the total carbon emissions in the monitoring area on September 1, 2025 were 14.4 tCO2, and the total electricity consumption on that day was 32 MWh, so the carbon intensity on that day was 0.45 tCO2 / MWh. The data format is "statistical date-monitoring area number-carbon intensity (unit: tCO2 / MWh)". Finally, the collected electricity index data and carbon emission index data were aligned and standardized in terms of time dimension. Time dimension alignment was based on the sampling timestamp of the electricity index, integrating voltage, current, load, carbon factor, and carbon intensity data under the same timestamp into a single time series data record, forming a multi-dimensional data structure of "timestamp-voltage-current-active load-reactive load-carbon factor-carbon intensity". Standardization was performed using the min-max normalization method, which calculates the minimum and maximum values of each index within the historical collection period, transforming the original index values to the [0,1] interval. For example, the historical minimum value of the voltage index is 9.8kV and the maximum value is 10.5kV. If the original voltage value of a certain data is 10.3kV, then the normalized value is (10.3-9.8) / (10.5-9.8)≈0.71, thereby eliminating the interference of different index dimensions on subsequent model calculations, and finally forming a unified and dimensionally complete multi-dimensional time series dataset of electricity and carbon.
[0029] S02: The multi-dimensional time-series data of the electrocarbon is input into a preset multi-scale constrained anomaly detection model. After the time-series modeling and reconstruction submodule of the multi-scale constrained anomaly detection model extracts the time-series embedding features and generates a data reconstruction sequence, the residual between the multi-dimensional time-series data of the electrocarbon and the reconstruction sequence is calculated to obtain the data reconstruction error. The multi-scale embedding calculation submodule calculates the multi-scale embedding offset score of the time-series embedding based on multiple preset time scales, and concatenates the data reconstruction error and the multi-scale embedding offset score into a joint feature. The joint feature is then mapped in a high dimension through a preset deep support vector description network, and the distance from the high-dimensional mapping result to the center of the preset minimum closed sphere is calculated to generate an adaptive anomaly score. The multi-scale constrained anomaly detection model is based on historical normal carbon time-series data and a preset proportion of labeled anomaly data, combined with a preset deep support vector description network, and trained by multi-time-scale embedding offset modeling and anomaly distance constraints on the initial multi-scale constrained anomaly detection model.
[0030] In a preferred embodiment of this invention, the multi-scale constrained anomaly detection model is obtained by training an initial multi-scale constrained anomaly detection model based on historical normal carbon electrochemical time-series data and a preset proportion of labeled anomaly data, combined with a preset deep support vector description network, through multi-time-scale embedding offset modeling and anomaly distance constraints. Specifically: First, assume the original input data is a multidimensional time series: in, Indicates the first At any point in time The observation indicators include power-related indicators (such as voltage, current, and load) and carbon emission-related indicators (such as carbon factor and carbon intensity). To avoid the inconsistency of dimensions interfering with model training, the original sequence needs to be normalized first to ensure that each variable follows a distribution with the same scale. Next, the normalized sequence The temporal modeling and reconstruction submodule, input to the initial multi-scale constrained anomaly detection model, is used to extract the evolutionary patterns of data over time. This submodule employs a deep structure based on temporal location encoding and integrates a self-attention mechanism to model long-range dependencies and variable interactions in the time series. At each time step... The model combines the current input Based on its context information, a corresponding high-dimensional embedding vector is generated. Finally, the embedding representation of the entire sequence is obtained: in This is the dimension of the embedding space. The embedded sequence retains both the structural evolution characteristics of the time series and an abstract representation of the coupling relationships between variables, exhibiting strong identifiability and generalization ability. To achieve anomaly detection under unsupervised conditions, a self-supervised learning task is further constructed, using the reconstruction of the current or future input sequence as the model training objective. Specifically, a symmetric or biased decoder is designed to process the embedded sequence... Map back to the original input space to generate a reconstruction sequence ,in Indicates to The reconstructed estimate is obtained. The training objective is to minimize the residual between the observed and reconstructed values. This reconstruction error It can serve as an important quantitative indicator of data deviation from the normal pattern. Since the model mainly learns the temporal evolution of normal data during the training phase, its reconstruction performance for abnormal samples is usually poor, resulting in a significant increase in error, thus providing a preliminary basis for anomaly scoring for subsequent anomaly detection modules; Let the input embedding sequence be This represents the temporal feature representation of each time step after the temporal modeling and reconstruction submodule. To capture the evolutionary trends at different time scales, the multi-scale embedding computation submodule introduces a sliding window mechanism, operating across multiple time scales. Feature aggregation is performed at each time step. and scale The average embedding within the window is defined as: Wherein, the length of the sliding window is within a given minimum / maximum time scale. / With scale number Selected according to geometric series: This selection ensures uniform coverage of the logarithmic domain, avoiding excessive density at large scales or excessive sparseness at small scales. Typical settings: , The business cycle is approximately daily / weekly / ten-day (e.g.) ), ; Time step The default strategy is full overlap, i.e. To ensure the capture of the finest-grained changes, downsampling strategies can be used for large-scale data, such as... While reducing computational complexity, the main trend characteristics are maintained; To characterize the degree of deviation of the current embedding from "normal behavior", the average embedding and the corresponding normal embedding center are calculated at each scale. The Euclidean distance is used to obtain the multi-scale embedding offset score: Among them, the embedded center During the training phase, all normal samples are used at a scale. The mean value is calculated by the sliding window and represents the center position of the normal pattern at this scale. ,in This represents the number of sliding windows of length s that can be extracted from the normal samples in the training set.
[0031] To improve the discriminative power of the multi-scale embedding space, some anomaly-labeled samples are further introduced. This is used to enhance the supervised learning signal. Specifically, for each labeled outlier sample time point... The embedding offset is defined at each scale as And introduce an abnormal distance constraint term, defined as: in, The minimum distance threshold is set to ensure that abnormal samples maintain a sufficient distance from the normal center in the embedding space, effectively preventing abnormal samples from being misclassified as normal points. The value can be referenced from the mean of the multi-scale shift values of normal samples. and variance And set: in To adjust the parameters, a value of 1.5-3 is typically used to control the detection sensitivity.
[0032] Finally, the reconstruction error sequences output from the first two stages and the multi-scale embedding offset features are fused to construct a joint representation. Using this as input, an adaptive anomaly scoring mechanism for "electricity-carbon" data samples is designed by constructing a Deep Support Vector Description Network (Deep SVDD). Simultaneously, when class labels are available, an auxiliary classification network is jointly trained to provide a structured interpretation of anomaly types, thereby achieving accurate identification and interpretable output of anomalies in "electricity-carbon" data. The specific method is as follows: Joint characterization This includes the reconstruction error sequence output by module one. Multi-scale migration score output by Module 2 Concatenate them into a joint feature vector: This joint feature As input, a deep support vector description network is constructed. And learn a minimum closed sphere in a high-dimensional embedding space, centered at... The training objective is to minimize the squared distance from the center of the normal sample after mapping: in, This represents the normal training sample set. For deep network embedding functions, To describe the center of the sphere, the mean can be fixed as a normal initial value or obtained through joint training. This optimization objective forces normal sample embeddings to cluster at the center, thereby causing abnormal samples to be mapped away from this region, forming an adaptive anomaly detection boundary.
[0033] For the test sample, the anomaly score is defined as follows: To avoid performance degradation of fixed thresholds under different data distributions, this invention employs a percentile dynamic thresholding method, adaptively setting the anomaly detection threshold based on the distribution of scores: in, It can usually be set to This means that the 99.5% quantile is used as the threshold, and samples exceeding this threshold are considered anomalous. This strategy has the advantages of being highly adaptable and not requiring a fixed threshold, thus better matching the anomaly detection accuracy under different distribution environments.
[0034] Furthermore, when anomaly type labels are provided, an auxiliary classifier is introduced to enhance the model's interpretability of anomaly types. The embedded representation Input classifier, output anomaly type prediction: This refers to the predicted anomaly label.
[0035] In the presence of an exception type label Under these conditions, the classification loss is jointly optimized during training: The final total loss function for this module is: in , These are the weighting coefficients. For the abnormal distance loss term in Module 2, it represents the structural constraint of the joint training of this module and the previous module.
[0036] During the construction of labeled abnormal data for model training, the generation of three types of anomalies needs to be based on the statistical characteristics of historical normal carbon dioxide emissions data of industrial park C, and the preset multiples and judgment rules need to be clearly defined: Data mutation anomaly (first preset multiple): First, calculate the historical normal fluctuation range of electricity / carbon emission indicators for the same period in the past 6 months (e.g., 14:00-15:00 daily) (take the mean of the indicator value for that period ± 2 times the standard deviation, e.g., the normal fluctuation range of current is 380A-450A), and set the first preset multiple to 2 times; when the change of the indicator value at a certain time step compared to the previous time step (e.g., the current suddenly increases from 420A to 966A, a change of 130%) exceeds twice the historical normal fluctuation range (i.e., exceeds 450A + (450A-380A) × 2 = 590A), it is marked as a data mutation anomaly sample; Data slow change anomaly (second preset multiple): The number of consecutive time steps is set to 8 (corresponding to 2 hours), the calculation method of the historical normal fluctuation range is the same as above, and the second preset multiple is set to 1.8 times; when the index value of 8 consecutive time steps shows monotonous change (such as the load continuously rising from 32MW to 58MW), and the total change amplitude (26MW) exceeds 1.8 times the historical normal fluctuation range (i.e. (40MW-25MW)×1.8=27MW, close to 26MW), it is marked as a data slow change anomaly sample; Abnormal periodic disturbance (third preset multiple): First, extract the normal periodic fluctuation range of the indicators within the historical daily cycle (e.g., the peak value of the daily load cycle is 45MW - the valley value is 20MW, and the normal fluctuation range is 25MW). The third preset multiple is set to 1.2 times. When the fluctuation range of the indicators within a certain cycle (e.g., the peak value of the daily load is 52MW - the valley value is 18MW, and the fluctuation range is 34MW) deviates from 1.2 times the historical normal periodic fluctuation range (i.e., 25MW×1.2=30MW), it is marked as a sample of abnormal periodic disturbance.
[0037] The labeled abnormal data generated by the above rules accounts for 3% of the total training set data, and the proportion of the three types of abnormal samples is 1:1:1, ensuring the model's learning balance for each type of abnormality.
[0038] To further illustrate the specific implementation of the embodiments of this application, taking the electro-carbon co-monitoring scenario of industrial park C as an example, the model processing and adaptive anomaly scoring generation process of multi-dimensional time-series electro-carbon data are explained. The preset multi-scale constrained anomaly detection model has been trained using historical data. The specific implementation process is as follows: The pre-processed multi-dimensional time-series data of carbon in the industrial park (formatted as "timestamp-normalized voltage-normalized current-normalized active load-normalized reactive load-normalized carbon factor-normalized carbon intensity", with a time step interval of 15 minutes, and a single input data includes multi-dimensional data from 96 time steps over 24 consecutive hours) is input into the preset multi-scale constrained anomaly detection model. The model automatically calls the internal time-series modeling and reconstruction submodule, multi-scale embedding calculation submodule, and deep support vector description network to complete the data processing according to the preset process. The temporal modeling and reconstruction submodule is constructed using a bidirectional long short-term memory network (Bi-LSTM), which consists of an input layer (7 neurons, corresponding to 7 electrocarbon index dimensions), two hidden layers (64 neurons each), and an output layer (7 neurons, with the same dimensions as the input layer). The submodule first extracts features from the 96 time-step multidimensional input data: the gating mechanism of the hidden layer captures the dependence of electrocarbon indexes on time changes, outputting a 64-dimensional temporal embedding feature corresponding to each time step; then, based on this temporal embedding feature, a data reconstruction sequence is generated through linear mapping of the output layer, completely consistent with the input data dimensions and number of time steps (i.e., each time step corresponds to the reconstructed values of the 7 indicators). The reconstruction error was calculated using the mean square error (MSE) formula. The error was calculated one by one between the original value of the electrocarbon multidimensional time series data and the corresponding value of the reconstructed sequence at each time step. Finally, the reconstruction error of the 1-dimensional data corresponding to each of the 96 time steps was obtained (the value range is 0-0.1, and the larger the error, the more significant the deviation of the data from the normal pattern). The multi-scale embedding computation submodule first calls the preset multi-scale computation parameters: the minimum time scale is 5 time steps (corresponding to 75 minutes), the maximum time scale is 30 time steps (corresponding to 7.5 hours), and the number of scales is 3. The time scale set is selected based on the geometric series rule as {5,15,30}. The submodule first acquires the 64-dimensional temporal embedding features output by the temporal modeling and reconstruction submodule. Then, it performs window aggregation and distance calculation for each time scale and each time step. Taking the time scale "15 time steps" and the 40th time step as an example, the temporal embedding features of the 26th to 40th time steps are extracted with the 40th time step as the endpoint. The 64-dimensional average embedding value within the window is calculated by arithmetic mean. Subsequently, the average embedding value is compared with the preset normal embedding center (the 64-dimensional normal pattern center of each scale is calculated based on the past 6 months of abnormal historical data of industrial park C during the model training phase, according to the same time scale set, such as the normal embedding center corresponding to "15 time steps" with the first dimension value of 0.23 and the second dimension value of 0.18) by Euclidean distance calculation to obtain the 1-dimensional multi-scale embedding offset score at that time step and scale. Following this process, each time step finally corresponds to the embedding offset score of 3 scales (such as the scores of the 40th time step being 0.15, 0.21, and 0.18 respectively). Then, joint feature concatenation is performed: the 1D data reconstruction error and the 3D multi-scale embedding offset score of each time step are concatenated in the order of "reconstruction error - 5-step scale score - 15-step scale score - 30-step scale score" to form the 4D joint feature corresponding to each time step (e.g., the joint feature of the 40th time step is [0.08, 0.15, 0.21, 0.18]).
[0039] The 4-dimensional joint features are then input into a pre-defined Deep Support Vector Description Network (Deep SVDD), which contains three fully connected layers (layer 1 with 64 neurons and ReLU activation function, layer 2 with 32 neurons and ReLU activation function, and layer 3 with 16 neurons and no activation function). Through linear transformation and nonlinear mapping of the fully connected layers, the 4-dimensional joint features are converted into a 16-dimensional high-dimensional feature vector. The Euclidean distance between this high-dimensional feature vector and the pre-defined minimum closed sphere center (a 16-dimensional center vector obtained by optimizing historical normal data during model training, such as 0.31 for the first dimension and 0.25 for the second dimension) is then calculated. This distance value is the adaptive anomaly score for the corresponding time step (e.g., the distance value at the 40th time step is 0.42, and a higher score indicates a greater probability of data anomalies).
[0040] S03: Based on the adaptive anomaly score, combined with the preset percentile threshold, the anomaly detection result is obtained.
[0041] Taking the co-monitoring scenario of electricity and carbon in industrial park C as an example, after generating adaptive anomaly scores for each time step, it is necessary to combine them with preset percentile thresholds to determine the anomaly detection results. The specific implementation process is as follows: First, a complete adaptive anomaly score set was constructed. For the 24-hour (96 time steps, one time step every 15 minutes) multidimensional time-series data of electrocarbon emissions from Industrial Park C, 96 corresponding adaptive anomaly scores (scoring range 0.12~0.85, the larger the score value, the more significant the deviation of the electrocarbon data from the normal pattern at that time step) were generated by a multi-scale constrained anomaly detection model. These 96 scores were then arranged in chronological order to form a set containing timestamps and corresponding scores, such as "2025-09-01 08:00-0.23", "2025-09-01 08:15-0.21", "2025-09-01 14:30-0.78", etc. Secondly, a preset percentile threshold is determined. This threshold is set based on the adaptive anomaly score of the past 30 days when there were no abnormal records in Industrial Park C (a total of 30 × 96 = 2880 normal score samples). A preset proportion parameter of 0.005 is selected (i.e., only 0.5% of normal data is allowed to be misjudged as abnormal due to random fluctuations). The 99.5 percentile value of this normal score sample set is calculated as the anomaly judgment threshold: First, the 2880 normal scores are sorted in ascending order, and the score value corresponding to the 2880 × (1 - 0.005) = 2865th position after sorting is taken as the threshold. The calculated threshold is 0.68 (i.e., only 0.5% of the normal time step scores in the past 30 days exceed 0.68). If the misjudgment tolerance of the monitoring scenario is adjusted (e.g., more stringent monitoring is required for carbon emission anomalies), the proportion parameter can be adjusted to 0.003, and the corresponding 99.7 percentile value is calculated as the new threshold to adapt to different monitoring needs. Subsequently, anomaly detection is performed step-by-step. The adaptive anomaly scores for each of the 96 time steps of the day are compared with a percentile threshold of 0.68. For the time step "2025-09-01 14:30", its adaptive anomaly score is 0.78, which is greater than the threshold of 0.68, thus the corresponding electrocarbon data for this time step is considered abnormal. For time steps such as "2025-09-01 08:00" and "2025-09-01 08:15", their scores are 0.23 and 0.21 respectively, both less than the threshold of 0.68, thus the corresponding electrocarbon data is considered normal. If multiple consecutive time steps (e.g., "2025-09-01 14:30-15:00", a total of 3 time steps) are all determined to be abnormal, it is marked as a "continuous abnormal period," and the trend of changes in electrocarbon indicators during this period needs to be closely monitored (e.g., whether it is accompanied by a sudden increase in current, a sudden increase in carbon intensity, etc.). Finally, the results are integrated to form a complete anomaly detection report. The judgment results of all time steps are organized in timestamp order, generating a report containing "timestamp - adaptive anomaly score - judgment result (normal / abnormal) - anomaly type prompt." The "anomaly type prompt" incorporates the actual fluctuation characteristics of the carbon index at that time step (e.g., the current at time step "2025-09-01 14:30" increased by 2.3 times compared to the previous time step, corresponding to the prompt "suspected data mutation anomaly"). Simultaneously, the daily score change curve and percentile threshold line are visualized in a time series graph, intuitively showing the location of the abnormal time step and the extent to which the score exceeds the threshold. This facilitates staff in quickly locating the abnormal period and conducting subsequent verification, ultimately forming anomaly detection results that can be directly used for collaborative carbon management decisions.
[0042] In summary, this embodiment, after acquiring multi-dimensional time-series data containing power indicators (voltage, current, load) and carbon emission indicators, inputs it into a multi-scale constrained anomaly detection model. The multi-scale embedding calculation submodule explicitly calculates the time-series embedding offset score based on multiple preset time scales (covering different time dimensions such as short-term, medium-term, and long-term). This design directly targets the characteristics of power data in different time dimensions (such as real-time current fluctuations in the short-term dimension, load period changes in the medium-term dimension, and periodic electricity consumption patterns in the long-term dimension). Compared to the limitations of existing single-scale modeling techniques that can only adapt to data in a single time dimension, this design can comprehensively capture the abnormal characteristics of power data in each time dimension (such as short-term sudden changes, medium-term gradual changes, and long-term periodic disturbances), completely solving the problem of missed anomaly detection caused by scale mismatch in power data in different time dimensions. Secondly, during the model training phase, historical normal data and a preset proportion of labeled abnormal data are combined. Through anomaly distance constraints (determining the minimum distance threshold based on the embedding offset statistical characteristics of normal data in each time dimension), optimization can be performed to strengthen the corresponding dimension of anomaly detection based on the normal fluctuation patterns of power data in different time dimensions. The model avoids the defects of blurred abnormal boundaries and high false alarm rate caused by the difference in data fluctuations in different time dimensions by using the feature boundaries of normal samples. Furthermore, the model concatenates the data reconstruction error (reflecting the fitting deviation of the data itself and adapting to the numerical characteristics of data in each time dimension) with the multi-scale embedding offset score (reflecting the feature deviation of each time dimension) into a joint feature. An adaptive anomaly score is generated through a deep support vector description network, which can comprehensively judge anomalies from the dual dimensions of "numerical fitting" and "multi-time dimension features", further improving the accuracy of identifying anomalies in power data in different time dimensions. Finally, based on the adaptive anomaly score and the judgment result of the preset percentile threshold, the percentile threshold can be dynamically adapted according to the distribution characteristics of power data in different time dimensions, avoiding the judgment deviation caused by the difference in time dimension due to the fixed threshold. Ultimately, it can achieve accurate and efficient identification of power data anomalies in different time dimensions such as short-term, medium-term and long-term, and provide reliable technical support for real-time monitoring and anomaly early warning of power data in multi-time dimension in power carbon collaborative management. This application effectively solves the problem that the existing technology cannot accurately and efficiently detect anomalies in power carbon data.
[0043] Example 2 Please refer to Figure 2 This is an abnormal detection device for carbon dioxide data provided in the embodiments of this application.
[0044] In this embodiment, the anomaly detection device for carbon dioxide data includes an acquisition module 10, a model scoring module 20, and an anomaly detection module 30.
[0045] Module 10 is used to acquire multidimensional time-series data of electricity and carbon emissions, including electricity indicators and carbon emission indicators. The model scoring module 20 is used to input the multi-dimensional time-series data of the electrocarbon into a preset multi-scale constrained anomaly detection model. After the time-series modeling and reconstruction submodule of the multi-scale constrained anomaly detection model extracts the time-series embedding features and generates a data reconstruction sequence, it calculates the residual between the multi-dimensional time-series data of the electrocarbon and the reconstruction sequence to obtain the data reconstruction error. The multi-scale embedding calculation submodule calculates the multi-scale embedding offset score of the time-series embedding based on multiple preset time scales, and concatenates the data reconstruction error and the multi-scale embedding offset score into a joint feature. The joint feature is then mapped in a high dimension through a preset deep support vector description network, and the distance from the high-dimensional mapping result to the center of the preset minimum closed sphere is calculated to generate an adaptive anomaly score. The multi-scale constrained anomaly detection model is based on historical normal carbon dioxide time series data and a preset proportion of labeled anomaly data, combined with a preset deep support vector description network, and trained by multi-time scale embedding offset modeling and anomaly distance constraint on the initial multi-scale constrained anomaly detection model. The anomaly detection module 30 is used to obtain anomaly detection results based on the adaptive anomaly score and a preset percentile threshold.
[0046] For ease of description and brevity, the embodiments of the device of the present invention include all the implementation methods in the embodiments of the above-described method for detecting abnormal carbon data, and will not be repeated here.
[0047] Example 3: This application provides a computer-readable storage medium, which includes a stored computer program, wherein the computer program controls the device where the computer-readable storage medium is located to execute the aforementioned method for detecting anomalies in carbon dioxide data when it is executed. The method for detecting anomalies in carbon dioxide data, if 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.
[0048] 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 abnormal detection methods for electrocarbon data as described in Embodiment 1.
[0049] 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. A method for detecting anomalies in carbon dioxide data, characterized in that, include: Obtain multidimensional time-series data on electricity and carbon emissions, including both electricity and carbon emission indicators; Among them, the power indicators are selected from three categories: voltage, current and load, which are directly related to the power grid operation status; the carbon emission indicators are selected from two categories: carbon factor and carbon intensity, which reflect the carbon emission level. The multi-dimensional time-series data of the electrocarbon is input into a preset multi-scale constrained anomaly detection model. After the time-series modeling and reconstruction submodule of the multi-scale constrained anomaly detection model extracts the time-series embedding features and generates a data reconstruction sequence, the residual between the multi-dimensional time-series data of the electrocarbon and the reconstruction sequence is calculated to obtain the data reconstruction error. The multi-scale embedding computation submodule calculates the multi-scale embedding offset score of temporal embedding based on multiple preset time scales, and concatenates the data reconstruction error with the multi-scale embedding offset score into a joint feature. The joint feature is then mapped in high dimension through a preset deep support vector description network, and the distance from the high-dimensional mapping result to the center of the preset minimum closed sphere is calculated to generate an adaptive anomaly score. The multi-scale embedding calculation submodule calculates the multi-scale embedding offset score of temporal embedding based on multiple preset time scales, specifically: Obtain multi-scale calculation parameters, which include a preset minimum time scale, a preset maximum time scale, and a preset number of scales; Based on the preset geometric series rules, a corresponding number of time scales are selected from the smallest time scale to the largest time scale to form a set of time scales for calculation. Obtain the temporal embedding features output by the temporal modeling and reconstruction submodule; For each time scale and each time step in the time scale set, with the current time step as the endpoint, a window is truncated according to the length of the corresponding time scale, and a preset averaging calculation rule is called to aggregate the temporal embedding features obtained within the window to obtain the average embedding value of all temporal embedding features within the window. The distance between the average embedding value at each time scale and the preset embedding center is calculated. This distance is the multi-scale embedding offset score for the corresponding time scale and time step. The preset embedding center is the normal pattern center at each scale, calculated from historical normal carbon electrochemical time-series data. The multi-scale constrained anomaly detection model is based on historical normal carbon dioxide time series data and a preset proportion of labeled anomaly data, combined with a preset deep support vector description network, and trained by multi-time scale embedding offset modeling and anomaly distance constraint on the initial multi-scale constrained anomaly detection model. Based on the adaptive anomaly score, combined with a preset percentile threshold, the anomaly detection result is obtained.
2. The method for detecting anomalies in electrocarbon data according to claim 1, characterized in that, After generating the adaptive anomaly score, the process also includes: If the multidimensional time-series data of the electrocarbon carries anomaly type labels, the auxiliary classifier integrated by the multi-scale constrained anomaly detection model receives the high-dimensional mapping result output by the deep support vector description network, and calculates the prediction probability of each anomaly type through the softmax layer, and selects the type with the highest prediction probability as the anomaly type prediction result.
3. The method for detecting anomalies in electrocarbon data according to claim 1, characterized in that, The acquisition of multidimensional time-series data on electricity and carbon emissions, including both electricity and carbon emission indicators, specifically involves: The power indicators are generated by acquiring and using real-time voltage data, real-time current data, and real-time load data of the power system. Obtain carbon emission data of the power system, and generate the carbon emission index based on the carbon emission data; The electricity index and the carbon emission index are normalized to output the multidimensional time-series data of electricity and carbon emissions.
4. The method for detecting anomalies in electrocarbon data according to claim 1, characterized in that, The anomaly detection result is obtained based on the adaptive anomaly score and a preset percentile threshold, specifically as follows: Obtain the adaptive anomaly scores corresponding to all time steps output by the multi-scale constrained anomaly detection model to form a complete set of anomaly scores; Based on a preset ratio parameter, the corresponding percentile of the abnormal score set is calculated, and the percentile is used as the preset percentile threshold for abnormal judgment. The adaptive anomaly score for each time step is compared with a preset percentile threshold. If the adaptive anomaly score for a certain time step is greater than the preset percentile threshold, the corresponding carbon data for that time step is determined to be abnormal. If the adaptive anomaly score at a certain time step is less than or equal to the preset percentile threshold, the corresponding carbon data at that time step is determined to be normal. The judgment results of all time steps are integrated to form an anomaly detection result that includes both abnormal time step location information and normal time step location information.
5. The method for detecting anomalies in electrocarbon data according to claim 1, characterized in that, The preset ratio of labeled abnormal data specifically includes: The anomaly data annotations cover three types of anomalies in the carbon dioxide data. The first type of anomaly is data mutation anomaly; the data mutation anomaly is when the change in the index value of a single time step exceeds a first preset multiple of the historical normal fluctuation range. The second type of anomaly is the slow data variation anomaly; the slow data variation anomaly is when the index value of multiple consecutive time steps shows monotonic changes and the total change exceeds the second preset multiple of the historical normal fluctuation range. The third type of anomaly is periodic disturbance anomaly; The periodic disturbance anomaly is defined as the periodic fluctuation amplitude of the indicator value deviating from the historical normal periodic fluctuation amplitude by a third preset multiple.
6. The method for detecting anomalies in electrocarbon data according to claim 1, characterized in that, The initial multi-scale constrained anomaly detection model is trained using anomaly distance constraints, specifically as follows: The system obtains the temporal modeling and reconstruction submodule and the multi-scale embedding calculation submodule of the initial multi-scale constrained anomaly detection model, extracts the temporal embedding features of the labeled anomaly data at a preset ratio, and calculates the multi-scale embedding offset score corresponding to the temporal embedding features. Based on the embedded offset statistical characteristics and preset adjustment coefficients of historical normal carbon dioxide time series data, the preset minimum distance threshold for abnormal distance constraint is determined. If the multi-scale embedding offset score is less than the preset minimum distance threshold, then an abnormal distance loss function is constructed. The anomaly distance loss function is combined with the reconstruction error loss function of the initial multi-scale constrained anomaly detection model and the training loss function of the preset deep support vector description network to obtain the joint loss function. The parameters of the initial multi-scale constrained anomaly detection model are adjusted iteratively through backpropagation until the joint loss function converges, thus obtaining the multi-scale constrained anomaly detection model.
7. An anomaly detection device for carbon dioxide data, characterized in that, include: The acquisition module is used to acquire multidimensional time-series data on electricity and carbon emissions, including electricity indicators and carbon emission indicators. Among them, the power indicators are selected from three categories: voltage, current and load, which are directly related to the power grid operation status; the carbon emission indicators are selected from two categories: carbon factor and carbon intensity, which reflect the carbon emission level. The model scoring module is used to input the multi-dimensional time-series data of the electric carbon into a preset multi-scale constrained anomaly detection model, so that after the time-series modeling and reconstruction sub-module of the multi-scale constrained anomaly detection model extracts the time-series embedding features and generates the data reconstruction sequence, the residual between the multi-dimensional time-series data of the electric carbon and the reconstruction sequence is calculated to obtain the data reconstruction error. The multi-scale embedding computation submodule calculates the multi-scale embedding offset score of temporal embedding based on multiple preset time scales, and concatenates the data reconstruction error with the multi-scale embedding offset score into a joint feature. The joint feature is then mapped in high dimension through a preset deep support vector description network, and the distance from the high-dimensional mapping result to the center of the preset minimum closed sphere is calculated to generate an adaptive anomaly score. The multi-scale embedding calculation submodule calculates the multi-scale embedding offset score of temporal embedding based on multiple preset time scales, specifically: Obtain multi-scale calculation parameters, which include a preset minimum time scale, a preset maximum time scale, and a preset number of scales; Based on the preset geometric series rules, a corresponding number of time scales are selected from the smallest time scale to the largest time scale to form a set of time scales for calculation. Obtain the temporal embedding features output by the temporal modeling and reconstruction submodule; For each time scale and each time step in the time scale set, with the current time step as the endpoint, a window is truncated according to the length of the corresponding time scale, and a preset averaging calculation rule is called to aggregate the temporal embedding features obtained within the window to obtain the average embedding value of all temporal embedding features within the window. The distance between the average embedding value at each time scale and the preset embedding center is calculated. This distance is the multi-scale embedding offset score for the corresponding time scale and time step. The preset embedding center is the normal pattern center at each scale, calculated from historical normal carbon electrochemical time-series data. The multi-scale constrained anomaly detection model is based on historical normal carbon dioxide time series data and a preset proportion of labeled anomaly data, combined with a preset deep support vector description network, and trained by multi-time scale embedding offset modeling and anomaly distance constraint on the initial multi-scale constrained anomaly detection model. An anomaly detection module is used to obtain anomaly detection results based on the adaptive anomaly score and a preset percentile threshold.
8. 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 for electrocarbon data as described in any one of claims 1 to 6.
9. 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 method for detecting anomalies in electrocarbon data as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Abnormal data prediction and state evaluation method for battery
CN121114791A
Self-supervised learning charging abnormal load detection method based on large model
CN121723241A