Green electricity precise metering method and system based on internet of things and power balance algorithm

CN122553101APending Publication Date: 2026-08-11BEIJING LONGZHIYI TECHNOLOGY DEVELOPMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-27
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0003]现有绿电计量方案存在诸多技术缺陷,主要体现在:1)计量口径失真,仅在可再生能源侧装表并以发电量作为绿电量口径,未考虑弃电、反送电、储能充电和线路损耗,高估实际消纳结果;2)无法处理储能时移,未建立储能绿电归属和出库规则,储能充放电过程中易出现绿电双算、漏算;3)时间颗粒度过粗,采用月度/日度人工对账,无法反映分钟级/十五分钟级功率变化,难以满足结算、审计的可核验性要求;4)结果可信度不足,缺乏多计量点联合校验和母线功率平衡残差校验机制,未对计量误差、通信异常、时钟漂移进行系统化处理;5)场景扩展性弱,单设备口径或人工规则难以适配多源、多荷、多储、多租户并存的复杂微电网

Benefits of technology

1.计量口径精准,贴合业务实际:摒弃“以发电量计绿电量”的传统方式,核算被负荷实际消纳的绿电量,排除弃电、反送电、储能充电和线路损耗的影响,计量结果更贴合碳核算、绿电交易、内部结算的业务价值需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122553101A_ABST
    Figure CN122553101A_ABST
Patent Text Reader

Abstract

This invention relates to the field of green electricity metering and accounting technology, and discloses a precise green electricity metering method based on the Internet of Things and power balance algorithms. The method includes: S1, collecting raw metering data and equipment operating status data from various metering points, including the microgrid common connection point, renewable energy source side, energy storage side, and load side; S2, uniformly synchronizing the data from each metering point through an IoT gateway, completing data cleaning, standardization conversion, and time slice boundary alignment; S3, based on the bus power balance principle, constructing a power balance equation within the time slice, solving for the power and electricity values ​​of electricity purchase, grid connection, energy storage charging and discharging, and load consumption, and performing network loss corrections for transformers and lines. This method overcomes the technical defects of existing green electricity metering methods and achieves precise metering of the green electricity actually consumed by the load in a source-grid-load-storage integrated scenario.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of green electricity metering and accounting technology, specifically to a method and system for accurate green electricity metering based on the Internet of Things and power balance algorithms. Background Technology

[0002] With the large-scale integration of distributed photovoltaic, decentralized wind power, energy storage systems, and flexible loads on the user side, industrial and commercial parks, data centers, factories, and other scenarios have formed a typical source-grid-load-storage collaborative operation structure. This structure involves complex energy flows such as local renewable energy generation, local load absorption, time-shifted energy storage charging and discharging, and bidirectional grid exchange. In actual operations, it is necessary to accurately measure the actual amount of green electricity absorbed by the load and to achieve reasonable allocation of green electricity among multiple loads, tenants, and regions, providing a reliable basis for carbon accounting, green electricity trading, and internal settlement.

[0003] Existing green electricity metering schemes have many technical defects, mainly reflected in the following aspects: 1) Inaccurate metering caliber: Meters are installed only on the renewable energy side and the power generation is used as the green electricity caliber, without considering power curtailment, reverse power transmission, energy storage charging, and line losses, thus overestimating the actual absorption results; 2) Inability to handle energy storage time shift: No rules for the attribution and release of green electricity from energy storage have been established, and double counting and omission of green electricity are prone to occur during the charging and discharging of energy storage; 3) Overly coarse time granularity: Monthly / daily manual reconciliation is used, which cannot reflect power changes at the minute / fifteen-minute level, making it difficult to meet the verifiability requirements of settlement and auditing; 4) Insufficient reliability of results: There is a lack of joint verification of multiple metering points and bus power balance residual verification mechanism, and no systematic processing of metering errors, communication anomalies, and clock drift; 5) Weak scenario scalability: Single device caliber or manual rules are difficult to adapt to complex microgrids with multiple sources, multiple loads, multiple storage, and multiple tenants.

[0004] Therefore, there is an urgent need for a green electricity metering method and system that can accurately measure the actual amount of green electricity consumed, adapt to the time shift of energy storage, and has high precision, high reliability and strong scalability, so as to solve the core problems of existing technologies. Summary of the Invention

[0005] To address the shortcomings of existing technologies, the present invention aims to provide a method and system for accurate green electricity metering based on the Internet of Things and power balance algorithms. This method and system overcome the technical defects of existing green electricity metering, realize the accurate metering of the actual green electricity consumed by the load in the integrated source-grid-load-storage scenario, and at the same time complete the reasonable allocation of green electricity among multiple loads, regions, and tenants, ensuring that the metering results are verifiable, traceable, and highly reliable, and adaptable to the application needs of various types of microgrid scenarios.

[0006] To achieve the above objectives, the present invention provides the following technical solution: A precise green electricity metering method based on the Internet of Things (IoT) and power balance algorithms includes: S1, collecting raw metering data and equipment operation status data from various metering points, including the microgrid's point of common connection, renewable energy source side, energy storage side, and load side; S2, uniformly synchronizing the data from each metering point through an IoT gateway, completing data cleaning, standardization conversion, and time slice boundary alignment; S3, based on the bus power balance principle, constructing a power balance equation within the time slice, solving for the power and energy values ​​of electricity purchase, grid connection, energy storage charging and discharging, and load consumption, and calculating the network losses of transformers and lines. Correction; S4, establish a green electricity attribution ledger for energy storage, record the share of green electricity entering energy storage in each time slot, and calculate the green electricity released by energy storage discharge through a preset attribution strategy; S5, combine the direct consumption of renewable energy and the transfer consumption of energy storage to calculate the overall green electricity consumption and consumption rate of the microgrid; S6, calculate the allocation of green electricity consumption completed by load, region, and tenant according to the preset allocation rules; S7, perform bus power balance residual verification, trigger alarms for abnormal data and locate suspected abnormal metering points, supplement missing data, and output green electricity metering and allocation results with data quality labels.

[0007] In this invention, preferably, in S1, the original metering data includes active power, cumulative power, charge and discharge power, and state of charge. Each metering point transmits data through Ethernet, wireless private network, serial bus or industrial bus.

[0008] In this invention, preferably, in S2, the target time slice for time slice boundary alignment is 1 minute, 5 minutes, 15 minutes, or 30 minutes; the time slice boundary alignment includes: data aggregation when the data sampling period is less than the target time slice, and data splitting or interpolation when the data sampling period is greater than the target time slice; the data cleaning includes identifying and marking out-of-limit values, reverse values, sudden jump values, and long-term invariant values, and assigning each data point a unique data quality label; in S3, the power balance equation is: local renewable energy injection power + external grid power purchase power + energy storage discharge equivalent injection power = load consumption power + energy storage charging absorption power + grid connection power + network loss correction power + balance residual power; the power value is calculated by converting the power value into a power value according to the time slice length; the network loss correction power includes transformer loss and line loss, the transformer loss is estimated based on no-load loss, load loss, and real-time load rate; the line loss is calculated using online estimation of branch impedance model, empirical coefficient correction, or hierarchical empirical coefficient method, and for scenarios with complete electrical parameters, the loss model is dynamically updated using online identification method.

