Real-time energy consumption intelligent analysis method and system fusing multi-source heterogeneous data

By establishing cross-data source mapping relationships and load balancing mechanisms, combined with sliding time windows and water level mechanisms, and dynamically generating anomaly judgment thresholds, the problem of fusion and anomaly detection of multi-source heterogeneous energy consumption data is solved, achieving efficient energy consumption monitoring and anomaly tracing.

CN122155037APending Publication Date: 2026-06-05BEIJING HONGQI RUISHENG TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING HONGQI RUISHENG TECHNOLOGY CO LTD
Filing Date
2026-04-24
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing technologies suffer from insufficient timeliness and accuracy in processing multi-source heterogeneous energy consumption data, making it difficult to adapt to dynamically changing business environments. Furthermore, their low sensitivity in anomaly detection leads to frequent false alarms and missed alarms, resulting in low operational efficiency.

Method used

By receiving heterogeneous data streams, a cross-data source mapping relationship is established to perform data fusion and load balancing. Aggregation operations are performed using a sliding time window and watermark mechanism to dynamically generate anomaly judgment thresholds and identify the data source with the greatest anomaly contribution.

Benefits of technology

It enables real-time fusion and intelligent analysis of multi-source heterogeneous data, improves the accuracy of energy consumption monitoring and the efficiency of anomaly identification, ensures the consistency and integrity of the analysis basis, quickly locates the root cause of anomalies, and improves the efficiency of operation and maintenance diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122155037A_ABST
    Figure CN122155037A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of data processing, and more particularly to a real-time energy consumption intelligent analysis method and system fusing multi-source heterogeneous data. Multi-source heterogeneous original data streams are received and associated fields are parsed and extracted, cross-data-source mapping relationships are established to fuse and generate unified data records. Recordings are allocated based on monitoring processing channel load, and aggregation calculation is performed based on time window and water line mechanism in the target channel to generate a fused aggregation value sequence. Sequence features are extracted to predict energy consumption and calculate residuals, and an abnormality determination threshold is dynamically generated to identify abnormalities. Abnormal window records are traced back, and the abnormal contribution degree of each data source is calculated to identify the main abnormal source. The method realizes real-time fusion and efficient processing of multi-source data, and through dynamic threshold and contribution degree analysis, the accuracy and tracing ability of energy consumption anomaly detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a real-time intelligent energy consumption analysis method and system that integrates multi-source heterogeneous data. Background Technology

[0002] In the field of energy management, real-time monitoring and analysis of energy consumption data is crucial for optimizing operations, reducing costs, and ensuring system stability. Currently, energy consumption data in industrial settings or large buildings typically originates from various heterogeneous systems, such as building automation systems, power monitoring systems, environmental sensor networks, and production execution systems. The data generated by these systems differ significantly in format, sampling frequency, communication protocols, and semantics, constituting a typical multi-source heterogeneous data environment.

[0003] For analyzing this type of data, current conventional practices typically employ a layered or step-by-step processing architecture. A common approach is to deploy multiple independent data acquisition interfaces, each connecting to different data source systems. The collected raw data, after format conversion and cleaning, is stored in a centralized database or data warehouse. Analysis tasks then use scheduled batch processing jobs or queries to perform offline calculations on historical data to generate energy consumption reports, statistical trends, or perform post-event anomaly detection. Another more real-time approach involves introducing message queues as data buffers and building stream processing pipelines to perform data processing line-by-line or micro-batch processing, thereby achieving near real-time metric calculations.

[0004] The fusion of multi-source heterogeneous data often relies on pre-configured static data mapping rules or complex ETL scripts. When data sources increase, data formats change, or new correlation analysis needs arise, manual adjustments to the mapping logic and processing flow are required. This results in insufficient system flexibility and scalability, making it difficult to adapt to dynamically changing business environments. This poses challenges to the timeliness and accuracy of data fusion. Conventional methods often use rules based on fixed thresholds or simple statistical models (such as the 3σ principle) for anomaly detection. Fixed thresholds cannot adapt to the periodic or trend-based changes in energy consumption data caused by seasons, operating conditions, and production plans, easily leading to numerous false alarms or missed alarms. Simple statistical models are not sensitive enough to abnormal fluctuations under complex patterns after multi-source data fusion, especially in distinguishing between overall system anomalies and local anomalies introduced by specific data sources. This makes subsequent problem localization and root cause analysis inefficient, requiring maintenance personnel to spend a significant amount of time manually investigating the source of anomalies. Summary of the Invention

[0005] The present invention provides a real-time intelligent energy consumption analysis method and system that integrates multi-source heterogeneous data, which can solve the problems in the prior art.

[0006] Receive raw data streams from multiple heterogeneous data sources. The raw data streams carry timestamps, data source identifiers, and data type identifiers.

[0007] The original data stream is parsed and related fields are extracted based on the data type identifier. A cross-data source mapping relationship is established based on the related fields. Data of different data types are merged to generate a unified data record based on the mapping relationship.

[0008] Monitor the backlog of multiple processing channels and calculate the load weight, and allocate unified data records to the target processing channel according to the load weight;

[0009] In the target processing channel, data is categorized into a sliding time window based on the timestamp and mapping relationship in the unified data record. Window calculation is triggered based on the water level mechanism, and aggregation operation is performed on the unified data record within the window to generate a fused aggregated value sequence.

[0010] Periodic features are extracted from the fused aggregated value sequence to calculate the predicted energy consumption value. The residual between the fused aggregated value and the predicted energy consumption value is calculated. An anomaly judgment threshold is dynamically generated based on the statistical distribution of the residual. The fused aggregated value is compared with the anomaly judgment threshold to generate an anomaly identifier.

[0011] Extract unified data records from the window corresponding to the anomaly identifier, calculate the anomaly contribution of each data source based on the mapping relationship and the data source identifier, and identify the data source with the largest contribution as the anomaly source.

[0012] The raw data stream is parsed based on data type identifiers, and related fields are extracted. A cross-data source mapping relationship is established based on these related fields. Data of different data types is then merged according to the mapping relationship to generate a unified data record, including:

[0013] The raw data stream is parsed into structured data records based on the data type identifier, and the device identifier field, location identifier field, and time identifier field are extracted from the structured data records as association fields;

[0014] The sampling intervals of the time identifier fields of each data source are statistically analyzed. The greatest common divisor of the sampling intervals is selected as the benchmark time granularity. For data sources with sampling intervals greater than the benchmark time granularity, the time identifier fields are segmented according to the benchmark time granularity, and aggregation operations are performed on the values ​​within the segments to generate aligned data.

[0015] The aligned data is grouped by the device identifier field and the location identifier field. Within each group, a mapping relationship is established based on the time identifier field corresponding to the base time granularity. The mapping relationship records the association between the device identifier field, the location identifier field, the time identifier field, and the data source identifier.

[0016] Based on the mapping relationship, query the aligned data corresponding to different data source identifiers with the same device identifier field, location identifier field and time identifier field, and then horizontally concatenate the queried aligned data to generate a unified data record.

[0017] Monitoring the backlog across multiple processing channels and calculating load weights, then allocating unified data records to target processing channels based on these load weights includes:

[0018] Extract mapping relationships from unified data records, count the number of unified data records arriving for each mapping relationship within a preset time window, calculate the arrival rate of each mapping relationship based on the number of unified data records arriving, and assign association weights to each mapping relationship based on the arrival rate.

[0019] Record the set of mapping relationships allocated to each processing channel and the cumulative number of unified data records corresponding to each mapping relationship; calculate the distribution of the proportion of the mapping relationship sets in each processing channel; and calculate the distribution entropy value of the mapping relationship in each processing channel based on the distribution of the proportion of the proportions.

[0020] The amount of data to be processed in each processing channel is monitored as the backlog, and the ratio of the backlog of each processing channel to the total backlog of the processing channels is calculated as the load weight.

[0021] Extract mapping relationships from the unified data records to be assigned, query the associated weights corresponding to the mapping relationships, traverse each processing channel and obtain the mapping relationship distribution entropy value and load weight, and then perform a weighted summation of the associated weights, mapping relationship distribution entropy values ​​and load weights to generate the comprehensive weights for each processing channel.

[0022] The processing channel with the lowest overall weight is selected as the target processing channel, and the unified data records are allocated to the target processing channel.

[0023] In the target processing channel, data is categorized into sliding time windows based on timestamps and mapping relationships in unified data records. Window calculations are triggered using a watermark mechanism, and aggregation operations are performed on the unified data records within the window to generate a fused aggregated value sequence, including:

[0024] Receive unified data records in the target processing channel and extract timestamps and mapping relationships from the unified data records;

[0025] Establish window groups based on the mapping relationship. Within each window group, classify the unified data records into the corresponding sliding time window based on the timestamp. Record the maximum timestamp of the unified data records received by each sliding time window as the window water level.

[0026] Traverse each window group, calculate the difference between the window water level of each sliding time window in the window group and the maximum window water level in the window group, and mark the sliding time window whose window water level difference exceeds the preset window duration as a delay window;

[0027] Based on the water level mechanism, each sliding time window is traversed. When the water level of the sliding time window exceeds the end time of the sliding time window, a window trigger signal is generated to trigger window calculation. When the water level of the delayed window does not exceed the end time, but the maximum water level of the window in the window group has exceeded the end time of the delayed window, a window trigger signal is generated to trigger window calculation.

[0028] Receive window trigger signal, extract unified data records within the sliding time window corresponding to the window trigger signal, group and aggregate the unified data records according to the mapping relationship, and perform summation operation on the numerical fields of the unified data records in each group to generate a fused aggregated value sequence.

