A power consumption metering error compensation method and system based on transfer learning
By utilizing the structural attributes of the target energy meter and transfer learning algorithms in electricity metering, matching and testing a multi-dimensional error compensation model, configuring a multi-dimensional weight fusion strategy, and constructing an adaptive metering error compensator, the problems of poor scenario adaptability and low compensation accuracy in existing technologies are solved, achieving efficient and accurate electricity metering error compensation.
Patent Information
- Application Number
- CN202511177150.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-21
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-08-21
AI Technical Summary
Existing methods for compensating for electricity metering errors rely on general transfer models, which suffer from poor scenario adaptability, insufficient compensation accuracy, and low reliability, making it difficult to meet the high-efficiency and accurate requirements of diverse electricity consumption scenarios.
By using the structural attributes of the target electricity meter as a comparison constraint, a library of electricity metering error compensation models is retrieved, and a multi-dimensional error compensation model is matched. The transfer learning algorithm is used for testing, and a model test dataset is output. With maximizing the model output accuracy and stability as indicators, a multi-dimensional weight fusion strategy is configured to construct an adaptive metering error compensator.
It achieves accurate compensation for electricity meter measurement errors, improves model adaptability and compensation accuracy, and solves the problem of poor compensation accuracy and reliability caused by insufficient parameter optimization in traditional methods.
Smart Images

