Power carbon online metering method and system based on hierarchical distribution

CN122509501APending Publication Date: 2026-08-04WUXI POWER SUPPLY BRANCH OF STATE GRID JIANGSU ELECTRIC POWER CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WUXI POWER SUPPLY BRANCH OF STATE GRID JIANGSU ELECTRIC POWER CO LTD
Filing Date
2026-07-06
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

传统单一算法计量方式,因适配场景有限,易出现主干网碳流分配偏差大、用户侧分布式电源碳计量精度不足的问题,导致整体计量结果可信度低;同时,实际电力碳运行数据存在稀缺场景覆盖不足(如高比例新能源接入、极端负荷等场景数据少)的问题,直接用于模型优化易造成模型泛化能力弱;此外,人工校准电力碳计量数据不仅耗时费力、成本高,还易因人为误差进一步降低计量准确性

Benefits of technology

[0016] The beneficial effects of this invention are as follows: The method of this invention utilizes multiple algorithms for joint measurement to reduce the scenario bias of a single algorithm, improves the consistency and reliability of measurement results through automatic verification and correction, compensates for the problem of insufficient coverage of scarce scenarios by combining generated data, and improves the model optimization efficiency through hierarchical multi-threaded processing. This not only reduces the dependence on manual calibration and lowers the measurement cost, but also improves the carbon measurement accuracy of different hierarchical nodes, ultimately achieving highly reliable and efficient online carbon measurement of electricity that is compatible with the entire power grid.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122509501A_ABST
    Figure CN122509501A_ABST
Patent Text Reader

Abstract

This invention discloses a hierarchical distribution-based online electricity carbon metering method and system, relating to the field of power system carbon metering technology. The method involves acquiring multiple first metering results from the raw electricity carbon-related data of each hierarchical node in a dataset of electricity data to be metered. Using these first metering results from the raw electricity carbon-related data of each hierarchical node, automatic verification and correction processing is performed on the corresponding hierarchical node to determine the final metering result and metering reliability of each hierarchical node. Based on the online electricity carbon metering dataset, a preset hierarchical distribution electricity carbon metering model is optimized. This invention utilizes multiple algorithms for joint metering to reduce the scenario bias of a single algorithm, improves the consistency and reliability of metering results through automatic verification and correction, compensates for insufficient coverage of scarce scenarios by combining generated data, and improves model optimization efficiency through hierarchical multi-threaded processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of carbon metering in power systems, and more particularly to an online carbon metering system and method for power systems based on hierarchical distribution. Background Technology

[0002] In recent years, with the deepening implementation of dual carbon targets in the power industry, accurate measurement of power grid carbon emissions has become a core foundation for achieving carbon emission control. Currently, power carbon measurement mainly relies on a single algorithm to process data across the entire network. However, the power grid presents a hierarchical distribution architecture of "backbone network - distribution network - user side," with significant differences in carbon flow patterns and data granularity across different levels. Traditional single-algorithm metering methods have limited applicability and are prone to problems such as large deviations in carbon flow allocation in the backbone network and insufficient accuracy in carbon metering of distributed power sources on the user side, resulting in low overall metering reliability. At the same time, actual power carbon operation data suffers from insufficient coverage of scarce scenarios (such as data scarcity in scenarios with high proportion of renewable energy access and extreme loads), and direct use of such data for model optimization can easily lead to weak model generalization ability. In addition, manual calibration of power carbon metering data is not only time-consuming, labor-intensive, and costly, but also prone to further reduction in metering accuracy due to human error.

[0003] This shows that existing electricity carbon metering technologies still suffer from poor adaptability to different scenarios, low reliability of metering results, and weak model generalization ability. Summary of the Invention

[0004] The purpose of this section is to outline some aspects of embodiments of the present invention and to briefly describe some preferred embodiments. Simplifications or omissions may be made in this section, as well as in the abstract and title of this application, to avoid obscuring the purpose of these documents; however, such simplifications or omissions should not be construed as limiting the scope of the invention.

[0005] In view of the problems existing in the prior art, the present invention is proposed.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: an online electricity carbon metering method based on hierarchical distribution, the method comprising the following steps: Multiple first measurement results are obtained from the raw data of electricity carbon related to each hierarchical node in the set of electricity data to be measured; the multiple first measurement results are obtained by measuring the raw data of electricity carbon related by multiple electricity carbon measurement algorithms; Using multiple first measurement results of the raw electricity carbon-related data of each of the hierarchical nodes, an automatic verification and correction process is performed on the corresponding hierarchical nodes to determine the final measurement result and measurement reliability of each hierarchical node; the automatic verification and correction process includes global consistency voting verification and local fragment matching verification. By integrating each of the hierarchical nodes and the corresponding final metering results and metering reliability, an online electricity carbon metering dataset is generated. Based on the online electricity carbon metering dataset, the preset hierarchical distribution electricity carbon metering model is optimized to obtain a target online electricity carbon metering model that is adapted to the hierarchical distribution scenario.

[0007] As a preferred embodiment of the online electricity carbon metering method based on hierarchical distribution described in this invention, the step of performing automatic verification and correction processing on the corresponding hierarchical node using multiple first metering results of the electricity carbon-related raw data of each hierarchical node to determine the final metering result and metering reliability of each hierarchical node includes: For each of the hierarchical nodes, the deviation between the target measurement result and other measurement results is calculated based on the raw electricity carbon-related data; the target measurement result is any one of a plurality of first measurement results; the other measurement results are first measurement results other than the target measurement result. The target measurement result with the smallest deviation value is taken as the candidate measurement result of the corresponding hierarchical node; The matching data segments between the candidate measurement results and other measurement results are determined, and the measurement reliability of the candidate measurement results is determined by the proportion of the matching data segments. The candidate measurement results are then used as the final measurement results.

