A flow power consumption settlement method, device, equipment and medium
By generating a load fingerprint database through edge computing nodes and processing meter data using clustering algorithms, the problems of data disconnection, spatiotemporal alignment, and cloud pressure in electricity consumption settlement are solved, achieving high-fidelity and low-cost streaming electricity consumption settlement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGSU ANKEREI MICROGRID RES INST CO LTD
- Filing Date
- 2026-02-06
- Publication Date
- 2026-06-05
Smart Images

Figure CN122160384A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power data processing technology, specifically to a streaming power consumption settlement method, apparatus, equipment, and medium. Background Technology
[0002] With the widespread application of Internet of Things (IoT) technology in smart energy management, the massive amounts of energy consumption data generated by smart meters, sensors, and other end-point sensing devices have become the core basis for energy consumption monitoring and billing. However, in actual industrial production and large-scale deployment scenarios, existing electricity billing technologies still face the following challenges that urgently need to be addressed: First, there's the issue of statistical distortion caused by data loss. In wireless communication environments (such as NB-IoT, LoRa, 4G / 5G), sensing devices frequently experience short-term or long-term offline outages due to signal fluctuations, base station failures, or equipment maintenance. Existing energy management systems typically use a simple "indication difference" logic to fully record the total increase in electricity consumption during the offline period at the moment of restoration. This approach leads to non-physical "data spikes" on the energy consumption curve, failing to reconstruct the true operating conditions of the device during the offline period (e.g., whether it experienced shutdown, standby, or full-load operation), severely impacting the accuracy of energy scheduling and load forecasting.
[0003] Second, there is the challenge of spatiotemporal alignment and out-of-order processing in heterogeneous environments. Large-scale energy monitoring systems often span multiple time zones, and due to network latency, the order in which data arrives at the server (processing time) is often significantly inconsistent with the physical time of occurrence (event time). Traditional batch processing architectures struggle to handle such high-concurrency out-of-order data streams, resulting in low accuracy of time-sharing settlements (such as hourly settlements) and a high likelihood of cross-period statistical errors.
[0004] Third, the costs of equipment maintenance and anomaly detection are high. Throughout the equipment's lifecycle, hardware replacements, meter reading rollbacks, and sensor erratic readings are common occurrences. Most existing billing solutions lack self-healing capabilities; once an abnormal reading rollback is detected, manual intervention for reconciliation or database record modification is usually required. In massive platforms managing hundreds of millions of devices, this manual maintenance model is not only inefficient but also highly susceptible to introducing secondary errors.
[0005] Fourth, the dual challenges of cloud storage and computing pressure. Existing energy consumption monitoring solutions tend to send all raw high-frequency data to the cloud. As the scale of access expands, massive amounts of redundant data occupy huge communication bandwidth and storage space, and the cloud faces serious IO performance bottlenecks and latency challenges when performing long-cycle recalculation and compensation. Summary of the Invention
[0006] The purpose of this invention is to overcome the defects in the prior art and provide a streaming power consumption settlement method, device, equipment and medium that can both ensure real-time calculation and realize high-fidelity restoration of disconnection conditions.
[0007] To achieve the above objectives, the first aspect of the present invention provides a method for settling electricity consumption based on flow rate, comprising: The device receives meter data packets sent by an edge computing node. The data packets include cumulative energy consumption readings and instantaneous power feature vectors. The data packets are uploaded when the edge computing node detects a change in the statistical window boundary or load fingerprint pattern. The load fingerprint pattern is determined by the edge computing node based on the instantaneous power feature vector. The timestamps of the cumulative energy consumption readings are uniformly converted to logical local time according to the time zone of the electricity meter, and the maximum tolerable out-of-order time is determined based on the network latency fluctuations during the data packet upload process to construct a streaming water level line. The streaming water level line is used to drive the streaming settlement of the statistical window. Based on the instantaneous power feature vector, a clustering algorithm is used to generate the load fingerprint database of the electricity meter. The load fingerprint database includes multiple load fingerprint patterns and their corresponding reference values. After the meter is detected to have recovered from a loss of connection, the instantaneous power feature vectors before and after the loss of connection are extracted. The load fingerprint pattern sequence during the loss of connection is deduced by combining the load fingerprint database, and the electricity consumption increment generated during the loss of connection is restored to the corresponding statistical windows during the loss of connection.
[0008] Furthermore, the edge computing node detects a change in the load fingerprint pattern, including: The edge computing node collects the cumulative readings of the electricity meter and calculates the instantaneous power feature vector at a frequency higher than the statistical window. By matching the current instantaneous power feature vector with preset pattern features or performing lightweight clustering, load fingerprint patterns can be identified. When the identified load fingerprint pattern changes compared to the previous identification result, it is determined that a change has occurred.
[0009] Furthermore, the instantaneous power characteristic vector includes electricity consumption slope, fluctuation standard deviation, power characteristics, peak-valley fluctuation frequency, and current harmonic characteristics.
[0010] Furthermore, based on the instantaneous power feature vector, a load fingerprint database of the electricity meter is generated using a clustering algorithm, including: An unsupervised clustering algorithm is used to perform cluster analysis on the instantaneous power feature vectors of historical reception to form multiple clusters. Each cluster corresponds to a load fingerprint pattern, and the central feature vector of each cluster is used as the reference value of the corresponding load fingerprint pattern to generate the load fingerprint database. A persistent state machine is maintained for each electricity meter to store and update the load fingerprint database; The newly received instantaneous power feature vector is matched with the Euclidean distance of each load fingerprint pattern reference value in the load fingerprint database to determine the target load fingerprint pattern with the smallest Euclidean distance, and the newly received instantaneous power feature vector is assigned to the target load fingerprint pattern. When multiple instantaneous power feature vectors belonging to the same target load fingerprint pattern consistently meet the preset statistical significance condition for their deviation from the target load fingerprint pattern, the baseline value of the target load fingerprint pattern is recalculated and updated based on all instantaneous power feature vectors belonging to the target load fingerprint pattern.
[0011] Furthermore, the instantaneous power feature vectors before and after the loss of connection are extracted, and the load fingerprint pattern sequence during the loss of connection is deduced by combining the load fingerprint database. The electricity consumption increment generated during the loss of connection is then restored to the corresponding statistical windows within the period of loss of connection, including: The historical load state transition probability matrix of the electricity meter is obtained from the load fingerprint database. The historical load state transition probability matrix is generated based on the historical load fingerprint pattern sequence of the electricity meter by statistically calculating the frequency of mutual transition between different load fingerprint patterns. Starting with the load fingerprint pattern corresponding to the instantaneous power feature vector before the loss of connection, and ending with the load fingerprint pattern corresponding to the instantaneous power feature vector after the recovery, a probability deduction is performed based on the historical load state transition probability matrix to generate a load fingerprint pattern sequence for each statistical window during the period of loss of connection. Based on the load fingerprint pattern sequence, the power consumption intensity feature weights corresponding to each pattern are retrieved from the load fingerprint database, and the power consumption increment generated during the disconnection period is dynamically divided into the statistical windows corresponding to the disconnection period based on the power consumption intensity feature weights.
[0012] Furthermore, the load fingerprint patterns in the load fingerprint database include preset new table initial run fingerprint patterns; The method further includes: When the cumulative energy consumption reading of the meter experiences a non-monotonic regression, the instantaneous power feature vector corresponding to the regression time is matched with the load fingerprint database. If the matching result matches the initial running fingerprint pattern of the new table, it is determined that the non-monotonic rollback was triggered by the table replacement event, and the cumulative value of the statistical window used for streaming differential settlement in the persistent state machine is reset.
[0013] Furthermore, the method also includes: If the matching result does not match the initial running fingerprint pattern of the new meter, then determine the historical electricity consumption slope statistical characteristics of the load fingerprint pattern of the meter before the rollback time. If the difference between the electricity consumption slope in the instantaneous power feature vector corresponding to the rollback time and the statistical feature of the historical electricity consumption slope exceeds a preset information interval, then the cumulative energy consumption indication of the non-monotonic rollback is determined to be dirty data and intercepted.
[0014] A second aspect of the present invention provides a streaming electricity consumption settlement device, comprising: The data receiving module is used to receive meter data packets sent by the edge computing node. The data packets include cumulative energy consumption readings and instantaneous power feature vectors. The data packets are uploaded when the edge computing node detects a change in the statistical window boundary or load fingerprint pattern. The load fingerprint pattern is determined by the edge computing node based on the instantaneous power feature vector. The time zone alignment module is used to convert the timestamp of the cumulative energy consumption value into a logical local time according to the time zone of the electricity meter, and to determine the maximum tolerable out-of-order time based on the network latency fluctuation during the data packet upload process in order to construct a streaming water level line, and to use the streaming water level line to drive the streaming settlement of the statistical window. The fingerprint management module is used to generate a load fingerprint database of the electricity meter based on the instantaneous power feature vector using a clustering algorithm. The load fingerprint database includes multiple load fingerprint patterns and their corresponding reference values. The disconnection compensation module is used to extract the instantaneous power feature vector before and after the disconnection is detected after the meter is disconnected and restored. It combines the load fingerprint database to deduce the load fingerprint pattern sequence during the disconnection period and restores the electricity consumption increment generated during the disconnection period to the corresponding statistical windows during the disconnection period.
[0015] Furthermore, the edge computing node detects a change in the load fingerprint pattern, including: The edge computing node collects the cumulative readings of the electricity meter and calculates the instantaneous power feature vector at a frequency higher than the statistical window. By matching the current instantaneous power feature vector with preset pattern features or performing lightweight clustering, load fingerprint patterns can be identified. When the identified load fingerprint pattern changes compared to the previous identification result, it is determined that a change has occurred.
[0016] Furthermore, the instantaneous power characteristic vector includes electricity consumption slope, fluctuation standard deviation, power characteristics, peak-valley fluctuation frequency, and current harmonic characteristics.
[0017] Furthermore, when the fingerprint management module generates the load fingerprint database of the electricity meter based on the instantaneous power feature vector using a clustering algorithm, it is specifically used for: An unsupervised clustering algorithm is used to perform cluster analysis on the instantaneous power feature vectors of historical reception to form multiple clusters. Each cluster corresponds to a load fingerprint pattern, and the central feature vector of each cluster is used as the reference value of the corresponding load fingerprint pattern to generate the load fingerprint database. A persistent state machine is maintained for each electricity meter to store and update the load fingerprint database; The newly received instantaneous power feature vector is matched with the Euclidean distance of each load fingerprint pattern reference value in the load fingerprint database to determine the target load fingerprint pattern with the smallest Euclidean distance, and the newly received instantaneous power feature vector is assigned to the target load fingerprint pattern. When multiple instantaneous power feature vectors belonging to the same target load fingerprint pattern consistently meet the preset statistical significance condition for their deviation from the target load fingerprint pattern, the baseline value of the target load fingerprint pattern is recalculated and updated based on all instantaneous power feature vectors belonging to the target load fingerprint pattern.
[0018] Furthermore, when the disconnection compensation module extracts the instantaneous power feature vectors before and after the disconnection, combines them with the load fingerprint database to deduce the load fingerprint pattern sequence during the disconnection period, and restores the electricity consumption increment generated during the disconnection period to the corresponding statistical windows within the disconnection period, it is specifically used for: The historical load state transition probability matrix of the electricity meter is obtained from the load fingerprint database. The historical load state transition probability matrix is generated based on the historical load fingerprint pattern sequence of the electricity meter by statistically calculating the frequency of mutual transition between different load fingerprint patterns. Starting with the load fingerprint pattern corresponding to the instantaneous power feature vector before the loss of connection, and ending with the load fingerprint pattern corresponding to the instantaneous power feature vector after the recovery, a probability deduction is performed based on the historical load state transition probability matrix to generate a load fingerprint pattern sequence for each statistical window during the period of loss of connection. Based on the load fingerprint pattern sequence, the power consumption intensity feature weights corresponding to each pattern are retrieved from the load fingerprint database, and the power consumption increment generated during the disconnection period is dynamically divided into the statistical windows corresponding to the disconnection period based on the power consumption intensity feature weights.
[0019] Furthermore, the load fingerprint patterns in the load fingerprint database include preset new table initial run fingerprint patterns; The device also includes a meter replacement self-healing module, which is used to match the instantaneous power feature vector corresponding to the rollback time with the load fingerprint database when the cumulative energy consumption reading of the meter undergoes non-monotonic rollback; if the matching result is consistent with the initial operating fingerprint mode of the new meter, it is determined that the non-monotonic rollback is caused by the meter replacement event, and the statistical window baseline cumulative reading used for streaming differential settlement in the persistent state machine is reset.
[0020] Furthermore, the device also includes an anomaly interception module, used to determine the historical electricity consumption slope statistical characteristics of the load fingerprint mode of the electricity meter before the rollback time if the matching result does not conform to the initial operating fingerprint mode of the new meter; if the difference between the electricity consumption slope in the instantaneous power feature vector corresponding to the rollback time and the historical electricity consumption slope statistical characteristics exceeds a preset information interval, then the cumulative energy consumption indication of the non-monotonic rollback is determined to be dirty data and intercepted.
[0021] A third aspect of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that, when executed by the processor, implements the method described in the first aspect.
[0022] A fourth aspect of the present invention provides a computer-readable storage medium having program instructions stored thereon, which, when executed, implement the method described in the first aspect.
[0023] The advantages and beneficial effects of this invention are as follows: By receiving data packets intelligently reported by edge computing nodes when state transitions or window boundaries are detected, redundant data transmission is greatly reduced from the source, optimizing communication bandwidth. Furthermore, through time zone conversion and a streaming water level dynamically constructed based on network latency, the problem of out-of-order data arrival under cross-time zone deployment is effectively solved, ensuring that each energy consumption data point is accurately aligned and assigned to its physical occurrence statistical period, thus achieving spatiotemporal consistency in streaming settlement. Based on this, a load fingerprint database characterizing equipment operating conditions is generated and maintained using clustering algorithms, providing a dynamic knowledge model for understanding equipment behavior. Finally, after detecting equipment recovery from disconnection, by extracting boundary features and combining them with the fingerprint database to deduce the load pattern sequence during the disconnection period, high-fidelity, condition-level restoration of the total power consumption during the disconnection period is achieved. Power consumption is intelligently distributed to different time periods according to the deduced actual operating mode, eliminating data spikes and statistical distortions caused by blind supplementation or average allocation in traditional methods. Attached Figure Description
[0024] Figure 1 This is a flowchart of the flow-based electricity consumption settlement method of the present invention; Figure 2 This is a schematic diagram of the keyed state machine. Figure 3 A flowchart combining load fingerprint updates and data restoration after disconnection; Figure 4 This is a comparison chart showing the effects of compensation for lost contact; Figure 5 A flowchart combining table replacement self-healing and dirty data interception; Figure 6This is a schematic diagram of the structure of the flow-type electricity consumption settlement device of the present invention; Figure 7 This is a schematic diagram of the structure of the electronic device of the present invention. Detailed Implementation
[0025] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings and examples. The following examples are only used to more clearly illustrate the technical solutions of the present invention and should not be construed as limiting the scope of protection of the present invention.
[0026] The streaming electricity consumption settlement method of the present invention can be implemented in collaboration with a distributed streaming computing engine such as Apache Flink and an industrial-grade edge gateway deployed on site.
[0027] For example, the streaming electricity consumption settlement method of the present invention can be executed by a cloud platform, such as... Figure 1 As shown, the method includes the following steps: S110. Receive a meter data message sent by an edge computing node. The data message includes a cumulative energy consumption reading and an instantaneous power feature vector. The data message is uploaded when the edge computing node detects a change in the statistical window boundary or the load fingerprint pattern. The load fingerprint pattern is determined by the edge computing node based on the instantaneous power feature vector.
[0028] S120. Based on the time zone of the electricity meter, the timestamp of the cumulative energy consumption value is uniformly converted into the logical local time, and the maximum tolerable out-of-order time is determined based on the network delay fluctuation during the data packet upload process to construct a streaming water level line, and the streaming water level line is used to drive the streaming settlement of the statistical window.
[0029] S130. Based on the instantaneous power feature vector, a clustering algorithm is used to generate a load fingerprint database for the electricity meter. The load fingerprint database includes multiple load fingerprint patterns and their corresponding reference values.
[0030] S140. After the meter is detected to have recovered from disconnection, the instantaneous power feature vectors before and after the disconnection are extracted, and the load fingerprint pattern sequence during the disconnection period is deduced by combining the load fingerprint database. The electricity consumption increment generated during the disconnection period is restored to the corresponding statistical windows during the disconnection period.
[0031] Edge computing nodes (such as industrial gateways) deployed at the site of electrical equipment are responsible for direct communication with smart meters. The data packets do not contain raw high-frequency sampled values, but rather key cumulative energy consumption readings and the instantaneous power feature vector calculated from them. The edge computing nodes collect the cumulative reading V of the smart meter at a frequency of one second (e.g., 1 second / time) and calculate the power feature vector X=[v, Δv, σ] in real time, where v is the instantaneous rate, Δv is the increment, and σ is the standard deviation of the fluctuation.
[0032] Edge computing nodes upload data packets following an event-driven principle, triggering only when one of two conditions is detected locally: 1. Reaching a preset statistical window boundary (e.g., the hourly mark); 2. Identifying a change in the device's load fingerprint mode (e.g., switching from "full load operation" to "shutdown"). The load fingerprint mode is a device operating condition category determined by the edge computing node through analysis of real-time calculated instantaneous power feature vectors. For example, the edge node uses a built-in lightweight clustering algorithm to identify the current load mode. A state transition event is sent to the cloud platform only when a load fingerprint mode switch is detected (e.g., from "high-load production mode" to "low-power standby mode") or when a settlement boundary is reached, thereby reducing communication bandwidth by more than 80%.
[0033] After receiving data packets, the cloud platform first performs spatiotemporal standardization. The system maintains a global device registry that records the geographical time zone of each meter. Based on the device ID, the system retrieves the corresponding time zone offset and converts the original timestamp in the packet to a logical local time (e.g., UTC), thus resolving the time base inconsistency issue caused by cross-time zone deployment. Next, to handle data out-of-order issues caused by network transmission, the system introduces a streaming watermark mechanism. This mechanism dynamically estimates and determines a maximum tolerable out-of-order time by analyzing historical data packet upload latency fluctuations. Based on this time and the logical local time, the dynamic watermark intelligently judges the progress of the data stream and drives the closing and settlement triggering of statistical windows (e.g., 1-hour windows), ensuring that late data within the tolerable range is correctly included in the corresponding window for calculation.
[0034] The cloud platform maintains a persistent state machine for each meter (the persistent state machine is as follows: ...). Figure 2 As shown, one of the core components stored in this state machine is the load fingerprint database. The load fingerprint database utilizes unsupervised clustering algorithms (such as K-Means) to cluster the continuously received instantaneous power feature vectors of the electricity meter. Each cluster formed after clustering corresponds to a typical equipment operating condition and is defined as a load fingerprint pattern (e.g., "Pattern A: Shutdown", "Pattern B: Standby", "Pattern C: Full Load"). The central feature vector of each cluster is extracted and used as the baseline value for that load fingerprint pattern for subsequent pattern matching. The load fingerprint database is the knowledge foundation for the system to understand the electricity consumption behavior of the equipment.
[0035] When the system detects that a power meter has been offline for a period of time and then reconnected through mechanisms such as heartbeat detection, a high-fidelity compensation process will be initiated. First, the effective instantaneous power feature vector at the last moment before the disconnection and the feature vector at the first moment after the recovery are extracted. Then, combined with the historical load state transition probability matrix learned for the device from the load fingerprint database, probabilistic deduction (e.g., using the Viterbi algorithm) is performed, using the load fingerprint patterns corresponding to the feature vectors before and after the disconnection as the starting and ending points, to generate the most probable load fingerprint pattern sequence for each statistical window during the disconnection period. Finally, based on this sequence, the power intensity feature weights corresponding to each pattern in the fingerprint database are called (rather than evenly distributed), and the total power consumption increment generated during the disconnection period is intelligently and proportionally distributed and restored to the corresponding virtual statistical windows within the disconnection interval, thereby restoring an energy consumption curve that conforms to physical reality.
[0036] This invention, through receiving data packets intelligently reported by edge computing nodes when state transitions or window boundaries are detected, firstly significantly reduces redundant data transmission and optimizes communication bandwidth at the source. Secondly, by using time zone conversion and a streaming watermark dynamically constructed based on network latency, it effectively solves the problem of out-of-order data arrival in cross-time zone deployments, ensuring that each energy consumption data point is accurately aligned and assigned to its physical occurrence statistical period, thus achieving spatiotemporal consistency in streaming settlement. Based on this, a load fingerprint database representing device operating conditions is generated and maintained using clustering algorithms, providing a dynamic knowledge model for understanding device behavior. Finally, after detecting device recovery from disconnection, by extracting boundary features and combining them with the fingerprint database to deduce the load pattern sequence during the disconnection period, high-fidelity, condition-level restoration of the total power consumption during the disconnection period is achieved. Power consumption is intelligently distributed to different time periods according to the deduced actual operating pattern, eliminating data spikes and statistical distortions caused by blind supplementation or average allocation in traditional methods.
[0037] To clarify the intelligent determination logic at the edge, a preferred embodiment of the present invention is that the edge computing node detects a change in the load fingerprint pattern, including: the edge computing node collects the cumulative reading of the electricity meter at a frequency higher than the statistical window and calculates the instantaneous power feature vector; the load fingerprint pattern is identified by matching the current instantaneous power feature vector with preset pattern features or by lightweight clustering; when the identified load fingerprint pattern changes compared to the previous identification result, it is determined that a change has occurred.
[0038] Edge computing nodes collect cumulative meter readings at a frequency far exceeding the cloud-based billing and statistics window (e.g., once per second) and calculate instantaneous power feature vectors in real time. Each edge node has a built-in lightweight pattern recognition module that stores preset pattern features (i.e., simplified fingerprint benchmarks) synchronized from the cloud or learned locally. By quickly matching the currently calculated instantaneous power feature vector with these preset features, or by running a lightweight online clustering analysis, the edge node can identify the current load fingerprint pattern in real time. Only when the identified load fingerprint pattern differs from the pattern identified in the previous reporting cycle does the edge node determine a change has occurred, thus triggering the reporting of a state transition event. This design ensures that only critical information representing changes in operating conditions is uploaded.
[0039] In order to accurately characterize the instantaneous power consumption behavior of the device and provide highly distinguishable features for load fingerprint identification, a preferred embodiment of the present invention is that the instantaneous power feature vector includes power consumption slope, fluctuation standard deviation, power characteristics, peak-valley fluctuation frequency, and current harmonic characteristics.
[0040] Electricity consumption slope (i.e., power change rate, reflecting the drastic increase or decrease in load), standard deviation of fluctuation (reflecting the stability of power within a short period), broader power characteristics (such as RMS and peak values), peak-valley fluctuation frequency (reflecting the rhythm of periodic load changes), and current harmonic characteristics (reflecting load type, such as whether it contains nonlinear equipment). These characteristics together constitute a digital profile of the equipment's electricity consumption behavior, enabling the system to finely distinguish different operating conditions.
[0041] To achieve the adaptive learning capability of the load fingerprint database, a preferred embodiment of the present invention is to generate the load fingerprint database of the electricity meter based on the instantaneous power feature vector using a clustering algorithm, including: performing cluster analysis on the historically received instantaneous power feature vectors using an unsupervised clustering algorithm to form multiple clusters, each cluster corresponding to a load fingerprint pattern, and using the central feature vector of each cluster as the benchmark value of the corresponding load fingerprint pattern to generate the load fingerprint database; maintaining a persistent state machine for each electricity meter to store and update the load fingerprint database; matching the Euclidean distance between the newly received instantaneous power feature vector and the benchmark values of each load fingerprint pattern in the load fingerprint database to determine the target load fingerprint pattern with the smallest Euclidean distance, and assigning the newly received instantaneous power feature vector to the target load fingerprint pattern; when the deviation of multiple instantaneous power feature vectors belonging to the same target load fingerprint pattern from the target load fingerprint pattern continuously meets a preset statistical significance condition, recalculating and updating the benchmark value of the target load fingerprint pattern based on all instantaneous power feature vectors belonging to the target load fingerprint pattern.
[0042] Specifically, the system first analyzes historical data using unsupervised clustering algorithms such as K-Means to form clusters and baseline values, thus initializing the fingerprint database. A persistent state machine ensures that the fingerprint database state for each device is retained after a system restart. When a new instantaneous power feature vector arrives, the system calculates its Euclidean distance to the baseline values of each pattern in the database and assigns it to the target load fingerprint pattern with the smallest distance. The system continuously monitors the deviation of new data from its corresponding baseline pattern. When a series of new feature vectors belonging to the same target pattern show a statistically significant overall deviation (e.g., the mean distance of multiple consecutive vectors exceeds twice the historical threshold standard deviation), the pattern is updated. The update is not a simple replacement, but rather a re-execution of cluster analysis based on the set of all historical and latest feature vectors currently belonging to the pattern. This recalculates new cluster centers that better represent the current device operating conditions as new baseline values, thereby achieving dynamic reconstruction and self-evolution of the fingerprint database.
[0043] To improve the accuracy and physical plausibility of data restoration after loss of connection, a preferred embodiment of this invention involves extracting instantaneous power feature vectors before and after the loss of connection, combining them with the load fingerprint database to deduce the load fingerprint pattern sequence during the loss of connection, and restoring the electricity consumption increment generated during the loss of connection to the corresponding statistical windows within the period of loss of connection. This includes: obtaining the historical load state transition probability matrix of the meter from the load fingerprint database, wherein the historical load state transition probability matrix is generated based on the historical load fingerprint pattern sequence of the meter by statistically calculating the frequency of mutual transitions between different load fingerprint patterns; taking the load fingerprint pattern corresponding to the instantaneous power feature vector before the loss of connection as the starting state and the load fingerprint pattern corresponding to the instantaneous power feature vector after the recovery as the ending state, performing probability deduction based on the historical load state transition probability matrix to generate the load fingerprint pattern sequence for each statistical window during the loss of connection; and, based on the load fingerprint pattern sequence, calling the electricity intensity feature weights corresponding to each pattern from the load fingerprint database, and dynamically dividing the electricity consumption increment generated during the loss of connection to the corresponding statistical windows based on the electricity intensity feature weights.
[0044] The historical load state transition probability matrix is derived from the analysis of long-term equipment operation data. It is calculated by statistically analyzing the frequency of transitions from one mode to the next in the historical load fingerprint pattern sequence, thus quantifying the operational patterns. During disconnection compensation, this matrix serves as a constraint, using the load fingerprint patterns corresponding to the feature vectors before and after disconnection as fixed start and end points. A probabilistic graphical model is used to deduce the most likely simulated load fingerprint pattern sequence. Then, instead of evenly distributing electricity, the total electricity increment is dynamically allocated to different time periods based on the pre-stored power intensity feature weights (such as the historical average power of that mode) in the fingerprint database corresponding to each mode. For example, periods predicted as "full load" will receive more electricity, while "standby" periods will receive less. The reconstructed energy consumption values for each statistical window not only ensure equal total energy consumption but also introduce a second-order slope constraint operator at the disconnection point to ensure the physical continuity of the reconstruction curve.
[0045] The overall process of combining load fingerprint update and lost data restoration is as follows: Figure 3 As shown, the effects of data recovery from lost connections in this embodiment of the invention compared to existing data processing techniques are as follows: Figure 4 As shown.
[0046] To handle meter replacement maintenance events without human intervention, a preferred embodiment of the present invention includes a load fingerprint pattern in the load fingerprint database that includes a preset initial operating fingerprint pattern for the new meter. The method further includes: when the cumulative energy consumption reading of the meter experiences a non-monotonic rollback, matching the instantaneous power feature vector corresponding to the rollback time with the load fingerprint database; if the matching result matches the initial operating fingerprint pattern for the new meter, then it is determined that the non-monotonic rollback was triggered by a meter replacement event, and the baseline cumulative reading of the statistical window used for streaming differential settlement in the persistent state machine is reset.
[0047] To achieve self-healing after meter replacement, a pre-defined initial operating fingerprint mode for new meters is stored in the load fingerprint database. This mode is characterized by extremely low and stable power consumption. When the cloud platform receives a newly arrived meter data packet, if streaming computation detects that the meter's cumulative energy consumption reading violates a monotonically increasing pattern (i.e., a non-monotonic rollback occurs (the current reading is less than the previous valid reading), a diagnostic process is automatically triggered. The system immediately matches the instantaneous power feature vector collected at the rollback moment with the load fingerprint database. If the matching result highly matches the initial operating fingerprint mode of the new meter, it intelligently determines that the rollback was caused by a physical meter replacement event, rather than a data error. Subsequently, the system automatically resets the critical state in the persistent state machine used for streaming differential settlement—the statistical window baseline cumulative reading—updating it to the initial reading of the new meter after replacement, thus achieving a seamless and imperceptible switch in the settlement logic.
[0048] To clean up irregularly fluctuating abnormal data and prevent it from contaminating the settlement results, a preferred embodiment of the present invention further includes the following steps: if the matching result does not conform to the initial operating fingerprint mode of the new meter, then determine the historical electricity consumption slope statistical characteristics of the load fingerprint mode of the meter before the rollback time; if the difference between the electricity consumption slope in the instantaneous power feature vector corresponding to the rollback time and the historical electricity consumption slope statistical characteristics exceeds a preset confidence interval, then determine that the cumulative energy consumption reading of the non-monotonic rollback is dirty data and intercept it.
[0049] This invention also provides a dirty data interception scheme as a discrimination branch for meter replacement self-healing. The cloud platform detects a non-monotonic rollback in the cumulative energy consumption reading of the meter. If the feature vector at the rollback moment does not match the initial operating fingerprint pattern of the new meter, the system initiates a dirty data check. The system first retrieves the historical electricity consumption slope statistical characteristics under the stable load fingerprint pattern of the device before the rollback moment from the fingerprint database, including its long-term mean and standard deviation. Then, it checks the instantaneous electricity consumption slope in the rollback moment data. If the difference between this slope value and the historical mean exceeds the dynamic confidence interval determined based on the three-times-standard-deviation principle (i.e., ...), the system checks the data. ,in Indicates the instantaneous electricity consumption slope. This represents the average historical power consumption slope of the device under the load fingerprint mode before the rollback time. If the standard deviation of the historical power consumption slope under the load fingerprint mode is represented, it indicates that this rollback is accompanied by a physically impossible power jump.
[0050] Based on this, the system determines that the cumulative energy consumption reading is dirty data and performs an interception operation, either discarding it or placing it in the side output stream for subsequent analysis, preventing it from affecting the correct state of the state machine and the cumulative calculation results. The overall process combining table replacement self-healing and dirty data interception is as follows: Figure 5 As shown.
[0051] like Figure 6 As shown, the current-flow electricity consumption settlement device of the present invention includes: The data receiving module 601 is used to receive meter data messages sent by the edge computing node. The data messages include cumulative energy consumption readings and instantaneous power feature vectors. The data messages are uploaded when the edge computing node detects a change in the statistical window boundary or load fingerprint pattern. The load fingerprint pattern is determined by the edge computing node based on the instantaneous power feature vector. The time zone alignment module 602 is used to convert the timestamp of the cumulative energy consumption reading into a logical local time according to the time zone where the electricity meter is located, and to determine the maximum tolerable out-of-order time based on the network latency fluctuation during the data packet upload process in order to construct a streaming water level line, and to use the streaming water level line to drive the streaming settlement of the statistical window. The fingerprint management module 603 is used to generate a load fingerprint database of the electricity meter based on the instantaneous power feature vector using a clustering algorithm. The load fingerprint database includes multiple load fingerprint patterns and their corresponding reference values. The disconnection compensation module 604 is used to extract the instantaneous power feature vector before and after the disconnection is detected after the meter is disconnected and restored, and to deduce the load fingerprint pattern sequence during the disconnection period by combining the load fingerprint database, and to restore the electricity consumption increment generated during the disconnection period to the corresponding statistical windows during the disconnection period.
[0052] In some embodiments, the edge computing node detects a change in load fingerprint pattern, including: The edge computing node collects the cumulative readings of the electricity meter and calculates the instantaneous power feature vector at a frequency higher than the statistical window. By matching the current instantaneous power feature vector with preset pattern features or performing lightweight clustering, load fingerprint patterns can be identified. When the identified load fingerprint pattern changes compared to the previous identification result, it is determined that a change has occurred.
[0053] In some embodiments, the instantaneous power characteristic vector includes electricity consumption slope, fluctuation standard deviation, power characteristics, peak-valley fluctuation frequency, and current harmonic characteristics.
[0054] In some embodiments, when the fingerprint management module 603 generates the load fingerprint database of the electricity meter based on the instantaneous power feature vector using a clustering algorithm, it is specifically used for: An unsupervised clustering algorithm is used to perform cluster analysis on the instantaneous power feature vectors of historical reception to form multiple clusters. Each cluster corresponds to a load fingerprint pattern, and the central feature vector of each cluster is used as the reference value of the corresponding load fingerprint pattern to generate the load fingerprint database. A persistent state machine is maintained for each electricity meter to store and update the load fingerprint database; The newly received instantaneous power feature vector is matched with the Euclidean distance of each load fingerprint pattern reference value in the load fingerprint database to determine the target load fingerprint pattern with the smallest Euclidean distance, and the newly received instantaneous power feature vector is assigned to the target load fingerprint pattern. When multiple instantaneous power feature vectors belonging to the same target load fingerprint pattern consistently meet the preset statistical significance condition for their deviation from the target load fingerprint pattern, the baseline value of the target load fingerprint pattern is recalculated and updated based on all instantaneous power feature vectors belonging to the target load fingerprint pattern.
[0055] In some embodiments, when the disconnection compensation module 604 extracts the instantaneous power feature vectors before and after disconnection, combines the load fingerprint database to deduce the load fingerprint pattern sequence during the disconnection period, and restores the electricity consumption increment generated during the disconnection period to the corresponding statistical windows within the disconnection period, it is specifically used for: The historical load state transition probability matrix of the electricity meter is obtained from the load fingerprint database. The historical load state transition probability matrix is generated based on the historical load fingerprint pattern sequence of the electricity meter by statistically calculating the frequency of mutual transition between different load fingerprint patterns. Starting with the load fingerprint pattern corresponding to the instantaneous power feature vector before the loss of connection, and ending with the load fingerprint pattern corresponding to the instantaneous power feature vector after the recovery, a probability deduction is performed based on the historical load state transition probability matrix to generate a load fingerprint pattern sequence for each statistical window during the period of loss of connection. Based on the load fingerprint pattern sequence, the power consumption intensity feature weights corresponding to each pattern are retrieved from the load fingerprint database, and the power consumption increment generated during the disconnection period is dynamically divided into the statistical windows corresponding to the disconnection period based on the power consumption intensity feature weights.
[0056] In some embodiments, the load fingerprint patterns in the load fingerprint database include preset new table initial run fingerprint patterns; The device also includes a meter replacement self-healing module 605, which is used to match the instantaneous power feature vector corresponding to the rollback time with the load fingerprint database when the cumulative energy consumption reading of the meter undergoes non-monotonic rollback; if the matching result is consistent with the initial operating fingerprint mode of the new meter, it is determined that the non-monotonic rollback is caused by the meter replacement event, and the statistical window baseline cumulative reading used for streaming differential settlement in the persistent state machine is reset.
[0057] In some embodiments, the device further includes an anomaly interception module 606, configured to: if the matching result does not conform to the initial operating fingerprint mode of the new meter, determine the historical electricity consumption slope statistical characteristics of the load fingerprint mode of the meter before the rollback time; if the difference between the electricity consumption slope in the instantaneous power feature vector corresponding to the rollback time and the historical electricity consumption slope statistical characteristics exceeds a preset confidence interval, determine that the cumulative energy consumption reading of the non-monotonic rollback is dirty data and intercept it.
[0058] Figure 6The streaming electricity consumption settlement device in the illustrated embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and will not be repeated here.
[0059] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. The electronic device can be a server as described in the above embodiment. The electronic device provided in this embodiment of the present invention can execute the processing flow provided in the embodiment of the streaming electricity consumption settlement method, such as... Figure 7 As shown, the electronic device 1100 includes: a memory 1101, a processor 1102, a computer program, and a communication interface 1103; wherein, the computer program is stored in the memory 1101 and is configured to be executed by the processor 1102 as described above in the streaming electricity consumption billing method.
[0060] In addition, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the streaming electricity consumption settlement method described in the above embodiments.
[0061] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0062] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for settling electricity consumption based on flow rate, characterized in that, include: The device receives meter data packets sent by an edge computing node. The data packets include cumulative energy consumption readings and instantaneous power feature vectors. The data packets are uploaded when the edge computing node detects a change in the statistical window boundary or load fingerprint pattern. The load fingerprint pattern is determined by the edge computing node based on the instantaneous power feature vector. The timestamps of the cumulative energy consumption readings are uniformly converted to logical local time according to the time zone of the electricity meter, and the maximum tolerable out-of-order time is determined based on the network latency fluctuations during the data packet upload process to construct a streaming water level line. The streaming water level line is used to drive the streaming settlement of the statistical window. Based on the instantaneous power feature vector, a clustering algorithm is used to generate the load fingerprint database of the electricity meter. The load fingerprint database includes multiple load fingerprint patterns and their corresponding reference values. After the meter is detected to have recovered from a loss of connection, the instantaneous power feature vectors before and after the loss of connection are extracted. The load fingerprint pattern sequence during the loss of connection is deduced by combining the load fingerprint database, and the electricity consumption increment generated during the loss of connection is restored to the corresponding statistical windows during the loss of connection.
2. The method for settling electricity consumption according to claim 1, characterized in that, The edge computing node detects a change in the load fingerprint pattern, including: The edge computing node collects the cumulative readings of the electricity meter and calculates the instantaneous power feature vector at a frequency higher than the statistical window. By matching the current instantaneous power feature vector with preset pattern features or performing lightweight clustering, load fingerprint patterns can be identified. When the identified load fingerprint pattern changes compared to the previous identification result, it is determined that a change has occurred.
3. The method for settling electricity consumption according to claim 1, characterized in that, The instantaneous power characteristic vector includes electricity consumption slope, fluctuation standard deviation, power characteristics, peak-valley fluctuation frequency, and current harmonic characteristics.
4. The method for settling electricity consumption according to claim 1, characterized in that, Based on the instantaneous power feature vector, a load fingerprint database of the electricity meter is generated using a clustering algorithm, including: An unsupervised clustering algorithm is used to perform cluster analysis on the instantaneous power feature vectors of historical reception to form multiple clusters. Each cluster corresponds to a load fingerprint pattern, and the central feature vector of each cluster is used as the reference value of the corresponding load fingerprint pattern to generate the load fingerprint database. A persistent state machine is maintained for each electricity meter to store and update the load fingerprint database; The newly received instantaneous power feature vector is matched with the Euclidean distance of each load fingerprint pattern reference value in the load fingerprint database to determine the target load fingerprint pattern with the smallest Euclidean distance, and the newly received instantaneous power feature vector is assigned to the target load fingerprint pattern. When multiple instantaneous power feature vectors belonging to the same target load fingerprint pattern consistently meet the preset statistical significance condition for their deviation from the target load fingerprint pattern, the baseline value of the target load fingerprint pattern is recalculated and updated based on all instantaneous power feature vectors belonging to the target load fingerprint pattern.
5. The method for settling electricity consumption according to claim 1, characterized in that, Extract the instantaneous power feature vectors before and after the disconnection, combine them with the load fingerprint database to deduce the load fingerprint pattern sequence during the disconnection period, and restore the electricity consumption increment generated during the disconnection period to the corresponding statistical windows within the disconnection period, including: The historical load state transition probability matrix of the electricity meter is obtained from the load fingerprint database. The historical load state transition probability matrix is generated based on the historical load fingerprint pattern sequence of the electricity meter by statistically calculating the frequency of mutual transition between different load fingerprint patterns. Starting with the load fingerprint pattern corresponding to the instantaneous power feature vector before the loss of connection, and ending with the load fingerprint pattern corresponding to the instantaneous power feature vector after the recovery, a probability deduction is performed based on the historical load state transition probability matrix to generate a load fingerprint pattern sequence for each statistical window during the period of loss of connection. Based on the load fingerprint pattern sequence, the power consumption intensity feature weights corresponding to each pattern are retrieved from the load fingerprint database, and the power consumption increment generated during the disconnection period is dynamically divided into the statistical windows corresponding to the disconnection period based on the power consumption intensity feature weights.
6. The method for settling electricity consumption according to claim 4, characterized in that, The load fingerprint patterns in the load fingerprint database include preset initial running fingerprint patterns for new tables. The method further includes: When the cumulative energy consumption reading of the meter experiences a non-monotonic regression, the instantaneous power feature vector corresponding to the regression time is matched with the load fingerprint database. If the matching result matches the initial running fingerprint pattern of the new table, it is determined that the non-monotonic rollback was triggered by the table replacement event, and the cumulative value of the statistical window used for streaming differential settlement in the persistent state machine is reset.
7. The method for settling electricity consumption according to claim 6, characterized in that, The method further includes: If the matching result does not match the initial running fingerprint pattern of the new meter, then determine the historical electricity consumption slope statistical characteristics of the load fingerprint pattern of the meter before the rollback time. If the difference between the electricity consumption slope in the instantaneous power feature vector corresponding to the rollback time and the statistical feature of the historical electricity consumption slope exceeds a preset information interval, then the cumulative energy consumption indication of the non-monotonic rollback is determined to be dirty data and intercepted.
8. A flow-type electricity consumption settlement device, characterized in that, include: The data receiving module is used to receive meter data packets sent by the edge computing node. The data packets include cumulative energy consumption readings and instantaneous power feature vectors. The data packets are uploaded when the edge computing node detects a change in the statistical window boundary or load fingerprint pattern. The load fingerprint pattern is determined by the edge computing node based on the instantaneous power feature vector. The time zone alignment module is used to convert the timestamp of the cumulative energy consumption value into a logical local time according to the time zone of the electricity meter, and to determine the maximum tolerable out-of-order time based on the network latency fluctuation during the data packet upload process in order to construct a streaming water level line, and to use the streaming water level line to drive the streaming settlement of the statistical window. The fingerprint management module is used to generate a load fingerprint database of the electricity meter based on the instantaneous power feature vector using a clustering algorithm. The load fingerprint database includes multiple load fingerprint patterns and their corresponding reference values. The disconnection compensation module is used to extract the instantaneous power feature vector before and after the disconnection is detected after the meter is disconnected and restored. It combines the load fingerprint database to deduce the load fingerprint pattern sequence during the disconnection period and restores the electricity consumption increment generated during the disconnection period to the corresponding statistical windows during the disconnection period.
9. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program that, when executed by the processor, implements the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, It stores program instructions that, when executed, implement the method as described in any one of claims 1-7.