[0029] Periodic features are extracted from the fused aggregated value sequence to calculate the predicted energy consumption value. The residual between the fused aggregated value and the predicted energy consumption value is calculated. An anomaly detection threshold is dynamically generated based on the statistical distribution of the residual. The fused aggregated value is compared with the anomaly detection threshold to generate an anomaly identifier, including:

[0030] Periodic features are extracted by periodic decomposition of the fused aggregated value sequence. Based on the periodic features, a predicted energy consumption value sequence is generated by fitting. The difference between the fused aggregated value sequence and the predicted energy consumption value sequence is calculated to construct a residual sequence.

[0031] The residual sequence is subjected to time-series differencing to construct a residual rate of change sequence. The statistical distribution characteristics of the residual rate of change sequence are calculated to construct a residual fluctuation model. Based on the residual fluctuation model, the time interval in the residual sequence where the residual rate of change exceeds the fluctuation threshold is identified as the fluctuation interval.

[0032] The residual sequences are grouped according to the mapping relationship. The statistical distribution difference of the residuals in the fluctuation range and the non-fluctuation range within each mapping relationship group is calculated. The dynamic weights are calculated for each mapping relationship group based on the statistical distribution difference.

[0033] The residuals in the residual sequence are weighted and adjusted according to the dynamic weights to construct the adjusted residual sequence. The adjusted residual sequence is accumulated and summed to construct the cumulative residual sequence. The statistical distribution characteristics of the cumulative residual sequence are calculated. An anomaly judgment threshold is dynamically generated based on the statistical distribution of the cumulative residual sequence.

[0034] Extract the cumulative residual sequence value corresponding to the fusion aggregation value, compare the cumulative residual sequence value with the anomaly detection threshold, and generate an anomaly label for the fusion aggregation value when the cumulative residual sequence value exceeds the anomaly detection threshold.

[0035] The residual sequences are grouped according to mapping relationships. The statistical distribution differences of the residuals within each mapping relationship group in the fluctuation range and the non-fluctuation range are calculated. Based on the statistical distribution differences, dynamic weights are calculated for each mapping relationship group, including:

[0036] The residual sequences are grouped according to the mapping relationship to construct the mapping relationship grouped residual sequence. The residuals in the fluctuation range of each mapping relationship grouped residual sequence are extracted to construct the fluctuation residual subsequence. The residuals in the non-fluctuation range of each mapping relationship grouped residual sequence are extracted to construct the non-fluctuation residual subsequence.

[0037] Align the fluctuation residual subsequences of each mapping relationship group by timestamp, calculate the covariance matrix of the fluctuation residual values ​​of different mapping relationship groups at each timestamp, and perform eigenvalue decomposition on the covariance matrix to extract the principal component contribution rate corresponding to each mapping relationship group.

[0038] The ratio between the variance of the fluctuating residual subsequence and the variance of the non-fluctuating residual subsequence is calculated as the statistical distribution difference. The statistical distribution difference is multiplied by the principal component contribution rate of the corresponding mapping relationship group, and the product result is normalized to generate the dynamic weights of each mapping relationship group.

[0039] Extract unified data records from the windows corresponding to the anomaly identifiers. Calculate the anomaly contribution of each data source based on the mapping relationship and data source identifiers. Identify the data source with the largest contribution as the anomaly source, including:

[0040] Extract the time window identifier corresponding to the fused aggregated value carrying the anomaly identifier, extract the unified data record within the time window from the unified data record according to the time window identifier, and construct the data source group record set by grouping according to the data source identifier;

[0041] Extract the mapping relationships corresponding to the fused aggregated values ​​carrying anomaly identifiers to construct an anomaly mapping relationship set; extract the mapping relationships of unified data records in the data source group record set; calculate the intersection of the mapping relationships and the anomaly mapping relationship set to construct an overlapping mapping relationship set.

[0042] Traverse the mapping relationships in the overlapping mapping relationship set, extract the timestamps of the unified data records carrying the current mapping relationship in the data source group record set to construct a timestamp sequence, calculate the number of consecutive timestamps in the timestamp sequence, and mark the current mapping relationship as a continuous abnormal mapping relationship when the number of consecutive timestamps exceeds the preset number threshold;

[0043] The number of persistently abnormal mapping relationships corresponding to the data source group record set is counted. The proportion of the number of persistently abnormal mapping relationships to the total number of mapping relationships in the data source group record set is calculated as the abnormal contribution of the data source. The data source with the largest abnormal contribution is extracted as the abnormal source.

[0044] A second aspect of this invention provides a real-time energy consumption intelligent analysis system that integrates multi-source heterogeneous data, comprising:

[0045] The data receiving unit is used to receive raw data streams from multiple heterogeneous data sources. The raw data streams carry timestamps, data source identifiers, and data type identifiers.

[0046] The data fusion unit is used to parse the original data stream according to the data type identifier and extract related fields, establish a cross-data source mapping relationship based on the related fields, and fuse data of different data types to generate a unified data record according to the mapping relationship;

[0047] The load balancing unit is used to monitor the backlog of multiple processing channels and calculate the load weight, and distribute the unified data records to the target processing channel according to the load weight.

[0048] The window calculation unit is used to classify data into a sliding time window in the target processing channel according to the timestamp and mapping relationship in the unified data record, trigger window calculation based on the water level mechanism, and perform aggregation operation on the unified data record in the window to generate a fused aggregated value sequence.

[0049] An anomaly detection unit is used to extract periodic features from the fused aggregated value sequence to calculate the predicted energy consumption value, calculate the residual between the fused aggregated value and the predicted energy consumption value, dynamically generate an anomaly judgment threshold based on the statistical distribution of the residual, and compare the fused aggregated value with the anomaly judgment threshold to generate an anomaly identifier.

[0050] The anomaly tracing unit is used to extract unified data records from the window corresponding to the anomaly identifier, calculate the anomaly contribution of each data source according to the mapping relationship and data source identifier, and identify the data source with the largest contribution as the anomaly source.

[0051] A third aspect of the present invention provides an electronic device, comprising:

[0052] processor;

[0053] Memory used to store processor-executable instructions;

[0054] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0055] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0056] This method achieves real-time fusion and intelligent analysis of multi-source heterogeneous data, significantly improving the accuracy of energy consumption monitoring and the efficiency of anomaly identification. By establishing cross-data source mapping relationships, data from different formats and sources are integrated into a unified record, effectively solving the data silo problem and ensuring the consistency and integrity of the analytical foundation. A dynamic allocation mechanism based on load weights optimizes the resource utilization of processing channels, avoids data backlog, and ensures low latency and high throughput performance for real-time streaming data processing. Utilizing a sliding time window and watermark mechanism for windowed aggregation of unified data enables precise data collection and calculation along the time dimension, generating a continuous sequence of fused aggregated values. This method effectively captures the temporal variation patterns of energy consumption data, providing a stable and reliable data foundation for subsequent analysis. Periodic features are extracted from the sequence for prediction, and anomaly judgment thresholds are dynamically generated through residual analysis, making the anomaly detection mechanism adaptive and able to adjust sensitivity according to the statistical characteristics of the data itself, reducing the false alarm rate. By calculating the contribution of each data source to the anomaly window, the main data source causing the anomaly can be quickly located, achieving precise tracing of the anomaly root cause. This process refines anomaly detection from a holistic level down to the specific data source level, greatly improving the efficiency of operations and maintenance personnel in diagnosing problems. The entire analysis process achieves end-to-end intelligentization from data fusion and real-time computation to anomaly detection and tracing, constructing a closed-loop energy consumption monitoring system. Attached Figure Description

[0057] Figure 1 This is a flowchart illustrating the real-time energy consumption intelligent analysis method that integrates multi-source heterogeneous data in this embodiment.

[0058] Figure 2 This is a flowchart of the abnormal source extraction and determination operation in this embodiment. Detailed Implementation

[0059] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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.

[0060] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0061] Figure 1 This is a flowchart illustrating the real-time energy consumption intelligent analysis method integrating multi-source heterogeneous data according to an embodiment of the present invention. Figure 1As shown, the real-time energy consumption intelligent analysis method that integrates multi-source heterogeneous data includes:

[0062] Receive raw data streams from multiple heterogeneous data sources. The raw data streams carry timestamps, data source identifiers, and data type identifiers.

[0063] The original data stream is parsed and related fields are extracted based on the data type identifier. A cross-data source mapping relationship is established based on the related fields. Data of different data types are merged to generate a unified data record based on the mapping relationship.

[0064] Monitor the backlog of multiple processing channels and calculate the load weight, and allocate unified data records to the target processing channel according to the load weight;

[0065] In the target processing channel, data is categorized into a sliding time window based on the timestamp and mapping relationship in the unified data record. Window calculation is triggered based on the water level mechanism, and aggregation operation is performed on the unified data record within the window to generate a fused aggregated value sequence.

[0066] Periodic features are extracted from the fused aggregated value sequence to calculate the predicted energy consumption value. The residual between the fused aggregated value and the predicted energy consumption value is calculated. An anomaly judgment threshold is dynamically generated based on the statistical distribution of the residual. The fused aggregated value is compared with the anomaly judgment threshold to generate an anomaly identifier.

[0067] Extract unified data records from the window corresponding to the anomaly identifier, calculate the anomaly contribution of each data source based on the mapping relationship and the data source identifier, and identify the data source with the largest contribution as the anomaly source.