[0009] In this invention, preferably, in S4, the preset attribution strategy includes one or more of the following: a time matching strategy, a first-in-first-out (FIFO) strategy, and a proportional allocation strategy. The time matching strategy prioritizes matching the energy storage discharge with the green electricity stored in the most recent time slots. The FIFO strategy releases green electricity in a first-in-first-out manner according to the share of green electricity entering the energy storage, forming a traceable green electricity inventory queue. The proportional allocation strategy determines the inventory green electricity share based on the proportion of green electricity charged into the energy storage, and calculates the released green electricity based on the proportion of green electricity in the inventory during discharge. The measurement rule for the energy storage green electricity attribution ledger is as follows: green electricity is not included in the load consumption when it enters the energy storage; it is only included in the actual green electricity consumption when it is directly used by the load or reaches the load side after being released from the energy storage.

[0010] In this invention, preferably, in S5, the direct consumption of renewable energy is the amount of green electricity that matches the supply of renewable energy with the load demand within a time slice, the energy storage transfer consumption is the amount of green electricity released by energy storage discharge, and the overall green electricity consumption of the microgrid is the sum of the direct consumption and the transfer consumption.

[0011] In this invention, preferably, in S6, the preset allocation rules include: allocation according to the proportion of actual electricity consumption of each load object in the same time slice, allocation according to the priority of key loads, allocation according to the tenant's contractually agreed proportion and the real-time electricity consumption proportion, or allocation according to the dimensions of region, building, production line, and equipment group; the allocation calculation results include total green electricity, green electricity proportion, green electricity curve of time period, tenant green electricity certificate and carbon accounting interface data.

[0012] In this invention, preferably, in S7, the bus power balance residual verification involves calculating the absolute value and residual rate of the bus power balance residual for each time slice, and triggering a data quality alarm when the residual exceeds a preset threshold; the location of suspected abnormal metering points refers to sorting suspected abnormal metering points according to residual contribution, metering point communication status, equipment operating status, and historical confidence level, and determining abnormal metering points based on the sorting results; the supplementary calculation of missing data adopts the methods of interpolation of adjacent time periods, curve fitting of similar equipment, backpropagation of rated parameters, or joint inversion of multiple tables.

[0013] In this invention, preferably, S7 further includes: when a metering point experiences a communication failure and disconnection, retaining the abnormality marker and storing the recalculation results and the original results in a hierarchical manner; when the real data is obtained after re-transmission, automatically writing back and correcting the historical recalculation results, and updating the green electricity consumption and allocation report.

[0014] A green electricity precision metering system based on the Internet of Things (IoT) and power balance algorithms includes: a data acquisition module for collecting raw metering data and equipment operating status data from various metering points, including the microgrid's point of common connection (PCC), renewable energy source side, energy storage side, and load side; a preprocessing module for uniformly synchronizing the data from each metering point via an IoT gateway, completing data cleaning, standardization conversion, and time slice boundary alignment; a calculation module for constructing power balance equations within the time slice based on the bus power balance principle, solving for the power and energy values ​​of electricity purchase, grid connection, energy storage charging and discharging, and load consumption, and correcting for network losses in transformers and lines; and an energy storage module. The recording module is used to establish a green electricity ownership ledger for energy storage, record the share of green electricity entering energy storage in each time slot, and calculate the green electricity released by energy storage discharge through a preset ownership strategy. The consumption recording module is used to calculate the overall green electricity consumption and consumption rate of the microgrid by combining the direct consumption of renewable energy and the consumption transferred from energy storage. The allocation calculation module is used to calculate the allocation of green electricity consumption completed by load, region, and tenant according to preset allocation rules. The verification and output module is used to perform bus power balance residual verification, trigger alarms for abnormal data and locate suspected abnormal metering points, supplement missing data, and output green electricity metering and allocation results with data quality labels.

[0015] In this invention, preferably, in the acquisition module: the original metering data includes active power, cumulative electricity, charge / discharge power, and state of charge; each metering point transmits data via Ethernet, wireless private network, serial bus, or industrial bus; in the preprocessing module: the target time slice for time slice boundary alignment is 1 minute, 5 minutes, 15 minutes, or 30 minutes; the time slice boundary alignment includes: data aggregation when the data sampling period is less than the target time slice, and data splitting or interpolation when the data sampling period is greater than the target time slice; the data cleaning includes identifying and marking out-of-limit values, reverse values, sudden jump values, and long-term invariant values, assigning each data point a unique data quality label; in the calculation module: the power balance equation is: local renewable energy Source injection power + external grid power purchase power + energy storage discharge equivalent injection power = load consumption power + energy storage charging absorption power + grid connection power + network loss correction power + balance residual power; the energy value is calculated by converting the power value into an energy value according to the time slice length; the network loss correction power includes transformer loss and line loss, the transformer loss is estimated based on no-load loss, load loss and real-time load rate; the line loss is estimated online using the branch impedance model, empirical coefficient correction or hierarchical empirical coefficient method, and for scenarios with complete electrical parameters, the loss model is dynamically updated using online identification method; in the energy storage recording module: the preset attribution strategy includes one or two of the following: time matching strategy, first-in-first-out strategy, and proportional allocation strategy. The above combination; the time matching strategy is to prioritize matching the energy storage discharge with the green electricity stored in the most recent time slices; the first-in-first-out strategy is to release according to the green electricity share entering the energy storage in a first-in-first-out manner, forming a traceable green electricity inventory queue; the proportional allocation strategy is to determine the inventory green electricity share according to the proportion of green electricity charged into the energy storage, and calculate the released green electricity according to the proportion of inventory green electricity during discharge; the measurement rule of the energy storage green electricity ownership ledger is: green electricity is not included in the load consumption when it enters the energy storage, and is only included in the actual green electricity consumption when the green electricity is directly used by the load or reaches the load side after being released by the energy storage; in the consumption record module: the direct consumption of renewable energy is the green electricity volume that matches the renewable energy supply and load demand within the time slice, The energy storage transfer and absorption amount refers to the amount of green electricity released by energy storage discharge. The overall green electricity absorption amount of the microgrid is the sum of direct absorption and transfer absorption. In the allocation calculation module: the preset allocation rules include: allocation according to the actual electricity consumption ratio of each load object in the same time slice, allocation according to the priority of key loads, allocation according to the tenant contractual ratio and the real-time electricity consumption ratio, or allocation according to the dimensions of region, building, production line, and equipment group. The allocation calculation results include total green electricity, green electricity ratio, green electricity curve of time period, tenant green electricity certificate and carbon accounting interface data. In the verification and output module: the bus power balance residual verification is to calculate the absolute value and residual rate of the bus power balance residual of each time slice. When the residual exceeds the preset threshold, a data quality alarm is triggered.The process of locating suspected abnormal metering points involves sorting suspected abnormal metering points based on residual contribution, metering point communication status, equipment operating status, and historical confidence levels, and then determining the abnormal metering points based on the sorting results. The process of supplementing missing data employs methods such as interpolation of adjacent time periods, curve fitting of similar equipment, backtesting of rated parameters, or joint inversion of multiple tables. The output of the verification and output module includes the overall green energy consumption of the microgrid, the green energy consumption rate for each time period, the load / region / tenant green energy allocation results, data quality alarm logs, supplementary calculation records, and standardized reports and interface data applicable to carbon accounting, green energy trading, and internal settlement. The verification and output module is also used to: retain the abnormality marker and store the supplementary calculation results and original results hierarchically when a metering point experiences a communication failure; and automatically write back and correct historical supplementary calculation results and update the green energy consumption and allocation reports after obtaining the real data that has been supplemented.