[0008] As a preferred embodiment of the online carbon metering method for electricity based on hierarchical distribution described in this invention, the step of determining the matching data segments between the candidate metering results and other metering results, and determining the metering reliability of the candidate metering results by the proportion of the matching data segments, includes: The candidate measurement results are segmented using a preset data segmentation algorithm to obtain multiple first data segments; the other measurement results are segmented using the preset data segmentation algorithm to obtain multiple second data segments. Each of the first data segments is matched with each of the second data segments to determine the matching data segments; the ratio of the number of matching data segments to the total number of the first data segments is used as the measurement reliability of the candidate measurement result.

[0009] As a preferred embodiment of the hierarchical distribution-based online electricity carbon metering method of the present invention, the step of integrating each hierarchical node and its corresponding final metering result and metering reliability to generate an online electricity carbon metering dataset includes: The following data are used as measurement benchmark data: hierarchical nodes whose measurement credibility meets a preset credibility threshold, corresponding raw data related to electricity carbon, and final measurement results; multiple preset electricity carbon scenario texts and electricity carbon data generation models are obtained; the preset electricity carbon scenario texts are input into the electricity carbon data generation models to obtain multiple generated electricity carbon data; the generated electricity carbon data and the corresponding preset electricity carbon scenario texts are used as measurement supplementary data; the measurement benchmark data and measurement supplementary data are integrated to generate an online electricity carbon measurement dataset.

[0010] As a preferred embodiment of the online electricity carbon metering method based on hierarchical distribution described in this invention, the method further includes, after using the generated electricity carbon data and the corresponding preset electricity carbon scenario text as supplementary metering data: Multiple second measurement results are obtained for each of the generated electricity carbon data; the multiple second measurement results are obtained by measuring the generated electricity carbon data using multiple electricity carbon measurement algorithms; based on the multiple second measurement results for each of the generated electricity carbon data, automatic verification and correction processing is performed on the corresponding generated electricity carbon data to determine the calibration measurement result and data reliability level of each of the generated electricity carbon data; the automatic verification and correction processing includes global consistency voting verification and local fragment matching verification; based on the calibration measurement result and data reliability level of each of the generated electricity carbon data, multiple metering supplementary data are filtered to obtain filtered metering supplementary data.

[0011] As a preferred embodiment of the hierarchical distribution-based online electricity carbon metering method of the present invention, the method comprises: generating the online electricity carbon metering dataset using multiple metering data generation threads; and optimizing the preset hierarchical distribution electricity carbon metering model based on the online electricity carbon metering dataset to obtain a target online electricity carbon metering model adapted to the hierarchical distribution scenario, which includes: processing metering data of different hierarchical nodes through multiple metering data generation threads, writing the online electricity carbon metering dataset into an electricity carbon metering data queue according to the hierarchical dimension; and reading metering data in the electricity carbon metering data queue one by one through multiple model optimization threads, inputting iterative optimization of parameters into the preset hierarchical distribution electricity carbon metering model according to a preset hierarchical weight allocation rule to obtain a target online electricity carbon metering model adapted to the hierarchical distribution scenario.

[0012] As a preferred embodiment of the online carbon metering method for electricity based on hierarchical distribution described in this invention, the method further includes: Real-time monitoring of the data inventory and backlog duration of each layer in the electricity carbon metering data queue; dynamically increasing or decreasing the number of metering data generation threads and / or model optimization threads for the corresponding layer nodes based on whether the data inventory exceeds a preset inventory threshold or the data backlog duration exceeds a preset duration threshold.

[0013] A system applied to the aforementioned hierarchical distribution-based online electricity carbon metering method includes: a raw data and metering result acquisition module, used to acquire raw electricity carbon-related data for each hierarchical node in the electricity data set to be metered, and multiple first metering results obtained by metering the raw electricity carbon-related data through various electricity carbon metering algorithms; an automatic verification and correction module, used to perform automatic verification and correction processing on the corresponding hierarchical node using the multiple first metering results of the raw electricity carbon-related data for each hierarchical node, to determine the final metering result and metering reliability of each hierarchical node; the automatic verification and correction processing includes global consistency voting verification and local fragment matching verification; a metering dataset generation module, used to integrate each hierarchical node and its corresponding final metering result and metering reliability to generate an online electricity carbon metering dataset; and a metering model optimization module, used to optimize a preset hierarchical distribution electricity carbon metering model based on the online electricity carbon metering dataset to obtain a target online electricity carbon metering model adapted to the hierarchical distribution scenario.

[0014] The present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described online carbon metering method based on hierarchical distribution.

[0015] The present invention also discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described online carbon metering method for electricity based on hierarchical distribution.

[0016] The beneficial effects of this invention are as follows: The method of this invention utilizes multiple algorithms for joint measurement to reduce the scenario bias of a single algorithm, improves the consistency and reliability of measurement results through automatic verification and correction, compensates for the problem of insufficient coverage of scarce scenarios by combining generated data, and improves the model optimization efficiency through hierarchical multi-threaded processing. This not only reduces the dependence on manual calibration and lowers the measurement cost, but also improves the carbon measurement accuracy of different hierarchical nodes, ultimately achieving highly reliable and efficient online carbon measurement of electricity that is compatible with the entire power grid. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein: Fig. 1 This is a schematic diagram of the overall structure of the online carbon metering method for electricity based on hierarchical distribution proposed in this invention; Fig. 2 This is a logical schematic diagram of the online carbon metering method for electricity based on hierarchical distribution proposed in this invention. Detailed Implementation

[0018] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0019] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0020] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0021] Reference Figs. 1-2 As an embodiment of the present invention, an online electricity carbon metering system and method based on hierarchical distribution are provided. The method includes the following steps: Step 1: Obtain multiple first measurement results of the raw electricity carbon-related data for each hierarchical node in the electricity data set to be measured; the multiple first measurement results are obtained by measuring the raw electricity carbon-related data using multiple electricity carbon measurement algorithms; Specifically, the set of electricity data to be metered can be a set of power system operation data that has not yet undergone carbon metering processing. The raw electricity carbon-related data is the basic data supporting hierarchical distributed online electricity carbon metering. It can be collected in real time by smart sensors (such as power flow sensors and load monitors) deployed at each hierarchical node of the power system, or retrieved from the historical operation database of the power grid dispatching EMS system. For example, the raw electricity carbon-related data may include, but is not limited to, power flow distribution data of backbone network nodes, load power data of distribution network nodes, renewable energy output data of user-side nodes, and fuel consumption and carbon intensity benchmark data of generating unit nodes.

