Electric quantity restoration method based on combination of clustering algorithm and time sequence

The power data of power users are classified through clustering algorithms and data fitting is combined with the ARIMA model, which solves the problem of low accuracy in the calculation of restored power in the existing technology, and achieves more accurate power reduction and line loss analysis.

CN119691489APending Publication Date: 2025-03-25JIANGSU INTELEVER ENERGY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411848458.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

In the prior art, when calculating the restored power of the power user, the average calculation method results in the accuracy of the acquisition abnormal analysis of the restored power of the station area and the line loss abnormality analysis.

Method used

Using a method based on the combination of clustering algorithm and time series, the user's power data is clustered through the K-Means clustering algorithm, which is divided into high-power consumption users, conventional power consumption users and energy-saving users. The ARIMA(1,0,0) model is used to fit the power consumption data of the same type of users, thereby achieving accurate calculation of the restored power.

Benefits of technology

This method can fit the reduction power more accurately, improve the accuracy of the impact of the abnormality, facilitate accurate determination of the bit line loss problem in the later stage, and reduce the workload of manual abnormality identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119691489A_ABST
    Figure CN119691489A_ABST
Patent Text Reader

Abstract

The invention discloses an electric quantity restoring method based on combination of a clustering algorithm and a time sequence. The electric quantity restoring method comprises the following steps: acquiring power consumption data of each user as a sample set by taking the user as a unit; randomly selecting n samples as initial cluster centers from the sample set in the step 1 by using a K-Means clustering algorithm; calculating the distance between each sample and the center of the initial cluster, and distributing the distance to the nearest cluster to obtain a new cluster; recalculating a new cluster center according to the obtained new cluster; repeating the steps 2-4 until the new cluster center is no longer changed or less than the threshold T, and outputting a clustering result; and performing data fitting on the power consumption data of the same type of users clustered according to the clustering result in the step 5 by adopting an ARIMA model, thereby realizing reduction power calculation. The electric quantity restoration method based on the combination of the clustering algorithm and the time sequence can fit and restore more accurate restoration electric quantity, the calculated acquisition abnormity influence degree is accurate, and the line loss problem can be accurately positioned in the later period.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for restoring electric quantity based on the combination of clustering algorithm and time series, and belongs to the technical field of restoring electric quantity. Background Art

[0002] With the development of big data technology, the power industry is increasingly exploring the application of big data. Big data technology can be applied to aspects such as line loss analysis. Failure in power collection will have a great impact on line loss. If the collection fails, we need to restore the restored electricity. The simplified calculation method is to take the average based on a week, half a month, a month, three months or longer. Although the power restoration scheme is relatively simple, the average calculation of the restored electricity in the substation is less accurate for the collection anomaly analysis and subsequent line loss anomaly analysis.

[0003] Therefore, a new method for reducing electric charge is needed to solve the above problems. Summary of the invention

[0004] Purpose of the invention: In view of the problems existing in the prior art, the present invention provides a method for restoring electric quantity based on the combination of clustering algorithm and time series.

[0005] A method for restoring electric quantity based on a combination of a clustering algorithm and a time series comprises the following steps:

[0006] Step 1: Obtain the power consumption data of each user as a sample set;

[0007] Step 2: Use the K-Means clustering algorithm to randomly select n samples as the initial cluster centers for the sample set in step 1;

[0008] Step 3: Calculate the distance between each sample and the center of the initial cluster, assign it to the nearest cluster, and obtain a new cluster;

[0009] Step 4: Recalculate the new cluster center based on the obtained new cluster;

[0010] Step 5: Repeat steps 2 to 4 until the center of the new cluster no longer changes or is less than the threshold T, and output the clustering result;

[0011] Step 6: The power consumption data of the same type of users clustered according to the clustering results of step 5 are fitted using the ARIMA model to achieve the restored power calculation.

[0012] Furthermore, the electricity consumption data in step one includes regular electricity consumption data and average electricity consumption during peak hours, wherein the regular electricity consumption data is weekly electricity consumption data, half-monthly electricity consumption data, monthly electricity consumption data, three-month electricity consumption data, half-year electricity consumption data or annual electricity consumption data.

[0013] Furthermore, the n initial cluster centers in step 2 are expressed by the following formula:

[0014]

[0015] In the formula, m represents the dimension of the sample, and the subscript i represents the i-th sample. represents the i-th m-dimensional sample.

[0016] Furthermore, n=3, that is, users are divided into high-power-consuming users, conventional power-consuming users and energy-saving users.

[0017] Furthermore, the distance between the sample and the initial cluster center in step 3 is calculated by the following formula:

[0018]

[0019] In the formula, L2(x i ,x j ) represents the Euclidean distance between the i-th sample and the j-th sample, represents the i-th l-dimensional sample, represents the jth l-dimensional sample.

[0020] Furthermore, the new cluster center in step 4 is expressed by the following formula:

[0021]

[0022] In the formula, u i represents the i-th new cluster center, represents the m-dimensional vector of the i-th new cluster, C i represents the i-th cluster, |C i | represents cluster C i The total number of samples in x (m) Represents cluster C i The coordinates of the sample points in .

