Energy consumption settlement method based on multi-source data
By using edge computing and smart contract technologies, the multi-source data acquisition strategy is dynamically optimized, solving the problem of balancing monitoring accuracy and economy in existing technologies, and achieving efficient energy consumption management and transparent settlement.
Patent Information
- Application Number
- CN202511332400.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2026-01-02
AI Technical Summary
Existing technologies struggle to balance monitoring accuracy and system operating economy in complex power consumption scenarios involving multiple tenants, multiple devices, and multiple energy types. Furthermore, they lack the ability to intelligently perceive and adapt to the operating conditions of equipment, leading to wasted data acquisition resources or loss of critical information.
The system acquires multi-source heterogeneous data through an edge computing gateway, performs protocol conversion and data aggregation, performs validity verification, missing value marking and timestamp alignment, uses unsupervised machine learning and time series prediction technology to identify and repair abnormal patterns, combines state machine models to identify operating conditions, dynamically optimizes the acquisition strategy, adjusts the acquisition frequency and resolution through reinforcement learning algorithms, uses fuzzy logic reasoning to decompose energy consumption, and finally uses smart contracts and blockchain technology for automatic settlement.
It enables adaptive adjustment of data acquisition strategies, improves the quality and accuracy of energy consumption data, reduces system operating costs, enhances energy efficiency management, and ensures the transparency and credibility of the settlement process through blockchain technology.
Smart Images