[0022] Multiple first-order measurement results are obtained by performing measurement calculations on the raw electricity carbon-related data of each hierarchical node using various electricity carbon measurement algorithms. For example, the raw electricity carbon-related data of each hierarchical node can be input into each selected electricity carbon measurement algorithm (such as power flow tracing or nodal carbon potential method), and the carbon measurement results output by each algorithm can be collected to obtain multiple first-order measurement results corresponding to the raw data of that hierarchical node. It is understood that by combining the measurement results of multiple electricity carbon measurement algorithms for subsequent processing, the inherent limitations of a single algorithm's applicable scenarios can be avoided, measurement errors caused by insufficient algorithm adaptability can be reduced, and the reliability of hierarchical node carbon measurement can be improved.

[0023] Step 2: Using multiple first-level measurement results of the raw electricity carbon-related data for each layer node, perform automatic verification and correction processing on the corresponding layer node to determine the final measurement result and measurement reliability of each layer node; the automatic verification and correction processing includes global consistency voting verification and local fragment matching verification. Specifically, the final measurement result can be core power carbon data such as the carbon emissions and carbon flow allocation ratio finally determined by the hierarchical node. Measurement credibility can represent the degree to which the final measurement result matches the actual power carbon operation. For example, measurement credibility can include, but is not limited to, global consistency voting score and local fragment matching score.

[0024] The automatic verification and correction process includes global consistency voting verification and local fragment matching verification. Global consistency voting verification can be a verification rule based on the majority consensus principle of multi-algorithm measurement results, while local fragment matching verification can be a matching verification rule based on the dimensional segmentation of electricity carbon data. In this embodiment, global consistency voting verification can be used solely to determine the final measurement result or measurement reliability, or it can be used to determine both the final measurement result and measurement reliability simultaneously; similarly, local fragment matching verification can also be used solely to determine the final measurement result or measurement reliability, or it can be used to determine both the final measurement result and measurement reliability simultaneously.

[0025] In one exemplary embodiment, global consensus voting verification can be used to determine the final measurement result, and local fragment matching verification can be used to calculate the measurement confidence level. Alternatively, local fragment matching verification can be used for the final measurement result, and global consensus voting verification can be used to calculate the measurement confidence level.

[0026] In another exemplary embodiment, a global consensus voting check can be used to determine the first measurement result and the first measurement confidence level, and a local fragment matching check can be used to determine the second measurement result and the second measurement confidence level. If the deviation between the first measurement result and the second measurement result is within a preset allowable range, the two results are combined to determine the final measurement result, and the measurement confidence level is determined comprehensively based on the weighted value of the first and second measurement confidence levels. If the deviation between the first and second measurement results exceeds the preset allowable range, the result with higher confidence level can be determined as the final measurement result based on the numerical values ​​of the first and second measurement confidence levels. Accordingly, the measurement confidence level can be determined by using the measurement confidence level corresponding to the selected first or second measurement result. Furthermore, when the deviation between the first and second measurement results is within the allowable range, the measurement confidence level can be increased by a preset ratio, and when the deviation exceeds the allowable range, the measurement confidence level can be decreased by a preset ratio.

[0027] In another exemplary embodiment, when using global consensus voting verification to determine the final metering result, the numerical deviation between each first metering result and other first metering results can be compared to determine the consistent occurrence frequency of each first metering result, and the first metering result with the highest consistent occurrence frequency can be taken as the final metering result. In another exemplary embodiment, for the original data of the same hierarchical node, the number of times the values ​​of multiple first metering results fall within a preset reasonable range can also be counted. The preset reasonable range can be determined by prior knowledge of power system operation, and then the first metering result that falls within the range the most times can be taken as the final metering result. Alternatively, other methods can be used to determine the most realistic first metering result based on the majority consensus principle of multiple algorithm results, which is not limited in this embodiment.

[0028] When using global consensus voting verification to determine measurement reliability, the numerical deviation between each first measurement result and other first measurement results can be compared to comprehensively calculate the consistency degree corresponding to each first measurement result, thereby determining the measurement reliability. In another exemplary embodiment, for the original data of the same hierarchical node, the proportion of times the values ​​of multiple first measurement results fall within a preset reasonable range can also be counted. The preset reasonable range can be determined by prior knowledge of power system operation, and then the measurement reliability can be determined based on this proportion. Alternatively, other methods can be used to determine the measurement reliability based on the consistency degree of multiple algorithm results, which are not limited in this embodiment.

[0029] When using local segment matching verification to determine the final metering result and / or metering reliability, a power carbon data segmentation method based on the time dimension (such as 15 minutes, 1 hour) or the node topology dimension (such as backbone network segment, distribution network segment) can be used to obtain multiple data segments corresponding to each first metering result. Alternatively, a segmentation method based on the carbon flow direction can be used to directly obtain multiple data segments corresponding to each first metering result.

[0030] When using local segment matching verification to determine the final measurement result, based on the obtained data segments, the overlap of data segment deviations between each first measurement result and other first measurement results can be compared to determine the frequency of consistent occurrence of data segments for each first measurement result. The first measurement result with the highest frequency of consistent occurrence of data segments is then taken as the final measurement result. In another exemplary embodiment, for the original data of the same hierarchical node, the number of times the data segment values ​​of multiple first measurement results fall within a preset deviation threshold can also be counted. The preset deviation threshold can be determined according to the accuracy requirements of electricity carbon measurement. Then, the first measurement result containing the most segments that meet the threshold is taken as the final measurement result. Alternatively, other methods can be used to determine the most realistic first measurement result based on the data segmentation matching results. This embodiment does not limit this method.