[0016] Compared with the prior art, the beneficial effects of the present invention are: 1. Precise metering caliber, aligned with actual business needs: Abandoning the traditional method of "measuring green electricity based on power generation", the metering calculates the actual green electricity consumed by the load, eliminating the impact of power curtailment, reverse power transmission, energy storage charging, and line losses. The metering results are more aligned with the business value needs of carbon accounting, green electricity trading, and internal settlement.

[0017] 2. Solve the problem of time-shifted metering of energy storage: Establish a green electricity ownership ledger for energy storage and design multiple ownership strategies to achieve full-process tracking of the green electricity share during the charging and discharging of energy storage, clarify the rules for green electricity consumption, and completely avoid the problems of double calculation and omission of green electricity under the participation of energy storage.

[0018] 3. High time precision, adaptable to timing requirements: Supports fine-grained time slice calculations such as 1 minute, 5 minutes, and 15 minutes, accurately reflecting the impact of energy storage time shift, back-to-grid transmission, and short-term power fluctuations. This is far superior to the precision of traditional monthly / daily manual reconciliation and meets the verifiability requirements of settlement, auditing, and service agreement disclosure.

[0019] 4. Highly reliable, verifiable and traceable results: Real-time alarm and location of metering anomalies are achieved through bus power balance residual verification, multi-metering point joint alignment, and data quality label management; missing data and communication anomaly data are standardized, the recalculation results are traceable, and real data can be written back for correction, ensuring the accuracy and reliability of metering results.

[0020] 5. Strong scalability and adaptability to complex microgrids: It supports complex microgrid scenarios with multiple sources, multiple loads, multiple storage, multiple bus levels and multiple tenants. The allocation rules and attribution strategies can be flexibly configured according to business needs. The system can be deployed in various ways, and it is suitable for both new projects and the renovation of existing parks. It has good productization and engineering capabilities.

[0021] 6. Multi-business scenario adaptation, empowering energy and carbon management: Metering results can be directly used for carbon emission accounting, carbon footprint accounting, green manufacturing / industrial park evaluation, supporting green electricity trading, green certificate collaboration, virtual power plants, integrated energy services and other businesses. It can be connected to energy and carbon platforms, billing and settlement platforms and operation and maintenance platforms to achieve integrated connection between green electricity metering and energy and carbon management. Attached Figure Description

[0022] Figure 1 This is a flowchart of the green electricity precise metering method based on the Internet of Things and power balance algorithm of the present invention.

[0023] Figure 2 This is a schematic diagram of the bus balance principle in the green electricity precision metering method based on the Internet of Things and power balance algorithm of this invention.

[0024] Figure 3 This is a flowchart illustrating the data quality verification and supplementary calculation in the green electricity precision metering method based on the Internet of Things and power balance algorithm of this invention.

[0025] Figure 4 This is a flowchart illustrating the logical flow of the green electricity precise metering method based on the Internet of Things and power balance algorithm of this invention.

[0026] Figure 5 This is a schematic diagram of the green electricity precision metering system based on the Internet of Things and power balance algorithm of the present invention.

[0027] In the attached diagram: 1. Acquisition module; 2. Preprocessing module; 3. Calculation module; 4. Energy storage recording module; 5. Consumption recording module; 6. Allocation calculation module; 7. Verification and output module. Detailed Implementation

[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the specification of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0030] Please see Figure 1 A preferred embodiment of the present invention provides a method for accurate green electricity metering based on the Internet of Things and power balance algorithms, comprising: S1 collects raw metering data and equipment operation status data from various metering points, including the microgrid common connection point, renewable energy power source side, energy storage side, and load side.

[0031] The core of this step is to achieve full-dimensional, real-time, and accurate data collection from all nodes of the microgrid, providing a complete data foundation for subsequent metering.

[0032] Metering Point Layout: Based on the microgrid topology and business needs, metering points are deployed across all dimensions—the point of common connection, the renewable energy source side, the energy storage side, and the load side—covering the entire process of power generation, grid, load, and storage. Specifically, bidirectional metering units are deployed at the point of common connection to measure the bidirectional power / electricity exchanged with the external grid; generation metering units are deployed at the photovoltaic inverter outlet and wind power grid connection point to collect renewable energy output data; bidirectional metering units are deployed on the AC side and / or battery side of the energy storage converter to collect energy storage charging and discharging data; and metering units are deployed on the load side at a hierarchical level of zone-tenant-production line-key equipment to achieve refined collection of load data.

[0033] Data types collected: The collected data includes raw metering data and equipment operating status data. Raw metering data is the core, including active power, reactive power, cumulative forward / reverse power, charge / discharge power, state of charge (SOC), voltage, current and other electrical parameters. Equipment operating status data includes equipment start / stop status, fault alarm information, operating mode parameters, communication status, etc., which are used to help determine the validity of the data.

[0034] Data transmission and aggregation: Each metering point selects an appropriate communication method based on the deployment scenario (indoor / outdoor, wired / wireless), including Ethernet, industrial bus, serial bus, private wireless network, 4G / 5G, etc. The transmission frequency matches the sampling period of the metering point (1s~15min) to ensure the real-time performance of the data. All data from the metering points are aggregated to the IoT gateway to achieve unified reception and initial caching of multi-source data. The caching time is no less than 7 days to prevent data loss.

[0035] S2 uses an IoT gateway to perform unified time synchronization on the data from each metering point, completing data cleaning, standardization conversion, and time slice boundary alignment.

[0036] The core of this step is to solve the problems of clock asynchrony, protocol inconsistency, data anomalies, and timing misalignment at multiple metering points, so as to provide a standardized, high-quality dataset for subsequent power balance calculations.

[0037] Unified clock synchronization: The IoT gateway has a built-in GPS / BeiDou dual-mode time synchronization module or supports NTP network time synchronization, providing a unified clock reference for all connected metering points with a time synchronization accuracy of ≤1ms, completely eliminating time deviations caused by local clock drift of each metering terminal, and ensuring the consistency of timestamps for all data.

[0038] Anomaly identification and labeling (data cleaning): Anomaly identification is performed through a multi-algorithm fusion approach, including threshold judgment (identifying out-of-limit values ​​and reverse values), trend analysis (identifying values ​​that remain unchanged for a long time), and mutation detection (identifying sudden jump values). The identified anomaly data is labeled in real time, and each data point is assigned a unique data quality label. The labels are divided into four categories: original and valid (original collected data without anomalies), interpolation and supplementation (missing data supplemented by interpolation), curve fitting and supplementation (missing data for curve fitting), and anomaly label (anomaly data that cannot be used). The data quality label follows the data flow throughout the process.

[0039] Protocol standardization conversion: To address the issue of inconsistent communication protocols among metering units from different manufacturers and models, the IoT gateway has a built-in multi-protocol parsing library that supports mainstream power communication protocols such as Modbus-RTU, Modbus-TCP, DL / T645, and IEC104. It converts all metering point data into a pre-defined standardized data structure in the format of "timestamp-metering point number-data type-data value-device status-original protocol", enabling unified data parsing and storage.

