A power metering calibration method and system based on MSCOFA
By constructing a smart meter metering error model using the Multi-Strategy Constraint Optimization Firefly Algorithm (MSCOFA), the problems of low accuracy and poor stability in traditional methods are solved, and high-precision and stable power metering calibration is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING NENGRUI AUTOMATION EQUIP
- Filing Date
- 2026-03-13
- Publication Date
- 2026-06-30
AI Technical Summary
Traditional methods and the basic firefly algorithm suffer from low accuracy, poor stability, and difficulty in handling constraints in multi-parameter nonlinear calibration of smart meters.
The Multi-Strategy Constraint Optimization Firefly Algorithm (MSCOFA) is adopted. By constructing a comprehensive metering error model for smart meters, and combining parameter adaptive optimization, hybrid optimization, population management and diversity maintenance and constraint processing mechanisms, iterative optimization is performed to obtain the optimal error parameters and then calibration compensation is performed.
It significantly reduced the root mean square error and the average relative error, improved calibration accuracy and stability, ensured that the optimization results conformed to the physical characteristics of smart meters, and enhanced the practicality of calibration.
Smart Images

Figure CN122307451A_ABST
Abstract
Description
[0001] Technology Neighborhood
[0002] This invention belongs to the field of power metering and calibration technology, specifically relating to a power metering and calibration method and system based on MSCOFA. Background Technology
[0003] With the large-scale deployment of smart grids, smart meters, as core energy metering devices, directly impact the fairness of electricity trading and the efficiency of system operation due to their measurement accuracy. However, in actual operation, smart meters are susceptible to interference from multiple sources of errors, such as proportional coefficient error, temperature drift, nonlinear distortion, and phase error, leading to systematic deviations between measured and true values. Traditional calibration methods are mostly based on modeling a single error source or linear assumptions, making them difficult to adapt to the nonlinear optimization requirements of multi-parameter coupling in complex power environments. Although the Firefly Algorithm (FA), as a swarm intelligence optimization algorithm, has been attempted for parameter optimization, the basic FA algorithm suffers from high parameter sensitivity, lack of constraint handling mechanisms, susceptibility to premature convergence, and weak local search capabilities, making it difficult to directly apply to smart meter calibration problems with explicit physical constraints (such as non-negative phase coefficients). Therefore, a high-precision calibration method that can balance global exploration and local development and handle physical constraints is urgently needed. Summary of the Invention
[0004] The technical problem to be solved by this invention is to provide a power metering calibration method that can address the issues of low accuracy, poor stability, and difficulty in handling constraints in the multi-parameter nonlinear calibration of smart meters using traditional methods and the basic firefly algorithm.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution.
[0006] In a first aspect, the present invention provides a power metering calibration method based on MSCOFA, comprising the following steps:
[0007] Step 1: Construct a comprehensive metering error model for smart meters, uniformly representing the metering error of smart meters as a parameter vector including gain coefficient, temperature drift coefficient, nonlinearity coefficient, and phase error coefficient. The formula is as follows:
[0008] ;
[0009] in, Indicates the gain scaling factor; Indicates the temperature drift coefficient; Indicates the first Order nonlinear coefficient; Indicates the first Order nonlinear coefficient; Indicates the phase error coefficient;
[0010] Step 2: The multi-strategy constraint optimization firefly algorithm is used to iteratively optimize the comprehensive metering error model of the smart meter to obtain the optimal error parameters. The multi-strategy constraint optimization firefly algorithm integrates parameter adaptive optimization, hybrid optimization, population management and diversity maintenance and constraint processing mechanism optimization strategies on the basic firefly algorithm, and adopts a multi-stage optimization framework of exploration, development and refinement.
[0011] Step 3: Input the optimal error parameters into the smart meter's comprehensive metering error model to calibrate and compensate the smart meter's metering value.
[0012] The aforementioned power metering calibration method, specifically the multi-strategy constrained optimization firefly algorithm, comprises the following steps:
[0013] A multi-stage optimization framework is constructed, dividing the optimization process into three stages and configuring the baseline parameters for each stage.
[0014] The numbers are used to provide a structural basis for subsequent parameter adaptation and local search;
[0015] Iterative optimization involves adaptive parameter optimization within a multi-stage framework, taking into account the stage and diversity.
[0016] And dynamically adjust parameters for improvement rate to better match algorithm behavior with stage goals;
[0017] Incorporate population management and diversity maintenance mechanisms, and employ niche technology, intelligent initialization, and mutation operations to maintain diversity;
[0018] A hybrid optimization strategy is introduced, in which the local search is triggered periodically during the refinement or development phase. This requires a good foundation of feasible solutions and is combined with parameter adaptive optimization and multi-stage optimization frameworks.
[0019] In the aforementioned power metering calibration method, step two includes a parameter adaptive optimization strategy that dynamically adjusts the random step size factor, maximum attraction, and light absorption coefficient of the firefly algorithm based on feedback information from the iteration stage, population diversity, and improvement rate. The random step size factor decays exponentially with the number of iterations and is modified in conjunction with a stage adjustment factor to balance global exploration and local development capabilities.
[0020] In the aforementioned power metering calibration method, the constraint processing mechanism optimization strategy in step two is as follows: an adaptive penalty function method is used to incorporate the constraint violation into the objective function, combined with a gradient-guided repair mechanism; during the iteration process, the penalty factor is dynamically adjusted according to the proportion of feasible solutions, and gradient-guided repair is triggered when the feasibility rate is lower than the threshold, guiding the population to move towards the feasible domain that satisfies the physical constraints.
[0021] Secondly, the present invention provides an MSCOFA-based power metering calibration system, comprising:
[0022] The error modeling module is used to construct a comprehensive metering error model for smart meters, which uniformly represents the metering error of smart meters as a parameter vector including gain coefficient, temperature drift coefficient, nonlinear coefficient and phase error coefficient.
[0023] The parameter optimization module is used to iteratively optimize the smart meter's comprehensive metering error model using the multi-strategy constraint optimization firefly algorithm to obtain the optimal error parameters.
[0024] The calibration execution module is used to receive the optimal error parameters and substitute them into the smart meter comprehensive metering error model to calibrate and compensate the metering value of the smart meter.
[0025] The output of the error modeling module is connected to the input of the parameter optimization module, and the output of the parameter optimization module is connected to the input of the calibration execution module.
[0026] The aforementioned power metering calibration system includes a parameter optimization module comprising an adaptive control unit and a constraint processing unit. The adaptive control unit dynamically adjusts the random step size factor, maximum attraction, and light absorption coefficient of the firefly algorithm based on feedback information from the iteration stage, population diversity, and improvement rate. The constraint processing unit incorporates constraint violations into the objective function using an adaptive penalty function method and dynamically adjusts the penalty factor during iteration, combined with a gradient-guided repair mechanism. Both the adaptive control unit and the constraint processing unit are electrically connected to the core computation unit in the parameter optimization module to provide optimization strategy parameters.
[0027] The aforementioned power metering calibration system further includes a hybrid optimization unit and a population management unit in its parameter optimization module. The hybrid optimization unit is used to perform local refinement search on the current optimal solution during the development and refinement stages. The population management unit is used to maintain population diversity by employing niche technology and mutation operations. The hybrid optimization unit and the population management unit are connected in parallel with the core computing unit to collaboratively complete the iterative update of the population.
[0028] The aforementioned power metering calibration system includes an error modeling module comprising a data acquisition subunit and a model building subunit. The data acquisition subunit is used to acquire the actual output energy value of the smart meter and the true energy value measured by the reference standard. The model building subunit is used to establish a nonlinear observation equation that includes gain, temperature drift, nonlinearity, and phase error. The output of the data acquisition subunit is connected to the input of the model building subunit.
[0029] The aforementioned power metering calibration system includes a calibration execution module comprising a parameter writing unit and a compensation calculation unit; the compensation calculation unit is used to calculate the calibration value based on the optimal error parameter; the parameter writing unit is used to write the optimal error parameter into the calibration register of the smart meter; both the compensation calculation unit and the parameter writing unit are connected to the output of the parameter optimization module.
[0030] The aforementioned power metering calibration system is deployed on a cloud server or a local calibration terminal and interacts with smart meters via a communication interface.
[0031] The beneficial effects achieved by this invention compared with the prior art are as follows:
[0032] This invention addresses the problems of low accuracy, poor stability, and difficulty in handling constraints in multi-parameter nonlinear calibration of smart meters using traditional methods and the basic firefly algorithm, through an MSCOFA-based power metering calibration method and system. This invention significantly reduces the root mean square error (RMSE) and mean relative error through multi-parameter coupling optimization, bringing the calibration accuracy close to the theoretical limit. Furthermore, this invention effectively avoids premature convergence through multi-strategy improvements, enhancing the algorithm's stability in complex nonlinear environments. Finally, this invention's constraint handling mechanism ensures that the optimization results conform to the actual physical characteristics of smart meters, improving the practicality of calibration. Attached Figure Description
[0033] Figure 1 This is a schematic diagram of a power metering calibration method based on MSCOFA in Embodiment 1 of the present invention;
[0034] Figure 2 This is a schematic diagram of the residual distribution results of MSCOFA metrological calibration in Embodiment 2 of the present invention;
[0035] Figure 3 This is a schematic diagram showing the comparison between observed and predicted values of MSCOFA. Detailed Implementation
[0036] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations thereof. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0037] The term "and / or" simply describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0038] Example 1:
[0039] This embodiment provides a power metering calibration method and system based on MSCOFA, such as... Figure 1 As shown, the method includes:
[0040] Step 1: Construct a comprehensive metering error model for smart meters, uniformly representing the metering error of smart meters as a parameter vector including gain coefficient, temperature drift coefficient, nonlinearity coefficient, and phase error coefficient. The formula is as follows:
[0041] ;
[0042] in, Indicates the gain scaling factor; Indicates the temperature drift coefficient; Indicates the first Order nonlinear coefficient; Indicates the first Order nonlinear coefficient; Indicates the phase error coefficient;
[0043] Step 2: The multi-strategy constraint optimization firefly algorithm is used to iteratively optimize the comprehensive metering error model of the smart meter to obtain the optimal error parameters. The multi-strategy constraint optimization firefly algorithm integrates parameter adaptive optimization, hybrid optimization, population management and diversity maintenance and constraint processing mechanism optimization strategies on the basic firefly algorithm, and adopts a multi-stage optimization framework of exploration, development and refinement.
[0044] Step 3: Input the optimal error parameters into the smart meter's comprehensive metering error model to calibrate and compensate the smart meter's metering value.
[0045] The aforementioned power metering calibration method, specifically the multi-strategy constrained optimization firefly algorithm, comprises the following steps:
[0046] A multi-stage optimization framework is constructed, dividing the optimization process into three stages and configuring the baseline parameters for each stage.
[0047] The numbers are used to provide a structural basis for subsequent parameter adaptation and local search;
[0048] Iterative optimization involves adaptive parameter optimization within a multi-stage framework, taking into account the stage and diversity.
[0049] And dynamically adjust parameters for improvement rate to better match algorithm behavior with stage goals;
[0050] Incorporate population management and diversity maintenance mechanisms, and employ niche technology, intelligent initialization, and mutation operations to maintain diversity;
[0051] A hybrid optimization strategy is introduced, in which the local search is triggered periodically during the refinement or development phase. This requires a good foundation of feasible solutions and is combined with parameter adaptive optimization and multi-stage optimization frameworks.
[0052] In the aforementioned power metering calibration method, step two includes a parameter adaptive optimization strategy that dynamically adjusts the random step size factor, maximum attraction, and light absorption coefficient of the firefly algorithm based on feedback information from the iteration stage, population diversity, and improvement rate. The random step size factor decays exponentially with the number of iterations and is modified in conjunction with a stage adjustment factor to balance global exploration and local development capabilities.
[0053] In the aforementioned power metering calibration method, the constraint processing mechanism optimization strategy in step two is as follows: an adaptive penalty function method is used to incorporate the constraint violation into the objective function, combined with a gradient-guided repair mechanism; during the iteration process, the penalty factor is dynamically adjusted according to the proportion of feasible solutions, and gradient-guided repair is triggered when the feasibility rate is lower than the threshold, guiding the population to move towards the feasible domain that satisfies the physical constraints.
[0054] A power metering calibration system based on MSCOFA includes: an error modeling module, used to construct a comprehensive metering error model for smart meters, which uniformly represents the metering error of smart meters as a parameter vector including gain coefficient, temperature drift coefficient, nonlinear coefficient and phase error coefficient;
[0055] The parameter optimization module is used to iteratively optimize the smart meter's comprehensive metering error model using the multi-strategy constraint optimization firefly algorithm to obtain the optimal error parameters.
[0056] The calibration execution module is used to receive the optimal error parameters and substitute them into the smart meter comprehensive metering error model to calibrate and compensate the metering value of the smart meter.
[0057] The output of the error modeling module is connected to the input of the parameter optimization module, and the output of the parameter optimization module is connected to the input of the calibration execution module.
[0058] The aforementioned power metering calibration system includes a parameter optimization module comprising an adaptive control unit and a constraint processing unit. The adaptive control unit dynamically adjusts the random step size factor, maximum attraction, and light absorption coefficient of the firefly algorithm based on feedback information from the iteration stage, population diversity, and improvement rate. The constraint processing unit incorporates constraint violations into the objective function using an adaptive penalty function method and dynamically adjusts the penalty factor during iteration, combined with a gradient-guided repair mechanism. Both the adaptive control unit and the constraint processing unit are electrically connected to the core computation unit in the parameter optimization module to provide optimization strategy parameters.
[0059] The aforementioned power metering calibration system further includes a hybrid optimization unit and a population management unit in its parameter optimization module. The hybrid optimization unit is used to perform local refinement search on the current optimal solution during the development and refinement stages. The population management unit is used to maintain population diversity by employing niche technology and mutation operations. The hybrid optimization unit and the population management unit are connected in parallel with the core computing unit to collaboratively complete the iterative update of the population.
[0060] The aforementioned power metering calibration system includes an error modeling module comprising a data acquisition subunit and a model building subunit. The data acquisition subunit is used to acquire the actual output energy value of the smart meter and the true energy value measured by the reference standard. The model building subunit is used to establish a nonlinear observation equation that includes gain, temperature drift, nonlinearity, and phase error. The output of the data acquisition subunit is connected to the input of the model building subunit.
[0061] The aforementioned power metering calibration system includes a calibration execution module comprising a parameter writing unit and a compensation calculation unit; the compensation calculation unit is used to calculate the calibration value based on the optimal error parameter; the parameter writing unit is used to write the optimal error parameter into the calibration register of the smart meter; both the compensation calculation unit and the parameter writing unit are connected to the output of the parameter optimization module.
[0062] The aforementioned power metering calibration system is deployed on a cloud server or a local calibration terminal and interacts with smart meters via a communication interface.
[0063] Example 2:
[0064] This embodiment provides a design and implementation process for a multi-strategy constraint optimization firefly algorithm, including:
[0065] Step 1: Initialization:
[0066] 1) Set algorithm parameters: population size Maximum number of iterations Dimension ,boundary .
[0067] 2) Set multi-stage parameters: number of iterations in the exploration phase Number of iterations during development phase Number of iterations in the refining stage .
[0068] 3) Set adaptive parameters, constraint parameters, hybrid optimization parameters, diversity parameters, etc.
[0069] 4) Intelligent population initialization: The initial population is generated using Latin hypercube sampling, neighborhood sampling based on real parameters, and boundary sampling, and the constraints (such as non-negative phase coefficients) are guaranteed to be met.
[0070] Step 2: Calculate the initial fitness:
[0071] 1) Use an adaptive penalty function to calculate the fitness of each individual.
[0072] Step 3: Record the initial optimal solution
[0073] Step 4: Multi-stage optimization of the main loop:
[0074] For each generation iteration:
[0075] 1) Determine the current stage: exploration, development, or refinement.
[0076] 2) Update the adaptive parameters based on the current stage and diverse feedback.
[0077] 3) Constraint repair mechanism (if the feasibility rate is low, gradient-guided repair is performed on some individuals).
[0078] 4) Diversity maintenance (if diversity is below the threshold, apply niche techniques).
[0079] 5) Hybrid optimization (if it is in the development or refinement stage and the local search frequency is met, then perform a local search on the current optimal solution).
[0080] 6) Parallelized Firefly Update:
[0081] For each firefly Searching for brighter fireflies Calculate attraction and distance, update position, and perform mutation operation.
[0082] Calculate the fitness of the new location.
[0083] 7) Update the global optimal solution.
[0084] 8) Record historical data (fitness, diversity, parameters, etc.).
[0085] 9) Check convergence conditions: If the convergence conditions are met (if the improvement rate is very small for several consecutive generations, the constraints are satisfied, and the diversity is sufficient, then convergence is determined and the loop is terminated early, or the maximum number of iterations is reached), then the loop is exited.
[0086] Step 5: Final Local Refinement
[0087] If convergence under multiple conditions is satisfied, the iteration is terminated early, and a local search is performed on the obtained optimal solution for further optimization.
[0088] Step 6: Output the result:
[0089] 1) Returns the optimal solution, optimal fitness, historical records, etc.
[0090] The metrological calibration effect was simulated and verified using MATLAB. The simulation data is shown in the table below.
[0091] index Uncalibrated MSCOFA Improvement extent (uncalibrated → MSCOFA) Root Mean Square Error (RMSE) 14.0413 0.5622 96.00% Mean relative error (%) 10.1162 0.4040 96.01% Coefficient of determination R² 0.7403 0.9996 35.03% Error fluctuation range 63.6943 2.4946 96.08%
[0092] RMSE comprehensively measures the overall error level of the prediction. MSCOFA drove the RMSE to decrease rapidly from 14.04 and eventually converge to 0.56, achieving an optimization margin of 96.00%. Its convergence curve shows a rapid and stable downward trend, verifying the algorithm's efficient and accurate global optimization capability in complex parameter spaces.
[0093] The mean relative error directly reflects the level of systematic deviation in a metrology system. MSCOFA reduced the mean relative error from 10.12% in the uncalibrated system to 0.40%, a reduction of over 96%. This demonstrates that the algorithm can accurately correct the inherent deviation of the system, achieving calibration accuracy close to the theoretical limit.
[0094] The R² value is used to evaluate the model's ability to explain data variation. MSCOFA increased the coefficient of determination R² from the initial 0.7403 to 0.9996. This means that the calibrated model can explain more than 99.96% of the data variation, almost perfectly reproducing the real physical characteristics of the power metering system, and achieving an extremely high level of model fidelity.
[0095] Error fluctuation range is a key indicator for measuring the stability and robustness of system output. The error fluctuation range of the uncalibrated system is as high as 63.69, while MSCOFA drastically reduces it to 2.49, a staggering reduction of 96.08%. This demonstrates that the improved algorithm significantly enhances the output consistency of the metrology system and substantially improves its stability and reliability under complex operating conditions.
[0096] System simulation diagram as follows Figure 2 and Figure 3 As shown; the residual distribution reflects the random characteristics of the model prediction error. Simulation results show that, compared with the wide dispersion of the uncalibrated residuals, the residual distribution after calibration by the MSCOFA algorithm is highly concentrated near the zero value, the distribution range is significantly narrowed and the shape is more symmetrical. This intuitively proves that the improved algorithm not only greatly reduces the systematic bias, but also effectively suppresses the fluctuation of random error, making the measurement output more accurate and reliable. From the scatter plot of observed values and predicted values, it can be seen that: (1) linear relationship: all data points are closely distributed on both sides of the diagonal of y=x; (2) accurate across the entire range: accurate prediction from the low value of 40 to the high value of 215; (3) no systematic bias: no obvious underfitting or overfitting regions.
[0097] The results show that the calibration model has: (1) full-range consistency, avoiding the need for segmented calibration; (2) good extrapolation ability, adapting to changes in actual working conditions; and (3) stable performance, reducing the frequency of repeated calibration.
[0098] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.
Claims
1. A method for power metrology calibration based on MSCOFA, characterized by, Includes the following steps: Step 1: Construct a comprehensive metering error model for smart meters, representing the metering error of smart meters as a parameter vector including gain coefficient, temperature drift coefficient, nonlinearity coefficient, and phase error coefficient. wherein represents a gain proportional coefficient; represents a temperature drift coefficient; represents a first order non-linear coefficient; represents a first order non-linear coefficient; represents a phase error coefficient; the superscript represents a transpose; Step 2: The multi-strategy constraint optimization firefly algorithm is used to iteratively optimize the comprehensive metering error model of the smart meter to obtain the optimal error parameters. The multi-strategy constraint optimization firefly algorithm employs multiple optimization methods based on the basic firefly algorithm, including parameter adaptive optimization, hybrid optimization, population management and diversity maintenance, and constraint processing mechanism optimization methods. It also adopts a multi-stage optimization framework of exploration, development, and refinement. In the exploration stage, a larger step size and attraction are used to enhance the global search capability. In the development stage, the step size is gradually reduced to strengthen the local search. In the refinement stage, fine-tuning is performed by combining local search algorithms. Step 3: Input the optimal error parameters into the smart meter's comprehensive metering error model to calibrate and compensate the smart meter's metering value.
2. The power metering calibration method according to claim 1, characterized in that, The steps of the multi-strategy constraint optimization firefly algorithm are as follows: A multi-stage optimization framework is constructed, dividing the optimization process into three stages and configuring the baseline parameters for each stage. The numbers are used to provide a structural basis for subsequent parameter adaptation and local search; Iterative optimization involves adaptive parameter optimization within a multi-stage framework, taking into account the stage and diversity. And dynamically adjust parameters for improvement rate to better match algorithm behavior with stage goals; Incorporate population management and diversity maintenance mechanisms, and employ niche technology, intelligent initialization, and mutation operations to maintain diversity; A hybrid optimization strategy is introduced, in which the local search is triggered periodically during the refinement or development phase. This requires a good foundation of feasible solutions and is combined with parameter adaptive optimization and multi-stage optimization frameworks.
3. The power metering calibration method according to claim 1, characterized in that, In step two, the parameter adaptive optimization method includes dynamically adjusting the random step size factor, maximum attraction, and light absorption coefficient of the firefly algorithm based on feedback information from the iteration stage, population diversity, and improvement rate; the steps include: Step 1: Enhance the position update formula: ; in, This represents the number of iterations. Fireflies The attraction between them; Indicates the first The random step size factor is used to control the randomness of the exploration. It is a random vector that follows a uniform or normal distribution; Indicates the gradient information weight coefficients; Indicates the objective function in gradient at; Step 2: Improve the attraction function; ; ; in, Indicates the first The maximum attraction level influences the intensity of interaction between individuals; Indicates the first The light absorption coefficient is used to control the rate of gravitational attraction attenuation. Indicates constraint-oriented weights; Indicates the weight of fitness differences; Fireflies fitness value; Fireflies The amount of constraint violation; Guide the search to move towards regions where constraints are better satisfied; Step 3: Dynamically adjust parameters; Random step size factor: ; Maximum attraction: ; Light absorption coefficient: ; in, Indicates the first The random step size factor is used to control the randomness of the exploration. Indicates the first The maximum attraction level influences the intensity of interaction between individuals; Indicates the first The light absorption coefficient determines the rate of absorption decay. Indicates the attenuation coefficient; Indicates the stage regulation factor; These represent the initial random step size factor, the initial attractive force, and the initial light absorption coefficient, respectively.
4. The power metering calibration method according to claim 1, characterized in that, In step two, the constraint handling mechanism optimization method includes the following steps: Step 1: Calculate the constraint violation amount for each individual. The formula is as follows: ; Step 2: Calculate the post-penalty fitness using an adaptive penalty function. The formula for the adaptive penalty function is as follows: ; Step 3: Regularly update penalty factors The formula is as follows: ; Step 4: When the feasibility rate is lower than the threshold, initiate gradient-guided repair, as shown in the following formula: ; Step 5: Record the proportion of feasible solutions to guide the search direction; in, Indicates the constraint violation quantity, non-negative; This represents the phase coefficients, i.e., the parameter vector. The 5th element; Indicates the first Substitute punishment factor; This represents a linear penalty coefficient, used to handle minor violations; This represents the growth coefficient of the penalty factor; This indicates the maximum number of constraint violations in the current population. This represents the penalty factor decay coefficient; Indicates the repair step size; The gradient of the constraint violation function is represented. Indicates the feasibility threshold; During the iteration process, the penalty factor is dynamically adjusted according to the proportion of feasible solutions, and gradient-guided repair is triggered when the feasibility rate is lower than the threshold, guiding the population to move towards the feasible region that satisfies the physical constraints.
5. A power metering calibration system based on MSCOFA, characterized in that, include: The error modeling module is used to construct a comprehensive metering error model for smart meters, which uniformly represents the metering error of smart meters as a parameter vector including gain coefficient, temperature drift coefficient, nonlinear coefficient and phase error coefficient. The parameter optimization module is used to iteratively optimize the smart meter's comprehensive metering error model using the multi-strategy constraint optimization firefly algorithm to obtain the optimal error parameters. The calibration execution module is used to receive the optimal error parameters and substitute them into the smart meter comprehensive metering error model to calibrate and compensate the metering value of the smart meter. The output of the error modeling module is connected to the input of the parameter optimization module, and the output of the parameter optimization module is connected to the input of the calibration execution module.
6. The power metering calibration system according to claim 5, characterized in that, The parameter optimization module includes an adaptive control unit and a constraint processing unit. The adaptive control unit dynamically adjusts the random step size factor, maximum attraction, and light absorption coefficient of the firefly algorithm based on feedback information from the iteration stage, population diversity, and improvement rate. The constraint processing unit incorporates constraint violations into the objective function using an adaptive penalty function method and dynamically adjusts the penalty factor during iteration, combined with a gradient-guided repair mechanism. Both the adaptive control unit and the constraint processing unit are electrically connected to the core computation unit in the parameter optimization module to provide optimization strategy parameters.
7. The power metering calibration system according to claim 6, characterized in that, The parameter optimization module further includes a hybrid optimization unit and a population management unit; the hybrid optimization unit is used to perform local refinement search on the current optimal solution during the development and refinement stages; the population management unit is used to maintain population diversity by employing niche technology and mutation operations; the hybrid optimization unit and the population management unit are connected in parallel with the core computing unit to collaboratively complete the iterative update of the population.
8. The power metering calibration system according to claim 5, characterized in that, The error modeling module includes a data acquisition subunit and a model building subunit; the data acquisition subunit is used to acquire the actual output energy value of the smart meter and the real energy value measured by the reference standard; the model building subunit is used to establish a nonlinear observation equation that includes gain, temperature drift, nonlinearity and phase error; The output of the data acquisition subunit is connected to the input of the model building subunit.
9. The power metering calibration system according to claim 5, characterized in that, The calibration execution module includes a parameter writing unit and a compensation calculation unit; the compensation calculation unit is used to calculate the calibration value based on the optimal error parameter; the parameter writing unit is used to write the optimal error parameter into the calibration register of the smart meter; both the compensation calculation unit and the parameter writing unit are connected to the output of the parameter optimization module.
10. The power metering calibration system according to claim 5, characterized in that, The system is deployed on a cloud server or a local calibration terminal and interacts with smart meters via a communication interface.