[0031] When using local segment matching verification to determine measurement reliability, the overlap of data segment deviations between each first measurement result and other first measurement results can be compared to comprehensively calculate the segment consistency corresponding to each first measurement result, thereby determining the measurement reliability. In another exemplary embodiment, for the original data of the same hierarchical node, the proportion of data segment values ​​in multiple first measurement results falling within a preset deviation threshold can also be counted. The preset deviation threshold can be determined according to the accuracy requirements of electricity carbon measurement, and then the measurement reliability can be determined based on this proportion. Alternatively, other methods can be used to determine the measurement reliability based on the consistency of data segment matching, which is not limited in this embodiment.

[0032] This embodiment uses automatic verification and correction processes, including global consistency voting verification and local fragment matching verification, to obtain the final measurement results and measurement reliability. This can reduce the measurement error of a single algorithm and improve the consistency and reliability of the electricity carbon measurement results of hierarchical nodes.

[0033] Step 3: Integrate each hierarchical node along with the corresponding final metering results and metering reliability to generate an online electricity carbon metering dataset; Specifically, the online electricity carbon metering dataset can be a collection of data containing hierarchical node information, its corresponding raw electricity carbon-related data, final metering results, and metering reliability, used for subsequent parameter iteration and optimization of the pre-defined hierarchical distribution electricity carbon metering model. For example, the online electricity carbon metering dataset may include, but is not limited to, fields such as hierarchical node codes (e.g., backbone network node IDs, distribution network branch numbers), raw electricity carbon-related data (e.g., power flow distribution data, load power data), final metering results (e.g., node carbon emissions, carbon flow allocation ratio), and metering reliability values.

[0034] Metering reliability can serve as a core indicator for screening high-quality electricity carbon metering data. Data with high metering reliability can be used to generate an online electricity carbon metering dataset. For example, a hierarchical node dataset can be composed of metering reliability data that are higher than a preset reliability threshold (such as 0.85, which can be flexibly adjusted according to the accuracy requirements of electricity carbon metering), the corresponding original electricity carbon data, and the final metering results.

[0035] Step 4: Based on the online electricity carbon metering dataset, optimize the preset hierarchical distribution electricity carbon metering model to obtain the target online electricity carbon metering model adapted to the hierarchical distribution scenario.

[0036] Specifically, the preset hierarchical distributed electricity carbon metering model can refer to the initial hierarchical calculation model used for online electricity carbon metering. For example, it can be a graph neural network (GNN) carbon flow model based on power grid topology, a hierarchical iterative node carbon potential calculation model, etc., to adapt to carbon metering scenarios of different levels of power grid. Optimizing a pre-defined hierarchical distributed electricity carbon metering model can be achieved by dividing the online electricity carbon metering dataset into a training set and a validation set. The training set is used to input the model for iterative calculations, and the model parameters (such as grid topology weights and carbon flow allocation coefficients) are adjusted to minimize the deviation between the metering results and the actual values. The validation set is used to evaluate the metering accuracy of the model at different hierarchical nodes, and the hyperparameters (such as iteration step size and hierarchical calculation thresholds) are adjusted to optimize the model's generalization ability. Finally, the optimized model is saved as the target online electricity carbon metering model.

[0037] The hierarchical distribution-based online electricity carbon metering method provided in this embodiment acquires the raw electricity carbon data of each hierarchical node and obtains multiple first metering results through multiple algorithms; it determines the final metering result and metering reliability through automatic verification and correction processing (global consistency voting verification + local fragment matching verification); it integrates high-quality data to generate an online electricity carbon metering dataset; and then optimizes the preset hierarchical model based on this dataset: it reduces the scenario adaptation bias of a single algorithm through multi-algorithm metering and improves data quality through automatic verification. The final optimized model can adapt to the carbon metering needs of different levels of power grids, realize high-precision and low-latency online metering of hierarchical nodes, and reduce the cost of manual calibration.

[0038] In another embodiment, by using multiple first metering results of the raw electricity carbon-related data for each hierarchical node, automatic verification and correction processing is performed on the corresponding hierarchical node to determine the final metering result and metering reliability of each hierarchical node, including: For each hierarchical node, the deviation between the target measurement result and other measurement results is calculated based on the raw electricity carbon-related data. The target measurement result is any one of a plurality of first measurement results. The other measurement results are first measurement results other than the target measurement result. The target measurement result with the smallest deviation value is used as the candidate measurement result for the corresponding hierarchical node; Identify matching data segments between candidate measurement results and other measurement results, determine the measurement reliability of candidate measurement results by the proportion of matching data segments, and use candidate measurement results as final measurement results.

[0039] Specifically, the deviation value can be the relative deviation between the target measurement result and other measurement results (this method is commonly used in electricity carbon metering scenarios, i.e., |target measurement result - other measurement results| / other measurement results), or it can be an absolute deviation depending on the metering accuracy requirements. The target measurement result is any one of multiple first measurement results; other measurement results are all first measurement results other than the target measurement result.

[0040] For example, each first metering result can be used as the target metering result, and other first metering results can be used as other metering results. The deviation between the target metering result and all other metering results can be calculated, and the average of the deviations can be taken as the comprehensive deviation of the target metering result. The comprehensive deviation of each target metering result can be statistically analyzed. The first metering result with the smallest comprehensive deviation can be selected as the candidate metering result of the corresponding hierarchical node. This can effectively quantify the degree of fit between the output results of different algorithms and reduce the deviation of a single algorithm in adapting to a specific power grid scenario. Determining the matching data segments between the candidate metering results and other metering results can be done by dividing the metering data into multiple segments according to the core dimensions of power carbon metering (such as 15-minute time segments or distribution network branch node segments), and comparing whether the deviations of these segments in other metering results meet the preset accuracy threshold (such as the 3% relative deviation threshold commonly used in power carbon metering).

