Intelligent electric meter error prediction method based on GA-FSVR
1. A GA-FSVR-based smart meter error prediction method is characterized by comprising the following steps of:
providing a fusion kernel function model by combining the RBF kernel function and the Sigmoid kernel function, and establishing an FSVR-based intelligent electric meter error prediction model by utilizing the mapping function of the fusion kernel function;
optimizing kernel function parameters in the FSVR-based smart meter error prediction model through a genetic algorithm;
collecting metering error data of the intelligent electric meter under different temperature stresses, and dividing the data into a training set and a testing set;
training the FSVR-based smart meter error prediction model by using the data of the training set;
and inputting the data of the test set into the FSVR-based intelligent electric meter error prediction model to obtain intelligent electric meter error prediction results under different temperature stresses.
2. A GA-FSVR based smart meter error prediction method as claimed in claim 1, wherein the fusion kernel function model is:
wherein, KfRepresenting the fusion kernel function, KrRepresenting the RBF kernel function, KsRepresents Sigmoid kernel, s.t. represents constraint, xi,xjRepresenting two points in the measurement error data set, a1,a2And representing the kernel weight value, and adjusting the proportion of the local kernel function and the global kernel function in the fusion kernel.
3. A GA-FSVR based smart meter error prediction method as claimed in claim 2, wherein the expression of the FSVR based smart meter error prediction model is
Wherein alpha isiAndrepresenting the Lagrange multiplier, KfRepresenting the fusion kernel function, xiRepresenting a training sample vector, x representing a test data vector, and b being a bias term.
4. A GA-FSVR based smart meter error prediction method as claimed in claim 1, wherein the optimizing kernel function parameters in the FSVR based smart meter error prediction model through a genetic algorithm comprises:
s1, setting the ranges of sigma and theta, and setting the scale of the initialized population, the iteration times, the cross probability and the variation probability; wherein, σ is the width parameter of the RBF kernel function, and θ is the kernel parameter of the Sigmoid kernel function;
s2, calculating the minimum fitness value in the initial population and the corresponding nuclear parameter value by taking the root mean square error of the metering error as a fitness function;
s3, selecting new individuals by adopting a proportion selection operator, randomly selecting crossed and variant individuals to generate new chromosomes, and transferring the optimized chromosomes to the next generation to form a new population;
and S4, returning to the step S2 until the minimum fitness value converges or the loop reaches the iteration times, taking the minimum fitness value as an optimal solution, and outputting the optimal solution and the corresponding kernel parameter value.
5. A GA-FSVR based smart meter error prediction method as claimed in claim 1, further comprising:
and determining the optimal values of the RBF kernel function parameter and the Sigmoid kernel function parameter by adopting five-fold cross validation and a genetic algorithm.
Background
Whether the intelligent electric meter runs reliably and stably under different working environments has been a problem concerned by power enterprises, consumers and field experts all the time. The smart meter is generally composed of a large number of electronic components, and the metering error of the smart meter has a large correlation with the running time and the environmental information, and is particularly obviously influenced by the temperature. Therefore, the method has important guiding significance in the aspects of scientific rotation, standard updating, product upgrading and the like of the intelligent electric meter for predicting the metering error of the intelligent electric meter under different temperature stress, particularly under extreme temperature (such as high temperature in Xinjiang region and low temperature in Heilongjiang region).
Scholars at home and abroad have made a great deal of research on the problem of error prediction of metering equipment, including: the XGboost is used for predicting the error of the calibrator under different working conditions, so that a good effect is obtained, but when Bayes is used for parameter optimization, the problem of over-fitting is easily caused by improper prior distribution; an OOK dynamic load test excitation signal model is utilized, a gateway electric energy meter dynamic error test experiment system is provided, and problems of gateway meter dynamic errors are analyzed; the scheme of carrying out error analysis and service life prediction on the power equipment by using the artificial neural network is utilized, but the artificial neural network needs a large amount of data to train a network model; and the error prediction model of the mechanical temperature instrument based on the LS-SVM is provided, the prediction accuracy is high, and the overall performance of the model is limited by adopting a single kernel function.
Disclosure of Invention
The present invention is directed to solving at least one of the problems of the prior art. Therefore, the invention provides a GA-FSVR-based intelligent electric meter error prediction method which can accurately track the error change conditions of the intelligent electric meter at different temperatures.
According to the embodiment of the invention, the intelligent ammeter error prediction method based on GA-FSVR comprises the following steps: providing a fusion kernel function model by combining the RBF kernel function and the Sigmoid kernel function, and establishing an FSVR-based intelligent electric meter error prediction model by utilizing the mapping function of the fusion kernel function; optimizing kernel function parameters in the FSVR-based smart meter error prediction model through a genetic algorithm; collecting metering error data of the intelligent electric meter under different temperature stresses, and dividing the data into a training set and a testing set; training the FSVR-based smart meter error prediction model by using the data of the training set; and inputting the data of the test set into the FSVR-based intelligent electric meter error prediction model to obtain intelligent electric meter error prediction results under different temperature stresses.
The intelligent ammeter error prediction method based on GA-FSVR provided by the embodiment of the invention at least has the following beneficial effects: according to the GA-FSVR-based intelligent electric meter error prediction method, the learning capacity of the RBF kernel function and the global generalization capacity of the Sigmoid kernel function are effectively combined through the fusion kernel function model, and the parameters of the FSVR are optimized through the genetic algorithm, so that the prediction model provided by the embodiment of the invention has smaller root mean square error and higher goodness of fit, and the overall prediction performance of the model is higher.
According to some embodiments of the invention, the fusion kernel function model is:
wherein, KfRepresenting the fusion kernel function, KrRepresenting the RBF kernel function, KsRepresents Sigmoid kernel, s.t. represents constraint, xi,xjRepresenting two points in the measurement error data set, a1,a2And representing the kernel weight value, and adjusting the proportion of the local kernel function and the global kernel function in the fusion kernel.
According to some embodiments of the invention, the expression of the FSVR-based smart meter error prediction model is
Wherein alpha isiAndrepresenting the Lagrange multiplier, KfRepresenting the fusion kernel function, xiRepresenting a training sample vector, x representing a test data vector, and b being a bias term.
According to some embodiments of the invention, the optimizing, by a genetic algorithm, kernel function parameters in the FSVR-based smart meter error prediction model comprises: s1, setting the ranges of sigma and theta, and setting the scale of the initialized population, the iteration times, the cross probability and the variation probability; wherein, σ is the width parameter of the RBF kernel function, and θ is the kernel parameter of the Sigmoid kernel function; s2, calculating the minimum fitness value in the initial population and the corresponding nuclear parameter value by taking the root mean square error of the metering error as a fitness function; s3, selecting new individuals by adopting a proportion selection operator, randomly selecting crossed and variant individuals to generate new chromosomes, and transferring the optimized chromosomes to the next generation to form a new population; and S4, returning to the step S2 until the minimum fitness value converges or the loop reaches the iteration times, taking the minimum fitness value as an optimal solution, and outputting the optimal solution and the corresponding kernel parameter value.
According to some embodiments of the invention, the method further comprises: and determining the optimal values of the RBF kernel function parameter and the Sigmoid kernel function parameter by adopting five-fold cross validation and a genetic algorithm.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a schematic flow chart of a method according to an embodiment of the present invention.
FIG. 2 is a graph showing the error change of the intelligent electric meter under high-temperature stress.
FIG. 3 is a graph of the error change of the smart meter under low-temperature stress.
Fig. 4 is a diagram of an error prediction model of the smart meter based on FSVR according to an embodiment of the present invention.
FIG. 5 is a graph of GA-based FSVR kernel parameter optimization in accordance with an embodiment of the present invention.
FIG. 6 is a graph of the convergence process based on GA kernel parameter optimization in accordance with an embodiment of the present invention.
FIG. 7 is a diagram showing the comparison of the prediction results of different models under high temperature stress.
FIG. 8 is a diagram showing the comparison of the prediction results of different models under low temperature stress.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
In the description of the present invention, the step numbers are merely identification marks for convenience of description or citation, and are not to be construed as a limitation of the operation sequence of the steps.
Referring to fig. 1, the embodiment of the invention provides an error prediction and optimization method for a fusion kernel support vector regression (FSVR) and Genetic Algorithm (GA), aiming at the problem that the metering error change condition of a smart meter is difficult to predict accurately under different temperature conditions. Support Vector Regression (SVR) is based on VC latitude theory and structure risk minimization principle, and has unique advantages in solving small sample and non-linear problems. The invention provides a fusion kernel support vector regression (FSVR) fusing an RBF kernel function and a Sigmoid kernel function on a standard SVR, and optimally selects kernel parameters by using a Genetic Algorithm (GA).
Firstly, in order to fully consider the influence of temperature stress on the error of the intelligent electric meter, a support vector regression-based intelligent electric meter error prediction state space model is established by utilizing the mapping function of a combined kernel function in a support vector machine to simulate the aging process of the electric meter under the action of different temperatures. And then, in a kernel parameter setting stage, optimizing the kernel parameters supporting vector regression through a genetic algorithm, and further improving the model prediction precision. Finally, in the embodiment, on the basis of test set data, the comparison test is performed on the extracted model and the traditional prediction model under different temperature stresses, the performance of the extracted model is verified, and finally the influence of the different temperature stresses on the metering error of the intelligent electric meter is analyzed.
1. Test data collection
China is wide in territory and spans a plurality of climate areas, so that the climate difference between the east and the west is obvious. For example, in the desert river region of Heilongjiang in northeast, the lowest temperature is below-40 ℃ in winter every year, and the highest temperature in Turpan in Xinjiang in northwest is close to 50 ℃ in summer. In order to research the operation characteristics of the intelligent electric meter at different typical temperatures, the manufacturing process is improved in a targeted mode according to the climate characteristics of different regions, and therefore the reliability of the operation of metering equipment in the different regions is improved. In this embodiment, experiments are performed on the running states of a batch of smart meters of the same model, which are continuously 14 months from 1 month in 2020 to 2 months in 2021 in high-temperature and low-temperature environments, respectively.
The measurement error data of the smart meter at different temperatures are collected as shown in fig. 2 and 3. As can be known from the graphs in FIGS. 2 and 3, the measurement error of the smart meter is influenced by the temperature to a significant degree, the measurement error drifts towards the positive direction under the high-temperature environment, the measurement error drifts towards the negative direction under the low-temperature environment, the two changes both show nonlinear irregular increase, and in order to effectively predict the error change characteristics of the smart meter under different temperature stresses, a smart meter error prediction model based on the GA optimization is provided next.
2. Error prediction model construction based on GA-FSVR model
2.1 FSVR-based error prediction model
A set of metrology error data sets P { (x) given a certain temperature stress1,y1),(x1,y1),...,(xn,yn) Where x represents run time and y represents the corresponding metric error value. The standard SVR method adopts a single kernel function to map data features to a high-dimensional Hilbert space, the RBF kernel function is the most commonly used local kernel function at present, and data points close to each other have influence on a mapping result and have strong learning capacity. For two points x in the data set PiAnd xjThe RBF kernel function can be expressed as
Wherein, σ is a width parameter of the RBF kernel function, and directly influences the mapping result of the kernel function.
The Sigmoid kernel function is a common global kernel function at present, allows data points with longer distance to influence mapping results, has stronger generalization capability, and has an expression of
Wherein, tanh () is hyperbolic tangent function, β is 1/N, N is dimension of input data feature, and θ is less than 0.
In order to effectively combine the learning ability of the RBF kernel function and the global generalization ability of the Sigmoid kernel function, the invention provides a novel fusion kernel function model, and the expression of the fusion kernel function model is
In the formula, a1,a2The weight is used for adjusting the proportion of the local kernel function and the global kernel function in the fusion kernel, and the specific numerical value is distributed according to the input data characteristics.
Combining the proposed fusion kernel function by introducing the relaxation factor xiiAndthe invention further provides an FSVR model, the optimization goal of which is
The constraint condition is
Where ω is the decision plane normal vector, b is the offset,and C is a penalty parameter for the high-dimensional space mapped by the fusion kernel function.
In order to solve the constraint problem mentioned in equations (4) and (5), lagrange multiplier α is introducediAndconvert it into dual problem of
The constraint condition is
In seeking dual problemsiAndafter the optimal solution of (2), the final expression of the FSVR is shown in formula (8), and the structure is shown in fig. 4.
2.2 GA-based FSVR Nuclear parameter optimization
In the FSVR prediction model, the determination of the kernel parameters σ and θ is particularly important as can be seen from equations (1) and (2). For this purpose, the FSVR parameters are optimized using genetic algorithms. The genetic algorithm is a heuristic parallel global random search optimization method and has good self-adaption capability and robustness. The steps for optimizing the FSVR parameters based on GA are as follows:
(1) the σ is set to range from 1 to 10 and θ is set to range from-3 to 0. The initialization population size is 50, the iteration number is 100, the cross probability is set to be 0.7, and the mutation probability is set to be 0.01. In order to facilitate the processing of complex variable constraints, a real number coding mode is adopted.
(2) And calculating the minimum fitness value in the initial population and the corresponding nuclear parameter value by taking Root Mean Square Error (RMSE) of the metering Error prediction as a fitness function.
(3) And (3) selecting new individuals by adopting a proportion selection operator, randomly selecting crossed and mutated individuals to generate new chromosomes, and then transferring the optimized chromosomes to the next generation to form a new population.
(4) And (4) repeating the steps (2) and (3), taking the minimum fitness value as an optimal solution, finishing the algorithm when the minimum fitness value is converged or the loop reaches the iteration times, and outputting the optimal solution and the corresponding kernel parameter value.
3. Intelligent electric meter metering error prediction example analysis
3.1FSVR model parameter optimization and result analysis
In order to verify the prediction performance of the GA-FSVR model on the metering error of the intelligent electric meter, experimental analysis is carried out on the basis of two groups of data sets of the metering error of the intelligent electric meter under high-temperature stress and low-temperature stress, which are collected by a test bed. The data set is divided into a training set and a testing set, wherein the proportion of the training set is 70 percent, and the proportion of the testing set is 30 percent. In the experiment, libSVM is used as an FSVR modeling tool, and MATLAB software is used as a simulation environment for experimental analysis.
And (3) not selecting proper FSVR parameters, setting the range of the RBF nuclear parameter sigma to be 1-10, the range of the Sigmoid nuclear parameter theta to be-3-0, taking the penalty parameter C to be 1000, and determining the optimal values of sigma and theta by adopting five-fold cross validation and GA. Then, determining the kernel weight parameter a by using GA1And a2The optimum value of (c). The error prediction model of the smart meter under high-temperature stress is subjected to parameter optimization, and the result of kernel parameter optimization is shown in fig. 5.
In fig. 5, the z-axis represents the root mean square error, RMSE, such that the minimum σ and θ values of RMSE are the optimal kernel parameter pair. In order to more intuitively show the optimization results of the GA, fig. 6 shows the convergence process of the GA optimization. As can be seen from FIGS. 5 and 6, the minimum RMSE value of the model training is 0.0248, and the corresponding values of σ and θ are 5.44 and-2.78, respectively. Then, the weight parameter a is obtained by using a grid search method1And a20.76 and 0.24, respectively.
The metering errors of the smart meter metering error test set sample under high-temperature stress are predicted by using the FSVR model after parameter optimization, in order to verify the validity of the FSVR, the prediction effects of a single RBF core (model I) and a single Sigmoid core (model II) are compared, and the prediction results of the three models are visualized as shown in FIG. 7. As can be seen from fig. 7, the three SVR models can track the measurement error change under high temperature stress, but compared with the other two models, the predicted value of the model provided by the present invention is closer to the true value.
And then, carrying out an experiment on the metering error of the intelligent electric meter under the low-temperature stress. The model training mode under high-temperature stress is the same, the values of kernel parameters sigma and theta of the FSVR model after GA optimization are respectively 5.12 and-1.87, and the kernel weight parameter a1And a20.81 and 0.19, respectively. The prediction curves for both the mononuclear models and the model proposed herein are shown in fig. 8.
3.2 model evaluation index
In order to more intuitively compare the prediction results of different models, the root mean square error RMSE and the decision coefficient R are selected2As a model evaluation criterion. The definition formulas are respectively shown as formulas (9) and (10).
In the formula, yiFor the real dataset, y*In order to predict the data set(s),is the average of the real data set. The root mean square error RMSE is very sensitive to the oversize or extra-small values in the prediction result and can reflect the precision degree of the prediction result, and the smaller the RMSE is, the more accurate the prediction result is; determining the coefficient R2Also called goodness of fit, the higher the goodness of fit is, the higher the interpretation degree of the independent variable to the dependent variable is, the more accurate the regression prediction result is, and the value range is 0 to 1. Table 1 shows the results of the comparison of the GA-FSVR model with the RBF and Sigmoid nuclear models. As can be seen from Table 1, the prediction goodness of fit of the FSVR model under high-temperature stress reaches 98.93%, and the root mean square error is 0.0248; low temperatureThe predicted goodness of fit for FSVR under stress was 96.78% with a root mean square error of 0.0296. The result shows that compared with other two mononuclear models, the model has smaller root mean square error and higher goodness of fit, and the overall prediction performance of the model is higher.
TABLE 1 comparison of the prediction Performance of the fusion Nuclear model with that of the mononuclear model
In addition, in order to verify the applicability of the model disclosed by the invention, Bayesian Non-linear Regression (BNR) and BP Neural Network (BPNN) and two commonly used prediction methods based on data driving are selected and compared with the model disclosed by the invention. For fair comparison, the same data were used for model training and prediction, and the results of the comparative experiment are shown in table 2.
TABLE 2 comparison of the predicted Performance of the fused Nuclear model with other models
As can be seen from table 2, under the condition of the smart meter metering error data of the low-temperature stress and the high-temperature stress, the root mean square errors of the bayesian linear regression are 0.0426 and 0.0497, respectively, the root mean square errors of the BP neural network are 0.0405 and 0.0482, respectively, and the root mean square errors of the two prediction models are higher than those of the FSVR model; determining coefficient R of Bayes linear regression under two temperature stresses20.9596 and 0.9462, respectively, and 0.9643 and 0.9488, respectively, which are lower than the FSVR model proposed by the present invention. A comparison test shows that the prediction performance of the FSVR model provided by the invention is superior to that of a Bayesian linear regression model and a BP neural network model under the same test condition.
Through carrying out the analysis to smart electric meter measurement error data under different temperature stresses, high temperature stress can make smart electric meter measurement error positive deviation, and low temperature stress can make smart electric meter measurement error negative deviation. In order to accurately predict the variation trend of the metering error, a GA-FSVR-based intelligent electric meter metering error prediction model is provided, the metering error is analyzed by using a state space established by a fusion kernel function, and the parameters and the weight of the kernel function are optimized by GA. The results of model prediction comparison experiments under the same experiment show that the GA-FSVR model provided by the invention can effectively predict the variation trend of the metering error of the intelligent electric meter under different temperature stresses, and the prediction accuracy is higher than that of two commonly used single-core models, a Bayesian linear regression model and a BP neural network model. On the basis of the research of the invention, the degradation research and the service life prediction of the intelligent electric meter in different areas can be carried out subsequently, and a theoretical basis is provided for the standard updating and the scientific alternation of the intelligent electric meter in different areas.
Although specific embodiments have been described herein, those of ordinary skill in the art will recognize that many other modifications or alternative embodiments are equally within the scope of this disclosure. For example, any of the functions and/or processing capabilities described in connection with a particular device or component may be performed by any other device or component. In addition, while various illustrative implementations and architectures have been described in accordance with embodiments of the present disclosure, those of ordinary skill in the art will recognize that many other modifications of the illustrative implementations and architectures described herein are also within the scope of the present disclosure.
The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the gist of the present invention.