Electric meter misalignment detection method and device based on linear regression and electronic equipment
1. The electric meter misalignment detection method based on linear regression is characterized by comprising the following steps of:
performing generalized partial correlation analysis on the power consumption data of all the user electric meters in the distribution room to obtain the power consumption data of the user electric meters meeting preset conditions;
taking the electricity consumption data of the user ammeter meeting the preset conditions as a candidate independent variable set, and constructing a quadratic programming model according to the candidate independent variable set, wherein the quadratic programming model meets the following formula:
wherein y is the power bus loss of the transformer area;a candidate independent variable set is obtained;the regression coefficient set corresponding to the electricity consumption data of each user ammeter in the candidate autovariable set is obtained;
solving regression coefficients of the quadratic programming model to obtain a regression coefficient set corresponding to the power consumption data of each user electric meter in the candidate independent variable set;
and judging the misalignment state of each user electric meter according to the solved regression coefficient set.
2. The linear regression-based electricity meter misalignment detection method of claim 1, wherein the set of candidate independent variables and the set of regression coefficients respectively satisfy the following formulas:
wherein the content of the first and second substances,the method comprises the steps of obtaining user electric meter electricity consumption data meeting preset conditions;is a regression coefficient set;is the ith under the nth balcony regionkDaily electricity consumption of a block meter;is the ithkThe regression coefficient of the block ammeter for measuring the electricity consumption; i.e. ikAnd numbering the user electric meters in the candidate autovariable set.
3. The method for detecting meter misalignment based on linear regression of claim 1, wherein the determining the misalignment status of each user meter according to the solved regression coefficient set comprises:
in thatIf the user electric meter is in the right time, the user electric meter is judged to have less metering, and the misalignment degree of the user electric meter is compared withThe absolute value is proportional;
in thatWhen the user electric meter is negative, the user electric meter is judged to have more metering,and the user electric meter is out of alignment withThe absolute value is proportional.
4. The linear regression-based electric meter misalignment detection method according to claim 1, wherein the obtaining of the electric power consumption data of the user electric meters satisfying the preset conditions by performing generalized partial correlation analysis on the electric power consumption data of all the user electric meters in the distribution area comprises:
constructing an augmentation matrix A of the distribution room bus loss and the daily electric quantity of the user electric meter;
generating a sample covariance matrix C of the augmentation matrix A, wherein the sample covariance matrix C is used for representing the linear correlation between the distribution area bus loss and the user electric meter metering electric quantity;
obtaining an inverse matrix IC of a sample covariance matrix C, wherein the inverse matrix IC is used for representing linear partial correlation between distribution area bus loss and each user electric meter metering electric quantity;
obtaining a diagonal vector d of the inverse matrix IC, wherein the diagonal vector d is used for representing the distribution room bus loss and the variance of the user electric meter metering electric quantity;
obtaining a partial correlation coefficient vector pc for representing the bus loss of the transformer area and the metering electric quantity of each electric meter under the transformer area according to the diagonal vector d of the inverse matrix IC and the inverse matrix IC;
and acquiring a partial correlation threshold value s, and if the partial correlation coefficient vector pc of the metering electric quantity of a certain electric meter in the distribution area is greater than or equal to the partial correlation threshold value s, judging that the electric quantity data of the electric meter is the electric quantity data of the user electric meter meeting the preset condition.
5. The linear regression based meter misalignment detection method of claim 4, wherein obtaining the inverse matrix IC of the sample covariance matrix C comprises:
when the number of the electric meters under the transformer area is larger than or equal to the number of electric quantity collection days, converting the sample covariance matrix C into a reversible matrix by increasing a diagonal matrix, and acquiring an inverse matrix IC of the converted reversible matrix;
and when the number of the electric meters under the transformer area is less than the number of the electric quantity collecting days, the sample covariance matrix C is a reversible matrix, and an inverse matrix IC of the sample covariance matrix C is generated.
6. The linear regression based electricity meter misalignment detection method of claim 4, wherein the step of obtaining a partial correlation threshold s comprises:
and acquiring a partial correlation threshold value s of the distribution room bus loss and the user electric meter metering electric quantity under the condition that the confidence coefficient is 0.95.
7. The linear regression-based misalignment detection method for electric meters according to claim 1, wherein the step of performing the generalized partial correlation analysis on the electricity consumption data of all the users under the distribution area further comprises:
preprocessing the electricity consumption data of all user electricity meters in the distribution room; the pretreatment comprises one or more of the following: removing power consumption data with high station area bus loss caused by daily power acquisition failure factors; and acquiring time sequence data detection abnormal points of the distribution room bus loss, and removing daily electric quantity data corresponding to the detection abnormal points.
8. An apparatus for detecting misalignment of an electricity meter based on linear regression, comprising:
the analysis unit is used for carrying out generalized partial correlation analysis on the power consumption data of all the user electric meters in the transformer area to obtain the power consumption data of the user electric meters meeting preset conditions;
the secondary planning model construction unit is used for taking the electricity consumption data of the user electric meter meeting the preset conditions as a candidate autovariable set; constructing a quadratic programming model according to the candidate autovariate set
The quadratic programming model satisfies the following formula: s.t are provided.(ii) a Wherein y is the power bus loss of the transformer area;a candidate independent variable set is obtained;the regression coefficient set corresponding to the electricity consumption data of each user ammeter in the candidate autovariable set is obtained;
the calculation unit is used for solving regression coefficients of the quadratic programming model to obtain a regression coefficient set corresponding to the power consumption data of each user electric meter in the candidate auto-variable set;
and the judging unit is used for judging the misalignment state of each user electric meter according to the solved regression coefficient set.
9. An electronic device, comprising: at least one processor, and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the linear regression based electric meter misalignment detection method of any of claims 1-7.
10. A computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements a linear regression based electric meter misalignment detection method according to any of claims 1-7.
Background
As the intelligent transformation of the electric meters is promoted by the national power grid, hundreds of millions of electric meters are deployed all over the country. The so-called meter misalignment is that the actual electricity consumption of the user measured by the meter and the electricity measured by the meter are obviously inconsistent. When the actual electricity consumption of the user is larger than the electricity quantity measured by the electricity meter, the electricity meter is short, and the operating income of a power supply company is damaged; the reason for the lack of electricity meters is that the electricity meters usually have faults or are artificially stolen; on the other hand, if the actual electricity consumption of the user is less than the electricity amount measured by the electricity meter, the electricity meter is overdimensioned, which may damage the consumption rights of the user and cause the reason of the overdimensioning of the electricity meter, which is usually the fault of the electricity meter. Therefore, the misalignment detection of the electric meter has important significance for reducing the rotation cost of the electric meter and maintaining the order of the electricity utilization market.
For the misalignment detection of the electric meter, the traditional detection method can refer to patent application No. 202011332014.5, and a method for evaluating the running state and replacement of the electric meter in real time by relying on big data is disclosed, wherein the total power consumption of a gateway of a platform area is used as a dependent variable, the power consumption of each electric meter below the platform area is used as an independent variable, a multiple linear regression model is constructed, and whether the electric meter is misaligned or not is judged according to a regression coefficient. However, the conventional electric meter misalignment model constructed based on multiple linear regression generally has the following problems:
1) the traditional multiple linear regression model generally requires equation number greater than or equal to variable number, and for the electric meter misalignment model, that is, it requires that the number of days for collecting power consumption is greater than or equal to the total number of users under the station area, but there may exist some total numbers of users under the station area which may reach two hundred or three hundred, or even more, so that the traditional electric meter misalignment model may require the number of days for collecting power consumption to reach two hundred or three hundred days, or even more days, and can meet the conditions that the model can solve, if the number of days for collecting power consumption is less than the total number of users under the station area, the equation number is less than the variable number, the traditional multiple linear regression model cannot be solved, and the detection of the electric meter misalignment state cannot be realized.
2) The traditional multiple linear regression model usually requires accurate topological relation of a station area, namely the corresponding relation between an electric meter and the station area is required to be accurate, but the corresponding relation between the electric meter and the station area is required to be accurate, the number of acquisition days is required to be as small as possible, if the number of acquisition days is too small, the number of acquisition days is probably smaller than the total number of the electric meters below the station area, so that the linear regression model is not solvable, therefore, if the traditional multiple linear regression model is required to ensure that the linear regression model is solvable, the number of acquisition days needs to be enlarged, the number of acquisition days is usually set to be 300 days, but the enlargement of the acquisition days can not ensure that the corresponding relation between the electric meter and the station area is not changed in the period of acquisition, namely, the corresponding relation between the electric meter and the station area can be changed in the period of acquisition days, so that the accurate corresponding relation between the electric meter and the station area, the accuracy rate of detecting the misalignment state of the electricity meter is reduced.
Disclosure of Invention
In view of the above technical problems, an object of the present invention is to provide a method, an apparatus, and an electronic device for detecting misalignment of an electric meter based on linear regression, which solve the problem that the conventional method for constructing an misalignment model of an electric meter based on multiple linear regression cannot detect the misalignment state of the electric meter when the number of days for collecting power consumption is smaller than the total number of users under a platform area, or cannot meet the requirement that the number of days for collecting power consumption is usually long when detecting the misalignment state of the electric meter, so that the corresponding relationship between the electric meter and the platform area is accurate.
The invention adopts the following technical scheme:
the ammeter misalignment detection method based on linear regression comprises the following steps:
performing generalized partial correlation analysis on the power consumption data of all the user electric meters in the distribution room to obtain the power consumption data of the user electric meters meeting preset conditions;
taking the electricity consumption data of the user ammeter meeting the preset conditions as a candidate independent variable set, and constructing a quadratic programming model according to the candidate independent variable set, wherein the quadratic programming model meets the following formula:
wherein y is the power bus loss of the transformer area;a candidate independent variable set is obtained;the regression coefficient set corresponding to the electricity consumption data of each user ammeter in the candidate autovariable set is obtained;
solving a regression coefficient of the quadratic programming model to obtain a regression coefficient set;
and judging the misalignment state of each user electric meter according to the solved regression coefficient set.
Optionally, the candidate independent variable set and the regression coefficient set respectively satisfy the following formulas:
wherein the content of the first and second substances,the method comprises the steps of obtaining user electric meter electricity consumption data meeting preset conditions;is a regression coefficient set;is the ith under the nth balcony regionkDaily electricity consumption of a block meter;is the ithkThe regression coefficient of the block ammeter for measuring the electricity consumption; i.e. ikAnd numbering the user electric meters in the candidate autovariable set.
Optionally, the determining the misalignment state of each user electric meter according to the solved regression coefficient includes:
in thatIf the user electric meter is in the right time, the user electric meter is judged to have less metering, and the misalignment degree of the user electric meter is compared withThe absolute value is proportional;
in thatWhen the user ammeter is negative, the user ammeter is judged to have multiple metering, and the misalignment degree of the user ammeter is equal toThe absolute value is proportional.
Optionally, the generalized partial correlation analysis is performed on the power consumption data of all the user electric meters in the distribution room, so as to obtain the power consumption data of the user electric meters meeting the preset conditions, and the generalized partial correlation analysis includes:
constructing an augmentation matrix A of the distribution room bus loss and the daily electric quantity of the user electric meter;
generating a sample covariance matrix C of the augmentation matrix A, wherein the sample covariance matrix C is used for representing the linear correlation between the distribution area bus loss and the user electric meter metering electric quantity;
obtaining an inverse matrix IC of a sample covariance matrix C, wherein the inverse matrix IC is used for representing linear partial correlation between distribution area bus loss and user electric meter metering electric quantity;
obtaining a diagonal vector d of the inverse matrix IC, wherein the diagonal vector is used for representing the distribution room bus loss and the variance of the user electric meter metering electric quantity;
obtaining a partial correlation coefficient vector pc for representing the distribution area bus loss and the electricity consumption of each electricity meter under the distribution area according to the diagonal vector d of the inverse matrix IC and the inverse matrix IC;
and acquiring a partial correlation threshold value s, and if the partial correlation coefficient vector pc of the power consumption of a certain ammeter in the district is greater than or equal to the partial correlation threshold value s, judging that the power consumption data of the ammeter is the power consumption data of the user ammeter meeting the preset conditions.
Optionally, obtaining the inverse matrix IC of the sample covariance matrix C includes:
when the number of the electric meters under the transformer area is larger than or equal to the number of electric quantity collection days, converting the sample covariance matrix C into a reversible matrix by increasing a diagonal matrix, and acquiring an inverse matrix IC of the converted reversible matrix;
and when the number of the electric meters under the transformer area is less than the number of the electric quantity collecting days, the sample covariance matrix C is a reversible matrix, and an inverse matrix IC of the sample covariance matrix C is generated.
Optionally, the step of obtaining the partial correlation threshold s includes:
and acquiring a partial correlation threshold value s of the distribution room bus loss and the user electric meter metering electric quantity under the condition that the confidence coefficient is 0.95.
Optionally, before the step of performing generalized partial correlation analysis on the electricity consumption data of all the user electric meters in the distribution area, the method further includes:
preprocessing the electricity consumption data of all user electricity meters in the distribution room; the pretreatment comprises one or more of the following: removing power consumption data with high station area bus loss caused by daily power acquisition failure factors; and acquiring time sequence data detection abnormal points of the distribution room bus loss, and removing daily electric quantity data corresponding to the detection abnormal points.
An apparatus for meter misalignment detection based on linear regression, comprising:
the analysis unit is used for carrying out generalized partial correlation analysis on the power consumption data of all the user electric meters in the transformer area to obtain the power consumption data of the user electric meters meeting preset conditions;
a quadratic programming model construction unit for using the electricity consumption data of the user ammeter meeting the preset conditions as candidatesA set of variables; constructing a quadratic programming model according to the candidate independent variable set, wherein the quadratic programming model satisfies the following formula:wherein y is the power bus loss of the transformer area;a candidate independent variable set is obtained;the regression coefficient set corresponding to the electricity consumption data of each user ammeter in the candidate autovariable set is obtained;
the calculation unit is used for solving the regression coefficient of the quadratic programming model to obtain a regression coefficient set;
and the judging unit is used for judging the misalignment state of each user electric meter according to the solved regression coefficient set.
An electronic device, comprising: at least one processor, and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the linear regression based method for meter misalignment detection.
A computer storage medium having stored thereon a computer program which, when executed by a processor, implements the linear regression based electric meter misalignment detection method.
Compared with the prior art, the invention has the beneficial effects that:
according to the invention, by firstly carrying out generalized partial correlation analysis and then constructing an improved linear regression model, namely solving a quadratic programming model with constraint, judging the misalignment state of the electric meter according to the solved regression coefficient, and not requiring that the number of days for collecting the electricity consumption is more than or equal to the total number of the electric meters below a distribution area, the misalignment detection of the electric meter can be realized when the total number of the electric meters under the distribution area is more than the number of days for collecting the electricity consumption, for example, the total number of the electric meters under the distribution area is up to two hundred, even more, but under the condition that the number of days for collecting the electricity consumption is shorter, such as 90 days, the misalignment judgment of the electric meter can be effectively carried out, and the misalignment detection of the electric meter can be realized. Meanwhile, the misalignment state of the electric meter can be detected under the condition of short days for collecting the power consumption, so that the possibility of changing the corresponding relation between the electric meter and the distribution area can be reduced, the requirement of accurate corresponding relation between the electric meter and the distribution area can be met, and the misalignment detection accuracy is improved.
Drawings
FIG. 1 is a schematic flow chart of a method for detecting misalignment of an electric meter based on linear regression according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an apparatus for detecting misalignment of an electric meter based on linear regression according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The present invention will be further described with reference to the accompanying drawings and specific embodiments, and it should be noted that, in the premise of no conflict, the following described embodiments or technical features may be arbitrarily combined to form a new embodiment:
the first embodiment is as follows:
referring to fig. 1-3, fig. 1 shows a linear regression-based method for detecting misalignment of an electric meter according to the present invention, which includes the following steps:
step S1, performing generalized partial correlation analysis on the power consumption data of all the user electric meters in the transformer area to obtain the power consumption data of the user electric meters meeting the preset conditions;
in this embodiment, the power consumption of all the user electric meters in the area may refer to the power consumption data of all the user electric meters in the power supply range or area of one transformer in the power system.
Specifically, the distribution area general table and all the user electric meters below the distribution area have a topological connection relationship, that is, the total electric quantity measured under one distribution area general table corresponds to the electric quantity measured by a plurality of user electric meters.
In the present invention, the electricity consumption of the electricity meter means the electricity amount measured by the electricity meter, and is not distinguished in the present invention.
The power consumption data may specifically include power consumption of users in the distribution room collected every day within a preset time. For example, the preset time is 90 days, and the electricity consumption data comprises the electricity consumption displayed by the user electricity meters of all the users collected every day in the 90 days.
Specifically, the generalized partial correlation analysis is performed on the power consumption data of all the user electric meters in the distribution room, so that the power consumption data of the user electric meters meeting the preset conditions are obtained, and the generalized partial correlation analysis can include:
step S11, constructing an augmentation matrix A of the distribution room bus loss and the daily electric quantity of the user electric meter;
the rows of A sequentially represent different electricity collecting dates, and the columns of A sequentially represent the line loss value y of the total table area meter and the electricity metering quantity X of the user electricity meter on the corresponding dates; the specific calculation formula is as follows: a ═ y, X
Wherein the content of the first and second substances,
specifically, the calculation principle of the line loss value y of the distribution room summary table is as follows:
because the total electric quantity transmitted to all users below the distribution area is measured by the distribution area total meter, each user electric meter respectively measures the electric quantity used by the corresponding user, if the distribution area total meter and all the user electric meters below the distribution area are accurately measured, the electric quantity of the distribution area total meter should be equal to the sum of the electric quantities measured by all the user electric meters below the distribution area, and a part of inherent line electric quantity loss (hereinafter referred to as "inherent line loss") is added, namely, the following theoretical equation exists:
q=s+x1+x2+...+xp (1)
wherein q represents the measured electric quantity of the table of the transformer area, xjAnd (j is more than or equal to 1 and less than or equal to p) represents the metering electric quantity of the jth user electric meter, and s represents the inherent line loss. However, in real cases, each x in equation (1) is due to a metering failure in the user's electricity meter, or due to a human-induced electricity theftjNeeds to be multiplied by a calibration factor fjSo equation (1) is converted toThe formation is as follows:
q=s+f1x1+f2x2+...+fpxp (2)
to unify with the representation of the following algorithm, let:
substituting equation (2) results in the following equation:
y=s+c1x1+c2x2+...+cpxp (3)
in equation (3), y represents the power bus loss of the distribution area, xj(j is more than or equal to 1 and less than or equal to p) represents the measured electric quantity of the jth user electric meter, cjA regression coefficient representing the electricity usage of the jth customer meter, and in a theoretical case, if customer meter j measures exactly, coefficient cj0; if the electric meter is multi-meter (user actual electricity consumption)<Electricity meter metering amount of electricity), then the coefficient cj<0; if the electric meter counts less (the actual electricity consumption of the user)>Electricity meter metering amount of electricity), then the coefficient cj>0. Therefore, the coefficient c is solved accuratelyjBecomes the key point.
In general, it is assumed that within a time range, without loss of generality, the time range is from day 1 to day n, the topological relationship of the cell is not changed (i.e. the connection relationship of fig. 2 is not changed), and the coefficient c is obtainedj(1 ≦ j ≦ p) stable, then, for both the daily power bus loss and the user meter power, equation (3) is satisfied, which together is as follows:
in equation (4), yi (1. ltoreq. i. ltoreq. n) represents the station area bus loss on day i, xij(i is more than or equal to 1 and less than or equal to n, j is more than or equal to 1 and less than or equal to p) represents the daily electric quantity of the jth ammeter in the station area on the ith day, and epsilon represents a random error term, obeys n-element normal distribution and meets the following conditions: epsilon to N (0, sigma)2I);
The linear system of equations (4) if the usual minimum is usedThe second multiplication algorithm requires n to be more than or equal to p +1, namely, the number of days for collecting electric quantity>The total number of the user electric meters below the distribution area is 200, the number of days for collecting electric quantity needs more than 200 days, but if the number of days for collecting is too long, it is difficult to ensure that the topological relation of the distribution area is unchanged in the period of time, a newly added user electric meter exists below the distribution area, or the existing electric meters sell accounts and the like, the topological relation of the distribution area is changed, and the solving coefficient c is causedjIs inaccurate.
Therefore, the invention can carry out generalized partial correlation analysis on the electricity consumption data of all the user electricity meters in the distribution area so as to realize misalignment detection on the electricity meters in the following steps when the number of days for collecting the electricity is short. Since the number of meters in which misalignment usually occurs is only a few under one station, this means that in equation (1), where c isiMost of (i is more than or equal to 1 and less than or equal to p) are 0, if we can exclude most of normal electric meters in advance and only use a small number of electric meters as independent variables of the linear regression model, even if the total number of users is far more than the number of days for collecting electric quantity, the linear regression model is theoretically solvable as long as the number of electric meters finally entering the linear regression model is less than the number of days for collecting electric quantity.
For example, if 90% of normal meters can be excluded and only 10% of the remaining meters can be used as arguments for the linear model, then the misalignment calculation can be theoretically performed for all the stations whose total number of meters does not exceed 900, even if the number of days for collecting power is 90 days.
Therefore, the quadratic programming model of the invention is adopted to solve the coefficientsIt is possible to realize a short number of days for which the charge is collected, for example, n 90, for n<In case of p +1, the coefficient c can still be accurately solvedj. Meanwhile, the possibility of changing the topological relation of the platform area can be reduced as much as possible, and the accuracy of the misalignment calculation is ensured.
In the implementation process, generalized partial correlation analysis is carried out on the power consumption data of all the user electric meters in the distribution area, only the power consumption data of the user electric meters meeting the preset conditions are reserved, most normal electric meters can be effectively eliminated, only a small number of electric meters are used as independent variables of a linear regression model, and the possibility of calculation of a misalignment model (namely a constrained secondary planning model in the subsequent step) is provided for the condition that the number of the electric meters in the distribution area is far more than the number of days for acquiring electric quantity.
Step S12, generating a sample covariance matrix C of the augmentation matrix A, wherein the sample covariance matrix C is used for representing the linear correlation between the distribution area bus loss and the user electric meter metering electric quantity; the specific calculation formula is as follows:
C=cov(A)
step S13, obtaining an inverse matrix IC of the sample covariance matrix C, wherein the inverse matrix IC is used for representing the linear partial correlation between the distribution area bus loss and the user electric meter metering electric quantity;
optionally, obtaining the inverse matrix IC of the sample covariance matrix C includes:
s131, when the number of electric meters under the transformer area is larger than or equal to the number of electric quantity collection days, converting the sample covariance matrix C into a reversible matrix by adding a diagonal matrix, and acquiring an inverse matrix IC of the converted reversible matrix;
because, when the number of the electric meters under the transformer area is not less than the number of the electric quantity collection days, namely p is not less than n, the sample covariance matrix C is not reversible. Here, the sample covariance matrix C may be converted into an invertible matrix by adding a diagonal matrix, specifically, the diagonal element of the diagonal matrix is r, where r is a very small positive number, for example, r ═ 1e-15, converting the sample covariance matrix C into the invertible matrix, and then obtaining an inverse matrix IC of the converted invertible matrix; the specific calculation formula is as follows:
E=eig(C)
e=min(E)
if(e<r)
C=C+r*I
step S132, when the number of the electric meters under the transformer area is less than the number of the electric quantity collecting days, the sample covariance matrix C is a reversible matrix, an inverse matrix IC of the sample covariance matrix C is generated, and the specific calculation formula is as follows:
IC=inv(C);
step S14, obtaining a diagonal vector d of the inverse matrix IC, wherein the diagonal vector is used for representing the variance of the distribution room bus loss and the user electricity meter metering electric quantity; the specific calculation formula is as follows:
d=diag(IC);
step S15, obtaining a partial correlation coefficient vector pc used for representing the distribution room bus loss and the electricity consumption of each electricity meter under the distribution room according to the inverse matrix IC and the diagonal vector d of the inverse matrix IC; the specific calculation formula is as follows:
f=d[0]*d
f=1/sqrt(f)
pc=-IC[0,1:]*f[1:];
step S16: obtaining a partial correlation threshold value s, if a partial correlation coefficient vector pc of power consumption of a certain ammeter in a distribution area is greater than or equal to the partial correlation threshold value s, judging that the power consumption data of the ammeter is the power consumption data of a user ammeter meeting preset conditions, reserving the power consumption data of the user ammeter meeting the preset conditions as a candidate independent variable set indexs, and specifically calculating the formula as follows:
indexs={i|abs(pc[i])≥s,1≤i≤p};
optionally, the step of obtaining the partial correlation threshold s includes:
and acquiring a partial correlation threshold value s of the distribution room bus loss and the user electric meter metering electric quantity under the condition that the confidence coefficient is 0.95.
Specifically, according to the statistical analysis principle, a partial correlation threshold s of the distribution room bus loss and the user electric meter metering electric quantity is calculated under the condition that the confidence coefficient is 0.95, and the specific calculation formula is as follows:
s=t.ppf(0.95,n-p-2)
s=s2/(n-p-2)
wherein t.ppf (0.95, n-p-2) represents t distribution with degree of freedom n-p-2, and cumulative probability is 0.95 quantile.
Optionally, the candidate independent variable set and the regression coefficient set respectively satisfy the following formulas:
wherein the content of the first and second substances,the method comprises the steps of obtaining user electric meter electricity consumption data meeting preset conditions;is a regression coefficient set;is the ith under the nth balcony regionkDaily electricity consumption of a block meter;is the ithkThe regression coefficient of the block ammeter for measuring the electricity consumption; i.e. ikAnd numbering the user electric meters in the candidate autovariable set.
Step S2, taking the electricity consumption data of the user electricity meter meeting the preset conditions as a candidate autovariable set; constructing a quadratic programming model according to the candidate independent variable set, wherein the quadratic programming model satisfies the following formula:
wherein y is the power bus loss of the transformer area;a candidate independent variable set is obtained;the regression coefficient set corresponding to the electricity consumption data of each user ammeter in the candidate autovariable set is obtained;
specifically, the principle of constructing the quadratic programming model according to the candidate independent variable set is as follows:
assume that the candidate obtained by the generalized partial correlation analysis in step S1 is selected from the variable setCo indexs ═ i { (i) }1,i2,...,ikThen equation (1) can be converted to:
wherein i1...ikAnd representing the number of the user electric meter corresponding to the candidate autovariable set. In real environment, the regression coefficient cikNot less than-1. The linear regression model can therefore transform a constrained quadratic programming model, namely:
wherein the content of the first and second substances,
wherein the content of the first and second substances,the method comprises the steps of obtaining user electric meter electricity consumption data meeting preset conditions;is a regression coefficient set;is the ith under the nth balcony regionkDaily electricity consumption of a block meter;is the ithkThe regression coefficient of the block ammeter for measuring the electricity consumption; i.e. ikAnd numbering the user electric meters in the candidate autovariable set.
In the implementation process, a quadratic programming model is constructed according to the candidate independent variable set, and a linear regression model based on least square is converted into a quadratic programming model with constraints, so that the quadratic programming model is more consistent with the physical significance of a real environment.
Step S3, solving the regression coefficient of the quadratic programming model to obtain a regression coefficient set;
in this implementation, the constructed quadratic programming with constraints belongs to the convex optimization problem with constraints mathematically, and a theoretical optimal solution can be obtained through mathematical calculation in the prior art, for example, a solution can be realized by (but not limited to) a lagrange method, a Lemke method, an interior point method, an active set method, an ellipsoid algorithm, and the like.
And step S4, judging the misalignment state of each user electric meter according to the solved regression coefficient.
In this implementation, the step S4 may specifically include:
in thatIf the user electric meter is in the right time, the user electric meter is judged to have less metering, and the misalignment degree of the user electric meter is compared withThe absolute value is proportional;
in thatWhen the user ammeter is negative, the user ammeter is judged to have multiple metering, and the misalignment degree of the user ammeter is equal toThe absolute value is proportional.
As another embodiment, before the step of analyzing the generalized partial correlation of the power consumption data of all the user electric meters in the distribution area, the present invention further includes:
step S0, preprocessing the electricity consumption data of all the user electricity meters in the transformer area; the pretreatment comprises one or more of the following: removing power consumption data with high station area bus loss caused by daily power acquisition failure factors; and acquiring time sequence data detection abnormal points of the distribution room bus loss, and removing daily electric quantity data corresponding to the detection abnormal points.
In step S0, since the real production environment has a possibility of failure in collecting the daily electricity consumption of a part of electricity meters in a certain day, the calculated distribution room bus loss is significantly high, and therefore, the line loss electricity quantity data corresponding to the certain day can be filtered out through preprocessing; in addition, under the condition that the daily electric quantity of all the electric meters below the transformer area is completely collected successfully, the electric energy indicating value of the transformer area general meter can also have metering faults of falling away and flying away, so that abnormal point detection can be carried out on the time sequence data of the transformer area bus line loss through preprocessing, for example (but not limited to) a mu +/-3 sigma criterion can be used for searching the abnormal point, and then the line loss electric quantity data of the date corresponding to the abnormal point is deleted.
In the implementation process, line loss electric quantity data are preprocessed, then candidate electric meters are obtained based on generalized partial correlation analysis, a small number of electric meters with high partial correlation with the line loss of the transformer area are screened out, then a linear regression model of the total line loss of the transformer area is converted into a secondary planning model with constraints based on the candidate electric meters for solving, and therefore the electric meter misalignment judgment can be effectively carried out under the condition that the number of days for collecting the electric quantity is short.
The method comprises the following simulation detection steps:
the method comprises the following steps of collecting user electric meter data of a plurality of areas, wherein the number of days for collecting electric quantity is 90 days, assuming that 10% of electric meters below each area are out of alignment, then sequentially setting the total number of the electric meters with different numbers below each area, detecting the out-of-alignment electric meters by the method, and performing cyclic simulation detection 50 times on each group of electric meters, wherein the specific simulation experiment result is shown in the following table 1:
table 1:
as can be seen from Table 1, the total number of electric meters under the distribution room is less than or equal to 180, the recall rate is more than or equal to 60 percent, and the accuracy rate is more than or equal to 80 percent; when the total number of district meters reaches 200, the accuracy is maintained at 70% although the recall rate is below 50%.
Example two:
referring to fig. 2, fig. 2 shows an apparatus for detecting misalignment of an electric meter based on linear regression according to the present invention, including:
the analysis unit 10 is used for performing generalized partial correlation analysis on the power consumption data of all the user electric meters in the distribution room to obtain the power consumption data of the user electric meters meeting preset conditions;
the quadratic programming model building unit 20 is used for taking the electricity consumption data of the user electric meters meeting the preset conditions as a candidate autovariable set; constructing a quadratic programming model according to the candidate independent variable set, wherein the quadratic programming model satisfies the following formula:wherein y is the power bus loss of the transformer area;a candidate independent variable set is obtained;the regression coefficient set of the metering electricity consumption of each user ammeter in the candidate autovariable set is obtained;
the calculation unit 30 is configured to solve a regression coefficient of the quadratic programming model to obtain a regression coefficient set;
and the judging unit 40 is used for judging the misalignment state of each user electric meter according to the solved regression coefficient set.
In the implementation process, the generalized partial correlation analysis is performed through the analysis unit 10, then the quadratic programming model construction unit 20 constructs an improved linear regression model, that is, the quadratic programming model with constraints is used for solving, the misalignment state of the electric meter is judged according to the solved regression coefficient, the number of days for collecting the electricity consumption is not required to be more than or equal to the total number of the electric meters below the station area, on one hand, the misalignment detection of the electric meter can be realized when the total number of the electric meters under the station area is more than the number of days for collecting the electricity consumption, for example, the total number of the electric meters under the station area is up to two hundred, but the misalignment judgment of the electric meter can be effectively performed under the condition that the number of days for collecting the electricity consumption is short, for example, 90 days, so that the misalignment detection of the electric meter is realized.
Meanwhile, the invention can detect the misalignment state of the ammeter under the condition of short electricity consumption collection days, and can reduce the possibility of change of the corresponding relation between the ammeter and the transformer area, thereby improving the accuracy of misalignment detection.
Example three:
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and in the present application, an electronic device 100 for implementing the method for detecting misalignment of an electric meter based on linear regression according to the present invention according to the embodiment of the present application may be described with reference to the schematic diagram shown in fig. 3.
As shown in fig. 3, an electronic device 100 includes one or more processors 102, one or more memory devices 104, and the like, which are interconnected via a bus system and/or other type of connection mechanism (not shown). It should be noted that the components and structure of the electronic device 100 shown in fig. 3 are only exemplary and not limiting, and the electronic device may have some of the components shown in fig. 3 and may have other components and structures not shown in fig. 3 as needed.
The processor 102 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 100 to perform desired functions.
The storage 104 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. On which one or more computer program instructions may be stored that may be executed by processor 102 to implement the functions of the embodiments of the application (as implemented by the processor) described below and/or other desired functions. Various applications and various data, such as various data used and/or generated by the applications, may also be stored in the computer-readable storage medium.
The invention also provides a computer storage medium on which a computer program is stored, in which the method of the invention, if implemented in the form of software functional units and sold or used as a stand-alone product, can be stored. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer storage medium and used by a processor to implement the steps of the embodiments of the method. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer storage medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer storage media may include content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer storage media that does not include electrical carrier signals and telecommunications signals as subject to legislation and patent practice.
Various other modifications and changes may be made by those skilled in the art based on the above-described technical solutions and concepts, and all such modifications and changes should fall within the scope of the claims of the present invention.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:测距装置、测距系统以及测距方法