[0041] Specifically, each measurement result is used as a comparison benchmark in turn, and the absolute deviation of the result from all other measurement results is calculated. Then, the average value of all the deviations is calculated as the comprehensive deviation value of the result. The comprehensive deviations of all measurement results are compared, and the result with the smallest comprehensive deviation is selected as the candidate measurement data for the hierarchical node.

[0042] For example, after obtaining multiple data segments through a preset data segmentation algorithm, the ratio of the number of segments in the candidate metering result whose deviation from other metering results is ≤ a preset accuracy threshold to the total number of segments can be calculated to comprehensively determine the metering reliability of the candidate metering result. Furthermore, a weighted average method can be used to assign higher weights to key dimension segments such as unit carbon intensity and main grid power flow, thereby more accurately assessing the reliability of candidate metering results in core dimensions and improving the distinguishability of metering reliability in complex power grid scenarios.

[0043] In this embodiment, the deviation is calculated as an absolute deviation, and the number of segments is the result of the data segmentation algorithm described later for the electricity carbon metering data. Each candidate result segment is compared with the corresponding segments of other metering results. If the deviation between segments does not exceed the allowable error range, the number of such qualified segments is the number of segments that meet the threshold.

[0044] The automatic verification and correction sub-method provided in this embodiment can effectively capture the consistency of different algorithm outputs and reduce the impact of single algorithm error by calculating the deviation value and selecting the result with the smallest comprehensive deviation as the candidate measurement result. By matching the proportion of data segments to calculate the measurement credibility, the measurement accuracy of local dimensions can be further verified, and the accuracy and reliability of the hierarchical node power carbon measurement results can be improved.

[0045] In one embodiment, determining the matching data segments between candidate measurement results and other measurement results, and determining the measurement reliability of candidate measurement results by the proportion of matching data segments, includes: The candidate measurement results are segmented using a preset data segmentation algorithm to obtain multiple first data segments; other measurement results are segmented using the same preset data segmentation algorithm to obtain multiple second data segments. Each first data segment is matched with each second data segment to determine the matching data segments; the ratio of the number of matching data segments to the total number of first data segments is used as the measurement confidence of the candidate measurement result.

[0046] Specifically, the ratio of the number of matching data segments to the total number of the first data segments is used as the measurement confidence of the candidate measurement result.

[0047] The preset data segmentation algorithm can be an algorithm used to divide electricity carbon metering data into multiple segments, which can be trained through power grid operation dimension rules or machine learning models. For example, the preset data segmentation algorithm includes, but is not limited to, time-based segmentation (such as 15-minute or 1-hour time segments) and power grid topology-based segmentation (such as backbone network node segments and distribution network branch node segments). In a specific embodiment, the segmentation granularity can be determined according to the accuracy requirements of electricity carbon metering. For example, a 5-minute time segmentation granularity can be used for user-side nodes, and a 30-minute time segmentation granularity can be used for backbone network nodes, before the preset data segmentation algorithm is applied for segmentation.

[0048] The first data segment can be multiple electricity carbon metering data segments extracted from candidate metering results using a preset data segmentation algorithm. In one specific embodiment, the candidate metering results (carbon flow allocation data within 1 hour) of a certain distribution network node can be segmented into four 15-minute first data segments.

[0049] The second data segment can be multiple electricity carbon metering data segments extracted from other metering results using the same preset data segmentation algorithm. For example, other metering results can be carbon flow allocation data of the distribution network node output by different algorithms. Accordingly, a certain other metering result (carbon flow allocation data within 1 hour) can be segmented into four 15-minute second data segments.

[0050] To improve the comparability of the first and second data segments, the preset data segmentation algorithm must use the same segmentation dimension and granularity when segmenting candidate measurement results and other measurement results.

[0051] Matching the first data segment and the second data segment can be achieved by calculating whether the numerical deviation between the first data segment and the second data segment meets a preset accuracy threshold. In a specific embodiment, in scenarios where high accuracy is required for electricity carbon metering, the matching can be determined by judging whether the relative deviation between the first data segment and the second data segment is ≤3%.

[0052] A matching data segment can be a first data segment whose numerical deviation meets a preset accuracy threshold among multiple other measurement results. For example, if the first data segment has a deviation of ≤3% in the corresponding second data segments of more than two other measurement results, then the segment can be considered a matching data segment.

[0053] For example, determining a matching data segment can be done by traversing each first data segment and comparing it one by one with the corresponding second data segments of all other measurement results, recording the number of times the deviation of each first data segment in the set of second data segments meets a threshold, and determining the first data segment whose number of compliances exceeds a preset threshold as a matching data segment. This can filter out segments with stable measurement results and reflect the reliability of candidate measurement results in local dimensions.

[0054] The ratio of the number of matching data segments to the total number of the first data segments is used as the measurement reliability of the candidate measurement result, thus more accurately reflecting the overall reliability of the candidate measurement result across different dimensions. Understandably, the higher this ratio, the smaller the measurement deviation of the candidate measurement result in each local data segment, and the higher the overall reliability of the measurement result.

[0055] The automatic verification and correction sub-method provided in this embodiment divides candidate measurement results into a first data segment using a preset data segmentation algorithm, divides other measurement results into a second data segment, matches the two to determine the matching data segment, and uses the proportion of the matching segment as the measurement credibility. This can improve the refinement of measurement credibility assessment, enhance the reliability of candidate measurement results, and provide support for the generation of high-quality measurement datasets in the future.

[0056] In one embodiment, integrating each hierarchical node along with its corresponding final metering result and metering reliability to generate an online electricity carbon metering dataset includes: The following data are used as measurement benchmark data: hierarchical nodes whose measurement credibility meets the preset credibility threshold, the corresponding raw data related to electricity carbon, and the final measurement results; multiple preset electricity carbon scenario texts and electricity carbon data generation models are obtained; the preset electricity carbon scenario texts are input into the electricity carbon data generation models to obtain multiple generated electricity carbon data; the generated electricity carbon data and the corresponding preset electricity carbon scenario texts are used as measurement supplementary data; and the measurement benchmark data and measurement supplementary data are integrated to generate an online electricity carbon measurement dataset.