[0040] Precise alignment of time slice boundaries: Based on business needs, target time slices are preset (1 minute, 5 minutes, 15 minutes, 30 minutes, or 1 hour, with 15 minutes being preferred). The raw data of all metering points are mapped to the same time slice boundary to achieve time sequence alignment. Alignment processing employs a differentiated strategy: When the data sampling period is shorter than the target time slice, data aggregation is performed using a time-weighted method to ensure the accuracy of the aggregated power consumption; when the data sampling period is longer than the target time slice, data is split or linearly interpolated according to the power change trend to restore fine-grained power change characteristics.

[0041] S3, based on the principle of bus power balance, constructs the power balance equation within the time slice, solves for the power and energy values ​​of power purchase, grid connection, energy storage charging and discharging, and load power consumption, and performs network loss correction for transformers and lines.

[0042] This step is the core calculation process for green electricity metering, based on the principle of bus power balance, which is as follows: Figure 2 As shown, an energy flow solution model is constructed, and the network loss is accurately corrected to achieve quantitative solution of each energy flow.

[0043] Constructing the bus power balance equation: Treating the microgrid as an energy flow network that satisfies energy conservation, and using a preset time slice t as the calculation period, constructing the bus power balance equation within each time slice to quantitatively describe the interrelationships of various energy flows from a power perspective: Local renewable energy injection power + external grid power purchase power + energy storage discharge equivalent injection power = load consumption power + energy storage charging absorption power + grid connection power + network loss correction power + balance residual power; Among them, the balance residual power is the difference between the two sides of the equation, which is mainly caused by factors such as measurement error and data acquisition deviation. It is the core indicator for subsequent data quality verification.

[0044] Power-Energy Conversion: To meet the energy calculation requirements of green electricity metering, each power value is converted into an energy value according to the time slice length. The actual electricity consumption / generation is calculated using the integration method, that is, the power change curve within the time slice is integrated to avoid the error caused by traditional linear conversion and improve the accuracy of energy calculation.

[0045] Precise Network Loss Correction: Network loss (transformer loss + line loss) is a significant factor affecting the accuracy of green electricity metering. This invention adapts three loss calculation methods to different scenarios to achieve precise loss correction. For scenarios with complete electrical parameters (impedance, resistance, reactance), the branch impedance model is used in conjunction with real-time current to accurately estimate line losses online. Transformer losses are estimated using a dual model of "no-load loss + load loss" (no-load loss is constant, and load loss is proportional to the square of the real-time load rate). For small and medium-sized industrial park scenarios with incomplete parameters, a hierarchical empirical coefficient method is adopted, which sets different loss coefficients according to the power distribution level and dynamically corrects the coefficients monthly based on historical operating data to improve the accuracy of loss estimation. For large-scale campus / data center scenarios with a large amount of historical operating data, a loss estimation model based on machine learning is adopted. With current, voltage, and load rate as input features, the model is trained through historical data to achieve online dynamic estimation and updating of losses.

[0046] Output energy flow intermediate quantities: After solving the power balance equation and completing the loss correction, multi-dimensional energy flow intermediate quantities are output according to time slices and stored in a structured manner using a time-series database. The intermediate quantities include the total output of renewable energy, the output of photovoltaic / wind power, the electricity purchased / supplied to the grid, the charging / discharging of energy storage, the electricity consumption of each zone / tenant / equipment load, the loss correction electricity and the balance residual electricity. All intermediate quantities are accompanied by data quality labels to provide a basis for subsequent green electricity consumption calculation and data quality verification.

[0047] S4. Establish a green electricity ownership ledger for energy storage, record the share of green electricity entering energy storage in each time slot, and calculate the amount of green electricity released by energy storage discharge through a preset ownership strategy.

[0048] This step establishes a full-process ledger and multi-strategy attribution rules to achieve accurate tracking of green electricity during the energy storage charging and discharging process, completely avoiding double calculation and omission issues.

[0049] Establish a green energy storage ownership ledger: Create an independent green energy storage ownership ledger for each energy storage unit, stored in a relational database. The ledger fields include time slice number, energy storage unit number, total charging capacity, green energy charging capacity, green energy percentage, total green energy in stock, total stock capacity, total discharge capacity, green energy released capacity, remaining stock capacity, remaining total stock capacity, and ownership strategy type, enabling full-process recording and traceability of green energy from charging and stocking to release.

[0050] Determine the green electricity share: In each time slice, based on the energy storage charging amount obtained from the power balance equation, and combined with the green electricity share (renewable energy output / total power supply) of that time period, calculate the green electricity amount and green electricity share charged into the energy storage, and update the charging data and inventory data in the ledger in real time; if the energy storage charging amount comes from multiple power sources, calculate the green electricity and non-green electricity shares according to the power supply ratio of each power source.

[0051] Configure multi-strategy green energy release rules: Based on different business scenario requirements, configure flexible green energy allocation strategies for energy storage units. Each strategy takes effect independently or can be used in combination. Core strategies include: Time matching strategy: Prioritize the matching of energy storage discharge with the green electricity stored in the most recent 1 to 10 time slices for precise matching. This is suitable for carbon emission accounting scenarios that emphasize the relationship between green electricity consumption in the near term. First-in, first-out (FIFO) strategy: Green electricity is released sequentially according to the time it enters the energy storage system, forming a traceable green electricity inventory queue. This strategy is suitable for green electricity trading and green certificate collaboration scenarios that require full-process traceability of green electricity. Proportional allocation strategy: The share of newly added green electricity in the storage is determined based on the real-time green electricity ratio of the electricity charged into the storage. When discharging, the amount of green electricity released is calculated based on the current total green electricity ratio in the storage. This strategy is suitable for integrated energy service scenarios with multiple power sources and multiple tenants sharing energy storage.

[0052] Clear rules for green electricity consumption: To completely avoid double counting and omission of green electricity, this invention establishes strict rules for green electricity consumption: When green electricity enters energy storage, it is only included in the inventory data of the energy storage green electricity ownership ledger and is not included in the load green electricity consumption; only when green electricity is directly used by the load, or when it actually reaches the load side and is consumed by the load after being released by energy storage, is this part of the green electricity included in the actual green electricity consumption, ensuring that the same green electricity is only counted once.

[0053] S5, combining the direct consumption of renewable energy and the energy storage transfer consumption, calculates the overall green electricity consumption and consumption rate of the microgrid.

[0054] The core of this step is to distinguish between direct consumption and transferred consumption, to achieve accurate calculation of the overall green electricity consumption of the microgrid, and to support green electricity consumption rate analysis for multiple statistical periods.

[0055] Calculate the direct consumption of renewable energy: The direct consumption is the amount of green electricity consumed by the load in real time within a time slice after deducting the amount of electricity fed back to the grid and the losses of the line / transformer. It is solved directly through the power balance equation and reflects the green electricity consumption characteristics of "synchronous generation and consumption" of renewable energy.

[0056] Calculate the energy storage transfer and absorption volume: The transfer and absorption volume is the amount of green electricity released by energy storage after deducting line / transformer losses, which is then consumed by the load. It is calculated through the released green electricity volume in the energy storage green electricity ownership ledger, reflecting the green electricity absorption characteristics of renewable energy after "spatiotemporal transfer" through energy storage, and is an important supplement to the direct absorption volume.