[0068] The raw data stream is parsed based on data type identifiers, and related fields are extracted. A cross-data source mapping relationship is established based on these related fields. Data of different data types is then merged according to the mapping relationship to generate a unified data record, including:

[0069] The raw data stream is parsed into structured data records based on the data type identifier, and the device identifier field, location identifier field, and time identifier field are extracted from the structured data records as association fields;

[0070] The sampling intervals of the time identifier fields of each data source are statistically analyzed. The greatest common divisor of the sampling intervals is selected as the benchmark time granularity. For data sources with sampling intervals greater than the benchmark time granularity, the time identifier fields are segmented according to the benchmark time granularity, and aggregation operations are performed on the values ​​within the segments to generate aligned data.

[0071] The aligned data is grouped by the device identifier field and the location identifier field. Within each group, a mapping relationship is established based on the time identifier field corresponding to the base time granularity. The mapping relationship records the association between the device identifier field, the location identifier field, the time identifier field, and the data source identifier.

[0072] Based on the mapping relationship, query the aligned data corresponding to different data source identifiers with the same device identifier field, location identifier field and time identifier field, and then horizontally concatenate the queried aligned data to generate a unified data record.

[0073] In practical applications, energy consumption data collected from different data sources often have different data formats and sampling frequencies. Electricity meter data may collect voltage, current, and power information at fixed intervals, sensor data may record ambient temperature and humidity, and equipment operation logs may contain start-up and shutdown status and load rate changes. To achieve effective fusion of these heterogeneous data, it is necessary to perform structured parsing of the raw data streams and establish a unified mapping mechanism.

[0074] Upon receiving the raw data stream carrying data type identifiers, the system converts data of different formats into structured data records according to predefined parsing rules. For JSON-formatted sensor data, key-value pairs are extracted and mapped to a predefined field structure; for fixed-length meter data, it is split according to byte offsets and converted into corresponding fields; for CSV-formatted log data, it is parsed according to delimiters and the target columns are extracted. The integrity of the original data is preserved during the parsing process, ensuring that data source identifiers and timestamp information are not lost.

[0075] Identify fields from the parsed structured data records that enable cross-data source associations. The device identifier field is typically the device number or serial number, serving as a unique identifier to distinguish different energy-consuming devices; the location identifier field may contain floor numbers, area numbers, or spatial coordinates to identify the physical location of the device; and the time identifier field records the precise moment the data was collected. These three types of fields constitute the key basis for cross-data source fusion, allowing us to determine which records from different data sources describe the state of the same device at the same time.

[0076] Because the sampling intervals of different data sources vary significantly—some meters may collect data once per second, while some sensors may collect data once per minute or hour—directly fusing these data with inconsistent sampling frequencies leads to difficulties in aligning the time dimension. By iterating through the time identifier field of each data source, the time difference between adjacent records is calculated, and the typical sampling interval for each data source is statistically determined. For data sources with multiple sampling intervals, the interval with the highest frequency is selected as the representative sampling interval for that data source. After collecting the representative sampling intervals from all data sources, the greatest common divisor (GCD) of these intervals is calculated, and this GCD is set as the baseline time granularity. For example, when the sampling interval of data source A is 15 seconds, the sampling interval of data source B is 60 seconds, and the sampling interval of data source C is 45 seconds, the baseline time granularity is determined to be 15 seconds.

[0077] For data sources with sampling intervals larger than the baseline time granularity, time alignment processing is required. The time identifier fields of these data sources are segmented according to the baseline time granularity, with each segment corresponding to a baseline time point. For multiple sampled values ​​falling within the same segment, an appropriate aggregation strategy is selected based on the data characteristics. For power data, the average of all sampled values ​​within a segment is calculated as the representative value for that segment; for cumulative energy consumption data, the sum of the increments of sampled values ​​within a segment is calculated; for status data, the status value that appears most frequently within a segment is selected. After aggregation, the original data source with a sampling interval of 60 seconds is converted into aligned data with one data point every 15 seconds, maintaining consistency with the baseline time granularity.

[0078] After the data alignment is generated, it is grouped according to the device identifier and location identifier fields. Data records belonging to the same device and located in the same location are grouped together. Within each group, a mapping relationship is established based on the time identifier field. The mapping relationship uses the combination of device identifier, location identifier, and time identifier as the index key, recording all data source identifiers and their data fields corresponding to that index key. For example, for a data point with device number "DEV001", located at "FLOOR3-ZO7E2", and time identifier "2024-01-15 10:00:00", the mapping relationship might record that data source A provides voltage and current fields, data source B provides a temperature field, and data source C provides a device status field.

[0079] The mapping relationship is established using a hash index structure. A hash value is calculated by concatenating the device identifier, location identifier, and time identifier. Alignment data from different data sources is then inserted into the corresponding hash buckets. When alignment data from a data source arrives, the hash value corresponding to its associated field is calculated, and records from other data sources that already exist in that hash bucket are retrieved. If the hash bucket is empty, a new mapping entry is created and inserted into the record from the current data source; if the hash bucket already contains records from other data sources, the record from the current data source is appended to the mapping entry, forming a set of associated records from multiple data sources.

[0080] When performing data fusion based on mapping relationships, all data source records with the same device identifier, location identifier, and time identifier fields are queried. Alignment data corresponding to each data source is extracted from the mapping entries, and horizontal concatenation is performed according to a predefined field order. For example, if data source A's alignment data contains the fields [voltage, current], data source B's alignment data contains the fields [temperature, humidity], and data source C's alignment data contains the fields [operating status, load rate], then the concatenated unified data record will contain the fields [device identifier, location identifier, time identifier, voltage, current, temperature, humidity, operating status, load rate]. If certain data sources are missing at a specific time point, null values ​​are filled into the corresponding fields in the unified data record, and these are supplemented in subsequent processing according to interpolation strategies or default value rules.

[0081] After unified data records are generated, the original data source identification information is retained, recording the source of each numerical field in the form of a field array or nested structure. This metadata retention mechanism provides a traceability basis for subsequent anomaly source location. When unified data records are used in energy consumption calculation and anomaly detection, the specific data source can be quickly traced back to calculate the contribution of each data source to the abnormal results.

[0082] The entire data fusion process is continuously executed within a streaming processing framework. As new raw data streams arrive, the mapping relationships are continuously updated and new unified data records are generated. By maintaining the mapping index within a sliding time window and periodically cleaning up expired mapping entries, memory usage is kept under control. For high-frequency data sources, batch insertion of mapping relationships is used to reduce index update overhead; for low-frequency data sources, a triggered query mechanism is used, performing mapping relationship retrieval only when data arrives, avoiding invalid periodic scans.

[0083] Monitoring the backlog across multiple processing channels and calculating load weights, then allocating unified data records to target processing channels based on these load weights includes:

[0084] Extract mapping relationships from unified data records, count the number of unified data records arriving for each mapping relationship within a preset time window, calculate the arrival rate of each mapping relationship based on the number of unified data records arriving, and assign association weights to each mapping relationship based on the arrival rate.

[0085] Record the set of mapping relationships allocated to each processing channel and the cumulative number of unified data records corresponding to each mapping relationship; calculate the distribution of the proportion of the mapping relationship sets in each processing channel; and calculate the distribution entropy value of the mapping relationship in each processing channel based on the distribution of the proportion of the proportions.

[0086] The amount of data to be processed in each processing channel is monitored as the backlog, and the ratio of the backlog of each processing channel to the total backlog of the processing channels is calculated as the load weight.

[0087] Extract mapping relationships from the unified data records to be assigned, query the associated weights corresponding to the mapping relationships, traverse each processing channel and obtain the mapping relationship distribution entropy value and load weight, and then perform a weighted summation of the associated weights, mapping relationship distribution entropy values ​​and load weights to generate the comprehensive weights for each processing channel.

[0088] The processing channel with the lowest overall weight is selected as the target processing channel, and the unified data records are allocated to the target processing channel.

[0089] In the process of dynamic load balancing of channels, it is necessary to comprehensively consider the correlation characteristics of data streams, the processing capacity of channels, and the balance of load distribution. For real-time energy consumption analysis scenarios, data corresponding to different mapping relationships often have different processing characteristics and arrival frequencies, requiring the maintenance of processing consistency for data with the same mapping relationship while ensuring load balancing.

[0090] First, mapping relationship identifiers are extracted from the unified data records. Each unified data record has a clearly defined mapping relationship established during the fusion phase, reflecting the association pattern between data sources. A unique identifier for the mapping relationship is obtained by parsing the metadata fields of the unified data records. A preset time window of 5 minutes is set, and the arrival status of unified data records corresponding to each mapping relationship is continuously monitored within this window. A mapping relationship counter is maintained to accumulate the number of unified data records arriving for each mapping relationship within the window period in real time. As the time window slides, the arrival rate is calculated. For example, if a mapping relationship arrives with 300 unified data records within a 5-minute window, its arrival rate is 60 records per minute. Association weights are assigned based on the arrival rate; mapping relationships with higher arrival rates are assigned higher weight values. Specifically, normalization can be used to map the arrival rates of all mapping relationships to a range of 0 to 1, obtaining the association weight for each mapping relationship. The association weight reflects the data traffic intensity of that mapping relationship; a higher weight means more stable processing resources are required.