[0057] Specifically, the measurement benchmark data can be a collection of hierarchical node information retained after measurement reliability screening, corresponding raw data related to electricity carbon, and the final measurement results. The pre-set reliability threshold can be a pre-defined reliability standard used to screen high-quality electricity carbon measurement data, which can be determined based on the accuracy requirements of electricity carbon measurement and prior industry knowledge of grid operation. For example, the pre-set reliability threshold can be a measurement reliability ratio of not less than 0.85.

[0058] In one specific embodiment, the metering reliability of each hierarchical node can be compared one by one. The information of hierarchical nodes with a metering reliability greater than or equal to a preset reliability threshold, along with the corresponding raw electricity carbon-related data and the final metering results, are saved as metering benchmark data. This allows for the selection of high-quality metering foundation data to ensure the accuracy of the data used in subsequent model optimization. The preset electricity carbon scenario text can be a set of pre-prepared scenario description texts used to generate simulated electricity carbon data. These can be obtained through surveys of actual power grid operation scenarios, extraction from power industry standard documents, or manual editing. For example, the preset electricity carbon scenario text may include, but is not limited to, "carbon flow scenario in distribution networks with high penetration of new energy sources," "carbon allocation scenario during peak industrial load periods," and "user-side distributed photovoltaic + energy storage access scenario."

[0059] The power carbon data generation model can be a model that can generate corresponding power carbon operation data based on scenario text, and may include, but is not limited to, power carbon flow simulation models based on generative adversarial networks (GANs) and power grid hierarchical operation data generation models based on Transformers.

[0060] In this embodiment, preset power carbon scenario text can be collected, and each scenario text can be converted into corresponding power carbon operation data using a power carbon data generation model to obtain generated power carbon data. This allows for the supplementation of power carbon data in scarce scenarios through the generation model, thereby increasing the scenario coverage of the metering dataset.

[0061] In this embodiment, the online electricity carbon metering dataset can be an integrated result containing metering benchmark data and metering supplementary data, used for the parameter iterative optimization of a pre-defined hierarchical distribution electricity carbon metering model.

[0062] The method for generating online electricity carbon metering datasets provided in this embodiment uses hierarchical node data whose metering reliability meets a preset reliability threshold as metering benchmark data to select high-quality basic metering data to ensure data accuracy. Simultaneously, it generates multiple generated electricity carbon datasets through an electricity carbon data generation model and preset scenario text, which can compensate for insufficient coverage of actual collected data in scarce scenarios. Finally, it integrates the metering benchmark data and supplementary metering data to generate an online electricity carbon metering dataset, enabling the construction of a more comprehensive metering data support system. This improves the adaptability and metering accuracy of the hierarchical distributed electricity carbon metering model to different power grid scenarios.

[0063] In one embodiment, after generating electricity carbon data and corresponding preset electricity carbon scenario text as supplementary metering data, the method further includes: Multiple second measurement results are obtained for each generated electricity carbon data. These multiple second measurement results are obtained by measuring the generated electricity carbon data using various electricity carbon measurement algorithms. Based on the multiple second measurement results for each generated electricity carbon data, automatic verification and correction processing is performed on the corresponding generated electricity carbon data to determine the calibration measurement result and data reliability level of each generated electricity carbon data. The automatic verification and correction processing includes global consistency voting verification and local fragment matching verification. Based on the calibration measurement result and data reliability level of each generated electricity carbon data, multiple supplementary measurement data are filtered to obtain the filtered supplementary measurement data.

[0064] Specifically, multiple second measurement results are obtained by performing measurement calculations on the generated electricity carbon data using various electricity carbon measurement algorithms.

[0065] In one specific embodiment, all generated electricity carbon data can be traversed, and each generated electricity carbon data can be input into a variety of selected electricity carbon metering algorithms (such as power flow tracking method and nodal carbon potential allocation method), and the second metering result output by each algorithm can be collected.

[0066] Automatic verification and correction processing is performed on the corresponding generated electricity carbon data by using multiple second metering results for each generated electricity carbon data. This can be done by methods such as global consistency voting verification or local fragment matching verification for multiple metering results. This embodiment will not elaborate on these methods here (for specific procedures, please refer to the relevant content on automatic verification and correction mentioned above).

[0067] Furthermore, since the preset power carbon scenario text corresponding to the generated power carbon data is known (including scenario baseline carbon data), the generated power carbon data itself can be corrected by using the baseline carbon data in the scenario text. For example, it can be re-inputted into the power carbon data generation model and the scenario parameters (such as unit carbon intensity and load distribution ratio) can be adjusted to obtain generated power carbon data with a higher degree of matching with the actual operating characteristics of the scenario.

[0068] The metering supplementary data filtering method provided in this embodiment obtains multiple second metering results for each generated electricity carbon data and uses multiple algorithms to calculate them separately, which can reduce the scenario adaptation bias of a single algorithm; by automatically verifying and correcting the calibration metering results and data credibility level, it can improve the metering accuracy and consistency of the generated data; by filtering the metering supplementary data through data credibility level, it can significantly improve the quality and reliability of the supplementary data, optimize the scenario coverage and accuracy of the online electricity carbon metering dataset, and thus improve the adaptability and metering accuracy of the hierarchical distributed electricity carbon metering model to different power grid scenarios.

[0069] In one embodiment, multiple metering data generation threads are used to generate an online electricity carbon metering dataset. Based on the online electricity carbon metering dataset, a preset hierarchical distribution electricity carbon metering model is optimized to obtain a target online electricity carbon metering model adapted to the hierarchical distribution scenario. This includes: processing metering data of different hierarchical nodes through multiple metering data generation threads, writing the online electricity carbon metering dataset into an electricity carbon metering data queue according to the hierarchical dimension; reading metering data from the electricity carbon metering data queue one by one through multiple model optimization threads, inputting iterative parameter optimization into the preset hierarchical distribution electricity carbon metering model according to a preset hierarchical weight allocation rule, and obtaining a target online electricity carbon metering model adapted to the hierarchical distribution scenario.