[0023] Furthermore, the ARIMA model in step six is ​​an ARIMA(1,0,0) model.

[0024] Beneficial effect: The power reduction method based on the combination of clustering algorithm and time series of the present invention can fit and restore more accurate restored power, and the calculated collection abnormality impact is accurate, which is convenient for accurately locating line loss problems in the later stage and reduces the workload of manual abnormality identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a flow chart of the method for reducing electric quantity based on the combination of clustering algorithm and time series of the present invention;

[0026] Figure 2 It is the ADF detection result diagram;

[0027] Figure 3 are ACF and PACF plots;

[0028] Figure 4 This is the result chart of ARIMA model order determination;

[0029] Figure 5 Comparison chart of original data and predicted data;

[0030] Figure 6 Modeling flowchart for ARIMA model. DETAILED DESCRIPTION

[0031] The preferred embodiments of the present invention will be described below in conjunction with the accompanying drawings to more clearly and completely illustrate the technical solutions of the present invention.

[0032] See also Figure 1 and Figure 6 As shown, the method for restoring electric quantity based on the combination of clustering algorithm and time series of the present invention comprises the following steps:

[0033] Step 1: Obtain the electricity consumption data of all users in a substation for one month;

[0034] Step 2: K-Means clustering algorithm cluster calculation randomly generates n initial cluster centers:

[0035]

[0036] In the formula, m means that x has m dimensions, and the subscript i means that the vector is the i-th sample;

[0037] Step 3: Calculate the distance between each point and the cluster and assign it to the nearest cluster:

[0038] The Euclidean distance calculation formula between the i-th sample and the j-th sample is:

[0039]

[0040] In the formula, L2(x i ,x j ) represents the Euclidean distance between the i-th sample and the j-th sample, represents the i-th l-dimensional sample, represents the jth l-dimensional sample.

[0041] Step 4: Recalculate the cluster center based on the obtained clusters:

[0042]

[0043] In the formula, represents the m-dimensional vector of the i-th new cluster, C i represents the i-th cluster, |Ci | represents cluster C i The total number of samples in x (m) Represents cluster C i The coordinate points of the samples in ;

[0044]

[0045] In the formula, u i represents the i-th new cluster center, An m-dimensional vector representing the i-th new cluster.

[0046] Step 5: Repeat steps 2 to 4 until the cluster center does not change or is less than the specified threshold, and output the clustering results;

[0047] Step 6: Check the stability of the original data and the white noise:

[0048] See also Figure 2 As shown in the figure, the data sample is the latest one month of electricity data, and the results are obtained by ADF method. The statistical values ​​and ADF of 1%, 5%, and 10% rejection of the original hypothesis at different degrees are compared. It shows that the data is stable. The first and second order differences are performed on the unstable data until the stable data is output.

[0049] Perform white noise detection on the differenced data:

[0050] The calculation method is as follows:

[0051] P=acorr_ljungbox(diffM,lags=N))

[0052] Parameter Description:

[0053] (1) M represents the number of differences

[0054] (2) N represents the number of test data samples

[0055] The output p-value is less than 0.05, which indicates that the sequence after M-order difference is a stationary non-white noise sequence.

[0056] Step 7: ARIMA model identification

[0057] Model explanation:

[0058] In ARIMA (p, d, q), AR stands for "autoregression", p is the number of autoregression terms; MA stands for "moving average", q is the number of moving average terms, and d is the number of differences (order) made to make it a stationary series.

[0059] Model identification can be done through the following two methods:

[0060] 1. Determine the appropriate order of the autoregressive (AR) and moving average (MA) processes by using the autocorrelation function (ACF) and partial correlation function (PACF).

[0061] Parameter determination principle: In the case of truncated PACF and tailed ACF, PACF is more suitable for determining the AR model (p value); Identify the p-order of the AR model For the AR model, the ACF will decay exponentially, and the PACF will be used to identify the order (p) of the AR model. If we have a significant peak at lag 1 on the PACF, then we have a 1st-order AR model, that is, AR(1). If we have significant peaks at lags 1, 2, and 3 on the PACF, then we have a 3rd-order AR model, that is, AR(3).

[0062] Whereas in the case where the ACF is truncated and the PACF is tailed, the ACF is more suitable for determining the MA model (q-value); Identifying the q-order of the MA model For the MA model, the PACF will decay exponentially and the ACF plot will be used to identify the order of the MA process. If we have a significant peak at lag 1 on the ACF, then we have a 1st-order MA model, i.e., MA(1). If we have significant peaks at lags 1, 2, and 3 on the ACF, then we have a 3rd-order MA model, i.e., MA(3).

[0063] If both the autocorrelation graph and the partial autocorrelation graph show tailing, then the most significant order in the ACF graph can be used as the q value, and the most significant order in the PACF can be selected as the p value, and finally the ARMA (p, q) model can be established.

[0064] 2. Determine the most appropriate order by AIC, BIC or HQIC

[0065] The order of the ARIMA model can be AIC (Akaike Information Criterion), BIC (Bayesian Information Criterion) and HQIC (Hannan-Quinn Information Criterion)