[0091] In the status management of processing channels, it is necessary to record in detail the set of mapping relationships assigned to each processing channel. A channel mapping table is maintained, storing the channel identifier, the list of assigned mapping relationships, and the cumulative number of unified data records processed for each mapping relationship. The channel mapping table is periodically scanned to obtain the data distribution of different mapping relationships within each processing channel. Assume a processing channel has been assigned 5 types of mapping relationships, with cumulative numbers of 1000, 800, 600, 400, and 200 records for each. The distribution of the number of mapping relationships is calculated, i.e., the ratio of the number of each mapping relationship to the total number of records in the channel. In the example above, the ratios are 0.333, 0.267, 0.200, 0.133, and 0.067, respectively. The entropy value of the mapping relationship distribution is calculated based on the distribution of the number of mapping relationships. Introducing the concept of information entropy, the formula for calculating the entropy value of the mapping relationship distribution is: Where M represents the number of types of mapping relationships within the channel. Indicates the first The entropy value represents the percentage of different mapping relationships. A higher entropy value indicates a more even distribution of mapping relationships within a channel and a more diverse range of data types being processed. A lower entropy value indicates that channel processing is concentrated on a few types of mapping relationships. The entropy value of the mapping relationship distribution is used to assess the processing diversity of a channel and to prevent some channels from excessively focusing on processing a single type of data.

[0092] Backlog monitoring is achieved by querying the internal queues of each processing channel. Each processing channel maintains a queue of data to be processed, and the queue length represents the backlog for that channel. Real-time backlog data is obtained by periodically polling the queue status of each channel. Assume the system has four processing channels, and the backlogs detected at a certain moment are 150, 200, 100, and 250 records respectively. The total backlog for each processing channel is calculated to be 700 records. The load weight of each processing channel is calculated as a percentage of the backlog; in the example above, the load weights are 0.214, 0.286, 0.143, and 0.357 respectively. The load weight directly reflects the current load status of the channel; a higher weight indicates a more severe backlog and greater processing pressure.

[0093] When a new unified data record arrives and needs to be allocated, the mapping relationship identifier of that record is first extracted. The association weight corresponding to that mapping relationship is obtained by querying the mapping relationship weight table. Assume the association weight of this mapping relationship is 0.6. Next, all available processing channels are traversed, and for each channel, its mapping relationship distribution entropy value and load weight are obtained. Assume the mapping relationship distribution entropy value of a certain channel is 1.8 and the load weight is 0.25. To comprehensively evaluate the channel's adaptability, the association weight, mapping relationship distribution entropy value, and load weight are weighted and summed. The weighting coefficients are set as follows: ,in Take 0.4, Take 0.3, Take 0.3. The formula for calculating the overall weight is: ,in H represents the association weight, and H represents the distribution entropy of the mapping relationship. This represents the load weight. In the example above, the overall weight of this channel is calculated as 0.4 multiplied by 0.6 plus 0.3 multiplied by 1.8 plus 0.3 multiplied by 0.25, resulting in an overall weight of 0.855. The same calculation is performed on all processing channels to obtain the overall weight value for each channel.

[0094] The processing channel with the smallest overall weight is selected as the target processing channel. The smallest overall weight means that this channel is best suited for processing the current unified data record under a comprehensive balance of association weight, distribution entropy value, and load weight. Assuming that the calculated overall weight of channel 3 is 0.720, which is the smallest among all channels, channel 3 is selected as the target processing channel. The unified data record is assigned to the processing queue of channel 3, and the mapping relationship set and cumulative count of channel 3 are updated simultaneously. If the mapping relationship already exists in the mapping relationship set of channel 3, the corresponding cumulative count is incremented by 1; if it is a new mapping relationship, it is added to the set and the cumulative count is initialized to 1.

[0095] This dynamic allocation mechanism achieves multiple optimization objectives. By using associated weights, it ensures that high-frequency mapping relationships are prioritized for allocation to channels with sufficient processing capacity, preventing high-traffic data streams from being assigned to already full channels. By using mapping relationship distribution entropy values, it promotes the diversity of data types processed by each channel, preventing some channels from over-focusing on a single mapping relationship and causing delays in other mapping relationships. Through load weights, it achieves real-time load balancing, prioritizing new data allocation to channels with less backlog, avoiding load skew. The weighted combination of these three factors maintains overall system load balance and processing fairness while ensuring processing efficiency, adapting to the characteristics of data traffic fluctuations and dynamic changes in mapping relationships in real-time energy consumption analysis scenarios.

[0096] In practical deployments, the weighting coefficient can be adjusted according to system characteristics. If the system prioritizes load balancing, it can be increased. The value of can be increased if more attention is paid to the associative processing of mapping relationships. The value of the preset time window also affects the sensitivity of the associated weights; a shorter window can respond quickly to traffic changes, while a longer window provides a smoother weight evaluation. Parameter tuning can adapt to energy consumption monitoring systems of different sizes and characteristics, achieving efficient processing channel load management.

[0097] In the target processing channel, data is categorized into sliding time windows based on timestamps and mapping relationships in unified data records. Window calculations are triggered using a watermark mechanism, and aggregation operations are performed on the unified data records within the window to generate a fused aggregated value sequence, including:

[0098] Receive unified data records in the target processing channel and extract timestamps and mapping relationships from the unified data records;

[0099] Establish window groups based on the mapping relationship. Within each window group, classify the unified data records into the corresponding sliding time window based on the timestamp. Record the maximum timestamp of the unified data records received by each sliding time window as the window water level.

[0100] Traverse each window group, calculate the difference between the window water level of each sliding time window in the window group and the maximum window water level in the window group, and mark the sliding time window whose window water level difference exceeds the preset window duration as a delay window;

[0101] Based on the water level mechanism, each sliding time window is traversed. When the water level of the sliding time window exceeds the end time of the sliding time window, a window trigger signal is generated to trigger window calculation. When the water level of the delayed window does not exceed the end time, but the maximum water level of the window in the window group has exceeded the end time of the delayed window, a window trigger signal is generated to trigger window calculation.

[0102] Receive window trigger signal, extract unified data records within the sliding time window corresponding to the window trigger signal, group and aggregate the unified data records according to the mapping relationship, and perform summation operation on the numerical fields of the unified data records in each group to generate a fused aggregated value sequence.

[0103] For the calculation process of sliding time windows and waterline-based windows, after the target processing channel receives the unified data record, the first step is to perform a field extraction operation. The timestamp field, in Unix millisecond-level format, is read from a fixed field location in the unified data record. Simultaneously, the mapping relationship field is extracted. This field contains the correspondence between the data source identifier and related fields; for example, the mapping relationship field of a unified data record might contain the association information between the meter identifier and the workshop identifier. After extraction, the timestamp is used as the primary basis for data inclusion in the window, and the mapping relationship is used as the basis for dividing the window groups.

[0104] Window groups are created based on the combination of associated fields in the mapping relationship. Specifically, key associated fields in the mapping relationship are combined as group identifiers, for example, combining device type and region identifier into a group key in the form of "device type-region". All unified data records corresponding to the same group key are grouped into the same window group. Within the window group, a sliding time window is created according to preset window duration and sliding step parameters. Assuming the window duration is set to 300 seconds and the sliding step is set to 60 seconds, when the first unified data record is received, the window start time is calculated based on its timestamp. The timestamp is aligned to the whole minute. For example, a timestamp of 1672531845000 milliseconds corresponds to January 1, 2023, 00:30:45. The aligned window start time is January 1, 2023, 00:30:00, corresponding to a Unix timestamp of 1672531800000 milliseconds. The window end time is the start time plus the window duration, i.e., 1672532100000 milliseconds. Because of the sliding window mechanism, the same data record may belong to multiple windows at the same time. For example, a record with a timestamp of 1672531845000 milliseconds may be assigned to multiple windows with start times of 1672531800000 milliseconds, 1672531740000 milliseconds, etc.

[0105] During the process of incorporating unified data records into a window, a window watermark is maintained for each sliding time window. The window watermark is defined as the maximum timestamp of all unified data records received within that window. When a new unified data record is incorporated into a sliding time window, its timestamp is compared to the current window watermark. If the record's timestamp is greater than the current window watermark, the window watermark is updated to that timestamp. For example, if the current watermark for a window is 1672531850000 milliseconds, and the timestamp of a newly incorporated unified data record is 1672531920000 milliseconds, then the window watermark is updated to 1672531920000 milliseconds. The physical meaning of the window watermark is the latest event time observed within that window, used to determine the data reception progress of that window.

[0106] To identify windows with significant data reception delays, delayed window detection is performed within window groups. All sliding time windows within a given window group are iterated through, and the maximum value of all window watermarks within that group is recorded as the maximum window watermark. For each sliding time window, the difference between its window watermark and the maximum window watermark is calculated. This difference reflects the lag of the window relative to the fastest data reception window within the window group. The difference is compared to a preset window duration. If the difference exceeds the window duration, the sliding time window is marked as a delayed window. For example, if the maximum window watermark of a window group is 1672532500000 milliseconds, and the window watermark of a certain sliding time window is 1672532100000 milliseconds, the difference is 400000 milliseconds (400 seconds), while the preset window duration is 300 seconds. Therefore, this window is marked as a delayed window. Marking delayed windows helps avoid prolonged window calculation blocking due to delays in individual data sources.

[0107] The system iterates through each sliding time window using a watermark mechanism to determine whether to trigger window computation. The iteration is performed by window group. For each sliding time window within a group, it first determines whether the window is a delayed window. For non-delayed windows, a standard watermark trigger condition is used: when the window watermark exceeds the window's end time, the data for that window is considered largely complete, and a window trigger signal is generated. For example, if the end time of a sliding time window is 1672532100000 milliseconds, and the window watermark is updated to 1672532120000 milliseconds, the trigger condition is met, and a window trigger signal is generated. For delayed windows, a more lenient trigger condition is used: even if the delayed window's watermark has not exceeded its own end time, a window trigger signal is still generated if the maximum window watermark within the window group has exceeded the delayed window's end time. For example, if the end time of a certain delay window is 1672532100000 milliseconds, its window watermark is only 1672532050000 milliseconds. However, if the maximum window watermark within the window group has reached 1672532200000 milliseconds, exceeding the end time of the delay window, then a window trigger signal is generated for that delay window. This mechanism avoids the overall computation from stalling due to a small amount of delayed data.