[0070] Specifically, the electricity carbon metering data queue can be a queue used to store electricity carbon metering data awaiting model optimization. For example, the electricity carbon metering data queue may include hierarchical node information, corresponding raw electricity carbon-related data, final metering results, and metering reliability data.

[0071] In some examples, the electricity carbon metering data queue can be, but is not limited to, an in-memory data buffer in a power grid dispatching system, a message queue (such as a Kafka queue) in a distributed power data platform, etc., to meet the needs of high-concurrency data transmission in the power system.

[0072] The metering data generation thread can be a thread used to generate online metering data for electricity carbon. For example, the metering data generation thread may include a thread that processes metering data from backbone network nodes, or a thread that processes metering data from distribution network and user-side nodes and supplements it to generate electricity carbon data.

[0073] The model optimization thread can be used to iteratively optimize the parameters of a pre-defined hierarchical distributed electricity carbon metering model. The number of model optimization threads can be pre-configured according to the accuracy requirements of electricity carbon metering, or dynamically adjusted according to the real-time data inventory of the electricity carbon metering data queue.

[0074] The electricity carbon metering model optimization method provided in this embodiment writes the online electricity carbon metering dataset into the electricity carbon metering data queue according to the hierarchical dimension through multiple metering data generation threads; and reads the metering data in the queue one by one through multiple model optimization threads and inputs it into the model for optimization according to the hierarchical weight rules. The metering data of different hierarchical nodes can be generated and processed simultaneously during the model optimization process, avoiding the time loss of waiting for all data to be generated before optimization, thereby improving the optimization efficiency of the hierarchical distributed electricity carbon metering model.

[0075] In one embodiment, the method further includes: Real-time monitoring of data inventory and backlog duration in each layer of the electricity carbon metering data queue; dynamically increasing or decreasing the number of metering data generation threads and / or model optimization threads for the corresponding layer nodes based on whether the data inventory exceeds the preset inventory threshold or the data backlog duration exceeds the preset duration threshold.

[0076] Specifically, the data stock can be the number of metering data entries currently stored in each layer dimension (such as the backbone network and distribution network) of the electricity carbon metering data queue, and the data backlog duration can be the longest time that data has not been read after being written into the queue. Both can be obtained and calculated through the status monitoring interface of the queue (such as the offset information of the message queue and the data timestamp record).

[0077] Based on the data inventory and data backlog duration, adjust the number of measurement data generation threads and / or model optimization threads for the corresponding layer nodes. This can be done by comparing these two metrics with preset thresholds to determine whether the current thread processing capacity matches the data flow speed. For example, if the data inventory for a certain layer dimension exceeds a preset inventory threshold for a long time (e.g., the backbone queue exceeds 500 entries) and the data backlog duration exceeds a preset duration threshold (e.g., 30 seconds), it can be considered that the measurement data generation speed for that layer is faster than the model optimization speed. In this case, the number of model optimization threads for that layer can be increased or the number of measurement data generation threads for that layer can be decreased to achieve a speed match between data generation and model optimization. Conversely, if the data inventory of a certain stratum dimension is lower than 30% of the preset inventory threshold for a long time and the data backlog time is always less than 5 seconds, it can be considered that the econometric data generation speed of that stratum is slower than the model optimization speed. In this case, the number of model optimization threads corresponding to that stratum can be reduced or the number of econometric data generation threads of that stratum can be increased to avoid the model optimization threads from being idle due to insufficient data.

[0078] In this embodiment, by adjusting the number of threads based on the data inventory and backlog duration of each layer, the data processing rhythm of different layer nodes can be dynamically adapted. This avoids model optimization delays caused by data backlog in a certain layer or optimization interruptions due to insufficient data. Simultaneously, it ensures that each layer's data queue maintains a reasonable flow state, improving the continuity of layered metering model optimization. The dynamic thread adjustment method provided in this embodiment, by accurately monitoring the layered dimension data status of the electricity carbon metering data queue and adjusting the number of threads accordingly, can avoid resource mismatch between different layer nodes, reduce unnecessary computational waste, and further ensure the stability and efficiency of the layered distributed electricity carbon metering model optimization process.

[0079] This embodiment also discloses a hierarchical distribution-based online carbon metering system for electricity, applied to the aforementioned hierarchical distribution-based online carbon metering method for electricity. The system includes: The module for acquiring raw data and metering results is used to acquire raw data related to electricity carbon for each hierarchical node in the electricity data set to be metered, as well as multiple first metering results obtained by metering the raw data related to electricity carbon through various electricity carbon metering algorithms. The automatic verification and correction module is used to perform automatic verification and correction processing on the corresponding hierarchical nodes based on the multiple first metering results of the raw data related to electricity carbon for each hierarchical node, and to determine the final metering result and metering credibility of each hierarchical node. The automatic verification and correction processing includes global consistency voting verification and local fragment matching verification. The metering dataset generation module is used to integrate each hierarchical node and its corresponding final metering result and metering credibility to generate an online electricity carbon metering dataset. The metering model optimization module is used to optimize the preset hierarchical distribution electricity carbon metering model based on the online electricity carbon metering dataset to obtain a target online electricity carbon metering model adapted to the hierarchical distribution scenario.

[0080] This embodiment also provides a computer device applicable to the online carbon metering method based on hierarchical distribution, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the online carbon metering method based on hierarchical distribution as proposed in the above embodiment.

[0081] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0082] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the hierarchical distributed online electricity carbon metering method proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0083] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for online measurement of carbon emissions based on hierarchical distribution, characterized in that, The method includes the following steps: Multiple first measurement results are obtained from the raw data of electricity carbon related to each hierarchical node in the set of electricity data to be measured; the multiple first measurement results are obtained by measuring the raw data of electricity carbon related by multiple electricity carbon measurement algorithms; Using multiple first measurement results of the raw electricity carbon-related data of each of the hierarchical nodes, an automatic verification and correction process is performed on the corresponding hierarchical nodes to determine the final measurement result and measurement reliability of each hierarchical node; the automatic verification and correction process includes global consistency voting verification and local fragment matching verification. By integrating each of the hierarchical nodes and the corresponding final metering results and metering reliability, an online electricity carbon metering dataset is generated. Based on the online electricity carbon metering dataset, the preset hierarchical distribution electricity carbon metering model is optimized to obtain a target online electricity carbon metering model that is adapted to the hierarchical distribution scenario.