[0057] Calculating the overall green energy consumption: The overall green energy consumption of a microgrid is the sum of direct consumption and transferred consumption, reflecting the total amount of green energy actually consumed by the microgrid within a certain time slice. The calculation formula is as follows: Total green electricity consumption = Direct consumption of renewable energy + Consumption of energy storage transferred to other systems; Calculate green energy consumption rate over multiple periods: To adapt to the statistical needs of different businesses, it supports calculating green energy consumption rate at the minute, hour, day, month, and year levels. The consumption rate reflects the proportion of green energy in total electricity consumption and is a core indicator for green park / manufacturing evaluation and carbon accounting. The calculation formula is as follows: Green electricity consumption rate = (Actual amount of green electricity consumed during the statistical period / Total electricity consumption during the statistical period) × 100%; All calculation results are stored in a structured manner according to the statistical period, with accompanying data quality labels and calculation basis, enabling traceability.

[0058] S6 calculates the allocation of green electricity consumption for loads, regions, and tenants according to preset allocation rules.

[0059] The core of this step is to achieve a refined and rational allocation of green energy consumption among multiple objects such as load, region, tenant, production line, and key equipment based on different business needs, so as to provide a basis for internal settlement, tenant green energy certification, and equipment carbon accounting.

[0060] Flexible allocation rules: This invention provides multi-dimensional, combinable allocation rules that can be selected individually or combined according to business needs, covering allocation requirements in different scenarios. Allocation based on actual electricity consumption percentage: Green electricity is allocated based on the proportion of actual electricity consumption of each entity within the same time slot. This is applicable to scenarios where tenants settle accounts fairly and is the most basic allocation rule. Tiered allocation based on critical load priority: Loads are divided into first-level, second-level, and third-level loads according to their importance. All green electricity is first allocated to the first-level loads, and the remaining green electricity is then allocated to the second-level and third-level loads proportionally. This is suitable for scenarios such as hospitals and data centers that have special requirements for critical loads. Green electricity is allocated based on a combination of contractual agreement and real-time electricity consumption: Green electricity is allocated by combining the tenant's contractually agreed proportion (30%~70%) and the real-time electricity consumption proportion (70%~30%). The proportion can be flexibly adjusted and is suitable for scenarios with long-term tenant contracts, such as commercial complexes and industrial parks. Allocation by level / dimension: Green electricity is allocated independently by region, building, production line, equipment group, etc., which is suitable for factory scenarios that require carbon accounting and green manufacturing evaluation by dimension.

[0061] Hierarchical allocation calculation: Green electricity allocation adopts a hierarchical calculation method, following the principle of "total green electricity of the upper level - losses = sum of green electricity of each object in the lower level". Starting from the total green electricity of the park, the allocation is carried out hierarchically to the zones, tenants, production lines, and key equipment. The line / transformer losses of the level are deducted for each level of allocation to ensure the accuracy and rationality of the allocation results.

[0062] Generate multiple forms of allocation results: After the allocation calculation is completed, multiple forms of allocation results are generated, including the total green electricity, green electricity ratio, green electricity consumption curves by time segment, and cumulative green electricity consumption for each object. At the same time, standardized tenant green electricity vouchers, regional green electricity reports, equipment green electricity accounting data, and standardized interface data that can be directly connected to the carbon accounting platform are generated to meet the output needs of different businesses.

[0063] S7 performs bus power balance residual verification, triggers alarms for abnormal data and locates suspected abnormal metering points, performs supplementary calculations for missing data, and outputs green electricity metering and allocation results with data quality labels.

[0064] This step is crucial for ensuring the high reliability, verifiability, and traceability of measurement results. Through quantitative residual verification, tiered anomaly alerts, multi-method missing data recalculation, and closed-loop correction of historical results, it achieves comprehensive data quality control and outputs final measurement results with data quality labels. The logical flow of data quality verification and recalculation is as follows: Figure 3 As shown.

[0065] Bus power balance residual quantitative verification: Using the balance residual power calculated in S3 as the core indicator, calculate the absolute value of the residual and the residual rate for each time slice (residual rate = balance residual power / total injected power in time slice × 100%). A preset residual rate threshold (3%~10%, which can be flexibly adjusted according to the metering accuracy requirements) is set. When the absolute value of the residual or the residual rate exceeds the threshold, a data quality alarm is immediately triggered. The alarm information includes the time slice number, residual value, residual rate, and the metering points involved.