[0108] Upon receiving a window trigger signal, the window calculation operation is immediately executed. The corresponding sliding time window identifier is extracted from the window trigger signal, and all unified data records stored within that window are retrieved based on the window identifier. These unified data records are then grouped and aggregated according to their mapping relationships. Specifically, key dimension fields, such as data source identifier, device type, and region identifier, are extracted from the mapping relationship of each unified data record, and unified data records with the same combination of dimension fields are grouped into the same group. For example, if a window contains 5 unified data records, 3 of which have a data source identifier of meter A and a region identifier of workshop 1, and the other 2 have a data source identifier of meter B and a region identifier of workshop 2, then two groups are formed.

[0109] Aggregation operations are performed on the uniform data records within each group. Numerical fields are extracted from each uniform data record; these fields are typically energy consumption, power, or other metrics. The numerical fields of all uniform data records within the same group are summed to obtain the aggregated value for that group. For example, a group containing three uniform data records with numerical fields of 120.5, 135.2, and 142.8 would have an aggregated value of 398.5. The aggregated values ​​of all groups are then organized into a fused aggregated value sequence based on group identifiers and time window information. This fused aggregated value sequence is a structured sequence containing time window identifiers, group identifiers, and aggregated values. For example, a fused aggregated value record might be: "Window start time = 1672531800000, Window end time = 1672532100000, Data source = Meter A, Region = Workshop 1, Aggregated value = 398.5". The fused aggregated value sequence is arranged in time window order, providing input data for subsequent prediction and anomaly detection.

[0110] During the generation of the fused aggregate value sequence, a window state management mechanism is maintained. For sliding time windows that have already triggered calculations, they are marked as calculated, and the unified data records within the window are cleaned up according to the window retention policy. If a strategy of retaining only the most recent windows is adopted, the memory space occupied by the window is released when the difference between the end time of the calculated window and the current maximum window watermark exceeds the retention period. For example, if the window retention period is set to 1800 seconds, and the current maximum window watermark corresponds to the time January 1, 2023, 01:00:00, then windows with an end time earlier than January 1, 2023, 00:30:00 can be cleaned up. This mechanism controls memory usage while ensuring calculation correctness.

[0111] To ensure data consistency across windows, window dependencies are maintained within window groups. Since sliding windows overlap, some identical data records may be assigned to multiple windows simultaneously. To ensure consistency in aggregation calculations across these records, a reference counting mechanism is employed. When an identical data record is assigned to multiple windows, the number of windows referencing that data is recorded. The data record is only released after all referencing windows have completed their calculations. For example, if an identical data record is assigned to three overlapping windows, the initial reference count is 3. After each window completes its calculation, the reference count is decremented by 1. When the reference count reaches zero, the storage space occupied by that record is released.

[0112] In practical applications, the window duration and sliding step size should be determined based on the time granularity and real-time requirements of the energy consumption data. For scenarios requiring second-level response, the window duration can be set to 60 seconds and the sliding step size to 10 seconds, ensuring that a new fused aggregation value is generated every 10 seconds. For scenarios focusing on hourly trends, the window duration can be set to 3600 seconds and the sliding step size to 300 seconds, reducing the computation frequency while maintaining trend capture capabilities. The threshold for determining the delay window is typically set to 1 to 2 times the window duration, which can tolerate reasonable network latency while triggering the delay window calculation in a timely manner, avoiding overall process blockage.

[0113] Periodic features are extracted from the fused aggregated value sequence to calculate the predicted energy consumption value. The residual between the fused aggregated value and the predicted energy consumption value is calculated. An anomaly detection threshold is dynamically generated based on the statistical distribution of the residual. The fused aggregated value is compared with the anomaly detection threshold to generate an anomaly identifier, including:

[0114] Periodic features are extracted by periodic decomposition of the fused aggregated value sequence. Based on the periodic features, a predicted energy consumption value sequence is generated by fitting. The difference between the fused aggregated value sequence and the predicted energy consumption value sequence is calculated to construct a residual sequence.

[0115] The residual sequence is subjected to time-series differencing to construct a residual rate of change sequence. The statistical distribution characteristics of the residual rate of change sequence are calculated to construct a residual fluctuation model. Based on the residual fluctuation model, the time interval in the residual sequence where the residual rate of change exceeds the fluctuation threshold is identified as the fluctuation interval.

[0116] The residual sequences are grouped according to the mapping relationship. The statistical distribution difference of the residuals in the fluctuation range and the non-fluctuation range within each mapping relationship group is calculated. The dynamic weights are calculated for each mapping relationship group based on the statistical distribution difference.

[0117] The residuals in the residual sequence are weighted and adjusted according to the dynamic weights to construct the adjusted residual sequence. The adjusted residual sequence is accumulated and summed to construct the cumulative residual sequence. The statistical distribution characteristics of the cumulative residual sequence are calculated. An anomaly judgment threshold is dynamically generated based on the statistical distribution of the cumulative residual sequence.

[0118] Extract the cumulative residual sequence value corresponding to the fusion aggregation value, compare the cumulative residual sequence value with the anomaly detection threshold, and generate an anomaly label for the fusion aggregation value when the cumulative residual sequence value exceeds the anomaly detection threshold.

[0119] For anomaly detection in fused aggregated value sequences, a complete processing chain from periodic feature extraction to anomaly identifier generation needs to be established. After obtaining the fused aggregated value sequence generated by the aforementioned window calculation, a periodic decomposition operation is first performed. Periodic decomposition uses Fourier transform to extract frequency domain features for a fused aggregated value sequence of length L. Perform a discrete Fourier transform to obtain the spectral coefficients. Where k is the frequency index and j is the imaginary unit. The dominant period is identified through spectral energy analysis, and the energy percentage of each frequency component is calculated. The periods corresponding to frequency components with an energy percentage exceeding 5% are selected as the dominant period set. Based on the identified dominant period set, a periodic feature vector is constructed, containing the amplitude, phase, and frequency information of each dominant period.

[0120] The extracted periodic features are used to fit the predicted energy consumption values. A multi-period superposition model is employed to predict the energy consumption value sequence. It is composed of the superposition of the dominant periodic components, and is represented as ,in The baseline energy consumption average, As the dominant periodic set, They are respectively the period The corresponding amplitude, period length, and phase shift are determined. The parameters of each period component are fitted using the least squares method to minimize the sum of squared prediction errors. After completing the parameter fitting, the difference between the fused aggregated value and the predicted energy consumption value at each time point is calculated to construct a residual sequence. ,in The residual sequence reflects the degree to which actual energy consumption deviates from the predicted model.

[0121] Temporal differencing is performed on the residual sequence to capture the dynamic changes in the residuals. The differences between the residuals at adjacent time points are calculated to construct a residual rate of change sequence. ,in The residual rate of change reflects the rate of change of energy consumption deviation. Statistical analysis is performed on the residual rate of change series, and its mean is calculated. with standard deviation A residual fluctuation model is constructed based on statistical characteristics. A sliding window is used to calculate the standard deviation of local rates of change, with the window length set to 10 time steps. For the residual rate of change subsequence within window w, the local standard deviation is calculated. ,in This is the mean within the window. The fluctuation threshold is set to 1.5 times the global standard deviation, i.e. The time intervals corresponding to windows where the local standard deviation exceeds the fluctuation threshold are marked as fluctuation intervals, and the intervals where the local standard deviation is below the fluctuation threshold are marked as non-fluctuation intervals. Fluctuation intervals indicate the periods during which abnormal changes in energy consumption may occur.

[0122] Based on the established cross-data source mapping relationships, the residual sequences are grouped according to these mapping relationships. Each mapping relationship corresponds to a combination of data sources; for example, the mapping relationship between sensor group A and meter group B corresponds to one group. For each mapping relationship group g, its corresponding residual subsequence is extracted. Calculate the residual statistical characteristics of this group in the fluctuation range and the non-fluctuation range respectively. Within the fluctuation range, calculate the mean of the residuals. with standard deviation ; Calculate the mean residual within the non-fluctuation range. with standard deviation To quantify the statistical distribution differences between the two intervals, a weighted combination of the standard deviation ratio and mean shift is used to calculate the degree of distribution variability. ,in and As the weighting coefficient, it is usually set to... , The distribution dissimilarity reflects the degree of behavioral deviation of the mapping relationship group during abnormal periods. The distribution dissimilarity of each group is normalized, and dynamic weights are calculated. ,in This is the set of all mapping relationship groups. The dynamic weight allocation mechanism gives higher weights to mapping relationship groups that behave abnormally during abnormal periods.

[0123] The calculated dynamic weights are used to perform a weighted adjustment on the residual sequence. For each time point... residual Grouped according to their respective mapping relationships Weighted and adjusted residuals After completing the weighted adjustment for all time points, construct the adjusted residual series. Weighted adjustment enhances the residual signal corresponding to anomaly-sensitive mapping relationships. A cumulative summation operation is performed on the adjusted residual sequence to construct the cumulative residual sequence. ,in The cumulative residual sequence amplifies the impact of persistent bias. A single small bias will not trigger anomalies, but the continuous accumulation of bias will lead to a significant increase in the cumulative value.