2. The online carbon metering method for electricity based on hierarchical distribution according to claim 1, characterized in that: The step of performing automatic verification and correction processing on the corresponding layered nodes using multiple first measurement results of the raw electricity carbon-related data of each layered node, and determining the final measurement result and measurement reliability of each layered node, includes: For each of the hierarchical nodes, the deviation between the target measurement result and other measurement results is calculated based on the raw electricity carbon-related data; the target measurement result is any one of a plurality of first measurement results; the other measurement results are first measurement results other than the target measurement result. The target measurement result with the smallest deviation value is taken as the candidate measurement result of the corresponding hierarchical node; The matching data segments between the candidate measurement results and other measurement results are determined, and the measurement reliability of the candidate measurement results is determined by the proportion of the matching data segments. The candidate measurement results are then used as the final measurement results.

3. The online carbon metering method for electricity based on hierarchical distribution according to claim 2, characterized in that: The step of determining the matching data segments between the candidate measurement results and other measurement results, and determining the measurement reliability of the candidate measurement results based on the proportion of the matching data segments, includes: The candidate measurement results are segmented using a preset data segmentation algorithm to obtain multiple first data segments; the other measurement results are segmented using the preset data segmentation algorithm to obtain multiple second data segments. Each of the first data segments is matched with each of the second data segments to determine the matching data segments; the ratio of the number of matching data segments to the total number of the first data segments is used as the measurement reliability of the candidate measurement result.

4. The online carbon metering method for electricity based on hierarchical distribution according to claim 1, characterized in that: The process of integrating each hierarchical node, along with the corresponding final metering result and metering reliability, to generate an online electricity carbon metering dataset includes: The following data are used as measurement benchmark data: hierarchical nodes whose measurement credibility meets a preset credibility threshold, corresponding raw data related to electricity carbon, and final measurement results; multiple preset electricity carbon scenario texts and electricity carbon data generation models are obtained; the preset electricity carbon scenario texts are input into the electricity carbon data generation models to obtain multiple generated electricity carbon data; the generated electricity carbon data and the corresponding preset electricity carbon scenario texts are used as measurement supplementary data; the measurement benchmark data and measurement supplementary data are integrated to generate an online electricity carbon measurement dataset.

5. The online carbon metering method for electricity based on hierarchical distribution according to claim 4, characterized in that: After the generated electricity carbon data and the corresponding preset electricity carbon scenario text are used as supplementary metering data, the following are also included: Multiple second measurement results are obtained for each of the generated electricity carbon data; the multiple second measurement results are obtained by measuring the generated electricity carbon data using multiple electricity carbon measurement algorithms; based on the multiple second measurement results for each of the generated electricity carbon data, automatic verification and correction processing is performed on the corresponding generated electricity carbon data to determine the calibration measurement result and data reliability level of each of the generated electricity carbon data; the automatic verification and correction processing includes global consistency voting verification and local fragment matching verification; based on the calibration measurement result and data reliability level of each of the generated electricity carbon data, multiple metering supplementary data are filtered to obtain filtered metering supplementary data.

6. The online carbon metering method for electricity based on hierarchical distribution according to claim 1, characterized in that: The online electricity carbon metering dataset is generated using multiple metering data generation threads. The optimization of a pre-defined hierarchical distribution electricity carbon metering model based on this dataset to obtain a target online electricity carbon metering model adapted to the hierarchical distribution scenario includes: processing metering data from different hierarchical nodes using multiple metering data generation threads, writing the online electricity carbon metering dataset into an electricity carbon metering data queue according to hierarchical dimensions; and reading metering data from the electricity carbon metering data queue line by line using multiple model optimization threads, inputting iterative parameter optimization into the pre-defined hierarchical distribution electricity carbon metering model according to a pre-defined hierarchical weight allocation rule to obtain the target online electricity carbon metering model adapted to the hierarchical distribution scenario.

7. The online carbon metering method for electricity based on hierarchical distribution according to claim 6, characterized in that: The method further includes: Real-time monitoring of the data inventory and backlog duration of each layer in the electricity carbon metering data queue; dynamically increasing or decreasing the number of metering data generation threads and / or model optimization threads for the corresponding layer nodes based on whether the data inventory exceeds a preset inventory threshold or the data backlog duration exceeds a preset duration threshold.

8. A hierarchical distribution-based online carbon metering system for electricity, applied to the hierarchical distribution-based online carbon metering method for electricity as described in any one of claims 1-7, characterized in that: The system includes: The raw data and metering result acquisition module is used to acquire the raw data related to electricity carbon for each hierarchical node in the electricity data set to be metered, as well as multiple first metering results obtained by metering the raw data related to electricity carbon through various electricity carbon metering algorithms. An automatic verification and correction module is used to perform automatic verification and correction processing on the corresponding hierarchical node using multiple first metering results of the raw electricity carbon-related data of each hierarchical node, and to determine the final metering result and metering reliability of each hierarchical node; the automatic verification and correction processing includes global consistency voting verification and local fragment matching verification. The metering dataset generation module is used to integrate each of the hierarchical nodes and the corresponding final metering results and metering credibility to generate an online electricity carbon metering dataset; The metering model optimization module is used to optimize the preset hierarchical distribution electricity carbon metering model based on the electricity carbon online metering dataset to obtain a target electricity carbon online metering model that is adapted to the hierarchical distribution scenario.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the online carbon metering method for electricity based on hierarchical distribution as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the online carbon metering method based on hierarchical distribution as described in any one of claims 1 to 7.