Figure CN121256584A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of energy management, and particularly relates to a multi-source data-based energy consumption settlement method. BACKGROUND
[0002] With the rapid development of Internet of Things technology, smart city and green building, the energy management of large commercial complexes, smart parks and high-energy-consuming enterprises is facing profound changes. Traditional energy consumption settlement methods mainly rely on manual meter reading or single smart meter data, which is difficult to cope with complex electricity consumption scenarios such as multi-tenant, multi-device and multi-energy type. The multi-source data-based energy consumption settlement method emerges as the times require, which integrates intelligent meters, environmental sensors and device operation data to build a precise, transparent and automated energy consumption allocation and settlement system, effectively improving energy utilization efficiency, reducing management costs, and providing a solid data foundation for fine carbon emission accounting.
[0003] Generally, by deploying edge computing gateways, various types of intelligent meters, environmental sensors and device control systems are connected to realize real-time collection and preliminary integration of multi-source heterogeneous data.
[0004] However, the prior art usually adopts a fixed frequency data collection strategy, which lacks intelligent perception and adaptive ability for device operating conditions. The system collects a large amount of redundant data during low load periods, causing waste of communication and computing resources, while during high load or critical state switching periods, important details may be missed due to insufficient collection density, making it difficult to balance monitoring accuracy and system operation economy, and restricting the further improvement of energy efficiency management level. SUMMARY
[0005] In order to make up for the above shortcomings, the present application provides a multi-source data-based energy consumption settlement method, which aims to improve the problem that the prior art usually adopts a fixed frequency data collection strategy, which lacks intelligent perception and adaptive ability for device operating conditions.
[0006] The present application provides the following technical solutions, a multi-source data-based energy consumption settlement method, comprising the following steps:
[0007] S1, acquiring original multi-source heterogeneous data from intelligent meters, environmental sensors and building device management systems through an edge computing gateway, completing protocol conversion and data aggregation;
[0008] S2, performing stream processing on the original multi-source heterogeneous data, performing validity check, missing value marking and timestamp alignment, and generating regularized data after time alignment;
[0009] S3, performing abnormal pattern recognition on the normalized data based on an unsupervised machine learning algorithm, repairing abnormal data in combination with a time series prediction technique, and outputting a clean data set enhanced in data quality;
[0010] S4, calculating statistical features of the load curve based on the clean data set enhanced in data quality, identifying operating conditions using a state machine model, and outputting a load state classification result;
[0011] S5, dynamically optimizing the collection strategy according to the load state classification result through a reinforcement learning algorithm, and automatically adjusting the collection frequency and resolution to form an optimized collection strategy;
[0012] S6, fusing multi-source data features through an ensemble learning algorithm based on the clean data set enhanced in data quality and the load state classification result, and performing accurate energy consumption decomposition using fuzzy logic reasoning to output a multi-dimensional energy consumption allocation result;
[0013] S7, according to the multi-dimensional energy consumption allocation result, writing a hash digest of key data into a distributed ledger, and automatically performing cost calculation with a smart contract to generate a final settlement list containing a complete data traceability chain.
[0014] Preferably, in S1, the protocol conversion and data aggregation specifically include:
[0015] The different communication protocols of various sensing devices are unified and converted through the deployment of an edge computing gateway, and standardized preliminary data packets are output;
[0016] The standardized preliminary data packets are marked with sources and bound with device IDs, and are packaged into raw data streams with metadata;
[0017] The raw data streams with metadata are temporarily stored through the caching mechanism of the edge gateway, and are batched or real-time transmitted to the central data processing platform according to the transmission strategy pre-configured in the gateway to form uploaded raw multi-source heterogeneous data.
[0018] Preferably, in S2, the validity check, missing value marking and timestamp alignment specifically include:
[0019] The uploaded raw multi-source heterogeneous data is quickly scanned by setting data validity rules defined according to data quality specifications to mark invalid points;
[0020] The data marked with invalid points is timestamp calibrated using a time synchronization protocol, and is interpolated to the minimum time granularity to generate time-synchronized sequence data;
[0021] The time-synchronized sequence data is arranged and combined according to the time axis to fill in the missing time points.
[0022] Preferably, in S3, the anomaly pattern recognition specifically includes:
[0023] Calculate the statistical features of the normalized data through a sliding window to generate a time series feature dataset;
[0024] Build a multi-level anomaly detection funnel, the first level applies business rules defined according to business experience to quickly scan the data to generate rule anomaly labels, and the second level uses unsupervised machine learning algorithms for deep pattern analysis to generate model anomaly labels;
[0025] Automatically call an explanatory tool for generating feature contribution for the machine learning model labeled anomaly points to generate an explanatory report, and combine device state, temperature, humidity, and light intensity parameters for secondary verification;
[0026] Finally, fuse the two-level results to form a comprehensive preliminary anomaly labeling result.
[0027] Preferably, in S3, repairing the abnormal data specifically includes:
[0028] For the comprehensive preliminary anomaly labeling result, select a repair strategy based on interpolation or time series prediction according to the anomaly type and business scenario;
[0029] All repair operations are recorded, and the repair method and source are associated with the repair value.
[0030] Preferably, in S4, using a state machine model for operating condition recognition specifically includes:
[0031] Based on the data quality enhanced clean dataset, calculate the dynamic features in a short time window in real time to generate a real-time load feature vector;
[0032] Match the real-time load feature vector with a pre-defined state criterion library to generate a preliminary state classification signal;
[0033] Perform time series logic judgment on the preliminary state classification signal through a state machine model to avoid frequent state jumps and output a stable and reliable load state classification result.
[0034] Preferably, in S5, dynamically optimizing the collection strategy through a reinforcement learning algorithm specifically includes:
[0035] Build a reward function with the dual optimization goals of reducing the total collection overhead of the system and maintaining the key state monitoring accuracy;
[0036] Calculate the reward value in real time according to the load state classification result, and update the collection strategy parameters through a policy gradient algorithm;
[0037] The optimized strategy parameter is sent to an edge collection device to form the optimized collection strategy adaptive to the current working condition.
[0038] Preferably, in the S6, the energy consumption accurate decomposition using fuzzy logic reasoning specifically comprises:
[0039] According to the settlement scenario, the device type and the load state classification result, a preselected allocation algorithm is selected from a model library to generate a target allocation model;
[0040] The clean data set subjected to data quality enhancement is input into the target allocation model together with spatial topology, building area, device power and operation schedule static data to perform fusion calculation and generate a preliminary allocation weight matrix;
[0041] The preliminary allocation weight matrix is subjected to summation calibration and reasonableness verification to ensure that the sum of the sub-items is equal to the total amount, and the final multi-dimensional energy consumption allocation result is output.
[0042] Preferably, in the S7, the automatic execution of the fee calculation with the smart contract specifically comprises:
[0043] According to the multi-dimensional energy consumption allocation result and the tiered time-of-use electricity price policy, a suitable rate is automatically matched to perform fee calculation and generate a unit fee detail;
[0044] Key link information of the whole data processing chain is encapsulated as an audit traceability log;
[0045] The unit fee detail and the audit traceability log are combined to generate the final settlement list with clear structure and traceability, and are automatically pushed to a user through an API interface or a message queue.
[0046] Preferably, in the S7, the writing of the hash digest of the key data into the distributed ledger specifically comprises:
[0047] The audit traceability log and the key feature value of the multi-dimensional energy consumption allocation result are calculated to obtain a hash digest;
[0048] A smart contract deployed in a distributed ledger network is called to broadcast the hash digest to network nodes and store the evidence through a consensus mechanism;
[0049] A unique evidence identification generated by the smart contract is embedded in the final settlement list.
[0050] The present application has the following beneficial effects:
[0051] 1、The present application realizes adaptive adjustment of the data collection strategy through the load state recognition and the reinforcement learning optimization algorithm, effectively reduces the system operation overhead while ensuring the accuracy of the key state monitoring, and improves the overall energy efficiency management level.
[0052] 2、The application accurately identifies data anomalies through a multi-level anomaly detection and repair mechanism combined with a rule engine and machine learning algorithm, and intelligently repairs them through time series prediction technology, significantly improving the quality and accuracy of energy consumption data and laying a solid foundation for accurate settlement.
[0053] 3、The application realizes unified access and standardized processing of multi-source heterogeneous data through an edge computing gateway, improves the problem of scattered data sources and non-uniform protocols in traditional energy consumption settlement, and improves the efficiency and reliability of data collection.
[0054] 4、The application builds a trusted settlement system through blockchain technology, automatically executes fee calculation and distributed ledger storage through smart contracts, ensures the transparency of the settlement process and the non-tamperability of the data, and finally generates a settlement list with a complete traceability chain, improving the credibility and verifiability of the settlement result. BRIEF DESCRIPTION OF DRAWINGS
[0055] Figure 1 A method flowchart of an energy consumption settlement method based on multi-source data is provided for the application;
[0056] Figure 2 A data collection and protocol conversion flowchart is provided for the application;
[0057] Figure 3 A data preprocessing and time alignment diagram is provided for the application;
[0058] Figure 4 An anomaly detection and repair mechanism diagram is provided for the application;
[0059] Figure 5 A reinforcement learning optimization collection strategy framework diagram is provided for the application. DETAILED DESCRIPTION
[0060] The technical solutions in the embodiments of the application will be described clearly and completely below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the application, not all. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the application.
[0061] In the first embodiment of the application, the application provides an energy consumption settlement method based on multi-source data, as shown in Figure 1 and Figure 2 , comprising the following steps:
[0062] S1, acquire raw multi-source heterogeneous data from smart meters, environmental sensors and building equipment management systems through an edge computing gateway, complete protocol conversion and data aggregation;
[0063] Further, in S1, the protocol conversion and data aggregation specifically includes:
[0064] By deploying the edge computing gateway, different communication protocols of various sensing devices are uniformly converted and parsed, and standardized preliminary data packets are outputted;
[0065] The standardized preliminary data packets are marked with sources and bound with device IDs, and are encapsulated into raw data streams with metadata;
[0066] The raw data streams with metadata are temporarily stored by the cache mechanism of the edge gateway, and are transmitted in batches or in real time to the central data processing platform according to the transmission strategy pre-configured in the gateway, forming uploaded raw multi-source heterogeneous data.
[0067] Specifically, first, the edge computing gateway is deployed, and the Modbus protocol commonly used by intelligent meters, the LoRa protocol of environmental sensors, and the BACnet protocol of building equipment management systems are uniformly converted and parsed. The protocol parsing module built-in the gateway first decodes the register data of the Modbus protocol, extracts energy consumption parameters such as voltage, current, and instantaneous power, parses the frame structure of the temperature and humidity, light intensity data transmitted by the LoRa protocol to remove redundant check bits, and converts the object attribute data of the BACnet protocol into a standardized numerical value from an enumeration value, and then outputs standardized preliminary data packets containing data collection time, device type, and core monitoring parameters;
[0068] Then, the standardized preliminary data packets are marked with sources, and are marked as coming from intelligent meters, environmental sensors, or building equipment management systems. The device management module of the gateway calls the pre-stored device account information, binds each data packet with the corresponding device ID, and encapsulates it into raw data streams containing metadata. The metadata field covers data source identification, device ID, protocol type, collection timestamp, and data length.
[0069] Then, the edge gateway temporarily stores the raw data streams in the built-in ring buffer area. The capacity of the buffer area is configured according to the daily data volume of the deployment scenario. When the data volume stored in the buffer area reaches the preset proportion threshold, batch transmission is triggered. If it is monitored that the instantaneous power data of the intelligent meter exceeds the preset normal range, real-time transmission is triggered. During the transmission process, the gateway follows the pre-configured TCP / IP transmission strategy and sends the raw data streams to the receiving server of the central data processing platform.
[0070] Finally, the receiving server performs integrity check by comparing the actual data length with the data length field in the metadata. After the check is passed, the data is stored in the platform raw database, forming uploaded raw multi-source heterogeneous data.
[0071] In this way, the step realizes unified access and standardized processing of different communication protocol data, ensures that the subsequent data processing link can directly call the standard data source, and reduces invalid data transmission, reduces network bandwidth occupation between the gateway and the central platform, and improves the efficiency and reliability of multi-source data aggregation through the combination of caching and on-demand transmission.
[0072] As shown in Figure 1 and Figure 3 , S2, the original multi-source heterogeneous data is processed in a streaming manner, validity check, missing value marking and timestamp alignment are performed, and time-aligned regular data is generated;
[0073] Further, in S2, the validity check, the missing value marking and the timestamp alignment specifically include:
[0074] By setting data validity rules defined according to data quality specifications, the uploaded original multi-source heterogeneous data is quickly scanned, and invalid points are marked;
[0075] Adopting a time synchronization protocol, the data with marked invalid points is timestamp calibrated, and is interpolated to the minimum time granularity, generating time-synchronized sequence data;
[0076] The time-synchronized sequence data is arranged and combined according to the time axis, and the missing time points are filled;
[0077] Specifically, first, the pre-set data quality specifications are formulated in combination with industry energy consumption data collection standards and project actual scenes, including specific rules of three types of equipment: for smart meter data, set the physical range rules, such as limiting voltage to 220V±20% interval, limiting current to 0-100A interval, set the power mutation rate rule, such as the absolute value of the ratio of the power difference of consecutive sampling points to the power value at the previous moment should not exceed 30%, and set the data format rule, such as must contain device ID, collection timestamp, instantaneous power three fields. For environmental sensor data, set the range rules, such as temperature -20℃ to 50℃, humidity 0 to 100%, set the sampling frequency rule, such as the consecutive sampling interval of the same sensor should not exceed 2 times of the pre-set period. For building equipment management system data, set the state logic rule, such as the running state and the stop state cannot be true at the same time, the fault code needs to match the pre-set fault coding table;
[0078] Then, the above rules are converted into executable check logic by a rule engine, for example, the execution logic of the intelligent meter power mutation rate rule is: for a device ID, the power value of the second data P n and the power value of the first data P n+1 , calculate If the result is greater than 30%, it is marked as invalid. After the streaming processing engine receives the original multi-source heterogeneous data stream, it automatically matches the corresponding rule set according to the device type, performs field integrity check, threshold comparison and logical verification on each piece of data, and adds an invalid mark field to the metadata of the data that triggers any rule and notes the specific reason, such as power mutation exceeding the limit or humidity range being abnormal.
[0079] A high-precision clock synchronization technology based on PTP protocol is adopted to calibrate the data marked as invalid points and time stamp deviations, unify the collection time stamps of different devices to the same time coordinate system, determine the minimum time granularity according to the smallest collection interval in all devices, and complete the calibrated data by using linear interpolation method. For the missing power data of a certain intelligent meter in the time period from t1 to t2, the power value at the corresponding time point is calculated by the formula to generate time-synchronized sequence data, where P(t) is the interpolated power value, P(t1) and P(t2) are the valid power data at t1 and t2 time points, respectively.
[0080] The time-synchronized sequence data is arranged and combined according to the unified time axis. For the missing time points on the time axis, the average valid value of the same time period is used to fill in according to the historical data distribution characteristics of the corresponding device, so as to ensure that each time point has complete multi-source data records.
[0081] Finally, the time-aligned and regularized data is generated. The precise identification of invalid data is realized through explicit rule definition and executable logic. The time consistency of multi-source data is guaranteed by high-precision synchronization and interpolation technology. The data integrity is ensured through time axis arrangement and missing filling, which provides high-quality basic data for subsequent anomaly detection and energy consumption analysis.
[0082] As shown in Figure 1 and Figure 4 , S3, based on unsupervised machine learning algorithm, performs anomaly pattern recognition on the regularized data, and combines time series prediction technology to repair the abnormal data, and outputs the cleaned data set with enhanced data quality.
[0083] Further, in S3, the anomaly pattern recognition specifically includes:
[0084] The statistical characteristics of the regularized data are calculated through a sliding window to generate a time series feature data set.
[0085] A multi-level anomaly detection funnel is constructed. The first level applies business rules defined according to business experience to quickly scan the data and generate rule anomaly marks. The second level uses unsupervised machine learning algorithm for deep pattern analysis to generate model anomaly marks.
[0086] The abnormal points marked by the machine learning model automatically call the explanatory tool for generating feature contribution to generate an explanatory report, and the device state, temperature, humidity, and light intensity parameters are verified again.
[0087] Finally, the two-level results are fused to form a comprehensive preliminary abnormal marking result.
[0088] Further, in S3, repairing the abnormal data specifically includes:
[0089] For the comprehensive preliminary abnormal marking result, a repair strategy based on interpolation or time series prediction is selected according to the abnormal type and business scenario.
[0090] All repair operations are recorded, and the repair method and source are associated with the repair value.
[0091] Specifically, first, based on the time-aligned regularized data generated in S2, a fixed-length sliding window is used to split the data, and the window length is determined according to the collection period of the smart meter, environmental sensor, and building equipment management system data. The statistical features of each device monitoring parameter in the regularized data are calculated within the window, such as the window mean, variance, and maximum and minimum values of the smart meter power data, to generate a time series feature dataset containing device ID, window timestamp, and each statistical feature value.
[0092] Then, when constructing a multi-level anomaly detection funnel, the first-level business rules are designed based on typical abnormal patterns in energy consumption monitoring scenarios. For smart meter data, the power mean value of consecutive periods is calculated through a sliding window, and the power window mean value of the same period in the past three working days of the device is retrieved. The arithmetic mean of the historical reference value μ is taken as the historical reference value μ, and μ ± 2σ is taken as the preset reasonable fluctuation range, where σ is the standard deviation of the historical mean value. When the current window mean value exceeds this range, a "power mean value exceeds" rule-based abnormal marking is added to the corresponding record in the time series feature dataset. For environmental sensor data, the historical operating data corresponding to the normal working humidity range labeled by the device at the factory is collected, and the 95th percentile of the humidity window variance in this data set is calculated as the variance threshold. When the current humidity window variance exceeds this threshold, a "humidity fluctuation anomaly" rule-based abnormal marking is added. For building equipment management system data, set the state duration rule, such as if the "running" state duration of the same device is shorter than the minimum stable duration required for device startup, it is marked as "state jump anomaly".
[0093] The second stage uses an isolated forest unsupervised machine learning algorithm, selects time series feature data without abnormal records in the past period as the training set, contains statistical features such as power mean and variance of intelligent meter, temperature and humidity mean and fluctuation amplitude of environmental sensor, state switching frequency of building equipment, etc. During the training process, each decision tree randomly selects part of the features and samples for splitting. For the newly input time series feature data, the average path length of each sample in all decision trees is calculated, which reflects the difficulty of isolating the sample. The shorter the path, the more likely the sample is abnormal. The preset threshold is determined by the average path length of all normal samples in the training set. When the average path length of the new sample is less than the threshold, the model anomaly label "model detects anomaly" is generated.
[0094] Then, for the anomaly points marked by the machine learning model, an explanatory tool is automatically called to generate a feature contribution explanatory report, which clearly shows the contribution weight of each statistical feature in the anomaly determination of the anomaly point. At the same time, the corresponding device state parameters such as running / stop state and fault signal, and the temperature, humidity and light intensity parameters collected by the environmental sensor are retrieved for secondary verification. If the abnormal power data corresponds to a device state of failure, the abnormality determination is strengthened. If the corresponding environmental parameters exceed the normal working environment range of the device, the abnormal reason is supplemented. Finally, the weighted fusion rule anomaly label and model anomaly label form a comprehensive preliminary anomaly label result. The weights of the rule anomaly label and the model anomaly label are dynamically adjusted according to the historical anomaly detection accuracy;
[0095] For the comprehensive preliminary anomaly label result, select the repair strategy according to the anomaly type and business scenario: if the abnormal data is short-term single-point missing and the adjacent data is valid, use linear interpolation method for repair. For the abnormal power data P 异常 of the intelligent meter, calculate the repair value through the valid data P 前 , P 后 before and after it and the corresponding time t 异常 , t 前 , t 后 , the formula is:
[0096]
[0097] If the abnormal data is continuous multi-segment missing or significantly affected by environmental factors, use the ARIMA time series prediction algorithm for repair. The historical power data of the device at the same period is used as input to train the prediction model, and the repair power value of the corresponding time period is output.
[0098] All repair operations are recorded in the data repair log, which contains the device ID, abnormal time period, abnormal type, repair method and repair value source explanation of the abnormal data. The repaired data is consistent with the original regular data field.
[0099] The final output is a clean data set enhanced by data quality, which accurately extracts time series features through a sliding window, a multi-stage funnel that balances the efficiency and depth of anomaly detection, an explanatory tool that improves the accuracy of anomaly determination with multi-parameter verification, and a complete record of operations for different abnormal scenarios to effectively ensure the quality of the clean data set.
[0100] As shown in Figure 1 S4, based on the clean data set enhanced by data quality, the statistical features of the load curve are calculated, the state machine model is used for operating condition recognition, and the load state classification result is output.
[0101] Further, in S4, the state machine model is used for operating condition recognition, which specifically includes:
[0102] Based on the clean data set enhanced by data quality, real-time calculation of dynamic features in short windows is performed to generate real-time load feature vectors.
[0103] The real-time load feature vectors are matched with the pre-defined state criterion library to generate preliminary state classification signals.
[0104] The preliminary state classification signals are subjected to time sequence logic judgment through the state machine model to avoid frequent state jumps and output stable and reliable load state classification results.
[0105] Specifically, based on the clean data set enhanced by data quality generated by S3, the power load curve collected by the intelligent meter and the equipment operation parameters recorded by the building equipment management system are the core processing objects. First, the statistical features of the load curve are calculated, including the maximum and minimum power and average load in a specified period. Then, the short window length is determined based on the equipment load change period, and the dynamic features in each short window are calculated in real time. The power fluctuation coefficient is calculated by the formula , where CV is the power fluctuation coefficient, σ is the standard deviation of the power data in the short window, and μ is the mean of the power data in the short window. At the same time, the power change rate and load ratio, i.e. the ratio of the current window average power to the equipment rated power, are extracted. The equipment ID, short window time identifier and above-mentioned dynamic features are integrated to generate a real-time load feature vector containing multi-dimensional parameters.
[0106] When the pre-defined state criterion library is defined, the load characteristics of different operation scenarios of building equipment are combined, and the criteria are set by equipment type: for air conditioning equipment, the low load state criterion is that the power mean is less than 30% of the rated power and the fluctuation coefficient is less than a pre-set stability threshold, the normal load state criterion is that the power mean is between 30% and 80% of the rated power and the fluctuation coefficient is within the stability threshold, and the high load state criterion is that the power mean is more than 80% of the rated power; for lighting equipment, the low load state criterion is that the power mean is less than 20% of the rated power, such as corresponding part of the lamps being off, the normal load state criterion is that the power mean is between 20% and 90% of the rated power, such as corresponding basic lighting being on, and the high load state criterion is that the power mean is more than 90% of the rated power, such as corresponding all lamps being on. The criterion library parameters are optimized and calibrated by historical clean data sets of normal operation, the real-time load feature vector is compared with each state criterion of the corresponding equipment type in the criterion library one by one, the matching degree of the feature vector and each criterion is calculated, such as the proportion of the power mean falling within the criterion interval and the degree of the fluctuation coefficient meeting the threshold, the state with the highest matching degree is selected as the preliminary state classification signal, and the signal is associated with the equipment ID, the short time window identifier and the preliminary state category.
[0107] When the state machine model is constructed, three types of state nodes, i.e. low load, normal load and high load, and the jump rules between the nodes are defined, the jump rules include feature continuous verification conditions: when the preliminary state classification signal changes from low load to normal load, the load feature vectors of two consecutive short time windows both need to meet the normal load criterion, and the equipment operation mode fed back by the building equipment management system, such as the refrigeration / heat mode of air conditioning and the manual / automatic mode of lighting, is not switched, so as to allow the state jump to be executed; if the single preliminary state signal jumps but the subsequent signal restores the original state, such as the short time window t1 showing high load and t2 restoring normal load, it is determined that it is a transient fluctuation and the original state is maintained. Through this time sequence logic judgment, the frequent state jumps caused by transient interference are filtered, and finally the stable and reliable load state classification result is output, which includes the equipment ID, the state effective time interval, the load state category and the state determination basis such as the matched criterion item and the continuous verification result;
[0108] Through dynamic feature extraction, type-specific pre-defined criterion library and state machine time sequence logic verification, the load law description, classification pertinence and result stability are realized respectively, which provides working condition basis for subsequent dynamic optimization of collection strategy and accurate energy consumption allocation.
[0109] As shown in Figure 1 and Figure 5 , S5, according to the load state classification result, dynamically optimizes the collection strategy through a reinforcement learning algorithm, automatically adjusts the collection frequency and resolution, and forms an optimized collection strategy.
[0110] Further, in S5, dynamically optimizing the collection strategy through the reinforcement learning algorithm specifically includes:
[0111] A reward function is constructed to reduce the total acquisition overhead of the system and maintain the accuracy of key state monitoring;
[0112] The reward value is calculated in real time according to the load state classification result, and the acquisition strategy parameters are updated through the policy gradient algorithm;
[0113] The optimized strategy parameters are sent to the edge acquisition device to form an optimized acquisition strategy that is adaptive to the current working condition;
[0114] Specifically, in the dynamic optimization of the acquisition strategy, the system constructs a deep reinforcement learning framework based on the real-time load state classification result, and realizes the optimal control of the acquisition parameters through a multi-objective reward function and an adaptive strategy updating mechanism. Specifically, first, taking the unique identification code of the device as the index, the current load state category, historical acquisition overhead data and key state monitoring error are taken as the state input, wherein the current load state category includes high load state, transient state, low load state, etc. A dual-objective reward function is designed for the building device energy monitoring scene: R = a · R accuracy - β · R cost , wherein R accuracy represents the monitoring accuracy reward item, which is dynamically adjusted according to the load state: in the high load state, the power monitoring error ΔP and the rated power P rated of the device corresponding to the key monitoring threshold Δ c ritical are taken as the basis for calculation, wherein ΔP is in kilowatts, and an exponential decay function R accuracy = e -k·ΔP is adopted, wherein k is the sensitivity coefficient. In the low load state, a step function based on the basic monitoring accuracy standard is adopted: wherein θ base represents the basic accuracy threshold, and R cost represents the acquisition overhead penalty item, which is positively related to the acquisition frequency f (unit: hertz) and the data resolution r (unit: bit): R cost = w1 · f + w2 · r, wherein w1 and w2 are weight coefficients. The weight coefficients are set differently in different load states, and the high load state adopts and the low load state adopts and satisfies The target balance coefficients a and β are dynamically adjusted through historical operation data analysis: based on the accuracy-overhead sensitivity analysis under different load states in the last N complete operation cycles (taking N = 3), a coefficient adjustment model is established:
[0115]
[0116] wherein S accuracyand S cost These are the sensitivity indicators for accuracy and cost, respectively, with α0 and β0 as baseline coefficients.
[0117] The acquisition strategy parameters are updated using a policy gradient algorithm. The policy network output includes the acquisition frequency parameter set f corresponding to each load state. high ,f trans ,f low and data resolution parameter set r high ,r trans ,r low The gradient update formula is:
[0118]
[0119] in Let θ be the state-value function estimated for the value network, and θ represent the policy network parameters. A smooth parameter update mechanism is introduced, and momentum gradient descent is used to ensure policy stability.
[0120]
[0121] Where η is the learning rate and γ is the momentum coefficient.
[0122] The optimized strategy parameters are sent to the edge acquisition device through the device's unique identifier. The device's built-in status awareness module reads the current load status category in real time and automatically loads the corresponding acquisition parameters to perform data acquisition.
[0123] By combining load status perception with reinforcement learning, the data acquisition strategy is optimized adaptively under different operating conditions, which significantly reduces the data acquisition overhead under low load conditions while ensuring monitoring accuracy under high load conditions.
[0124] like Figure 1 As shown, S6, based on the clean dataset with enhanced data quality and the load status classification results, integrates multi-source data features through an ensemble learning algorithm and uses fuzzy logic reasoning to perform accurate energy consumption decomposition, outputting multi-dimensional energy consumption allocation results;
[0125] Furthermore, in S6, the precise energy consumption decomposition using fuzzy logic reasoning specifically includes:
[0126] Based on the classification results of settlement scenario, equipment type and load status, a pre-selected allocation algorithm is selected from the model library to generate the target allocation model;
[0127] The clean dataset with enhanced data quality is input into the target allocation model along with static data such as spatial topology, building area, equipment power, and operation schedule, and then fused to generate a preliminary allocation weight matrix.
[0128] The preliminary allocation weight matrix is summed and calibrated to ensure the sum of the items is equal to the total amount, and the final multi-dimensional energy allocation result is output.
[0129] Specifically, first, according to the settlement scene characteristics, device type classification and real-time load state, the optimal allocation algorithm is adaptively selected from the pre-constructed algorithm model library. The algorithm multi-dimensionally fuses the quality-enhanced clean energy consumption data with static data such as building space topology information, accurate building area, device rated power parameters, detailed operation schedule, etc., to construct a comprehensive feature vector containing time dimension, space dimension and device dimension.
[0130] An improved fuzzy inference system is used to handle the uncertainty in the allocation process. First, the fuzzy set and membership function of the input variable are defined. For the time factor, the time membership function μ time , the fuzzy set is {low valley period, flat period, peak period}, for the space factor, the space membership function μ space , the fuzzy set is {core area, general area, edge area}, and for the device factor, the device membership function μ device , the fuzzy set is {high energy consumption device, general energy consumption device, low energy consumption device}. Inference calculation is performed through a fuzzy rule base, and each rule is in the form: if the time belongs to the peak period and the space belongs to the core area, then the allocation weight is high.
[0131] The allocation weight calculation adopts a multi-objective optimization method, and the objective function is:
[0132]
[0133] where W i represents the i-th to-be-solved allocation weight, represents the i-th basic weight, represents the i-th actual energy consumption value, represents the i-th predicted energy consumption value, λ represents the balance coefficient, and n represents the total number of devices.
[0134] After generating the preliminary allocation weight matrix, an iterative calibration algorithm is used to ensure that the sum of the items is equal to the total energy consumption, and the calibration formula is:
[0135]
[0136] where W represents the i-th final allocation weight, represents the i-th initial allocation weight, E total represents the total energy consumption, and E j represents the energy consumption of the j-th device.
[0137] Meanwhile, rationality verification is performed, including non-negative weight check, weight range check, and consistency check. The final output multi-dimensional energy consumption allocation result includes time dimension allocation, space dimension allocation, and equipment dimension allocation, each of which provides detailed allocation basis and calculation process record, ensuring transparency and traceability of the allocation result. The combination of fuzzy logic and multi-source data fusion solves the problem of insufficient accuracy of traditional allocation methods in dealing with complex energy consumption scenarios, improving the accuracy and fairness of energy consumption allocation.
[0138] As shown in Figure 1 S7, according to the multi-dimensional energy consumption allocation result, the hash digest of the key data is written into the distributed ledger, and the smart contract is automatically executed for fee calculation to generate a final settlement list containing a complete data traceability chain;
[0139] Further, in S7, the automatic fee calculation with the smart contract specifically includes:
[0140] According to the multi-dimensional energy consumption allocation result and the tiered time-of-use electricity price policy, the applicable rate is automatically matched, the fee is calculated, and a unit fee detail is generated;
[0141] The key link information of the whole data processing chain is encapsulated as an audit traceability log;
[0142] The unit fee detail and the audit traceability log are combined to generate a final settlement list with clear structure and traceability, and are automatically pushed to the user through an API interface or a message queue.
[0143] Further, in S7, writing the hash digest of the key data into the distributed ledger specifically includes:
[0144] The audit traceability log and the key feature value of the multi-dimensional energy consumption allocation result are calculated for a hash digest;
[0145] The smart contract deployed in the distributed ledger network is called to broadcast the hash digest to the network nodes and store the evidence through a consensus mechanism;
[0146] The unique evidence identifier generated by the smart contract is embedded in the final settlement list;
[0147] Specifically, first, according to the multi-dimensional energy consumption allocation result E allocated and the currently applicable tiered time-of-use electricity price policy P tariff , the applicable electricity price standard of each settlement unit is automatically determined through a rate determination algorithm based on rule matching. The algorithm first divides the total energy consumption E total into three time periods, peak, flat, and valley, corresponding to different unit prices P peak , P flat , and P valleyAccording to the energy consumption interval, the final applicable electricity price is determined, and the cost calculation adopts a segmented progressive model:
[0148]
[0149] wherein C total represents the total cost; T represents the total period number (usually three periods of peak, flat, and valley); L represents the number of step electricity price intervals, E t,l represents the energy consumption in the tth period and the lth electricity price interval; P t,l represents the electricity price unit price corresponding to the period and interval. The system encapsulates the key link information of the whole chain of data processing to form a structured audit log L audit , which specifically includes the data collection timestamp T collect , data quality score Q data , abnormality detection result R anomaly , load state classification result S load , allocation calculation parameter P allocate and other fields. Then, the SHA-256 hashing algorithm is used to calculate the digest value of the key data:
[0150] H hash = SHA256 (L audit || E allocated || T stamp ) ;
[0151] wherein || represents data connection operation, and T stamp represents the current timestamp.
[0152] After receiving the hash digest, the smart contract deployed in the distributed ledger network broadcasts the data to all nodes for verification and storage through the PBFT consensus mechanism. The consensus process includes four stages of request, pre-preparation, preparation, and submission, which ensures that all nodes reach an agreement on the transaction. After the storage is successful, a unique transaction identifier TxID and block height BlockHeight are generated, which are embedded in the final settlement list.
[0153] The settlement list adopts a hierarchical structure design, including a cost detail layer, an energy consumption data layer, and a storage information layer. The cost detail layer records the energy consumption and cost details of each period and each step, the energy consumption data layer includes total energy consumption and sub-energy consumption data, and the storage information layer includes TxID, BlockHeight, and hash value H_hash. Finally, the settlement list is pushed to the user terminal in an asynchronous manner through the RESTful API interface. The API response includes message sequence number MsgID and delivery status Status, which ensures reliable message transmission.
[0154] The blockchain technology ensures the transparency and data non-tamperability of the settlement process, the intelligent contract automatically executes to avoid human intervention, the distributed storage mechanism provides a trusted data traceability capability for the energy consumption settlement, and through detailed audit log records and complete storage information, each settlement result is traceable and verifiable, thereby effectively improving the public credibility and reliability of the settlement result.
[0155] Finally, it should be noted that: the above only for the preferred embodiments of the present application, and not for limiting the present application, although the foregoing embodiments of the present application are described in detail, for those skilled in the art, it still can be modified, or part of the technical features of the equivalent replacement, within the spirit and principles of the present application, any modification, equivalent replacement, improvement, etc., should be included within the scope of the present application.
Claims
1. An energy consumption calculation method based on multi-source data, characterized in that, Includes the following steps: S1. Obtain raw, multi-source heterogeneous data from smart meters, environmental sensors, and building equipment management systems through the edge computing gateway, and complete protocol conversion and data aggregation; S2. Perform streaming processing on the original multi-source heterogeneous data, perform validity verification, missing value marking and timestamp alignment, and generate time-aligned regularized data; S3. Based on unsupervised machine learning algorithms, abnormal patterns are identified in the regularized data, and time-series prediction technology is combined to repair the abnormal data, outputting a clean dataset with enhanced data quality. S4. Based on the clean dataset that has undergone data quality enhancement, calculate the statistical characteristics of the load curve, use a state machine model to identify the operating conditions, and output the load state classification results. S5. Based on the load status classification results, the acquisition strategy is dynamically optimized through reinforcement learning algorithm, and the acquisition frequency and resolution are automatically adjusted to form an optimized acquisition strategy. S6. Based on the clean dataset with enhanced data quality and the load status classification results, the multi-source data features are fused through an ensemble learning algorithm, and fuzzy logic reasoning is used to perform precise energy consumption decomposition, outputting multi-dimensional energy consumption allocation results. S7. Based on the multi-dimensional energy consumption allocation results, write the hash digest of the key data into the distributed ledger, and automatically perform the fee calculation with the smart contract to generate a final settlement list containing a complete data traceability chain.
2. The energy consumption calculation method based on multi-source data according to claim 1, characterized in that, In step S1, completing the protocol conversion and data aggregation specifically includes: By deploying edge computing gateways, different communication protocols of various sensing devices are uniformly converted and parsed, and standardized preliminary data packets are output. The standardized preliminary data packets are then marked with source tags and bound to device IDs, and encapsulated into a raw data stream with metadata; The raw data stream with metadata is temporarily stored through the caching mechanism of the edge gateway, and then transmitted to the central data processing platform in batches or in real time according to the transmission strategy pre-configured in the gateway, forming the uploaded raw multi-source heterogeneous data.
3. The energy consumption calculation method based on multi-source data according to claim 1, characterized in that, In step S2, performing validity checks, missing value marking, and timestamp alignment specifically includes: By setting data validity rules based on data quality specifications, the uploaded raw multi-source heterogeneous data is quickly scanned and invalid points are marked. A time synchronization protocol is used to timestamp and calibrate data marked with invalid points, and then interpolate it to the smallest time granularity to generate time-synchronized sequence data. The time-synchronized sequence data is arranged and combined according to the time axis to fill in the missing time points.
4. The energy consumption calculation method based on multi-source data according to claim 1, characterized in that, In S3, the abnormal pattern recognition specifically includes: The statistical characteristics of the regularized data are calculated using a sliding window to generate a time-series feature dataset. A multi-level anomaly detection funnel is constructed. The first level uses business rules defined by business experience to quickly scan the data and generate rule anomaly tags. The second level uses unsupervised machine learning algorithms to perform deep pattern analysis and generate model anomaly tags. The machine learning model automatically calls an explanatory tool to generate feature contribution values for outliers marked by the model to generate an explanatory report, and performs secondary verification by combining equipment status, temperature, humidity, and light intensity parameters. Finally, the results from both levels are merged to form a comprehensive preliminary anomaly labeling result.
5. The energy consumption calculation method based on multi-source data according to claim 1, characterized in that, In step S3, the repair of abnormal data specifically includes: Based on the comprehensive preliminary anomaly labeling results, a repair strategy based on interpolation or time-series prediction is selected according to the anomaly type and business scenario. All repair operations are recorded, and the repair value is associated with the repair method and source description.
6. The energy consumption calculation method based on multi-source data according to claim 1, characterized in that, In step S4, the use of a state machine model for operational condition identification specifically includes: Based on the clean dataset that has undergone data quality enhancement, dynamic features within a short time window are calculated in real time to generate a real-time load feature vector; The real-time load feature vector is matched with a predefined state criterion library to generate a preliminary state classification signal; The initial state classification signal is subjected to timing logic judgment by a state machine model to avoid frequent state jumps and output stable and reliable load state classification results.
7. The energy consumption calculation method based on multi-source data according to claim 1, characterized in that, In step S5, the dynamic optimization of the acquisition strategy through reinforcement learning algorithm specifically includes: A reward function is constructed with the dual optimization objectives of reducing the total system acquisition overhead and maintaining the accuracy of critical status monitoring; The reward value is calculated in real time based on the load status classification results, and the acquisition strategy parameters are updated using the strategy gradient algorithm. The optimized strategy parameters are sent to the edge acquisition devices to form the optimized acquisition strategy that is adaptive to the current operating conditions.
8. The energy consumption calculation method based on multi-source data according to claim 1, characterized in that, In step S6, the precise energy consumption decomposition using fuzzy logic reasoning specifically includes: Based on the settlement scenario, equipment type, and the load status classification results, a pre-selected allocation algorithm is chosen from the model library to generate the target allocation model; The clean dataset with enhanced data quality is input together with static data such as spatial topology, building area, equipment power, and operation schedule into the target allocation model for fusion calculation to generate a preliminary allocation weight matrix. The initial allocation weight matrix is calibrated and its rationality is verified to ensure that the sum of the items equals the total amount, and the final multi-dimensional energy consumption allocation result is output.
9. The energy consumption calculation method based on multi-source data according to claim 1, characterized in that, In step S7, the calculation of automatic execution fees for smart contracts specifically includes: Based on the multi-dimensional energy consumption allocation results and the tiered time-of-use pricing policy, the applicable rate is automatically matched, the cost is calculated, and a unit cost detail is generated. Encapsulate key information from the entire data processing chain into audit traceability logs; The unit cost details are combined with the audit traceability log to generate a clear and traceable final settlement list, which is then automatically pushed to the user via API interface or message queue.
10. The energy consumption calculation method based on multi-source data according to claim 1, characterized in that, In step S7, writing the hash digest of key data into the distributed ledger specifically includes: Calculate a hash digest using the key feature values of the audit traceability logs and the multi-dimensional energy consumption allocation results; The smart contract deployed in the distributed ledger network is invoked to broadcast the hash digest to network nodes and store it through a consensus mechanism; A unique evidence identifier generated by a smart contract is embedded in the final settlement list.
Citation Information
Cited By
Data integration method and device applied to power switch
CN121509558A