[0124] Anomaly detection thresholds are dynamically generated based on the statistical distribution characteristics of the cumulative residual sequence. The mean of the cumulative residual sequence is calculated. with standard deviation Considering the non-stationary nature of energy consumption data, a sliding window is used to update statistical features, with a window length set to 50 time steps. For the current time point... Use window Local mean of cumulative residuals within With local standard deviation Based on the normal distribution assumption, we set out... ,in The sensitivity coefficient is typically set to 3, corresponding to a 99.7% confidence interval. This threshold is dynamically adjusted based on the statistical characteristics of the accumulated residuals to adapt to the slow changes in energy consumption patterns.

[0125] When performing anomaly detection, the cumulative residual sequence value at the corresponding time point for each fusion aggregation value is extracted. For each time point... Fusion aggregation value Obtain the corresponding cumulative residual. The cumulative residual value is compared with the dynamic threshold, and the judgment condition is as follows: When the absolute value of the accumulated residual exceeds the anomaly detection threshold, the fused aggregated value at that time point is considered anomaly, and an anomaly identifier is generated and associated with that fused aggregated value. The anomaly identifier includes a timestamp, the accumulated residual value, threshold information, and trigger type (positive or negative over-limit). A positive over-limit indicates that energy consumption is consistently higher than expected, while a negative over-limit indicates that energy consumption is consistently lower than expected. By combining accumulated residuals with dynamic thresholds, both sudden, large-scale anomalies can be identified, as well as gradual, accumulated anomalies, improving the comprehensiveness and accuracy of anomaly detection. The generated anomaly identifier serves as a trigger signal for subsequent anomaly source localization, guiding the precise tracing of anomaly data sources.

[0126] The residual sequences are grouped according to mapping relationships. The statistical distribution differences of the residuals within each mapping relationship group in the fluctuation range and the non-fluctuation range are calculated. Based on the statistical distribution differences, dynamic weights are calculated for each mapping relationship group, including:

[0127] The residual sequences are grouped according to the mapping relationship to construct the mapping relationship grouped residual sequence. The residuals in the fluctuation range of each mapping relationship grouped residual sequence are extracted to construct the fluctuation residual subsequence. The residuals in the non-fluctuation range of each mapping relationship grouped residual sequence are extracted to construct the non-fluctuation residual subsequence.

[0128] Align the fluctuation residual subsequences of each mapping relationship group by timestamp, calculate the covariance matrix of the fluctuation residual values ​​of different mapping relationship groups at each timestamp, and perform eigenvalue decomposition on the covariance matrix to extract the principal component contribution rate corresponding to each mapping relationship group.

[0129] The ratio between the variance of the fluctuating residual subsequence and the variance of the non-fluctuating residual subsequence is calculated as the statistical distribution difference. The statistical distribution difference is multiplied by the principal component contribution rate of the corresponding mapping relationship group, and the product result is normalized to generate the dynamic weights of each mapping relationship group.

[0130] The residual sequences are grouped according to mapping relationships to identify behavioral differences between different data source combinations under fluctuating and steady-state conditions. Upon receiving the fused aggregated value sequence and the predicted energy consumption value, the residual sequence is obtained by calculating the residuals of the two point by point. Each data point in this residual sequence retains a mapping relationship identifier from a unified data record. This mapping relationship identifier corresponds to a previously established cross-data source mapping relationship; for example, one energy consumption data point might come from a combination of sensor A and controller B, while another data point might come from a combination of sensor C and controller D. Based on these mapping relationship identifiers, the residual sequences are automatically grouped so that each mapping relationship group corresponds to a specific data source combination path. The integrity of the timestamps is maintained during the grouping process to ensure that the residual sequence of each mapping relationship group can reflect the prediction bias pattern of that combination path over time.

[0131] After constructing the residual sequence of the mapping relationship groups, it is necessary to distinguish the residual performance of the fluctuating intervals and the non-fluctuating intervals. The fluctuating interval is defined based on the local variation characteristics of the fused aggregated value sequence. The local standard deviation is calculated using a sliding window. When the standard deviation within a certain time period exceeds a preset fluctuation threshold, that time period is marked as a fluctuating interval; otherwise, it is marked as a non-fluctuating interval. For each mapping relationship group residual sequence, based on the interval label corresponding to the timestamp, all residual values ​​located within the fluctuating interval are extracted and arranged in chronological order to construct the fluctuating residual subsequence for that mapping relationship group. Simultaneously, all residual values ​​located within the non-fluctuating interval are extracted to construct the non-fluctuating residual subsequence. This separation process allows for independent observation of the prediction error characteristics of each mapping relationship group during periods of drastic system change and stable operation.

[0132] After obtaining the fluctuation residual subsequences for each mapping relationship group, timestamp alignment is performed. Since the fluctuation intervals of different mapping relationship groups may differ in their temporal distribution, it is necessary to find the set of fluctuation timestamps commonly covered by all mapping relationship groups. Specifically, the fluctuation residual subsequences of all mapping relationship groups are traversed, all occurrences of timestamps are extracted, and then timestamps appearing in at least two mapping relationship groups are selected as the common timestamp set. If a mapping relationship group lacks fluctuation residual data at a certain common timestamp, linear interpolation or nearest neighbor values ​​are used to fill the gap, ensuring that each mapping relationship group has a corresponding residual value at every moment in the common timestamp set. After alignment, the fluctuation residual values ​​of different mapping relationship groups at each timestamp are combined into a vector to form a time series matrix.

[0133] Based on time-aligned fluctuation residual data, the covariance matrix of different mapping relationship groups at each timestamp is calculated. Assuming there are M mapping relationship groups, a residual vector is constructed at the k-th common timestamp. ,in Indicates the first The fluctuation residuals of each mapping group at time k are calculated. The covariance matrix C over all common timestamps is calculated, and its elements are... Defined as Where K is the total number of public timestamps, For the first The mean of the fluctuation residuals of each mapping relationship group on a common timestamp set. This covariance matrix captures the strength of the linkage between different mapping relationship groups under fluctuation conditions.

[0134] Perform eigenvalue decomposition on the covariance matrix to find the eigenvalues ​​and their corresponding eigenvectors. Sort the eigenvalues ​​in descending order, denoted as . Calculate the first... The principal component contribution rate corresponding to each mapping relationship group is defined as the ratio of the sum of squared weights of that mapping relationship group in the principal eigenvector to the sum of all eigenvalues. Specifically, let the eigenvector corresponding to the first principal component be... Then the first The principal component contribution rate of each mapping relationship group is This contribution rate reflects the degree to which this mapping group dominates the contribution of the overall system variance during fluctuations.

[0135] Parallel computation of statistical distribution difference indices. For each mapping relationship group, the variance of its fluctuation residual subsequence is calculated separately. variance of non-fluctuating residual subsequence The variance of the fluctuation residual subsequence is calculated as follows: ,in The number of data points in the grouped fluctuation residual subsequences for this mapping relationship. For the first Each fluctuating residual value This is the mean of the subsequence. Similarly, calculate the variance of the non-fluctuating residual subsequence. The statistical distribution difference is defined as the ratio of the two. This ratio quantifies the difference in the dispersion of prediction errors of the mapping relationship group under fluctuating and steady conditions. The larger the ratio, the more significantly the uncertainty of the combination is enhanced during fluctuations.

[0136] By combining statistical distribution differences with principal component contribution rates, the original weight scores for each mapping relationship group are calculated. For the The mapping relationships are grouped, and their original weight scores are: This product simultaneously considers the variance variation of the mapping relationship group under fluctuating conditions and its importance in the overall covariance structure. If a mapping relationship group significantly increases the prediction error during fluctuations and also occupies a high weight in the principal components of the covariance matrix, its original weight score is high, indicating that the combined path is highly sensitive to and representative of anomalous events.

[0137] The original weight scores of all mapping relationship groups are normalized to generate the final dynamic weights. The normalization formula is as follows: This ensures that the sum of the dynamic weights for all mapping groupings is 1. The normalized dynamic weights... It can be directly used for subsequent weighted calculations of anomaly contributions, enabling the adaptive adjustment of the influence of each combined path based on the performance of grouping in the volatility and covariance structure according to the mapping relationship when comprehensively evaluating the anomaly impact of various data sources. This dynamic weighting mechanism avoids the limitation of fixed weights failing to adapt to changes in system state, improving the accuracy of anomaly source identification and real-time response capabilities.

[0138] like Figure 2 The diagram shows the flowchart of the abnormal source extraction and determination operation in this embodiment.

[0139] Extract unified data records from the windows corresponding to the anomaly identifiers. Calculate the anomaly contribution of each data source based on the mapping relationship and data source identifiers. Identify the data source with the largest contribution as the anomaly source, including:

[0140] Extract the time window identifier corresponding to the fused aggregated value carrying the anomaly identifier, extract the unified data record within the time window from the unified data record according to the time window identifier, and construct the data source group record set by grouping according to the data source identifier;

[0141] Extract the mapping relationships corresponding to the fused aggregated values ​​carrying anomaly identifiers to construct an anomaly mapping relationship set; extract the mapping relationships of unified data records in the data source group record set; calculate the intersection of the mapping relationships and the anomaly mapping relationship set to construct an overlapping mapping relationship set.