Figure CN120724173B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electricity metering, and in particular to a method and system for compensating for electricity metering errors based on transfer learning. Background Technology
[0002] With the intelligent development of power systems, the accuracy of electricity metering has become crucial for ensuring fair electricity trading and efficient grid operation. Currently, traditional electricity metering error compensation relies on general transfer models, which suffer from poor scenario adaptability, insufficient compensation accuracy, and low reliability.
[0003] Existing compensation methods rely solely on fixed migration model parameters and static analysis, making it difficult to adapt to the actual application scenarios of target electricity meters. This not only affects the fairness of electricity metering but also makes the compensation results significantly affected by the environment and equipment status due to the lack of dynamic model optimization for different scenarios. Furthermore, manual adjustments are lagging behind, making it difficult to meet the efficient and accurate requirements for electricity metering error compensation in diverse electricity consumption scenarios. Summary of the Invention
[0004] To address the aforementioned technical issues, this application provides a method and system for compensating electricity metering errors based on transfer learning. This method improves the adaptability of the transfer model to the actual scenario of the target electricity meter, achieves accurate compensation for metering errors, and solves the problems of poor compensation accuracy and reliability caused by insufficient parameter optimization and low adaptability in traditional methods.
[0005] The embodiments of this application disclose the following technical solutions:
[0006] In a first aspect, embodiments of this application provide a method for compensating for electricity metering errors based on transfer learning, the method comprising:
[0007] Using the structural properties of the target electricity meter as a comparison constraint, several multi-dimensional error compensation models are obtained by searching the electricity metering error compensation model library.
[0008] Based on the transfer learning algorithm, the multidimensional error compensation models are tested according to the sample error data of the target energy meter, and several model test datasets are output.
[0009] Using the maximization of model output accuracy and output stability as comprehensive evaluation indicators, model fitness is evaluated based on several model test datasets, and a multi-dimensional weight fusion strategy is configured based on the evaluation results.
[0010] According to the multi-dimensional weight fusion strategy, an adaptive metering error compensator is constructed by integrating the several multi-dimensional error compensation models to perform metering error compensation for the target electricity meter.
[0011] Secondly, embodiments of this application provide an electricity metering error compensation system based on transfer learning, the system comprising:
[0012] The model matching module is used to obtain several multi-dimensional error compensation models by searching the energy metering error compensation model library, using the structural properties of the target energy meter as comparison constraints.
[0013] The model testing module is used to test the several multi-dimensional error compensation models based on the transfer learning algorithm and the sample error data of the target energy meter, and output several model test datasets.
[0014] The fitness assessment and weight configuration module is used to evaluate the model fitness based on the several model test datasets, taking the maximization of model output accuracy and output stability as a comprehensive evaluation index, and to configure a multi-dimensional weight fusion strategy based on the evaluation results.
[0015] The compensator construction and execution module is used to construct an adaptive metering error compensator by integrating the several multi-dimensional error compensation models according to the multi-dimensional weight fusion strategy, and to perform metering error compensation for the target energy meter.
[0016] One or more technical solutions provided in this application have at least the following technical effects or advantages:
[0017] This application proposes a method and system for compensating electricity metering errors based on transfer learning. Through collaborative operations of model matching, testing and evaluation, weight configuration, and compensator construction, accurate compensation of electricity metering errors is achieved. First, constrained by the structural attributes of the target electricity meter, an electricity metering error compensation model library is searched, and multiple candidate power factor, grid fluctuation, and environmental factor error compensation models are obtained. Models with large deviations are selected as associated models through feature similarity comparison, resulting in a multi-dimensional error compensation model. Next, based on the transfer learning algorithm, test datasets corresponding to the three types of errors are selected according to the sample error data of the target electricity meter. Multiple rounds of testing are performed on the associated model, outputting a model test dataset containing the average test accuracy and fluctuation coefficient. Then, using accuracy and stability as indicators, weights are configured in conjunction with load, environmental fluctuation, and device aging characteristics to evaluate the fit and form a multi-dimensional weight fusion strategy. Finally, a compensator is constructed according to the strategy to perform error compensation.
[0018] The technical solution of this application solves the problems of low compensation accuracy and poor stability caused by poor model universality and insufficient scenario adaptation in traditional error compensation by integrating transfer learning model adaptation, performance evaluation of dual-dimensional indicators and integrated compensation of multi-dimensional weights. It achieves efficient compensation of electricity metering errors and provides technical support for accurate metering. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.
[0020] Figure 1 A flowchart illustrating an error compensation method for electricity metering based on transfer learning, provided in an embodiment of this application;
[0021] Figure 2 This is a schematic diagram of a power metering error compensation system based on transfer learning, provided as an embodiment of this application.
[0022] The components represented by each number in the attached diagram are explained below:
[0023] Model matching module 01, model testing module 02, fitness evaluation and weight configuration module 03, compensator construction and execution module 04. Detailed Implementation
[0024] This application provides a method and system for compensating for electricity metering errors based on transfer learning, which solves the technical problem in the prior art that the parameters of the transfer model cannot be optimized in a targeted manner according to the actual application scenario of the target electricity meter, resulting in insufficient model adaptability and thus low accuracy and reliability of electricity metering error compensation.
[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0026] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0027] In the description of this application, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0028] Example 1, as shown in the appendix Figure 1 As shown, this application provides a method for compensating for electricity metering errors based on transfer learning, the method comprising the following steps:
[0029] S110: Using the structural properties of the target energy meter as a comparison constraint, several multi-dimensional error compensation models are obtained by searching the energy metering error compensation model library.
[0030] In this embodiment of the application, in the model matching stage of electricity metering error compensation, in order to ensure that the selected model can accurately adapt to the characteristics of the target electricity meter, it is necessary to form a multi-dimensional error compensation model set through structural attribute constraints and model feature differentiation screening.
[0031] Specifically, the structural attributes of the target electricity meter are used as comparison constraints. These structural attributes include at least the equipment type, measurement circuit design, and device aging characteristics. The electricity metering error compensation model library is searched, and multiple candidate power factor error compensation models, multiple candidate grid fluctuation error compensation models, and multiple candidate environmental factor error compensation models are obtained by matching.
[0032] Furthermore, model feature similarity comparisons are performed on multiple candidate error compensation models of the three types. The model similarity is obtained by calculating the similarity of the model training dataset and the similarity of the model features, and then the model deviation is obtained by subtracting the model similarity from 1. A preset number of models with large deviations are selected as the associated models.
[0033] Ultimately, several related power factor error compensation models, several related power grid fluctuation error compensation models, and several related environmental factor error compensation models were obtained, which served as several multidimensional error compensation models.
[0034] This step, through the combination of structural attribute constraints and deviation screening, ensures the diversity and adaptability of the model, providing a reliable foundation for the subsequent construction of the error compensator.
[0035] Step S110 in the method provided in this application embodiment includes:
[0036] Using the structural attributes of the target energy meter as a comparison constraint, the energy metering error compensation model library is searched, and multiple candidate power factor error compensation models, multiple candidate grid fluctuation error compensation models, and multiple candidate environmental factor error compensation models are obtained by matching. The structural attributes include at least equipment type, measurement circuit design, and device aging characteristics.
[0037] The model feature similarity comparisons of the multiple candidate power factor error compensation models, multiple candidate power grid fluctuation error compensation models, and multiple candidate environmental factor error compensation models are performed respectively. A preset number of models with large deviations are selected as associated models to obtain several associated power factor error compensation models, several associated power grid fluctuation error compensation models, and several associated environmental factor error compensation models, which are used as several multidimensional error compensation models.
[0038] In this embodiment of the application, in the model screening stage of electricity metering error compensation, in order to ensure that the screened models can adapt to the characteristics of the target electricity meter and have diversity, it is necessary to achieve accurate matching and differentiated selection through structural attribute constraints and model feature similarity comparison.
[0039] Specifically, the first step is to use the equipment type, measurement circuit design and device aging characteristics of the target energy meter as constraints to search for matching candidate models in the energy metering error compensation model library.
[0040] Among them, the candidate models are divided into three categories: power factor error compensation model based on power factor feature prediction error and output compensation coefficient; power grid fluctuation error compensation model based on voltage fluctuation, harmonics and electromagnetic noise compensation; and environmental factor error compensation model based on temperature, humidity and electromagnetic interference intensity compensation. All three types of models are machine learning models with different training data and model structures.
[0041] Furthermore, feature similarity comparisons are performed on similar candidate models to achieve model differentiation screening and ensure the diversity and robustness of the integrated model.
[0042] The method provided in this application embodiment includes the following steps: "comparing the model features of the plurality of candidate power factor error compensation models and outputting several associated power factor error compensation models".
[0043] A first candidate power factor error compensation model is randomly selected, and a first training dataset and first model features are obtained. The model features include model structure, training method and model complexity.
[0044] The first training dataset and the training datasets of other candidate power factor error compensation models are compared for similarity, and the first data similarity mean is output.
[0045] The first model features and the model features of other candidate power factor error compensation models are compared for similarity, and the average similarity of the first features is output. The first model similarity is obtained by weighted calculation in combination with the average similarity of the first data.
[0046] The first model deviation is obtained by subtracting the first model similarity from 1. The multiple model deviations of the multiple candidate power factor error compensation models are calculated in sequence, and a preset number of models with large deviations are selected as associated power factor error compensation models to obtain several associated power factor error compensation models.
[0047] In this embodiment of the application, when comparing the features of multiple candidate power factor error compensation models to screen related models, it is necessary to achieve accurate screening through benchmark model selection, two-dimensional similarity calculation and deviation quantification, so as to ensure the comprehensiveness and stability of subsequent error compensation.
[0048] Specifically, taking the selection of power factor error compensation models as an example (the feature similarity comparison method for the other two types of candidate models is the same), a candidate power factor error compensation model is first randomly selected as the benchmark model, and its training dataset and model features are obtained. The model features include model structure, training method, and model complexity.
[0049] Furthermore, the training dataset of the benchmark model is compared with the training datasets of other candidate power factor error compensation models to obtain the mean data similarity.
[0050] For example, if the training dataset of the baseline model is the power factor error data of a steel plant (high power load) within one year, and the training dataset of another candidate model is the relevant data of a residential community (low power load) for 6 months, the average similarity between the two datasets is 0.25.
[0051] Meanwhile, the features of the benchmark model are compared with the features of other candidate models to obtain the average feature similarity.
[0052] For example, the baseline model is a 5-layer deep learning network (model structure), trained with an adaptive learning rate (training method), and has 100,000 parameters (model complexity). The other candidate model is a traditional linear regression model (model structure), trained with a fixed learning rate (training method), and has 1,000 parameters (model complexity). The average feature similarity between the two is 0.15.
[0053] Furthermore, the first model similarity is obtained by weighting the first data similarity mean and the first feature similarity mean. The overall similarity between models is comprehensively measured, and then the model similarity is subtracted from 1 to obtain the model deviation.
[0054] The weights can be dynamically adjusted according to the application scenario of the target electricity meter. For example, in industrial scenarios, if data volatility has a greater impact on the compensation effect, the weight of data similarity can be increased.
[0055] For example, if the average weight of data similarity is 0.3 and the average weight of feature similarity is 0.7, then the model similarity is 0.25×0.3+0.15×0.7=0.18 and the model deviation is 1-0.18=0.82.
[0056] Finally, after calculating the deviation of all candidate models using this method, a preset number of models with large deviations are selected as associated models, resulting in several associated power factor, grid fluctuation, and environmental factor error compensation models, which together constitute a multidimensional error compensation model.
[0057] For example, if three models with large deviations are selected in advance, the above-mentioned candidate model and two other models with deviations of 0.78 and 0.85 respectively are selected as the associated power factor error compensation model. Combined with the screened associated power grid fluctuation and environmental factor error compensation models, a multi-dimensional error compensation model is formed.
[0058] This step, through two-dimensional comparison and deviation quantification, ensures that the selected models have significant differences in data foundation and feature attributes, and can address power factor-related measurement errors from different perspectives, effectively improving the compensation accuracy and adaptability of subsequent integrated models.
[0059] S120: Based on the transfer learning algorithm, according to the sample error data of the target energy meter, the several multi-dimensional error compensation models are tested respectively, and several model test datasets are output.
[0060] In this embodiment of the application, in order to achieve quantitative evaluation of the performance of the multidimensional error compensation model and improve the model's adaptability to the target scene, it is necessary to combine the transfer learning algorithm and construct the model test dataset through stratified testing of sample data and dual-dimensional index output.
[0061] Specifically, based on the principle of transfer learning, the source domain data of the model training stage is aligned with the target domain data of the target energy meter through domain adaptive processing, thereby reducing the impact of data distribution differences on the test results.
[0062] Furthermore, based on the source of error, three types of targeted test datasets are obtained: power factor test dataset, power grid fluctuation test dataset, and environmental factor test dataset. These datasets correspond to the test requirements of three types of error compensation models, ensuring high adaptability of the test data to the target scenario.
[0063] Furthermore, multiple rounds of testing were conducted on several associated power factor error compensation models using the power factor test dataset. The generalization ability of the models on the target data was optimized through the knowledge transfer mechanism of transfer learning. The average test accuracy and the test result fluctuation coefficient were output as model test data, forming several power factor model test datasets.
[0064] Among them, the test result fluctuation coefficient is the ratio of the standard deviation to the mean of the accuracy of multiple rounds of testing, which is used to reflect the stability of the model output.
[0065] Similarly, using the power grid fluctuation test dataset and the environmental factor test dataset, and combining transfer learning, multiple rounds of testing were conducted on several related power grid fluctuation error compensation models and several related environmental factor error compensation models. By dynamically adjusting the model parameters, cross-scenario knowledge transfer was achieved, and several power grid fluctuation model test data and several environmental factor model test data were output.
[0066] This step, based on the transfer learning algorithm, combines hierarchical testing with dual-index quantification to provide accurate performance data support for subsequent model fit evaluation and weight configuration, ensuring the scientific nature of model selection and fusion.
[0067] Step S120 in the method provided in this application embodiment includes:
[0068] Based on the sample error data of the target electricity meter, power factor test dataset, power grid fluctuation test dataset, and environmental factor test dataset were obtained.
[0069] Using the power factor test dataset, multiple rounds of testing are conducted on the several associated power factor error compensation models. The mean test accuracy and the test result fluctuation coefficient are output as model test data, resulting in several power factor model test data. The test result fluctuation coefficient is the ratio of the standard deviation of the accuracy of multiple rounds of testing to the mean of the accuracy of multiple rounds of testing.
[0070] Using the power grid fluctuation test dataset and the environmental factor test dataset, multiple rounds of testing are conducted on the several related power grid fluctuation error compensation models and the several related environmental factor error compensation models, respectively, and the test data of several power grid fluctuation models and the test data of several environmental factor models are output.
[0071] In this embodiment of the application, in order to achieve quantitative evaluation of the performance of the association model, it is necessary to construct a hierarchical test dataset and output dual indicators to form a test dataset that comprehensively reflects the model performance, so as to provide an objective basis for subsequent fitness evaluation.
[0072] Specifically, based on the principle of transfer learning, the source domain data of the model training stage is aligned with the target domain data of the target energy meter through domain adaptive processing, thereby reducing the impact of data distribution differences on the test results.
[0073] Furthermore, based on the sample error data of the target electricity meter, the data is stratified and filtered according to the source of error to construct three types of targeted test datasets: power factor test dataset, power grid fluctuation test dataset, and environmental factor test dataset, to ensure accurate matching between the test data and the model function.
[0074] The dataset includes error samples for different power factor scenarios, power grid fluctuation test data for voltage fluctuations, harmonics, and electromagnetic noise, and environmental factors test data for temperature, humidity, and electromagnetic interference intensity. During the data selection process, a sample weighting strategy based on transfer learning is used to enhance the influence of samples similar to the target scenario.
[0075] For example, if the target electricity meter is an industrial-grade three-phase electricity meter, its sample error data includes measurement errors caused by power factor changes, grid voltage fluctuations, and high-temperature environments in the workshop. After stratified screening, the power factor test dataset can cover error samples for scenarios such as power factor 0.7 (lagging) and 0.9 (leading); the grid fluctuation test dataset includes error samples related to voltage fluctuations of ±7%, 5th harmonics, and high-frequency electromagnetic noise; and the environmental factor test dataset includes error samples corresponding to a temperature of 45℃, humidity of 60%, and electromagnetic interference intensity of 120dBμV / m.
[0076] Furthermore, multiple rounds of testing were conducted on the power factor error compensation model using a power factor test dataset. Before testing, the parameters of the model were fine-tuned using transfer learning, the parameters of the lower-level feature extraction layer were frozen, and only the higher-level parameters related to the power factor were adjusted to optimize the model's generalization ability on the target data.
[0077] Specifically, several test samples are first randomly divided from the power factor test dataset. Each sample group covers measurement error data corresponding to different power factor value ranges to ensure the diversity and representativeness of the test samples.
[0078] For example, 10 test samples are randomly divided from the power factor test dataset mentioned above, each containing 300 data points, covering measurement error samples in different scenarios such as lag and lead within the power factor range of 0.6 to 1.0.
[0079] Furthermore, each set of test samples is sequentially input into the associated power factor error compensation model, the error compensation result of the model for each set of samples is recorded, and compared with the actual error value to calculate the accuracy of this round of testing (i.e. the proportion of samples whose deviation between the compensation result and the actual error value is within a preset threshold).
[0080] For example, after inputting the first set of samples into the model, there were 285 samples whose compensation result deviation was within the ±0.5% threshold, and the accuracy rate of this round of testing was 95%; the accuracy rate of the second set of samples was 93%.
[0081] Furthermore, this process is repeated for multiple rounds of testing (e.g., 10 rounds, 20 rounds, etc.), with the test sample groups being randomly re-divided in each round to avoid the influence of fixed sample division on the results.
[0082] After the testing is completed, the accuracy of multiple rounds of testing is statistically analyzed, that is, the arithmetic mean of the accuracy of all rounds is calculated as the mean test accuracy. This mean can intuitively reflect the overall accuracy of the model in power factor-related error compensation.
[0083] For example, the accuracy rates of the above 10 rounds of testing are 95%, 93%, 94%, 92%, 95%, 93%, 94%, 92%, 95%, and 93%, respectively. The average accuracy rate is (95% + 93% + ... + 93%) / 10 = 93.6%.
[0084] Meanwhile, the standard deviation of the accuracy over multiple rounds is calculated, and then the standard deviation is divided by the mean of the test accuracy to obtain the fluctuation coefficient of the test results. By comparing the fluctuation coefficients before and after transfer learning, the effect of parameter transfer on the improvement of model stability can be quantitatively evaluated.
[0085] For example, by calculating the deviation between the accuracy rate of each of the above 10 rounds and the mean of the test accuracy rate, and squaring them, the sum of squared deviations (11.2%) is obtained. 2 Then divide by the number of rounds (10) to get the variance (1.12%). 2 If the standard deviation obtained by taking the square root of the result is approximately 1.1%, then the fluctuation coefficient of the test result is approximately 1.1% / 93.6%≈1.2%.
[0086] The smaller the fluctuation coefficient, the less the model performance is affected by the differences in sample partitioning, and the more stable the output. Conversely, the larger the fluctuation coefficient, the greater the impact of the differences in sample partitioning on the model performance, the worse the output stability, and the more obvious the fluctuation in the compensation effect under different test scenarios.
[0087] Similarly, using the power grid fluctuation test dataset and the environmental factor test dataset, and combining transfer learning, multiple rounds of testing were conducted on the error compensation models for the associated power grid fluctuation and environmental factors, so as to output the corresponding model test data.
[0088] Through multiple rounds of repeated testing and dual-index calculation in the above steps, the error compensation performance of the associated power factor error compensation model under different power factor scenarios was quantified, providing reliable data support for subsequent model fit evaluation and configuration of multi-dimensional weight fusion strategies based on the model test dataset.
[0089] S130: Using the maximization of model output accuracy and output stability as a comprehensive evaluation index, the model fit is evaluated based on the aforementioned model test datasets, and a multi-dimensional weight fusion strategy is configured based on the evaluation results.
[0090] In this embodiment of the application, during the model adaptation and weight fusion stage of power metering error compensation, it is necessary to combine scenario characteristics and model performance data to achieve accurate strategy configuration.
[0091] Specifically, the output stability requirements analysis is first conducted based on the load fluctuation characteristics, environmental fluctuation characteristics, and device aging characteristics of the target electricity meter during the current period of electricity metering error compensation.
[0092] Among them, the stability weight is positively correlated with load fluctuation, environmental fluctuation and device aging degree, and does not exceed 0.3. Based on this, the stability weight is configured, and the accuracy weight is obtained by subtracting the stability weight from 1.
[0093] Furthermore, based on the obtained stability weights and accuracy weights, and combined with test data from several power factor models, power grid fluctuation models, and environmental factor models, the model fit is calculated respectively, and the model fit of the three types of models—power factor, power grid fluctuation, and environmental factors—is output.
[0094] Finally, taking the maximization of model output accuracy and stability as a comprehensive evaluation index, and based on these model fit results, the fit of the multidimensional error compensation model is evaluated, and then a multidimensional weight fusion strategy is configured to make the model combination and weight allocation more scientific in different scenarios, thereby improving the overall effect of error compensation.
[0095] Step S130 in the method provided in this application embodiment includes:
[0096] Based on the load fluctuation characteristics and environmental fluctuation characteristics during the current period of electricity metering error compensation, as well as the device aging characteristics of the target electricity meter, an output stability requirement analysis is performed, and a stability weight is configured. The stability weight is positively correlated with load fluctuation, environmental fluctuation, and device aging degree, and the stability weight is no greater than 0.3.
[0097] The accuracy weight is obtained by subtracting the stability weight from 1.
[0098] Based on the stability weight and accuracy weight, the model fit is calculated according to the test data of several power factor models, several power grid fluctuation models, and several environmental factor models, and the model fit is output as several power factor model fits, several power grid fluctuation model fits, and several environmental factor model fits.
[0099] In this embodiment of the application, during the model fit calculation and weight configuration stage of power metering error compensation, it is necessary to combine scenario characteristics and model performance data, and derive the fit through the dual-dimensional weights of stability and accuracy to form a scientific model evaluation result.
[0100] Specifically, the first step is to conduct an output stability requirement analysis by comprehensively analyzing the load fluctuation characteristics, environmental fluctuation characteristics, and device aging characteristics of the target electricity meter, based on the current time period of electricity metering error compensation.
[0101] Among them, the stability weight is positively correlated with load fluctuation, environmental fluctuation, and device aging degree, and does not exceed 0.3. At the same time, the accuracy weight is obtained by subtracting the stability weight from 1, thus constructing a two-dimensional weight system.
[0102] Furthermore, based on the established stability weights and accuracy weights, model fit calculations are performed for several power factor model test data, power grid fluctuation model test data, and environmental factor model test data, respectively.
[0103] For example, when calculating the power factor model fit, if the current time period is a residential community's nighttime electricity consumption scenario with small load fluctuations, stable environment (temperature maintained at around 25℃, humidity moderate), and the target electricity meter has only been in use for 1 year (low degree of device aging), and based on the output stability requirement analysis, the stability weight is configured as 0.15, then the accuracy weight is 1-0.15=0.85.
[0104] For power factor model test data, there are test data for 3 associated power factor error compensation models. Among them, model A has an average test accuracy of 94% and a fluctuation coefficient of 1.1%; model B has an average test accuracy of 92% and a fluctuation coefficient of 1.0%; and model C has an average test accuracy of 93% and a fluctuation coefficient of 1.2%.
[0105] When calculating fitness, the impact of volatility coefficient on stability is considered based on stability weight, and accuracy performance is measured by accuracy weight. The formula "fitness = stability weight × (1 - volatility coefficient) + accuracy weight × mean accuracy" is used for calculation.
[0106] Specifically, the fitness of model A is 0.15×(1-1.1%)+0.85×94%≈0.947; the fitness of model B is 0.15×(1-1.0%)+0.85×92%≈0.9305; and the fitness of model C is 0.15×(1-1.2%)+0.85×93%≈0.9377. Several power factor model fitness values are obtained in this way.
[0107] Similarly, based on the test data of the power grid fluctuation model and the test data of the environmental factor model, and combined with the stability weight and accuracy weight configured in the corresponding scenarios, several power grid fluctuation model fit degrees and several environmental factor model fit degrees are calculated according to the above calculation logic, providing data support for the subsequent configuration of multi-dimensional weight fusion strategies.
[0108] In the method provided in this application embodiment, "the power factor model weight distribution, power grid fluctuation model weight distribution, and environmental factor model weight distribution are configured according to the several power factor model fit degrees, several power grid fluctuation model fit degrees, and several environmental factor model fit degrees, respectively, as a multi-dimensional weight fusion strategy, wherein the model weight is the ratio of the model fit degree to the sum of the fit degrees of similar models."
[0109] In this embodiment of the application, after the model fit calculation is completed, the model fit of similar models needs to be normalized to achieve accurate configuration of the multi-dimensional weight fusion strategy, so as to provide a quantitative basis for the subsequent integrated construction of the error compensator.
[0110] Specifically, for the power factor error compensation model, the fitness of several related power factor error compensation models is summed to obtain the total fitness of the power factor model.
[0111] Furthermore, the fitness of each associated power factor error compensation model is compared with the sum to obtain the weight of each model in the power factor error compensation dimension, thus forming the power factor model weight distribution.
[0112] Similarly, for the power grid fluctuation error compensation model, the sum of the fitness of several related power grid fluctuation error compensation models is calculated, and the fitness of each model is compared with the sum to obtain its respective weight, thus forming the power grid fluctuation model weight distribution.
[0113] Meanwhile, for the environmental factor error compensation model, the weights of each model are determined by the same calculation method, namely the ratio of the fitness of each associated environmental factor error compensation model to the sum of the fitness of similar models, thus forming the environmental factor model weight distribution.
[0114] For example, if the fitness scores of the three associated power factor error compensation models are 0.947, 0.9305, and 0.9377 respectively, and their total fitness score is 0.947 + 0.9305 + 0.9377 = 2.8152, then the weights of the three models are 0.947 / 2.8152 ≈ 0.336, 0.9305 / 2.8152 ≈ 0.330, and 0.9377 / 2.8152 ≈ 0.334 respectively, forming the power factor model weight distribution (0.336, 0.330, 0.334).
[0115] By using this weighting method based on the fit ratio, the model with better performance occupies a higher weight in the same type of ensemble, ensuring that the multi-dimensional weight fusion strategy can give full play to the advantages of each model and improve the overall accuracy and stability of error compensation.
[0116] S140: According to the multi-dimensional weight fusion strategy, an adaptive metering error compensator is constructed by integrating the several multi-dimensional error compensation models to perform metering error compensation for the target energy meter.
[0117] In this embodiment of the application, in order to achieve accurate compensation for the metering error of the target electricity meter, it is necessary to construct a hierarchical integrated adaptive metering error compensator based on the principle of integrated learning and the multi-dimensional weight fusion strategy.
[0118] Specifically, firstly, regarding the measurement error related to the power factor, based on the principle of ensemble learning, several related power factor error compensation models are integrated according to the configured power factor model weight distribution to construct a power factor error compensation unit. This unit can combine the weight advantages of each model to output a comprehensive compensation result for the power factor error.
[0119] Furthermore, for metering errors caused by power grid fluctuations, based on the principle of ensemble learning and according to the weight distribution of the power grid fluctuation model, several related power grid fluctuation error compensation models are integrated to construct a power grid fluctuation error compensation unit, so as to combine the compensation capabilities of each model and generate a comprehensive compensation result for power grid fluctuation errors.
[0120] Similarly, to address measurement errors caused by environmental factors, based on the weight distribution of the environmental factor model, several related environmental factor error compensation models are integrated to construct an environmental factor error compensation unit, thereby achieving comprehensive compensation for environmental factor errors.
[0121] Finally, the constructed power factor error compensation unit, power grid fluctuation error compensation unit, and environmental factor error compensation unit are combined with the superimposed fusion layer to construct a complete adaptive metering error compensator.
[0122] The superposition and fusion layer is used to sum the compensation results output by the three error compensation units, and finally generate the overall metering error compensation value of the target energy meter and perform compensation.
[0123] This step, through hierarchical integration and weighted fusion, fully leverages the advantages of various multi-dimensional error compensation models, improves the accuracy and reliability of metering error compensation, and ensures that the metering accuracy of the target electricity meter meets the requirements.
[0124] Step S140 in the method provided in this application embodiment includes:
[0125] Based on the principle of ensemble learning, a power factor error compensation unit is constructed by integrating the power factor model weight distribution and several associated power factor error compensation models.
[0126] Based on the principle of ensemble learning, a power grid fluctuation error compensation unit is constructed by integrating the weight distribution of the power grid fluctuation model and several related power grid fluctuation error compensation models.
[0127] Based on the principle of ensemble learning, an environmental factor error compensation unit is constructed by integrating the weight distribution of the environmental factor model and several related environmental factor error compensation models.
[0128] An adaptive metering error compensator is constructed based on the power factor error compensation unit, the power grid fluctuation error compensation unit, the environmental factor error compensation unit, and the superposition and fusion layer.
[0129] In this embodiment of the application, during the compensator construction stage for electricity metering error compensation, it is necessary to construct an adaptive metering error compensator based on the principle of ensemble learning by hierarchically integrating error compensation models of various dimensions and performing fusion processing, so as to achieve accurate compensation for the metering error of the target electricity meter.
[0130] Specifically, for measurement errors related to power factor, based on the principle of ensemble learning, several associated power factor error compensation models are integrated according to the determined weight distribution of the power factor model to construct a power factor error compensation unit.
[0131] This unit integrates the output results of each associated model through a weighted summation method. That is, the compensation value of each model is multiplied by its corresponding weight and then summed to obtain the comprehensive compensation result for the power factor error.
[0132] Furthermore, for metering errors caused by power grid fluctuations, based on the principle of ensemble learning and according to the weight distribution of the power grid fluctuation model, several related power grid fluctuation error compensation models are integrated to construct a power grid fluctuation error compensation unit.
[0133] This unit is consistent with the power factor error compensation unit, and it also integrates the compensation outputs of each model through weighted summation to generate a comprehensive compensation result for grid fluctuation error.
[0134] Similarly, for measurement errors caused by environmental factors, based on the weight distribution of the environmental factor model, several related environmental factor error compensation models are integrated to construct an environmental factor error compensation unit, and the comprehensive compensation result of environmental factor error is output in a weighted summation manner.
[0135] Finally, the constructed power factor error compensation unit, power grid fluctuation error compensation unit, and environmental factor error compensation unit are combined with the superimposed fusion layer to form a complete adaptive metering error compensator.
[0136] The core function of the superposition and fusion layer is to superimpose and sum the comprehensive compensation results output by the three error compensation units, and use the sum of the three compensation values as the final metering error compensation value of the target energy meter, thereby performing the error compensation operation.
[0137] For example, if the comprehensive compensation value output by the power factor error compensation unit is 0.5%, the comprehensive compensation value output by the power grid fluctuation error compensation unit is 0.3%, and the comprehensive compensation value output by the environmental factor error compensation unit is 0.2%, then the superposition and fusion layer adds these three values to obtain a final compensation value of 0.5% + 0.3% + 0.2% = 1.0%, and uses this to compensate for the metering error of the target electricity meter.
[0138] By integrating and merging different layers, the advantages of different error compensation models are fully combined, ensuring that the compensator can comprehensively and accurately cope with various metering errors and effectively improve the metering accuracy of the target electricity meter.
[0139] Ultimately, after compensation by the adaptive metering error compensator, the metering error of the target electricity meter is controlled within the preset allowable range, significantly reducing the metering deviation caused by power factor, grid fluctuations, environmental factors, etc., making the electricity metering results closer to the actual electricity consumption.
[0140] The embodiments of this application, through the specific implementation methods described above, achieve the following technical effects:
[0141] This application proposes a method for compensating electricity metering errors based on transfer learning. First, constrained by the structural attributes of the target electricity meter, a model library for electricity metering error compensation is searched, and multiple candidate models for power factor, grid fluctuation, and environmental factor error compensation are obtained. By comparing the features of these candidate models, the similarity between the training dataset and the model features is calculated. After weighting the model similarity, the deviation is derived, and a predetermined number of models with large deviations are selected as associated models to form a multi-dimensional error compensation model. Next, based on the transfer learning algorithm and the sample error data of the target electricity meter, three types of test datasets—power factor, grid fluctuation, and environmental factors—are selected. Multiple rounds of testing are conducted on the associated models, outputting a test dataset containing the average test accuracy and fluctuation coefficient. Then, using accuracy and stability as indicators, weights are configured in conjunction with scenario features to evaluate model adaptability and form a multi-dimensional weight fusion strategy. Finally, an adapted metering error compensator is constructed according to the strategy to perform metering error compensation for the target electricity meter.
[0142] The method provided in this application, through the technical solution of "model matching-test evaluation-weight configuration-compensator construction", solves the problems of low compensation accuracy and poor stability caused by poor model universality and insufficient scenario adaptation in traditional error compensation. It realizes efficient and accurate compensation of electricity metering errors and provides reliable technical support for improving the metering accuracy of electricity meters.
[0143] Example 2, as shown in the appendix Figure 2 As shown, based on the inventive concept of a transfer learning-based method for compensating electricity metering errors provided in Embodiment 1, this application also provides a transfer learning-based system for compensating electricity metering errors, specifically including:
[0144] Model matching module 01 is used to obtain several multi-dimensional error compensation models by searching the energy metering error compensation model library, using the structural properties of the target energy meter as comparison constraints.
[0145] Model testing module 02 is used to test the several multi-dimensional error compensation models based on the transfer learning algorithm and the sample error data of the target energy meter, and output several model test datasets.
[0146] The fitness assessment and weight configuration module 03 is used to evaluate the model fitness based on the several model test datasets, taking the maximization of model output accuracy and output stability as a comprehensive evaluation index, and to configure a multi-dimensional weight fusion strategy based on the evaluation results.
[0147] The compensator construction and execution module 04 is used to construct an adaptive metering error compensator by integrating the several multi-dimensional error compensation models according to the multi-dimensional weight fusion strategy, and to perform metering error compensation for the target energy meter.
[0148] In one embodiment, the model matching module 01 is further configured to:
[0149] Using the structural attributes of the target energy meter as a comparison constraint, the energy metering error compensation model library is searched, and multiple candidate power factor error compensation models, multiple candidate grid fluctuation error compensation models, and multiple candidate environmental factor error compensation models are obtained by matching. The structural attributes include at least equipment type, measurement circuit design, and device aging characteristics.
[0150] The model feature similarity comparisons of the multiple candidate power factor error compensation models, multiple candidate power grid fluctuation error compensation models, and multiple candidate environmental factor error compensation models are performed respectively. A preset number of models with large deviations are selected as associated models to obtain several associated power factor error compensation models, several associated power grid fluctuation error compensation models, and several associated environmental factor error compensation models, which are used as several multidimensional error compensation models.
[0151] In one embodiment, the model testing module 02 is also used for:
[0152] Based on the sample error data of the target electricity meter, power factor test dataset, power grid fluctuation test dataset, and environmental factor test dataset were obtained.
[0153] Using the power factor test dataset, multiple rounds of testing are conducted on the several associated power factor error compensation models. The mean test accuracy and the test result fluctuation coefficient are output as model test data, resulting in several power factor model test data. The test result fluctuation coefficient is the ratio of the standard deviation of the accuracy of multiple rounds of testing to the mean of the accuracy of multiple rounds of testing.
[0154] Using the power grid fluctuation test dataset and the environmental factor test dataset, multiple rounds of testing are conducted on the several related power grid fluctuation error compensation models and the several related environmental factor error compensation models, respectively, and the test data of several power grid fluctuation models and the test data of several environmental factor models are output.
[0155] In one embodiment, the fit evaluation and weight configuration module 03 is further used for:
[0156] Based on the load fluctuation characteristics and environmental fluctuation characteristics during the current period of electricity metering error compensation, as well as the device aging characteristics of the target electricity meter, an output stability requirement analysis is performed, and a stability weight is configured. The stability weight is positively correlated with load fluctuation, environmental fluctuation, and device aging degree, and the stability weight is no greater than 0.3.
[0157] The accuracy weight is obtained by subtracting the stability weight from 1.
[0158] Based on the stability weight and accuracy weight, the model fit is calculated according to the test data of several power factor models, several power grid fluctuation models, and several environmental factor models, and the model fit is output as several power factor model fits, several power grid fluctuation model fits, and several environmental factor model fits.
[0159] In one embodiment, the compensator construction and execution module 04 is further configured to:
[0160] Based on the principle of ensemble learning, a power factor error compensation unit is constructed by integrating the power factor model weight distribution and several associated power factor error compensation models.
[0161] Based on the principle of ensemble learning, a power grid fluctuation error compensation unit is constructed by integrating the weight distribution of the power grid fluctuation model and several related power grid fluctuation error compensation models.
[0162] Based on the principle of ensemble learning, an environmental factor error compensation unit is constructed by integrating the weight distribution of the environmental factor model and several related environmental factor error compensation models.
[0163] An adaptive metering error compensator is constructed based on the power factor error compensation unit, the power grid fluctuation error compensation unit, the environmental factor error compensation unit, and the superposition and fusion layer.
[0164] When the computer program is executed by the processor, it implements the method for compensating for electricity metering errors based on transfer learning, as described in Embodiment 1.
[0165] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this specification. Additionally, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are possible or may be advantageous.
[0166] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
[0167] This specification and accompanying drawings are merely illustrative examples of this application and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from its scope. Therefore, if such modifications and variations fall within the scope of this application and its equivalents, this application intends to include such modifications and variations.
Claims
1. A method for compensating for electricity metering errors based on transfer learning, characterized in that, The methods include: Using the structural properties of the target electricity meter as a comparison constraint, several multi-dimensional error compensation models are obtained by searching the electricity metering error compensation model library. Based on the transfer learning algorithm, the multidimensional error compensation models are tested according to the sample error data of the target energy meter, and several model test datasets are output. Using the maximization of model output accuracy and output stability as comprehensive evaluation indicators, model fitness is evaluated based on several model test datasets, and a multi-dimensional weight fusion strategy is configured based on the evaluation results. According to the multi-dimensional weight fusion strategy, an adaptive metering error compensator is constructed by integrating the several multi-dimensional error compensation models to perform metering error compensation for the target energy meter. Among them, using the structural properties of the target electricity meter as a comparison constraint, several multi-dimensional error compensation models are obtained by searching the electricity metering error compensation model library, including: Using the structural attributes of the target energy meter as a comparison constraint, the energy metering error compensation model library is searched, and multiple candidate power factor error compensation models, multiple candidate grid fluctuation error compensation models, and multiple candidate environmental factor error compensation models are obtained by matching. The structural attributes include at least equipment type, measurement circuit design, and device aging characteristics. The model feature similarity comparisons of the multiple candidate power factor error compensation models, multiple candidate power grid fluctuation error compensation models, and multiple candidate environmental factor error compensation models are performed respectively. A preset number of models with large deviations are selected as associated models to obtain several associated power factor error compensation models, several associated power grid fluctuation error compensation models, and several associated environmental factor error compensation models, which are used as several multidimensional error compensation models. Specifically, a model feature similarity comparison is performed on the multiple candidate power factor error compensation models to output several associated power factor error compensation models, including: A first candidate power factor error compensation model is randomly selected, and a first training dataset and first model features are obtained. The model features include model structure, training method and model complexity. The first training dataset and the training datasets of other candidate power factor error compensation models are compared for similarity, and the first data similarity mean is output. The first model features and the model features of other candidate power factor error compensation models are compared for similarity, and the average similarity of the first features is output. The first model similarity is obtained by weighted calculation in combination with the average similarity of the first data. The first model deviation is obtained by subtracting the first model similarity from 1. The multiple model deviations of the multiple candidate power factor error compensation models are calculated in sequence, and a preset number of models with large deviations are selected as associated power factor error compensation models to obtain several associated power factor error compensation models.
2. The method for compensating for electricity metering errors based on transfer learning according to claim 1, characterized in that, Based on the sample error data of the target electricity meter, the various multidimensional error compensation models are tested, and several model test datasets are output, including: Based on the sample error data of the target electricity meter, power factor test dataset, power grid fluctuation test dataset, and environmental factor test dataset were obtained. Using the power factor test dataset, multiple rounds of testing are conducted on the several associated power factor error compensation models. The mean test accuracy and the test result fluctuation coefficient are output as model test data, resulting in several power factor model test data. The test result fluctuation coefficient is the ratio of the standard deviation of the accuracy of multiple rounds of testing to the mean of the accuracy of multiple rounds of testing. Using the power grid fluctuation test dataset and the environmental factor test dataset, multiple rounds of testing are conducted on the several related power grid fluctuation error compensation models and the several related environmental factor error compensation models, respectively, and the test data of several power grid fluctuation models and the test data of several environmental factor models are output.
3. The method for compensating for electricity metering errors based on transfer learning according to claim 2, characterized in that, Using the maximization of model output accuracy and output stability as comprehensive evaluation metrics, model fit is evaluated based on the aforementioned model test datasets, including: Based on the load fluctuation characteristics and environmental fluctuation characteristics during the current period of electricity metering error compensation, as well as the device aging characteristics of the target electricity meter, an output stability requirement analysis is performed, and a stability weight is configured. The stability weight is positively correlated with load fluctuation, environmental fluctuation, and device aging degree, and the stability weight is no greater than 0.
3. The accuracy weight is obtained by subtracting the stability weight from 1. Based on the stability weight and accuracy weight, the model fit is calculated according to the test data of several power factor models, several power grid fluctuation models, and several environmental factor models, and the model fit is output as several power factor model fits, several power grid fluctuation model fits, and several environmental factor model fits.
4. The method for compensating for electricity metering errors based on transfer learning according to claim 3, characterized in that, Based on the fitness of several power factor models, several power grid fluctuation models, and several environmental factor models, the weight distributions of the power factor model, power grid fluctuation model, and environmental factor model are configured respectively as a multi-dimensional weight fusion strategy. Here, the model weight is the ratio of the model fitness to the sum of the fitness of similar models.
5. The method for compensating for electricity metering errors based on transfer learning according to claim 4, characterized in that, According to the aforementioned multi-dimensional weight fusion strategy, an adaptive metrology error compensator is constructed by integrating the aforementioned multi-dimensional error compensation models, including: Based on the principle of ensemble learning, a power factor error compensation unit is constructed by integrating the power factor model weight distribution and several associated power factor error compensation models. Based on the principle of ensemble learning, a power grid fluctuation error compensation unit is constructed by integrating the weight distribution of the power grid fluctuation model and several related power grid fluctuation error compensation models. Based on the principle of ensemble learning, an environmental factor error compensation unit is constructed by integrating the weight distribution of the environmental factor model and several related environmental factor error compensation models. An adaptive metering error compensator is constructed based on the power factor error compensation unit, the power grid fluctuation error compensation unit, the environmental factor error compensation unit, and the superposition and fusion layer.
6. A power metering error compensation system based on transfer learning, characterized in that, The system is used to execute the electricity metering error compensation method based on transfer learning as described in any one of claims 1-5, and the system comprises: The model matching module is used to obtain several multi-dimensional error compensation models by searching the energy metering error compensation model library, using the structural properties of the target energy meter as comparison constraints. The model testing module is used to test the several multi-dimensional error compensation models based on the transfer learning algorithm and the sample error data of the target energy meter, and output several model test datasets. The fitness assessment and weight configuration module is used to evaluate the model fitness based on the several model test datasets, taking the maximization of model output accuracy and output stability as a comprehensive evaluation index, and to configure a multi-dimensional weight fusion strategy based on the evaluation results. The compensator construction and execution module is used to construct an adaptive metering error compensator by integrating the several multi-dimensional error compensation models according to the multi-dimensional weight fusion strategy, and to perform metering error compensation for the target energy meter.
Citation Information
Patent Citations
Wind power prediction method and device, electronic equipment and storage medium
CN114757444A
Electric quantity prediction method and system based on combination of multiple electric quantity prediction models
CN117933457A