[0066] Among them, AIC and BIC are commonly used criteria. AIC tends to select models with more parameters, while BIC tends to select models with fewer parameters. HQIC is between AIC and BIC and is more suitable for data with smaller sample sizes. This patent uses the HQIC criterion.

[0067] The calculation method is as follows:

[0068] hqic=sm.tsa.arma_order_select_ic(train,ic=['hqic'],trend='n',max_ar=m,max_ma=m)['hqic_min_order']

[0069] Parameter Description:

[0070] (1) m Number of detection data samples

[0071] (2) Fixed parameters train, trend

[0072] hqic calls the result set method hqic_min_order.

[0073] The order is determined by using the autocorrelation function (ACF) and partial correlation function (PACF). Figure 3 The results obtained: The PACF graph shows 1st order truncation and ACF tailing, that is, the ARMA(1,0) model is fitted to the first order difference sequence, that is, the ARIMA(1,0,0) model is fitted to the original sequence. The order determined by HQIC is (1,0), and the verification results are as follows Figure 4 .

[0074] The model orders determined by the two methods are basically the same, so ARIMA(1,0,0) is used for model prediction.

[0075] Step 8: Model prediction

[0076] 1. Pass in parameters, build and fit the model

[0077] The calculation method is as follows:

[0078] model=ARIMA(data,order=(1,0,0)).fit()

[0079] Parameter Description:

[0080] (1) data original data;

[0081] (2) order p, d, q parameters;

[0082] 2. Prediction data

[0083] predict_data=model.predict(0,m)

[0084] m is the number of prediction data;

[0085] 3. Predict future data

[0086] forecast_data=model.forecast(n)

[0087] n is the number of future data to be predicted.

[0088] The prediction result data is as follows Figure 5 As shown in Figure 2, it can be seen that the original data and the predicted fitting results are highly similar.

[0089] Step 9: Model Evaluation

[0090] 1. Goodness of fit index evaluation

[0091] The formula is as follows:

[0092]

[0093] In the formula, Var represents variance, Var 残差 represents the variance of the fitted model minus the difference result, represents the variance of the difference result, R 2 The closer it is to 1, the better the fit.

[0094] 2. Mean Square Error

[0095] The formula is as follows:

[0096]

[0097] MSE is a sample estimator (prediction value). In this experiment, the prediction value refers to the in-sample prediction value + the out-of-sample prediction value, and the sample value is the value of all original data.

[0098] The goodness of fit of this set of experimental data is 0.7833, which is very close to 1, and the fit is good.

Claims

1. A method for reducing electricity based on a combination of clustering algorithm and time series, characterized in that: The following steps are involved: Step 1: Obtain the electricity consumption data of each user as a sample set; Step 2: Use the K-Means clustering algorithm to randomly select n samples as the initial cluster centers for the sample set in step 1; Step 3: Calculate the distance between each sample and the center of the initial cluster, assign it to the nearest cluster, and obtain a new cluster; Step 4: Recalculate the new cluster center based on the obtained new cluster; Step 5: Repeat steps 2 to 4 until the center of the new cluster no longer changes or is less than the threshold T, and output the clustering result; Step 6: The power consumption data of the same type of users clustered according to the clustering results of step 5 are fitted using the ARIMA model to achieve the restored power calculation.

2. The method for restoring electric quantity based on the combination of clustering algorithm and time series according to claim 1, characterized in that: The electricity consumption data in step 1 includes regular electricity consumption data and average electricity consumption during peak hours, wherein the regular electricity consumption data is weekly electricity consumption data, half-monthly electricity consumption data, monthly electricity consumption data, three-month electricity consumption data, half-year electricity consumption data or annual electricity consumption data.

3. The method for restoring electric quantity based on the combination of clustering algorithm and time series according to claim 1, characterized in that: The n initial cluster centers in step 2 are expressed as follows: In the formula, m represents the dimension of the sample, and the subscript i represents the i-th sample. represents the i-th m-dimensional sample.

4. The method for restoring electric quantity based on the combination of clustering algorithm and time series according to claim 1, characterized in that: n=3。 5. The method for restoring electric quantity based on the combination of clustering algorithm and time series according to claim 1, characterized in that: The distance between the sample and the initial cluster center in step 3 is calculated by the following formula: In the formula, L2(x i ,x j ) represents the Euclidean distance between the i-th sample and the j-th sample, represents the i-th l-dimensional sample, represents the jth I-dimensional sample.

6. The method for restoring electric quantity based on the combination of clustering algorithm and time series according to claim 1, characterized in that: The new cluster center in step 4 is expressed as follows: In the formula, u i represents the i-th new cluster center, represents the m-dimensional vector of the i-th new cluster, C i represents the i-th cluster, |C i | represents cluster C i The total number of samples in x (m) Represents cluster C i The coordinates of the sample points in .

7. The method for restoring electric quantity based on the combination of clustering algorithm and time series according to claim 1, characterized in that: The ARIMA model in step six is ​​the ARIMA(1,0,0) model.