[0142] Traverse the mapping relationships in the overlapping mapping relationship set, extract the timestamps of the unified data records carrying the current mapping relationship in the data source group record set to construct a timestamp sequence, calculate the number of consecutive timestamps in the timestamp sequence, and mark the current mapping relationship as a continuous abnormal mapping relationship when the number of consecutive timestamps exceeds the preset number threshold;

[0143] The number of persistently abnormal mapping relationships corresponding to the data source group record set is counted. The proportion of the number of persistently abnormal mapping relationships to the total number of mapping relationships in the data source group record set is calculated as the abnormal contribution of the data source. The data source with the largest abnormal contribution is extracted as the abnormal source.

[0144] When an aggregated value carrying an anomaly flag is detected, it is necessary to locate the specific data source causing the anomaly. The anomaly flag carries a time window identifier, which uniquely corresponds to a sliding time window. Based on the time window identifier, all unified data records participating in the aggregation operation within that window are retrieved from the storage layer. These records constitute a complete window sample set. The unified data records contain a data source identifier field. Grouping operations are performed according to the data source identifier, aggregating all unified data records from the same data source into the same set, forming a data source grouped record set with the data source identifier as the key and the unified data record list as the value. For example, if there are 180 unified data records within a certain time window, of which 75 are from smart meter data sources, 63 are from sensor network data sources, and 42 are from energy management system data sources, after grouping, three subsets are formed.

[0145] The fused aggregated value carrying anomaly identifiers relies on specific mapping relationships during its generation. The mapping relationship records corresponding to this fused aggregated value are extracted; these mapping relationships describe which data types of fields participated in the fusion calculation. For example, a fused aggregated value might be generated by the combined effects of a "device power-sensor temperature" mapping relationship and a "current value-operating status" mapping relationship. These mapping relationships are collected to form an abnormal mapping relationship set. Each unified data record in the data source group record set is traversed, and its mapping relationship identifier is extracted. The existence of this mapping relationship in the abnormal mapping relationship set is then calculated. When a unified data record's mapping relationship exists simultaneously in the abnormal mapping relationship set, this mapping relationship is added to the overlapping mapping relationship set. The overlapping mapping relationship set essentially represents which data fusion paths simultaneously participated in anomaly generation and are supported by actual data in the current window.

[0146] For each mapping relationship in the overlapping mapping relationship set, it is necessary to determine whether it exhibits persistent abnormal characteristics. The mapping relationship elements in the set are traversed. For the currently traversed mapping relationship, all unified data records carrying that mapping relationship are filtered from the data source group record set. The timestamp field of these records reflects the time sequence information of the data generation. All timestamps are extracted and arranged in ascending order to form a timestamp sequence. The continuity in the timestamp sequence is checked, and the number of consecutive timestamps in the sequence is calculated. The continuity criterion is that the time interval between adjacent timestamps does not exceed 1.5 times the data acquisition period. For example, if the data acquisition period is 10 seconds, when the interval between two adjacent timestamps is 8 seconds, 11 seconds, and 9 seconds, these three timestamps are considered consecutive. If the number of consecutive timestamps calculated from the beginning of the sequence reaches 15 (assuming a preset threshold of 15), then the mapping relationship is determined to have continuously participated in the formation of the abnormal pattern in the time dimension, and the mapping relationship is marked as a persistent abnormal mapping relationship. Occasionally occurring mapping relationships may also participate in anomaly calculations, but their number of consecutive timestamps is small, and they will not be marked as persistent anomalies.

[0147] After determining the persistence of all mapping relationships, statistics are performed for each subset of data sources within the data source group record set. The number of mapping relationships marked as persistently abnormal in the unified data records corresponding to that data source is calculated. Simultaneously, the total number of different mapping relationships contained in the data source group record set is counted; this total number reflects the richness of the data fusion paths that the data source participates in within the current window. The ratio of the number of persistently abnormal mapping relationships to the total number of mapping relationships is calculated; this ratio is used as the data source's abnormal contribution. For example, if a smart meter data source involves 8 different mapping relationships in this window, and 5 of them are marked as persistently abnormal mapping relationships, then its abnormal contribution is... The sensor network data source involves 12 mapping relationships, of which 3 are persistent anomalies, with anomaly contribution rates of [missing information]. The energy management system's data source involves six mapping relationships, four of which are persistently anomalies, with an anomaly contribution rate of [percentage missing]. Here This indicates the abnormal contribution level of the data source.

[0148] The system iterates through all data sources to calculate the abnormal contribution value and extracts the identifier of the data source with the highest abnormal contribution. In the example above, the abnormal contribution value of the energy management system data source is 0.667, which is higher than other data sources, so its identifier is extracted as the abnormal source. This abnormal source identifier is then used to trigger an alarm mechanism, notifying operations and maintenance personnel to focus on checking whether there are any faults or configuration errors in the data acquisition equipment, transmission links, and data format of this data source.

[0149] In a real-world application scenario, an industrial park deployed multiple energy consumption monitoring devices, including smart meters in various workshops, environmental sensors, and a central energy management platform. During a time window from 2:30 PM to 3:00 PM on a certain day, an anomaly was detected in the aggregated value, which was 27% higher than the predicted value. The system automatically extracted 1260 unified data records within this window. After grouping by data source, it was found that the meter data source contributed 540 records, the sensor data source contributed 450 records, and the management platform data source contributed 270 records. The abnormal mapping relationship set included seven types of mapping relationships, such as "active power-equipment status," "current-temperature," and "voltage-humidity." After calculating the overlapping mapping relationship set, it was found that the records from the meter data source involved five types of overlapping mapping relationships. Among them, the number of consecutive timestamps for the "active power-equipment status" and "current-temperature" mapping relationships were 28 and 32 respectively, both exceeding the preset threshold of 20, and were marked as continuous abnormal mapping relationships. The sensor data source involves four overlapping mapping relationships, with only the "temperature-humidity" mapping relationship meeting the criteria for continuous anomaly. The management platform data source involves three overlapping mapping relationships, all of which are continuously anomaly. The final calculated contribution of the meter data source anomaly is... The sensor data source is The data source for the management platform is The system identified the data source of the management platform as an anomaly. After inspection, maintenance personnel discovered that the platform had undergone a configuration update at 2:25 PM, causing the unit of some data fields to change from kilowatt-hours to watt-hours without updating the mapping relationship, resulting in abnormal numerical values. By rolling back the configuration and correcting the mapping relationship, the fused aggregation values ​​for subsequent time windows returned to normal.

[0150] This anomaly source localization method not only identifies the problematic data source, but also indicates the specific data fusion path problem through the marking of continuous anomaly mapping relationships, providing precise directional guidance for fault diagnosis and significantly reducing the operational complexity in multi-source heterogeneous data environments.

[0151] A second aspect of this invention provides a real-time energy consumption intelligent analysis system that integrates multi-source heterogeneous data, comprising:

[0152] The data receiving unit is used to receive raw data streams from multiple heterogeneous data sources. The raw data streams carry timestamps, data source identifiers, and data type identifiers.

[0153] The data fusion unit is used to parse the original data stream according to the data type identifier and extract related fields, establish a cross-data source mapping relationship based on the related fields, and fuse data of different data types to generate a unified data record according to the mapping relationship;

[0154] The load balancing unit is used to monitor the backlog of multiple processing channels and calculate the load weight, and distribute the unified data records to the target processing channel according to the load weight.

[0155] The window calculation unit is used to classify data into a sliding time window in the target processing channel according to the timestamp and mapping relationship in the unified data record, trigger window calculation based on the water level mechanism, and perform aggregation operation on the unified data record in the window to generate a fused aggregated value sequence.

[0156] An anomaly detection unit is used to extract periodic features from the fused aggregated value sequence to calculate the predicted energy consumption value, calculate the residual between the fused aggregated value and the predicted energy consumption value, dynamically generate an anomaly judgment threshold based on the statistical distribution of the residual, and compare the fused aggregated value with the anomaly judgment threshold to generate an anomaly identifier.

[0157] The anomaly tracing unit is used to extract unified data records from the window corresponding to the anomaly identifier, calculate the anomaly contribution of each data source according to the mapping relationship and data source identifier, and identify the data source with the largest contribution as the anomaly source.

[0158] A third aspect of the present invention provides an electronic device, comprising:

[0159] processor;

[0160] Memory used to store processor-executable instructions;

[0161] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0162] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0163] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.

[0164] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A real-time intelligent energy consumption analysis method integrating multi-source heterogeneous data, characterized in that, include: Receive raw data streams from multiple heterogeneous data sources. The raw data streams carry timestamps, data source identifiers, and data type identifiers. The original data stream is parsed and related fields are extracted based on the data type identifier. A cross-data source mapping relationship is established based on the related fields. Data of different data types are merged to generate a unified data record based on the mapping relationship. Monitor the backlog of multiple processing channels and calculate the load weight, and allocate unified data records to the target processing channel according to the load weight; In the target processing channel, data is categorized into a sliding time window based on the timestamp and mapping relationship in the unified data record. Window calculation is triggered based on the water level mechanism, and aggregation operation is performed on the unified data record within the window to generate a fused aggregated value sequence. Periodic features are extracted from the fused aggregated value sequence to calculate the predicted energy consumption value. The residual between the fused aggregated value and the predicted energy consumption value is calculated. An anomaly judgment threshold is dynamically generated based on the statistical distribution of the residual. The fused aggregated value is compared with the anomaly judgment threshold to generate an anomaly identifier. Extract unified data records from the window corresponding to the anomaly identifier, calculate the anomaly contribution of each data source based on the mapping relationship and data source identifier, and identify the data source with the largest contribution as the anomaly source.

