Electric energy meter error field verification method considering multiple factors
By constructing the ISCSO-SVR energy meter error calibration model and improving the sand cat swarm optimization algorithm, the problem of factors not being considered in the energy meter error calibration is solved, the calibration accuracy and efficiency are improved, real-time detection is achieved, and regular inspections are avoided. measurement error.
Patent Information
- Application Number
- CN202410633174.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-08-30
AI Technical Summary
Existing error calibration methods for electric energy meters fail to effectively consider the influence of factors such as temperature, humidity, voltage, and current, resulting in reduced accuracy of calibration results, and the inability to monitor error changes in electric energy meters in real time, affecting measurement accuracy.
An on-site calibration method for electric energy meter errors is adopted that takes into account multiple factors. By obtaining historical sample data of electric energy meters for preprocessing and correlation analysis, an ISCSO-SVR electric energy meter error calibration model is constructed, which is improved by combining the Levy flight strategy and the triangle wandering strategy. Sand cat swarm optimization algorithm optimizes the SVR model to improve verification accuracy and efficiency.
It improves the accuracy of the power error calibration results, realizes the correction and screening of multiple factors, enhances the local search capability and convergence accuracy of the algorithm, overcomes the problems of falling into local extreme values and low convergence accuracy, realizes real-time detection, and avoids Regularly check for possible measurement errors.
Smart Images