[0066] Multi-dimensional weighted anomaly localization: For the time slice that triggers the alarm, a multi-dimensional weighted analysis method is used to locate suspected abnormal metering points. Four dimensions are selected: residual contribution ratio (the contribution of each metering point's data deviation to the residual), metering point communication online rate, equipment operation failure rate, and historical data confidence level. Weight coefficients are set for each dimension, and the anomaly risk value of each metering point is calculated. The top 3 metering points with the highest risk values ​​are marked as high-risk anomalies. The alarm information and anomaly localization results are pushed to the operation and maintenance terminal in real time to guide on-site operation and maintenance.

[0067] Multi-method fusion for missing data restoration: To address data loss caused by communication anomalies, equipment malfunctions, etc., a multi-method fusion restoration strategy is employed. The appropriate restoration method is selected based on the duration of the data loss to ensure accuracy. All restoration results are labeled with the restoration method and included in the data quality tag, and stored separately from the original valid data. Short-term missing data (≤3 time slices): The nearest time slice interpolation method is used. Linear interpolation is performed on the same type of data from 3 normal time slices before and after the missing time slice. This method is suitable for scenarios with small data fluctuations. Mid-term missing data (4-10 time slices): Using the curve fitting method of similar equipment, data of equipment of the same type and operating mode in the park are selected, and missing data are restored by curve fitting. This method is suitable for scenarios with similar reference equipment. Long-term missing data (>10 time slices): The rated parameter back-draft method or the multi-table joint inversion method is used to back-draft data based on the rated parameters and operating status of the equipment, or to jointly invert the missing data through data from other relevant metering points. This method is suitable for scenarios where there is no direct reference.

[0068] Historical result closed-loop correction: When a metering point experiences a communication failure and disconnection, the system retains the failure flag, disconnection start time, and disconnection duration in real time. The recalculated results and the original valid data are stored in different database tables to ensure data traceability. When the real data transmitted by the metering point is subsequently obtained, the system automatically triggers the historical result closed-loop correction process, recalculates the power balance equation, green electricity consumption, and allocation results for that time slice, and synchronously updates all relevant reports, curves, and interface data. The correction record is retained throughout the process to achieve dynamic accuracy of metering results.

[0069] Tag-tagged final output: After completing all verifications and corrections, the final green electricity metering and allocation results with data quality tags are output. The results include the overall green electricity consumption of the microgrid, the green electricity consumption curves by time slice, the green electricity consumption rate of multiple statistical periods, the green electricity allocation results of each object, data quality alarm logs, supplementary calculation records and correction records. All results can be visualized, standardized reports can be generated, and multi-platform interfaces can be connected.

[0070] The logical flow of the green electricity precision metering method based on IoT and power balance algorithm of this invention is as follows: Figure 4 As shown.

[0071] like Figure 5 As shown, the present invention also provides a green electricity precision metering system based on the Internet of Things and power balance algorithms, comprising: The data acquisition module 1 is used to collect raw metering data and equipment operation status data from various metering points, including the microgrid common connection point, renewable energy power source side, energy storage side and load side. Preprocessing module 2 is used to uniformly synchronize the data of each metering point through the IoT gateway, and complete data cleaning, standardization conversion and time slice boundary alignment processing; The calculation module 3 is used to construct the power balance equation within the time slice based on the bus power balance principle, solve for the power and energy values ​​of power purchase, grid connection, energy storage charging and discharging, and load power consumption, and perform network loss correction for transformers and lines. Energy storage recording module 4 is used to establish a green electricity ownership ledger for energy storage, record the share of green electricity entering the energy storage in each time slot, and calculate the amount of green electricity released by the energy storage discharge through a preset ownership strategy. The absorption recording module 5 is used to calculate the overall green electricity absorption and absorption rate of the microgrid by combining the direct absorption of renewable energy and the absorption of energy storage transfer. The allocation calculation module 6 is used to calculate the allocation of green energy consumption for load, region, and tenant according to preset allocation rules; The verification and output module 7 is used to perform bus power balance residual verification, trigger alarms for abnormal data and locate suspected abnormal metering points, supplement missing data, and output green electricity metering and allocation results with data quality labels.

[0072] In acquisition module 1: the raw metering data includes active power, cumulative power, charge and discharge power, and state of charge. Data transmission between each metering point is achieved through Ethernet, wireless private network, serial bus or industrial bus.

[0073] In preprocessing module 2: the target time slice for time slice boundary alignment is 1 minute, 5 minutes, 15 minutes or 30 minutes; time slice boundary alignment includes: data aggregation when the data sampling period is less than the target time slice, and data splitting or interpolation when the data sampling period is greater than the target time slice; data cleaning includes identifying and marking out-of-limit values, reverse values, abrupt jump values ​​and long-term invariant values, and assigning each data point a unique data quality label.

[0074] In solution module 3: the power balance equation is: local renewable energy injection power + external grid power purchase power + energy storage discharge equivalent injection power = load consumption power + energy storage charging absorption power + grid connection power + network loss correction power + balance residual power; the power value is calculated by converting the power value into a power value according to the time slice length; the network loss correction power includes transformer loss and line loss. The transformer loss is estimated based on no-load loss, load loss and real-time load rate; the line loss is estimated online using the branch impedance model, corrected by empirical coefficients or calculated using the hierarchical empirical coefficient method. For scenarios with complete electrical parameters, the loss model is dynamically updated using the online identification method.

[0075] In the energy storage recording module 4: the preset attribution strategies include one or more combinations of time matching strategy, first-in-first-out strategy, and proportional allocation strategy; the time matching strategy prioritizes matching the energy storage discharge with the green electricity stored in the most recent time slots; the first-in-first-out strategy releases green electricity according to the share of green electricity entering the energy storage, forming a traceable green electricity inventory queue; the proportional allocation strategy determines the inventory green electricity share according to the proportion of green electricity charged into the energy storage, and calculates the released green electricity based on the proportion of inventory green electricity during discharge; the measurement rules for the energy storage green electricity attribution ledger are as follows: green electricity is not included in the load consumption when it enters the energy storage, and is only included in the actual green electricity consumption when it is directly used by the load or reaches the load side after being released by the energy storage.

[0076] In the consumption record module 5: the direct consumption of renewable energy is the amount of green electricity that matches the supply of renewable energy with the load demand within the time slice; the energy storage transfer consumption is the amount of green electricity released by energy storage discharge; and the overall green electricity consumption of the microgrid is the sum of the direct consumption and the transfer consumption.

[0077] In the allocation calculation module 6, the preset allocation rules include: allocation based on the actual electricity consumption ratio of each load object within the same time slice, allocation based on the priority of key loads, allocation based on a combination of the tenant's contractually agreed ratio and the real-time electricity consumption ratio, or allocation based on the dimensions of region, building, production line, and equipment group. The allocation calculation results include total green electricity, green electricity ratio, green electricity curve for the time period, tenant green electricity certificates, and carbon accounting interface data.

[0078] In the verification and output module 7: bus power balance residual verification calculates the absolute value and residual rate of the bus power balance residual for each time slice. When the residual exceeds the preset threshold, a data quality alarm is triggered; locating suspected abnormal metering points refers to sorting suspected abnormal metering points according to residual contribution, metering point communication status, equipment operating status, and historical confidence level, and determining abnormal metering points based on the sorting results; and supplementing missing data uses interpolation of adjacent time periods, curve fitting of similar equipment, backpropagation of rated parameters, or joint inversion of multiple tables.

[0079] The output of the verification and output module 7 includes the total green electricity consumption of the microgrid, the green electricity consumption rate of the time period, the green electricity allocation results of load / region / tenant, data quality alarm logs, supplementary calculation records, and standardized reports and interface data applicable to carbon accounting, green electricity trading, and internal settlement.

[0080] The verification and output module 7 is also used to: retain the abnormality mark and store the supplementary calculation results and the original results in a hierarchical manner when the metering point experiences a communication failure; and automatically write back and correct the historical supplementary calculation results and update the green electricity consumption and allocation report after obtaining the real data that has been supplemented.

[0081] Example 1

[0082] This embodiment takes the integrated microgrid scenario of industrial and commercial park as an example. The industrial and commercial park microgrid includes distributed photovoltaic, distributed wind power, energy storage system, total load of the park, load of 3 tenants, and 2 distribution branches. The common connection point realizes bidirectional power exchange with the external power grid. The target time slice is set to 15 minutes. The green electricity accurate metering method and system of the present invention are described in detail.

[0083] (1) Data collection from multiple measurement points Two-way metering units are deployed at the public connection points of the park to measure the two-way power / electricity exchange with the external power grid; power generation metering units are deployed at the photovoltaic inverter outlet and wind power grid connection point to collect active power, cumulative power generation, and equipment operating status; two-way metering units are deployed on the AC side of the energy storage converter to collect charging / discharging power, state of charge, and charging / discharging efficiency; load metering units are deployed at the total load of the park, the load of 3 tenants, and 2 distribution branches to collect active power and cumulative electricity consumption; all metering units are connected to the IoT gateway through the industrial bus to collect raw metering data in real time, with a sampling period of 5 minutes.

[0084] (2) Data synchronization and preprocessing The IoT gateway connects to the park's unified clock source (GPS time synchronization) to synchronize the clocks of all metering points, eliminating time deviations caused by local clock drift; it also standardizes and converts the protocols of metering units from different manufacturers (unifying them to the Modbus-RTU protocol), mapping the raw data into a preset data structure of "timestamp-power-energy-status-quality tag".

[0085] Identify abnormal data: such as a sudden jump in photovoltaic power generation to 0 without any equipment fault signal, mark it as "sudden jump anomaly"; a reverse value in load power consumption, mark it as "reverse anomaly"; assign corresponding data quality labels to all abnormal data.

[0086] The raw data from the 5-minute sampling period is aggregated to the 15-minute time slice boundary to complete the time slice alignment, resulting in a standardized dataset with a 15-minute granularity.

[0087] (3) Bus power balance calculation and loss correction Using 15 minutes as time slice t, construct the power balance equation for the park's busbars: Photovoltaic power injection + wind power injection + grid-purchased power + energy storage discharge power = total load power of the park + energy storage charging power + grid-connected power + network loss correction power + balance residual power Multiply each power value by 15 minutes (0.25h) to convert it into electricity consumption.

[0088] Network loss correction: Transformer losses are estimated based on the transformer nameplate parameters (no-load loss 0.5kW, load loss 2.0kW) and real-time load rate (80%), resulting in a transformer loss power of 0.5 + 2.0 × 0.8. 2 =1.78kW; the line loss was estimated online using a branch impedance model (R=0.5Ω, I=200A), yielding the line loss power I. 2 R=20kW; the total network loss correction power is 21.78kW, which is equivalent to 5.445kWh of electricity.

[0089] Solving the equations yields intermediate quantities of each energy flow: for example, at a certain time point, the photovoltaic power output is 100 kWh, the wind power output is 50 kWh, the grid-purchased power is 30 kWh, the energy storage discharge is 20 kWh, the total load of the park is 180 kWh, the energy storage charging power is 0 kWh, the grid-connected power is 5 kWh, and the balance residual power is 4.555 kWh. All intermediate quantities are stored in real time.

[0090] (4) Tracking the ownership of energy storage green electricity Establish a green energy storage ledger for the park, with fields including "time slice - charging volume - green energy percentage - green energy inventory - discharging volume - released green energy - remaining green energy inventory".

[0091] This embodiment adopts a first-in-first-out (FIFO) strategy as the green electricity ownership strategy for energy storage: for example, in time slice T1, 80kWh of energy storage is charged, of which 60kWh is green electricity (green electricity accounts for 75%), and the ledger records 60kWh of green electricity in stock; in time slice T5, 50kWh of energy storage is discharged, and 50kWh of green electricity is released according to the FIFO rule, and the ledger updates the remaining green electricity in stock to 10kWh.

[0092] Strictly adhere to the metering rules: When green electricity is charged into energy storage during time slot T1, it is not included in the load consumption; when green electricity is released from energy storage and used by the park's load during time slot T5, it is included in the actual green electricity consumption to avoid double counting.

[0093] (5) Calculation of green electricity consumption Distinguishing between direct consumption and transferred consumption: Within a certain statistical period, the amount of green electricity directly used by the park's load from photovoltaic / wind power is 2000 kWh (direct consumption); the amount of green electricity released from energy storage and used by the load is 500 kWh (transferred consumption).

[0094] Calculate the total green electricity consumption: 2000 + 500 = 2500 kWh.

[0095] Calculate the green electricity consumption rate: Green electricity consumption / Total electricity consumption in the park × 100% = 2500 / 10000 × 100% = 25%.

[0096] (6) Green electricity sharing among multiple objects This embodiment adopts an allocation rule based on the actual electricity consumption ratio, and simultaneously generates allocation results from a two-dimensional perspective: "tenant-distribution branch". The electricity consumption of the three tenants in the park is 3000kWh, 4000kWh and 3000kWh respectively, with a total electricity consumption of 10000kWh, accounting for 30%, 40% and 30% respectively.

[0097] The green electricity allocation amounts are: 2500×30%=750kWh, 2500×40%=1000kWh, and 2500×30%=750kWh.

[0098] At the same time, based on the electricity consumption ratio of the two distribution branches, the green electricity allocation at the branch level is completed, and tenant green electricity vouchers and branch green electricity reports are generated.

[0099] (7) Data quality verification and result output Calculate the bus power balance residual rate for each time slice: residual rate = balance residual power / total injected power × 100%. In this embodiment, the preset residual rate threshold is 5%.

[0100] The residual power of a certain time slice is 6kWh, the total injected power is 100kWh, the residual rate is 6%>5%, triggering a data quality alarm; based on the residual contribution and the communication status of the metering point (photovoltaic metering point offline), the suspected abnormal metering point is located as the photovoltaic power generation metering unit.

[0101] For missing data from photovoltaic metering points, interpolation of adjacent time periods is used to supplement the missing data: the average value of photovoltaic power output in the previous three simultaneous periods is taken to supplement the missing data; the supplementary calculation results are marked with a "supplementary calculation-interpolation" quality label and stored in a layered manner with the original data.

[0102] The following day, the photovoltaic metering point resumed communication and transmitted real data. The system automatically wrote back and corrected the power balance calculation results, green electricity consumption and allocation results for that time slot, and updated all reports.

[0103] The final output includes measurement results with data quality labels: the overall green electricity consumption of the park is 2500 kWh, the consumption rate is 25%, and the green electricity allocation for the three tenants is 750 kWh / 1000 kWh / 750 kWh. At the same time, carbon accounting interface data, green electricity trading vouchers, and park energy and carbon management reports are generated.

[0104] The above description is a detailed description of the preferred embodiments of the present invention. However, the embodiments are not intended to limit the scope of the patent application of the present invention. All equivalent changes or modifications made under the technical spirit of the present invention should fall within the patent scope covered by the present invention.

Claims

1. A precise metering method for green electricity based on the Internet of Things and power balance algorithms, characterized in that, include: S1 collects raw metering data and equipment operation status data from various metering points, including the microgrid common connection point, renewable energy power source side, energy storage side, and load side. S2 uses an IoT gateway to uniformly synchronize the data from each metering point, completing data cleaning, standardization conversion, and time slice boundary alignment. S3, based on the principle of bus power balance, constructs the power balance equation within the time slice, solves the power and energy values ​​of power purchase, grid connection, energy storage charging and discharging, and load power consumption, and performs network loss correction for transformers and lines; S4. Establish a green electricity ownership ledger for energy storage, record the share of green electricity entering energy storage in each time slot, and calculate the amount of green electricity released by energy storage discharge through a preset ownership strategy. S5, combining the direct consumption of renewable energy and the energy storage transfer consumption, calculate the overall green electricity consumption and consumption rate of the microgrid; S6 calculates the allocation of green electricity consumption for load, region, and tenant according to the preset allocation rules; S7 performs bus power balance residual verification, triggers alarms for abnormal data and locates suspected abnormal metering points, performs supplementary calculations for missing data, and outputs green electricity metering and allocation results with data quality labels.

2. The method according to claim 1, characterized in that, In S1, the original metering data includes active power, cumulative power, charge and discharge power, and state of charge. Data transmission between each metering point is achieved through Ethernet, wireless private network, serial bus or industrial bus.

3. The method according to claim 1, characterized in that, In S2, the target time slice for time slice boundary alignment is 1 minute, 5 minutes, 15 minutes, or 30 minutes; the time slice boundary alignment includes: data aggregation when the data sampling period is less than the target time slice, and data splitting or interpolation when the data sampling period is greater than the target time slice; the data cleaning includes identifying and marking out-of-limit values, reverse values, abrupt jump values, and long-term invariant values, and assigning each data point a unique data quality label; In S3, the power balance equation is: Local renewable energy injection power + External grid power purchase power + Energy storage discharge equivalent injection power = Load consumption power + Energy storage charging absorption power + Grid connection power + Network loss correction power + Balance residual power; The solution for the power value is to convert the power value into a power value according to the time slice length; The network loss correction power includes transformer loss and line loss. The transformer loss is estimated based on no-load loss, load loss and real-time load rate; The line loss is estimated online using the branch impedance model, corrected by empirical coefficients or calculated using the hierarchical empirical coefficient method. For scenarios with complete electrical parameters, the loss model is dynamically updated using the online identification method.

4. The method according to claim 1, characterized in that, In S4, the preset attribution strategy includes one or more of the following: time matching strategy, first-in-first-out strategy, and proportional allocation strategy. The time matching strategy prioritizes matching the energy storage discharge with the green electricity stored in the most recent time slots. The first-in-first-out strategy releases green electricity according to its share in the energy storage, forming a traceable green electricity inventory queue. The proportional allocation strategy determines the inventory green electricity share based on the proportion of green electricity charged into the energy storage, and calculates the released green electricity based on the proportion of inventory green electricity during discharge. The measurement rule for the energy storage green electricity attribution ledger is as follows: green electricity is not included in the load consumption when it enters the energy storage; it is only included in the actual green electricity consumption when it is directly used by the load or reaches the load side after being released from the energy storage.

5. The method according to claim 1, characterized in that, In S5, the direct consumption of renewable energy is the amount of green electricity that matches the supply of renewable energy with the load demand within a time slice, the energy storage transfer consumption is the amount of green electricity released by energy storage discharge, and the overall green electricity consumption of the microgrid is the sum of the direct consumption and the transfer consumption.

6. The method of claim 1, wherein, In S6, the preset allocation rules include: allocation based on the actual electricity consumption ratio of each load object within the same time slice, allocation based on the priority of key loads, allocation based on a combination of the tenant contractually agreed ratio and the real-time electricity consumption ratio, or allocation based on the dimensions of region, building, production line, and equipment group; the allocation calculation results include total green electricity, green electricity ratio, green electricity curve for the time period, tenant green electricity certificate, and carbon accounting interface data.

7. The method of claim 1, wherein, In S7, the bus power balance residual verification involves calculating the absolute value and residual rate of the bus power balance residual for each time slice. When the residual exceeds a preset threshold, a data quality alarm is triggered. Locating suspected abnormal metering points refers to sorting suspected abnormal metering points based on residual contribution, metering point communication status, equipment operating status, and historical confidence level, and determining abnormal metering points based on the sorting results. The supplementary calculation of missing data adopts interpolation of adjacent time periods, curve fitting of similar equipment, backpropagation of rated parameters, or joint inversion of multiple tables.

8. The method of claim 1, wherein, S7 also includes: when a metering point experiences a communication failure and disconnection, retaining the abnormality marker and storing the recalculation results and the original results in a hierarchical manner; when the real data is obtained after re-transmission, automatically writing back and correcting the historical recalculation results, and updating the green electricity consumption and allocation reports.

9. A green electricity precise metering system based on the Internet of Things and a power balance algorithm, characterized in that, include: The data acquisition module is used to collect raw metering data and equipment operating status data from various metering points, including the microgrid common connection point, renewable energy power source side, energy storage side and load side. The preprocessing module is used to uniformly synchronize the data of each metering point through the IoT gateway, and complete data cleaning, standardization transformation and time slice boundary alignment processing; The calculation module is used to construct the power balance equation within the time slice based on the bus power balance principle, solve for the power and energy values ​​of electricity purchase, grid connection, energy storage charging and discharging, and load power consumption, and perform network loss correction for transformers and lines. The energy storage recording module is used to establish a green electricity ownership ledger for energy storage, record the share of green electricity entering the energy storage in each time slot, and calculate the amount of green electricity released by the energy storage discharge through a preset ownership strategy. The absorption recording module is used to calculate the overall green electricity absorption and absorption rate of the microgrid by combining the direct absorption of renewable energy and the absorption of energy storage transfer. The allocation calculation module is used to calculate the allocation of green energy consumption for loads, regions, and tenants according to preset allocation rules. The verification and output module is used to perform bus power balance residual verification, trigger alarms for abnormal data and locate suspected abnormal metering points, supplement missing data, and output green electricity metering and allocation results with data quality labels.

10. The system according to claim 9, characterized in that, In the data acquisition module: the raw metering data includes active power, cumulative power, charge and discharge power, and state of charge. Data transmission between each metering point is achieved through Ethernet, wireless private network, serial bus or industrial bus. In the preprocessing module: The target time slice for time slice boundary alignment is 1 minute, 5 minutes, 15 minutes or 30 minutes; The time slice boundary alignment includes: performing data aggregation when the data sampling period is less than the target time slice, and performing data splitting or interpolation when the data sampling period is greater than the target time slice; The data cleaning process includes identifying and marking out-of-limit values, reverse values, sudden jump values, and long-term invariant values, and assigning each data point a unique data quality label. In the solution module: The power balance equation is: Local renewable energy injection power + External grid power purchase power + Energy storage discharge equivalent injection power = Load consumption power + Energy storage charging absorption power + Grid connection power + Network loss correction power + Balance residual power. The calculation of the power value involves converting the power value into a power value based on the time slice length; the network loss correction power includes transformer loss and line loss, and the transformer loss is estimated based on no-load loss, load loss and real-time load rate. The line loss is estimated online using the branch impedance model, corrected by empirical coefficients, or calculated using the hierarchical empirical coefficient method. For scenarios with complete electrical parameters, the loss model is dynamically updated using an online identification method. In the energy storage recording module: The preset attribution strategy includes one or more of the following: time matching strategy, first-in-first-out strategy, and proportional allocation strategy. The time matching strategy prioritizes matching the energy storage discharge with the green electricity stored in the most recent time slices; the first-in-first-out strategy releases the green electricity according to the share of green electricity entering the energy storage, forming a traceable green electricity inventory queue. The proportional allocation strategy is to determine the green electricity inventory share based on the proportion of green electricity charged into the energy storage capacity, and to calculate the green electricity released during discharge based on the proportion of green electricity inventory. The measurement rules for the energy storage green electricity ownership ledger are as follows: when green electricity enters energy storage, it is not included in the load consumption. It is only included in the actual consumption of green electricity when it is directly used by the load or reaches the load side after being released by energy storage. In the disposal record module: The direct renewable energy consumption is the amount of green electricity that matches the supply of renewable energy with the load demand within a time slice. The energy storage transfer consumption is the amount of green electricity released by energy storage discharge. The overall green electricity consumption of the microgrid is the sum of the direct consumption and the transfer consumption. In the allocation calculation module: The preset allocation rules include: allocation based on the proportion of actual electricity consumption of each load object within the same time slice, allocation based on the priority of key loads, allocation based on a combination of the proportion agreed upon in the tenant contract and the proportion of real-time electricity consumption, or allocation based on the dimensions of region, building, production line, and equipment group. The results of the allocation calculation include total green electricity, green electricity ratio, green electricity curve for each time period, tenant green electricity vouchers, and carbon accounting interface data; In the verification and output module: The bus power balance residual verification involves calculating the absolute value and residual rate of the bus power balance residual for each time slice. When the residual exceeds a preset threshold, a data quality alarm is triggered. The process of locating suspected abnormal metering points refers to sorting suspected abnormal metering points according to residual contribution, metering point communication status, equipment operation status and historical confidence, and determining abnormal metering points based on the sorting results. The missing data is supplemented by interpolation of adjacent time periods, curve fitting of similar equipment, back-engineering of rated parameters, or joint inversion of multiple tables. The output of the verification and output module includes the total green electricity consumption of the microgrid, the green electricity consumption rate of the time period, the green electricity allocation results of load / region / tenant, data quality alarm logs, supplementary calculation records, and standardized reports and interface data applicable to carbon accounting, green electricity trading, and internal settlement. The verification and output module is also used to: retain the abnormality mark and store the recalculation results and the original results in a hierarchical manner when the metering point experiences a communication failure; and automatically write back and correct the historical recalculation results and update the green electricity consumption and allocation report after the real data is obtained.