2. The method according to claim 1, characterized in that, The raw data stream is parsed based on data type identifiers, and related fields are extracted. A cross-data source mapping relationship is established based on these related fields. Data of different data types is then merged according to the mapping relationship to generate a unified data record, including: The raw data stream is parsed into structured data records based on the data type identifier, and the device identifier field, location identifier field, and time identifier field are extracted from the structured data records as association fields; The sampling intervals of the time identifier fields of each data source are statistically analyzed. The greatest common divisor of the sampling intervals is selected as the benchmark time granularity. For data sources with sampling intervals greater than the benchmark time granularity, the time identifier fields are segmented according to the benchmark time granularity, and aggregation operations are performed on the values ​​within the segments to generate aligned data. The aligned data is grouped by the device identifier field and the location identifier field. Within each group, a mapping relationship is established based on the time identifier field corresponding to the base time granularity. The mapping relationship records the association between the device identifier field, the location identifier field, the time identifier field, and the data source identifier. Based on the mapping relationship, query the aligned data corresponding to different data source identifiers with the same device identifier field, location identifier field, and time identifier field, and then horizontally concatenate the queried aligned data to generate a unified data record.

3. The method according to claim 1, characterized in that, Monitoring the backlog across multiple processing channels and calculating load weights, then allocating unified data records to target processing channels based on these load weights includes: Extract mapping relationships from unified data records, count the number of unified data records arriving for each mapping relationship within a preset time window, calculate the arrival rate of each mapping relationship based on the number of unified data records arriving, and assign association weights to each mapping relationship based on the arrival rate. Record the set of mapping relationships allocated to each processing channel and the cumulative number of unified data records corresponding to each mapping relationship. Calculate the distribution of the number of mapping relationship sets in each processing channel and calculate the distribution entropy of the mapping relationship distribution in each processing channel based on the distribution of the number of mapping relationship sets. The amount of data to be processed in each processing channel is monitored as the backlog, and the ratio of the backlog of each processing channel to the total backlog of the processing channels is calculated as the load weight. Extract mapping relationships from the unified data records to be assigned, query the associated weights corresponding to the mapping relationships, traverse each processing channel and obtain the mapping relationship distribution entropy value and load weight, and then perform a weighted summation of the associated weights, mapping relationship distribution entropy value and load weight to generate the comprehensive weight of each processing channel. The processing channel with the lowest overall weight is selected as the target processing channel, and the unified data records are allocated to the target processing channel.

4. The method according to claim 1, characterized in that, In the target processing channel, data is categorized into sliding time windows based on timestamps and mapping relationships in unified data records. Window calculations are triggered using a watermark mechanism, and aggregation operations are performed on the unified data records within the window to generate a fused aggregated value sequence, including: Receive unified data records in the target processing channel and extract timestamps and mapping relationships from the unified data records; Establish window groups based on the mapping relationship. Within each window group, classify the unified data records into the corresponding sliding time window based on the timestamp. Record the maximum timestamp of the unified data records received by each sliding time window as the window water level. Traverse each window group, calculate the difference between the window water level of each sliding time window in the window group and the maximum window water level in the window group, and mark the sliding time window whose window water level difference exceeds the preset window duration as a delay window; Based on the water level mechanism, each sliding time window is traversed. When the water level of the sliding time window exceeds the end time of the sliding time window, a window trigger signal is generated to trigger window calculation. When the water level of the delayed window does not exceed the end time, but the maximum water level of the window in the window group has exceeded the end time of the delayed window, a window trigger signal is generated to trigger window calculation. Receive window trigger signal, extract unified data records within the sliding time window corresponding to the window trigger signal, group and aggregate the unified data records according to the mapping relationship, and perform summation operation on the numerical fields of the unified data records in each group to generate a fused aggregated value sequence.

5. The method according to claim 1, characterized in that, Periodic features are extracted from the fused aggregated value sequence to calculate the predicted energy consumption value. The residual between the fused aggregated value and the predicted energy consumption value is calculated. An anomaly detection threshold is dynamically generated based on the statistical distribution of the residual. The fused aggregated value is compared with the anomaly detection threshold to generate an anomaly identifier, including: Periodic features are extracted by periodic decomposition of the fused aggregated value sequence. Based on the periodic features, a predicted energy consumption value sequence is generated by fitting. The difference between the fused aggregated value sequence and the predicted energy consumption value sequence is calculated to construct a residual sequence. The residual sequence is subjected to time-series differencing to construct a residual rate of change sequence. The statistical distribution characteristics of the residual rate of change sequence are calculated to construct a residual fluctuation model. Based on the residual fluctuation model, the time interval in the residual sequence where the residual rate of change exceeds the fluctuation threshold is identified as the fluctuation interval. The residual sequences are grouped according to the mapping relationship. The statistical distribution difference of the residuals in the fluctuation range and the non-fluctuation range within each mapping relationship group is calculated. The dynamic weights are calculated for each mapping relationship group based on the statistical distribution difference. The residuals in the residual sequence are weighted and adjusted according to the dynamic weights to construct the adjusted residual sequence. The adjusted residual sequence is accumulated and summed to construct the cumulative residual sequence. The statistical distribution characteristics of the cumulative residual sequence are calculated. An anomaly judgment threshold is dynamically generated based on the statistical distribution of the cumulative residual sequence. Extract the cumulative residual sequence value corresponding to the fusion aggregation value, compare the cumulative residual sequence value with the anomaly detection threshold, and generate an anomaly label for the fusion aggregation value when the cumulative residual sequence value exceeds the anomaly detection threshold.

6. The method according to claim 1, characterized in that, The residual sequences are grouped according to mapping relationships. The statistical distribution differences of the residuals within each mapping relationship group in the fluctuation range and the non-fluctuation range are calculated. Based on the statistical distribution differences, dynamic weights are calculated for each mapping relationship group, including: The residual sequences are grouped according to the mapping relationship to construct the mapping relationship grouped residual sequence. The residuals in the fluctuation range of each mapping relationship grouped residual sequence are extracted to construct the fluctuation residual subsequence. The residuals in the non-fluctuation range of each mapping relationship grouped residual sequence are extracted to construct the non-fluctuation residual subsequence. Align the fluctuation residual subsequences of each mapping relationship group by timestamp, calculate the covariance matrix of the fluctuation residual values ​​of different mapping relationship groups at each timestamp, and perform eigenvalue decomposition on the covariance matrix to extract the principal component contribution rate corresponding to each mapping relationship group. The ratio between the variance of the fluctuating residual subsequence and the variance of the non-fluctuating residual subsequence is calculated as the statistical distribution difference. The statistical distribution difference is multiplied by the principal component contribution rate of the corresponding mapping relationship group, and the product result is normalized to generate the dynamic weights of each mapping relationship group.

7. The method according to claim 1, characterized in that, Extract unified data records from the windows corresponding to the anomaly identifiers. Calculate the anomaly contribution of each data source based on the mapping relationship and data source identifiers. Identify the data source with the largest contribution as the anomaly source, including: Extract the time window identifier corresponding to the fused aggregated value carrying the anomaly identifier, extract the unified data record within the time window from the unified data record according to the time window identifier, and construct the data source group record set by grouping according to the data source identifier; Extract the mapping relationships corresponding to the fused aggregated values ​​carrying anomaly identifiers to construct an anomaly mapping relationship set; extract the mapping relationships of unified data records in the data source group record set; calculate the intersection of the mapping relationships and the anomaly mapping relationship set to construct an overlapping mapping relationship set. Traverse the mapping relationships in the overlapping mapping relationship set, extract the timestamps of the unified data records carrying the current mapping relationship in the data source group record set to construct a timestamp sequence, calculate the number of consecutive timestamps in the timestamp sequence, and mark the current mapping relationship as a continuous abnormal mapping relationship when the number of consecutive timestamps exceeds the preset number threshold; The number of persistently abnormal mapping relationships corresponding to the data source group record set is counted. The proportion of the number of persistently abnormal mapping relationships to the total number of mapping relationships in the data source group record set is calculated as the abnormal contribution of the data source. The data source with the largest abnormal contribution is extracted as the abnormal source.

8. A real-time energy consumption intelligent analysis system integrating multi-source heterogeneous data, used to implement the method as described in any one of claims 1-7, characterized in that, include: The data receiving unit is used to receive raw data streams from multiple heterogeneous data sources. The raw data streams carry timestamps, data source identifiers, and data type identifiers. The data fusion unit is used to parse the original data stream according to the data type identifier and extract related fields, establish a cross-data source mapping relationship based on the related fields, and fuse data of different data types to generate a unified data record according to the mapping relationship; The load balancing unit is used to monitor the backlog of multiple processing channels and calculate the load weight, and distribute the unified data records to the target processing channel according to the load weight. The window calculation unit is used to classify data into a sliding time window in the target processing channel according to the timestamp and mapping relationship in the unified data record, trigger window calculation based on the water level mechanism, and perform aggregation operation on the unified data record in the window to generate a fused aggregated value sequence. An anomaly detection unit is used to extract periodic features from the fused aggregated value sequence to calculate the predicted energy consumption value, calculate the residual between the fused aggregated value and the predicted energy consumption value, dynamically generate an anomaly judgment threshold based on the statistical distribution of the residual, and compare the fused aggregated value with the anomaly judgment threshold to generate an anomaly identifier. The anomaly tracing unit is used to extract unified data records from the window corresponding to the anomaly identifier, calculate the anomaly contribution of each data source according to the mapping relationship and data source identifier, and identify the data source with the largest contribution as the anomaly source.

9. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 7.