Figure CN118566822A
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of electric energy meter detection, and in particular to an electric energy meter error on-site detection method taking multiple factors into consideration. Background Art
[0002] With the continuous development of energy management and metering technology, the accuracy and reliability of electric energy meters as metering equipment have become increasingly important. Accurate electric energy metering is the basis for ensuring the effective use of energy resources, fair billing and energy management. Many countries and regions have strict laws and regulations requiring regular calibration of electric energy meters, and have stipulated the standards and methods for calibration. With the continuous development of the power market and the intensification of competition, users have higher and higher requirements for electric energy metering. They hope to ensure that they are accurately measured and avoid unfair situations caused by electric energy meter errors. Therefore, the research on electric energy meter error calibration methods can meet market demand and improve user satisfaction. At the same time, electric energy meter error calibration involves complex measurement technology, data processing methods and instruments and equipment. With the continuous updating and development of electric energy meter technology, it is necessary to continuously study new error calibration methods to adapt to the characteristics and needs of new electric energy meters and improve the accuracy and efficiency of calibration. Therefore, by studying the error calibration method of electric energy meters, we can have a deep understanding of the working principle, performance characteristics and factors affecting errors of electric energy meters, and promote theoretical and technological progress in related fields.
[0003] At present, the calibration cycle of electric energy meters is relatively long, and some calibration methods may take a long time to complete, which will affect the normal use of the electric energy meter, especially when large-scale calibration is required, and these impacts will last longer. The calibration results will be affected by the external environment, such as temperature, humidity, voltage, current, etc., which may affect the calibration results and need to be corrected and controlled accordingly during the calibration process. Some calibration methods cannot be monitored in real time. Most error calibration methods are performed periodically and cannot monitor the error changes of the electric energy meter in real time. If the electric energy meter has an abnormality during the calibration cycle, it may cause measurement errors for a period of time. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the present invention provides an on-site calibration method for electric energy meter errors taking into account multiple factors, which solves the problem that the prior method does not take into account the influence of factors such as temperature, humidity, voltage, current, etc. on the calibration results, and is unable to detect the electric energy meter in real time, resulting in a decrease in the accuracy of the calibration results.
[0005] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:
[0006] A method for on-site error verification of an electric energy meter taking multiple factors into consideration is provided, which comprises the following steps:
[0007] S1. Obtain historical sample data of the electric energy meter at each moment; wherein the electric energy meter sample data includes environmental data and metering error data;
[0008] S2. Preprocessing environmental data and measurement error data;
[0009] S3, performing correlation analysis and screening on the preprocessed environmental data and the preprocessed measurement error data to obtain characteristic data;
[0010] S4. Construct ISCSO-SVR electric energy meter error verification model;
[0011] S5. Input the characteristic data into the ISCSO-SVR electric energy meter error verification model for training to obtain the trained ISCSO-SVR electric energy meter error verification model;
[0012] S6. Acquire the current electric energy meter data in real time and process it in the same way as step S2 and step S3, and then input it into the trained ISCSO-SVR electric energy meter error calibration model to obtain the calibration result.
[0013] Furthermore, the environmental data in step S1 includes temperature data, humidity data, air pressure data, wind speed data, current data and voltage data; the preprocessing in step S2 includes abnormal data elimination processing, missing data filling processing and duplicate data filtering processing; the electric energy meter data in step S6 includes temperature data, humidity data, air pressure data, wind speed data, current data and voltage data.
[0014] Furthermore, step S2 further comprises:
[0015] S2-1. Draw a corresponding box diagram based on the historical sample data of the electric energy meter;
[0016] S2-2, calculate the box plot, obtain the minimum and maximum estimated values and use them as the threshold range;
[0017] S2-3, treating the electric energy meter historical sample data exceeding the threshold range as abnormal data and removing them to obtain the electric energy meter historical sample data after removal;
[0018] S2-4, according to the formula:
[0019]
[0020] The historical sample data of the electric energy meter after elimination is filled to obtain the filled historical sample data of the electric energy meter f(x); wherein N represents the total number of historical sample data of the electric energy meter after elimination, a n represents the nth amplitude, b n represents the nth angular frequency, c nrepresents the nth phase, x represents the sequence number corresponding to the historical sample data of the electric energy meter after elimination, sin(·) represents the sine function, and ∑(·) represents the sum function;
[0021] S2-5. Remove duplicate data from the filled historical sample data of the electric energy meter to obtain preprocessed historical sample data of the electric energy meter.
[0022] Furthermore, step S3 further includes:
[0023] S3-1. In a finite set In the method, the preprocessed measurement error data set Y and the preprocessed environmental data set X are concentrated in the two-dimensional space, and the preprocessed measurement error data set Y and the preprocessed environmental data set X are respectively divided into y measurement error data and x environmental data, and x·y rectangular networks are obtained; R represents a constant;
[0024] S3-2, according to the formula:
[0025]
[0026] The mutual information value I(D G ), where D G represents the distribution of data points in set D on the grid G, ∑(·) represents the summation function, P(x i ,y i ) represents the joint distribution between the i-th environmental data and the i-th measurement error data, P(x i ) represents the marginal distribution of the i-th environmental data, P(y i ) represents the marginal distribution of the i-th measurement error data, log(·) represents the logarithmic function with base 2;
[0027] S3-3, according to the formula:
[0028] I * (D,x,y)=max G I(D G )
[0029]
[0030] Get the standardized maximum mutual information value M(D) between the preprocessed measurement error data and each preprocessed environmental data x,y ; Among them, I * (D,x,y) represents the maximum mutual information value under the partition grid G, max G (·) represents the maximum value function, and min(·) represents the minimum value function;
[0031] S3-4, according to the formula:
[0032]
[0033] The maximum mutual information coefficient MIC(D) between the preprocessed measurement error data and each preprocessed environmental data is obtained; where N1 is the number of preprocessed samples, B(N1) represents the upper limit of grid division, and B(N1)=N1 φ , φ is a constant;
[0034] S3-5. Arrange the maximum mutual information coefficients MIC(D) in descending order, and select the historical sample data of the electric energy meter corresponding to the first five maximum mutual information coefficients MIC(D) as feature data.
[0035] Furthermore, the ISCSO-SVR electric energy meter error verification model includes a sand cat swarm optimization module and an SVR model; the sand cat swarm optimization module adopts an improved sand cat swarm optimization algorithm.
[0036] Furthermore, step S5 further includes:
[0037] S5-1, set the initial penalty factor C, kernel function variance g and kernel function of the SVR model;
[0038] S5-2, inputting the characteristic data into the SVR model to obtain the verified measurement error data;
[0039] S5-3. Based on the verified metering error data, the SVR model is optimized and iterated using the improved sand cat swarm optimization algorithm to obtain the trained SVR model, namely the trained ISCSO-SVR electricity meter error verification model.
[0040] Furthermore, the specific process of optimizing and iterating the SVR model using the improved sand cat swarm optimization algorithm in step S5-3 is as follows:
[0041] S5-3-1, respectively use the initial penalty factor C and kernel function variance g of the SVR model as sand cat individuals for iteration;
[0042] S5-3-2, set the population size of sand cats, the maximum number of iterations, the upper boundary of the penalty factor, the lower boundary of the penalty factor, the upper boundary of the kernel function variance, the lower boundary of the kernel function variance, and the variable dimension;
[0043] S5-3-3, use PWLCM chaotic mapping to initialize the sand cat population; the formula is as follows:
[0044]
[0045] x ij =lb j +zk ·(ub j -lb j )
[0046] Among them, z k+1 、z k represents the random number generated by the k+1th and kth chaotic mappings, p represents the control parameter of the PWLCM chaotic mapping, and x ij represents the j-th dimension variable of the i-th sand cat individual, ub j represents the upper bound of the j-th dimension variable, lb j represents the lower bound of the j-th dimension variable;
[0047] S5-3-4, calculate the initial individual fitness value of the population, and select the individual with the lowest initial individual fitness value as the optimal individual;
[0048] S5-3-5, according to the formula:
[0049]
[0050] Get Sand Cat Sensitivity G ; Among them, S M represents the maximum sensitivity, q represents the current number of iterations, and Q represents the maximum number of iterations;
[0051] S5-3-6, according to the formula:
[0052] R = 2 × r G ×rand(0,1)-r G
[0053] Get the balance parameter R; where rand(0,1) represents a random number between 0 and 1;
[0054] S5-3-7, determine whether the absolute value of the balance parameter R is greater than 1; if so, it means that the sand cat is in the searching stage and proceeds to step S5-3-8; otherwise, it means that the sand cat is in the predation stage and proceeds to step S5-3-9;
[0055] S5-3-8, using the triangle walk strategy to update the position information of the optimal individual and calculate the individual fitness value of the optimal individual after the initial update, and then proceed to step S5-3-10;
[0056] S5-3-9, using the Levy flight strategy to update the position information of the optimal individual and calculate the individual fitness value of the optimal individual after the initial update;
[0057] S5-3-10, compare the individual fitness value of the updated optimal individual with the initial individual fitness value, and select the individual corresponding to the lower individual fitness value as the updated optimal individual;
[0058] S5-3-11. Based on the updated optimal individual, mutate the population through t distribution;
[0059] S5-3-12. Calculate the individual fitness values before and after population mutation and compare them to obtain the optimal individual fitness value;
[0060] S5-3-13. Determine whether the current number of iterations is greater than or equal to the maximum number of iterations; if so, use the position information corresponding to the optimal individual fitness value as the initial penalty factor C or kernel function variance g of the SVR model to complete the training of the SVR model; otherwise, add 1 to the current number of iterations q and return to step S5-3-5.
[0061] Furthermore, the calculation formula of individual fitness value is:
[0062]
[0063] Among them, f represents the individual fitness value, n represents the total number of electric energy meter sample data, and Y i represents the measurement error data corresponding to the i-th sample, y i represents the measurement error data of the verification corresponding to the i-th sample, ∑(·) represents the summation function; wherein, when calculating the individual fitness value, the SVR model is updated based on the position information of the corresponding optimal individual; the updated SVR model is used for detection to obtain the corresponding measurement error data of the verification.
[0064] Furthermore, the formula of the triangle walking strategy in step S5-3-8 is:
[0065] L1=pos b (t)-pos c (t)
[0066] L2=rand(0,1)×L1
[0067] β=2×π×rand(0,1)
[0068]
[0069] r=r G ×rand(0,1)
[0070] Pos new =pos b (t)+r×P
[0071] Among them, L1 represents the distance between the sand cat and the prey, pos b (t) represents the position of the individual at time t, pos c(t) represents the position of the optimal individual corresponding to time t, β represents the walking direction of the sand cat, π represents pi, P represents the distance between the position obtained by the sand cat and the prey, L2 represents the step range of the sand cat, cos(·) represents the cosine function, Pos new represents the position of the updated optimal individual, r represents the sensitivity range of the sand cat;
[0072] The formula of the Levy flight strategy in step S5-3-9 is:
[0073] Pos new =pos b (t)+(pos b (t)-pos c (t))×C×Levy
[0074] Where C represents a constant, Levy represents Levy distribution;
[0075] Furthermore, the formula of t distribution in step S5-3-11 is:
[0076]
[0077]
[0078] in, represents the position of the jth dimension of the ith sand cat individual after mutation, t(i) represents the t-distribution with i degrees of freedom, pr represents the dynamic selection probability, rand represents a random number, ω1 and ω2 represent the upper limit of the dynamic selection probability and the range of change of the dynamic selection probability, respectively, t m Indicates the maximum number of iterations.
[0079] The beneficial effects of the present invention are as follows: the method takes into account the influence of factors such as temperature data and humidity data on electric energy error verification, corrects and screens multiple factors, extracts factors with a high correlation with error data as features, and further improves the accuracy of electric energy error verification results; the sand cat algorithm is improved by combining the Levy flight strategy and the triangle walk strategy, and the t distribution is introduced for mutation, thereby enhancing the local search capability of the algorithm and improving the convergence accuracy of the algorithm, and overcoming the problems of falling into local extreme values, low convergence accuracy and insufficient development capabilities of the algorithm, further optimizing the initial penalty factor and kernel function variance of the SVR model, and improving the processing efficiency and accuracy of the SVR model; real-time detection of electric energy meters to avoid regular inspections that may cause metering errors within a certain period of time. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] Figure 1 is a method flow chart;
[0081] Figure 2This is the flow chart of the improved sand cat colony optimization algorithm. DETAILED DESCRIPTION
[0082] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.
[0083] like Figure 1 As shown, a method for on-site error verification of an electric energy meter taking multiple factors into consideration includes the following steps:
[0084] S1. Obtain historical sample data of the electric energy meter at each moment; wherein the electric energy meter sample data includes environmental data and metering error data; the environmental data includes temperature data, humidity data, air pressure data, wind speed data, current data and voltage data;
[0085] The historical sample data of the electric energy meter includes at least 1500 groups of samples. In the field environment, the smart electric energy meter is calibrated to record the measurement error, current data and voltage data of the smart electric energy meter in each time period. At the same time, different types of sensors are installed at each smart electric energy meter test point to measure the temperature, humidity, air pressure, wind speed and other environmental factors of the experimental base.
[0086] S2. Preprocessing the environmental data and measurement error data; the preprocessing includes abnormal data elimination, missing data filling and duplicate data filtering;
[0087] Step S2 further comprises:
[0088] S2-1. Draw a corresponding box diagram based on the historical sample data of the electric energy meter;
[0089] S2-2. Calculate the box plot to obtain the minimum and maximum estimated values and use them as the threshold range; the formulas corresponding to the minimum and maximum estimated values are as follows:
[0090] Max=Q3+k(Q3-Q1)
[0091] Min=Q1-k(Q3-Q1)
[0092] Among them, Max represents the maximum estimated value, Min represents the minimum estimated value, Q1 and Q3 represent the lower quartile and upper quartile of the historical sample data of the electricity meter, respectively, and k represents a constant, which can be set to 1.5 or 3.
[0093] S2-3, treating the electric energy meter historical sample data that exceeds the threshold range as abnormal data and removing them, retaining the position of the abnormal data, and obtaining the electric energy meter historical sample data after removal;
[0094] S2-4, according to the formula:
[0095]
[0096] The historical sample data of the electric energy meter after elimination is filled to obtain the filled historical sample data of the electric energy meter f(x); wherein N represents the total number of historical sample data of the electric energy meter after elimination, a n represents the nth amplitude, b n represents the nth angular frequency, c n represents the nth phase, x represents the serial number corresponding to the historical sample data of the electric energy meter after elimination, sin(·) represents the sine function, ∑(·) represents the sum function; there are missing values in the electric energy meter data, which is caused by many reasons such as irregular management of the electric energy meter, irregular collection process and irregular data recording, so it is necessary to fill the historical sample data of the electric energy meter.
[0097] S2-5. Remove duplicate data from the filled historical sample data of the electric energy meter to obtain preprocessed historical sample data of the electric energy meter.
[0098] S3. Perform correlation analysis and screening on the preprocessed environmental data and the preprocessed measurement error data to obtain feature data; divide the feature data into 10 parts on average; use 9 samples as training sets and 1 sample as test set. It must be ensured that each training set and test set are different from each other. The entire sample data set has participated in training and testing. Take the number of hidden layers with the smallest calculation error.
[0099] Step S3 further comprises:
[0100] S3-1. In a finite set In the method, the preprocessed measurement error data set Y and the preprocessed environmental data set X are concentrated in the two-dimensional space, and the preprocessed measurement error data set Y and the preprocessed environmental data set X are respectively divided into y measurement error data and x environmental data, and x·y rectangular networks are obtained; R represents a constant;
[0101] S3-2, according to the formula:
[0102]
[0103] The mutual information value I(D G ), where D Grepresents the distribution of data points in set D on the grid G, ∑(·) represents the summation function, P(x i ,y i ) represents the joint distribution between the i-th environmental data and the i-th measurement error data, P(x i ) represents the marginal distribution of the i-th environmental data, P(y i ) represents the marginal distribution of the i-th measurement error data, log(·) represents the logarithmic function with base 2;
[0104] S3-3, according to the formula:
[0105] I * (D,x,y)=max G I(D G )
[0106]
[0107] Get the standardized maximum mutual information value M(D) between the preprocessed measurement error data and each preprocessed environmental data x,y ; Among them, I * (D,x,y) represents the maximum mutual information value under the partition grid G, max G (·) represents the maximum value function, and min(·) represents the minimum value function;
[0108] S3-4, according to the formula:
[0109]
[0110] The maximum mutual information coefficient MIC(D) between the preprocessed measurement error data and each preprocessed environmental data is obtained; where N1 is the number of preprocessed samples, B(N1) represents the upper limit of grid division, and B(N1)=N1 φ , φ is a constant;
[0111] S3-5. Arrange the maximum mutual information coefficients MIC(D) in descending order, and select the historical sample data of the electric energy meter corresponding to the first five maximum mutual information coefficients MIC(D) as feature data.
[0112] S4. Construct ISCSO-SVR electric energy meter error verification model;
[0113] The ISCSO-SVR electric energy meter error verification model includes a sand cat group optimization module and an SVR model; the sand cat group optimization module uses an improved sand cat group optimization algorithm. SVR is a support vector machine.
[0114] S5. Input the characteristic data into the ISCSO-SVR electric energy meter error verification model for training to obtain the trained ISCSO-SVR electric energy meter error verification model;
[0115] Step S5 further comprises:
[0116] S5-1, set the initial penalty factor C, kernel function variance g and kernel function of the SVR model;
[0117] S5-2, inputting the characteristic data into the SVR model to obtain the verified measurement error data;
[0118] S5-3. Based on the verified metering error data, the SVR model is optimized and iterated using the improved sand cat swarm optimization algorithm to obtain the trained SVR model, namely the trained ISCSO-SVR electricity meter error verification model.
[0119] like Figure 2 As shown, the specific process of optimizing and iterating the SVR model by the improved sand cat swarm optimization algorithm in step S5-3 is as follows:
[0120] S5-3-1, respectively use the initial penalty factor C and kernel function variance g of the SVR model as sand cat individuals for iteration;
[0121] S5-3-2, set the population size of sand cats, the maximum number of iterations, the upper boundary of the penalty factor, the lower boundary of the penalty factor, the upper boundary of the kernel function variance, the lower boundary of the kernel function variance, and the variable dimension;
[0122] S5-3-3, use PWLCM chaotic mapping to initialize the sand cat population; the formula is as follows:
[0123]
[0124] x ij =lb j +z k ·(ub j -lb j )
[0125] Among them, z k+1 、z k represents the random number generated by the k+1th and kth chaotic mappings, p represents the control parameter of the PWLCM chaotic mapping, and x ij represents the j-th dimension variable of the i-th sand cat individual, ub j represents the upper bound of the j-th dimension variable, lb j represents the lower bound of the j-th dimension variable;
[0126] S5-3-4, calculate the initial individual fitness value of the population, and select the individual with the lowest initial individual fitness value as the optimal individual;
[0127] S5-3-5. In the sand cat group optimization algorithm, the sand cat searches for prey by sensing noise below 2kHz. In order to control the sensitivity range of the sand cat to be between 0 and 2kHz, the formula is as follows:
[0128]
[0129] Get Sand Cat Sensitivity G ; Among them, S M represents the maximum sensitivity and its value is 2, q represents the current number of iterations, and Q represents the maximum number of iterations;
[0130] S5-3-6, according to the formula:
[0131] R = 2 × r G ×rand(0,1)-r G
[0132] Get the balance parameter R; where rand(0,1) represents a random number between 0 and 1;
[0133] S5-3-7, determine whether the absolute value of the balance parameter R is greater than 1; if so, it means that the sand cat is in the searching stage and proceeds to step S5-3-8; otherwise, it means that the sand cat is in the predation stage and proceeds to step S5-3-9;
[0134] S5-3-8, using the triangle wandering strategy to update the location information of the best individual and calculate the individual fitness value of the best individual after the initial update, and then enter step S5-3-10; the sand cat will gradually approach the prey in the process of searching for prey, and the triangle wandering strategy means that the sand cat will wander around the prey while approaching the prey. This strategy can increase the search range of the sand cat group, thereby increasing the algorithm's optimization ability.
[0135] The formula of the triangle walk strategy in step S5-3-8 is:
[0136] L1=pos b (t)-pos c (t)
[0137] L2=rand(0,1)×L1
[0138] β=2×π×rand(0,1)
[0139]
[0140] r=r G ×rand(0,1)
[0141] Pos new =pos b (t)+r×P, where L1 represents the distance between the sand cat and the prey, pos b (t) represents the position of the individual at time t, pos c (t) represents the position of the optimal individual corresponding to time t, β represents the walking direction of the sand cat, π represents pi, P represents the distance between the position obtained by the sand cat and the prey, L2 represents the step range of the sand cat, cos(·) represents the cosine function, Pos new represents the position of the updated optimal individual, r represents the sensitivity range of the sand cat;
[0142] S5-3-9, use the Levy flight strategy to update the position information of the optimal individual and calculate the individual fitness value of the optimal individual after the initial update; Levy flight can help the algorithm avoid falling into the local optimal solution and better explore the global search space. The Levy flight step length is relatively long. In order to better conform to the behavior of the sand cat attacking prey, the constant C is multiplied in the Levy flight. This allows the sand cat to get as close to the prey as possible.
[0143] The formula of the Levy flight strategy in step S5-3-9 is:
[0144] Pos new =pos b (t)+(pos b (t)-pos c (t))×C×Levy
[0145] Wherein, C represents a constant and its value is 0.35, and Levy represents Levy distribution.
[0146] S5-3-10, compare the individual fitness value of the updated optimal individual with the initial individual fitness value, and select the individual corresponding to the lower individual fitness value as the updated optimal individual;
[0147] S5-3-11. Based on the updated optimal individual, the population is mutated through t distribution. At the beginning of the iteration, the number of iterations is small, the t distribution is close to the Cauchy distribution, and the algorithm has a strong global search ability. When the number of iterations increases, the t distribution will be close to the Gaussian distribution, and the algorithm has a strong local search ability. Therefore, the population of the improved sand cat group optimization algorithm is mutated using t distribution, which enhances the global search ability in the early stage and the local search ability in the later stage, and improves the convergence accuracy of the algorithm.
[0148] The formula for the t distribution in step S5-3-11 is:
[0149]
[0150]
[0151] in, represents the position of the jth dimension of the ith sand cat individual after mutation, t(i) represents the t-distribution with i degrees of freedom, pr represents the dynamic selection probability, rand represents a random number, ω1 and ω2 represent the upper limit of the dynamic selection probability and the range of change of the dynamic selection probability, respectively, t m Indicates the maximum number of iterations.
[0152] S5-3-12. Calculate the individual fitness values before and after population mutation and compare them to obtain the optimal individual fitness value;
[0153] S5-3-13. Determine whether the current number of iterations is greater than or equal to the maximum number of iterations; if so, use the position information corresponding to the optimal individual fitness value as the initial penalty factor C and kernel function variance g of the SVR model to complete the training of the SVR model; otherwise, add 1 to the current number of iterations q and return to step S5-3-5.
[0154] The calculation formula of individual fitness value is:
[0155]
[0156] Among them, f represents the individual fitness value, n represents the total number of electric energy meter sample data, and Y i represents the measurement error data corresponding to the i-th sample, y i represents the measurement error data of the verification corresponding to the i-th sample, ∑(·) represents the summation function; wherein, when calculating the individual fitness value, the SVR model is updated based on the position information of the corresponding optimal individual; the updated SVR model is used for detection to obtain the corresponding measurement error data of the verification.
[0157] S6, real-time acquisition of the current electric energy meter data and processing in the same way as step S2 and step S3, and inputting into the trained ISCSO-SVR electric energy meter error verification model to obtain the verification result. The electric energy meter data includes temperature data, humidity data, air pressure data, wind speed data, current data and voltage data.
[0158] In summary, the present invention considers the influence of factors such as temperature data and humidity data on the electric energy error verification, corrects and screens multiple factors, extracts factors with high correlation with error data as features, and further improves the accuracy of the electric energy error verification results; combines the Levy flight strategy and the triangle walk strategy to improve the sand cat algorithm, introduces the t distribution for mutation, enhances the local search ability of the algorithm and improves the convergence accuracy of the algorithm, and overcomes the problems of falling into local extreme values, low convergence accuracy and insufficient development capabilities of the algorithm, further optimizes the initial penalty factor and kernel function variance of the SVR model, and improves the processing efficiency and accuracy of the SVR model; real-time detection of electric energy meters to avoid regular inspections that may cause metering errors within a certain period of time.
Claims
1. A field calibration method for electric energy meter errors considering multiple factors. Features: The following steps are involved: S1. Obtain historical sample data of the electric energy meter at each moment; wherein the electric energy meter sample data includes environmental data and metering error data; S2. Preprocessing environmental data and measurement error data; S3, performing correlation analysis and screening on the preprocessed environmental data and the preprocessed measurement error data to obtain characteristic data; S4. Construct ISCSO-SVR electric energy meter error verification model; S5. Input the characteristic data into the ISCSO-SVR electric energy meter error verification model for training to obtain the trained ISCSO-SVR electric energy meter error verification model; S6. Acquire the current electric energy meter data in real time and process it in the same way as step S2 and step S3, and then input it into the trained ISCSO-SVR electric energy meter error calibration model to obtain the calibration result.
2. According to the multi-factors electric energy meter error on-site verification method of claim 1, Features: The environmental data in step S1 include temperature data, humidity data, air pressure data, wind speed data, current data and voltage data; the preprocessing in step S2 includes abnormal data elimination processing, missing data filling processing and duplicate data filtering processing; the electric energy meter data in step S6 include temperature data, humidity data, air pressure data, wind speed data, current data and voltage data.
3. The on-site error verification method of electric energy meter considering multiple factors according to claim 2, Features: The step S2 further comprises: S2-1. Draw a corresponding box diagram based on the historical sample data of the electric energy meter; S2-2, calculate the box plot, obtain the minimum and maximum estimated values and use them as the threshold range; S2-3, treating the electric energy meter historical sample data exceeding the threshold range as abnormal data and removing them to obtain the electric energy meter historical sample data after removal; S2-4, according to the formula: Filling processing is performed on the eliminated historical sample data of the electric energy meter to obtain the filled historical sample data of the electric energy meter f(x); wherein N represents the total number of the eliminated historical sample data of the electric energy meter, an represents the nth amplitude, bn represents the nth angular frequency, cn represents the nth phase, x represents the sequence number corresponding to the eliminated historical sample data of the electric energy meter, sin(·) represents the sine function, and ∑(·) represents the summation function; S2-5. Remove duplicate data from the filled historical sample data of the electric energy meter to obtain preprocessed historical sample data of the electric energy meter.
4. The on-site error verification method of electric energy meter considering multiple factors according to claim 2, Features: The step S3 further comprises: S3-1. In a finite set In the method, the preprocessed measurement error data set Y and the preprocessed environmental data set X are concentrated in the two-dimensional space, and the preprocessed measurement error data set Y and the preprocessed environmental data set X are respectively divided into y measurement error data and x environmental data, and x·y rectangular networks are obtained; R represents a constant; S3-2, according to the formula: The mutual information value I(DG) between the preprocessed measurement error data and each preprocessed environmental data is obtained; wherein DG represents the distribution of the data points in the set D on the grid G, ∑(·) represents the summation function, P(xi,yi) represents the joint distribution between the i-th environmental data and the i-th measurement error data, P(xi) represents the marginal distribution of the i-th environmental data, P(yi) represents the marginal distribution of the i-th measurement error data, and log(·) represents the logarithmic function with base 2; S3-3, according to the formula: I*(D,x,y)=max G I(D G ) The standardized maximum mutual information value M(D)x,y between the preprocessed measurement error data and each preprocessed environmental data is obtained; wherein I*(D,x,y) represents the maximum mutual information value under the divided grid G, maxG(·) represents the maximum value function, and min(·) represents the minimum value function; S3-4, according to the formula: The maximum mutual information coefficient MIC(D) between the preprocessed measurement error data and each preprocessed environmental data is obtained; where N1 is the number of samples after preprocessing, B(N1) represents the upper limit of grid division, and B(N 1 )=N 1 φ, φ is a constant; S3-5. Arrange the maximum mutual information coefficients MIC(D) in descending order, and select the historical sample data of the electric energy meter corresponding to the first five maximum mutual information coefficients MIC(D) as feature data.
5. The on-site error verification method of electric energy meter considering multiple factors according to claim 1, Features: The ISCSO-SVR electric energy meter error verification model includes a sand cat swarm optimization module and an SVR model; the sand cat swarm optimization module adopts an improved sand cat swarm optimization algorithm.
6. The on-site error verification method of electric energy meter considering multiple factors according to claim 5, Features: The step S5 further comprises: S5-1, set the initial penalty factor C, kernel function variance g and kernel function of the SVR model; S5-2, inputting the characteristic data into the SVR model to obtain the verified measurement error data; S5-3. Based on the verified metering error data, the SVR model is optimized and iterated using the improved sand cat swarm optimization algorithm to obtain the trained SVR model, namely the trained ISCSO-SVR electricity meter error verification model.
7. The on-site error verification method of electric energy meter considering multiple factors according to claim 6, Features: The specific process of optimizing and iterating the SVR model by the improved sand cat swarm optimization algorithm in step S5-3 is as follows: S5-3-1, respectively use the initial penalty factor C and kernel function variance g of the SVR model as sand cat individuals for iteration; S5-3-2, set the population size of sand cats, the maximum number of iterations, the upper boundary of the penalty factor, the lower boundary of the penalty factor, the upper boundary of the kernel function variance, the lower boundary of the kernel function variance, and the variable dimension; S5-3-3, use PWLCM chaotic mapping to initialize the sand cat population; the formula is as follows: xij=lbj+zk·(ubj-lbj) Among them, zk+1 and zk represent the random numbers generated by the k+1th and kth chaotic mappings, p represents the control parameter of the PWLCM chaotic mapping, xij represents the jth dimension variable of the i-th sand cat, ubj represents the upper bound of the jth dimension variable, and lbj represents the lower bound of the jth dimension variable; S5-3-4, calculate the initial individual fitness value of the population, and select the individual with the lowest initial individual fitness value as the optimal individual; S5-3-5, according to the formula: Get the sensitivity of the sand cat rG; where SM represents the maximum sensitivity, q represents the current number of iterations, and Q represents the maximum number of iterations; S5-3-6, according to the formula: R=2×rG×rand(0,1)-rG Get the balance parameter R; where rand(0,1) represents a random number between 0 and 1; S5-3-7, determine whether the absolute value of the balance parameter R is greater than 1; if so, determine that the sand cat is in the searching stage and proceed to step S5-3-8; otherwise, determine that the sand cat is in the predation stage and proceed to step S5-3-9; S5-3-8, using the triangle walk strategy to update the position information of the optimal individual and calculate the individual fitness value of the optimal individual after the initial update, and then proceed to step S5-3-10; S5-3-9, using the Levy flight strategy to update the position information of the optimal individual and calculate the individual fitness value of the optimal individual after the initial update; S5-3-10, compare the individual fitness value of the updated optimal individual with the initial individual fitness value, and select the individual corresponding to the lower individual fitness value as the updated optimal individual; S5-3-11. Based on the updated optimal individual, mutate the population through t distribution; S5-3-12. Calculate the individual fitness values before and after population mutation and compare them to obtain the optimal individual fitness value; S5-3-13. Determine whether the current number of iterations is greater than or equal to the maximum number of iterations; if so, use the position information corresponding to the optimal individual fitness value as the initial penalty factor C or kernel function variance g of the SVR model to complete the training of the SVR model; otherwise, add 1 to the current number of iterations q and return to step S5-3-5.
8. The on-site error verification method of electric energy meter considering multiple factors according to claim 7, Features: The calculation formula of the individual fitness value is: Wherein, f represents the individual fitness value, n represents the total number of sample data of the electric energy meter, Yi represents the metering error data corresponding to the i-th sample, yi represents the verified metering error data corresponding to the i-th sample, and ∑(·) represents the summation function; wherein, when calculating the individual fitness value, the SVR model is updated based on the position information of the corresponding optimal individual; the updated SVR model is used for detection to obtain the corresponding verified metering error data.
9. The on-site error verification method of electric energy meter considering multiple factors according to claim 7, Features: The formula of the triangle walking strategy in step S5-3-8 is: L1=posb(t)-posc(t) L2=rand(0,1)×L1 β=2×π×rand(0,1) r=rG×rand(0,1) Posnew=posb(t)+r×P Wherein, L1 represents the distance between the sand cat and the prey, posb(t) represents the position of the individual corresponding to time t, posc(t) represents the position of the optimal individual corresponding to time t, β represents the walking direction of the sand cat, π represents pi, P represents the distance between the position obtained by the sand cat and the prey, L2 represents the step range of the sand cat, cos(·) represents the cosine function, Posnew represents the position of the optimal individual after update, and r represents the sensitivity range of the sand cat; The formula of the Levy flight strategy in step S5-3-9 is: Posnew=posb(t)+(posb(t)-posc(t))×C×Levy Wherein, C represents a constant and Levy represents Levy distribution.
10. The on-site error verification method of electric energy meter considering multiple factors according to claim 7, Features: The formula of the t distribution in step S5-3-11 is: in, represents the position of the jth dimension of the i-th sand cat individual after mutation, t(i) represents the t-distribution with i degrees of freedom, pr represents the dynamic selection probability, rand represents a random number, ω1 and ω2 represent the upper limit of the dynamic selection probability and the variation range of the dynamic selection probability respectively, and tm represents the maximum number of iterations.
Citation Information
Cited By
Edge computing node deployment system and method in industrial internet of things environment
CN120880910A
Lithium iron phosphate battery equivalent model parameter identification method based on improved SCSO
CN121114809A
