Electricity consumption prediction method and device, electronic equipment and storage medium

By constructing a power consumption prediction model, using the least squares method and model lag order to process power consumption data, the problem of high computing resources and time consumption in power consumption prediction of neural network models is solved, and prediction efficiency and explanatory are improved.

CN119204363AInactive Publication Date: 2024-12-27JIHUA LAB
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411742006.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2024-12-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing power consumption prediction methods require more computing resources and time to build neural network models due to their complex network structure and parameters, and the prediction results are poorly interpreted.

Method used

By inputting the recent electricity consumption data after the second-order difference processing into the power consumption prediction model constructed by the least squares method, model lag order and residual variance graph, the AR model is used to quickly determine the weight coefficient of the model, saving computing resources and time , improve prediction efficiency.

Benefits of technology

It realizes efficient prediction of electricity consumption, reduces the consumption and time of computing resources, and improves the interpretability and efficiency of prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119204363A_ABST
    Figure CN119204363A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of electricity consumption prediction, and discloses an electricity consumption prediction method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining historical electricity consumption data of a to-be-detected electricity consumption system, carrying out the second-order difference processing of the historical electricity consumption data through a difference method, and obtaining difference processing data, using a least square method, the model lag order and the residual variance map to construct an AR model according to the difference processing data to obtain an electricity consumption prediction model, obtaining recent electricity consumption data of the to-be-tested electricity consumption system, and inputting the recent electricity consumption data subjected to second-order difference processing into the electricity consumption prediction model to predict the electricity consumption of the to-be-tested electricity consumption system. Obtaining predicted power consumption data of the to-be-tested power consumption system in a preset period; the recent power consumption data after the second-order difference processing is input into the power consumption prediction model constructed by using the least square method, the model lag order and the residual variance graph, so that the power consumption is predicted, and the power consumption prediction efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electricity consumption prediction, and in particular to an electricity consumption prediction method, device, electronic device and storage medium. Background Art

[0002] In order to improve the power generation, transmission and distribution capabilities and ensure sufficient and stable power supply, it is very important to predict future power consumption. In the current power consumption prediction tasks and methods, many studies focus on using neural network models, such as long short-term memory networks (LSTM), back propagation neural networks (BPNN), and linear and nonlinear hybrid models. These nonlinear models can automatically learn the characteristics and nonlinear trends of the sequence.

[0003] However, existing neural network technology requires sufficient training data to optimize parameters when making single-step predictions of future data, and more computing resources and time are required during the training process. The prediction results of existing neural network models have poor interpretability due to the complex network structure and parameters of the models.

[0004] Therefore, in order to solve the technical problems that the existing power consumption prediction methods require more computing resources and time when training when building neural network models due to their complex network structure and parameters, and the prediction results are poorly interpretable, there is an urgent need for a power consumption prediction method, device, electronic device and storage medium. Summary of the invention

[0005] The purpose of the present application is to provide a method, device, electronic device and storage medium for predicting electricity consumption. By inputting recent electricity consumption data after second-order difference processing into an electricity consumption prediction model constructed using the least squares method, the model lag order and the residual variance diagram, the predicted electricity consumption data is obtained. The problem that the existing electricity consumption prediction method requires more computing resources and time during training and the prediction results are poorly interpretable due to its complex network structure and parameters when constructing a neural network model is solved. The weight coefficient of the model can be quickly determined by the model lag order, which saves a lot of computing resources and time and improves the efficiency of electricity consumption prediction.

[0006] In a first aspect, the present application provides a method for predicting power consumption, comprising: Obtain historical power consumption data of the power system to be tested; Using a differential method, performing second-order differential processing on the historical electricity consumption data to obtain differential processing data; Using the least squares method, the model lag order and the residual variance diagram, an AR model is constructed according to the differential processing data to obtain an electricity consumption prediction model; Acquire recent power consumption data of the power system to be tested, and input the recent power consumption data after second-order difference processing into the power consumption prediction model to obtain predicted power consumption data of the power system to be tested within a preset period.

[0007] The electricity consumption prediction method provided in the present application can realize the prediction of electricity consumption. The recent electricity consumption data after second-order difference processing is input into the electricity consumption prediction model constructed by using the least squares method, the model lag order and the residual variance diagram to obtain the predicted electricity consumption data. This solves the problem that the existing electricity consumption prediction method requires more computing resources and time during training and the prediction results are poorly interpretable due to its complex network structure and parameters when constructing a neural network model. The weight coefficient of the model can be quickly determined by the model lag order, which saves a lot of computing resources and time and improves the efficiency of electricity consumption prediction.

[0008] Optionally, a differential method is used to perform second-order differential processing on the historical power consumption data to obtain differential processing data, including: Performing a differential operation on the historical power consumption data to obtain primary differential processing data of the historical power consumption data; A differential operation is performed on the primary differential processing data to obtain differential processing data.

[0009] Optionally, using the least squares method, the model lag order and the residual variance map, an AR model is constructed according to the differential processing data to obtain a power consumption prediction model, including: The AR model was constructed using the least squares method, model lag order and residual variance diagram to obtain a preliminary electricity consumption forecasting model; The preliminary power consumption prediction model is trained and verified according to the differential processing data to obtain a power consumption prediction model.

[0010] The electricity consumption prediction method provided in the present application can realize the prediction of electricity consumption. An AR model is constructed through the least squares method and the model lag order. The AR model is trained and verified based on the differential processing data to obtain the electricity consumption prediction model. The electricity consumption is predicted by the electricity consumption prediction model, which is conducive to improving the prediction efficiency of electricity consumption.

[0011] Optionally, an AR model is constructed using the least squares method, the model lag order, and the residual variance diagram to obtain a preliminary electricity consumption prediction model, including: Build AR models; By using the autocorrelation coefficient and partial autocorrelation coefficient of the AR model, a partial autocorrelation function diagram of the AR model and residual variance diagrams of different orders are calculated to determine the model lag order of the AR model; The least square method is used to solve the weight coefficient of the AR model according to the lag order of the model, and the weight coefficient is used to optimize the AR model to obtain the preliminary electricity consumption prediction model.

[0012] The electricity consumption prediction method provided in the present application can realize the prediction of electricity consumption. The partial autocorrelation function diagram and residual variance diagrams of different orders are calculated through the autocorrelation coefficient and partial autocorrelation coefficient of the AR model, so as to calculate the model lag order. The weight coefficient of the AR model is solved by using the least squares method, the model lag order and the residual variance diagram, and the weight coefficient is used to optimize the AR model to obtain a preliminary electricity consumption prediction model. After the preliminary electricity consumption prediction model is trained, the electricity consumption can be accurately predicted.

[0013] Optionally, the preliminary power consumption prediction model is trained and verified according to the differential processing data to obtain the power consumption prediction model, including: Based on the data used for training in the differentially processed data, training the preliminary power consumption prediction model to obtain a trained preliminary power consumption prediction model; The trained preliminary power consumption prediction model is verified based on data not used for training in the differentially processed data to obtain the power consumption prediction model.

[0014] Optionally, training the preliminary power consumption prediction model based on the data used for training in the differentially processed data to obtain the trained preliminary power consumption prediction model includes: Inputting the data used for training in the differentially processed data into the preliminary power consumption prediction model to obtain a corresponding prediction output; Determine a training error according to the next time point data of the data used for training in the differentially processed data and the corresponding predicted output; Based on the training error, the parameters of the preliminary power consumption prediction model are adjusted to obtain the optimal parameters, and the preliminary power consumption prediction model is optimized using the optimal parameters to obtain a trained preliminary power consumption prediction model.

[0015] Optionally, before inputting the data used for training in the differentially processed data into the preliminary power consumption prediction model, the method further includes: Initialize the parameters of the preliminary electricity consumption prediction model.

[0016] In a second aspect, the present application provides a power consumption prediction device, comprising: An acquisition module is used to acquire historical power consumption data of the power system to be tested; A difference module, used for performing second-order difference processing on the historical power consumption data by using a difference method to obtain difference processing data; A construction module is used to construct an AR model based on the differential processing data using the least squares method, the model lag order and the residual variance diagram to obtain an electricity consumption prediction model; The prediction module is used to obtain the recent power consumption data of the power system to be tested, and input the recent power consumption data after second-order difference processing into the power consumption prediction model to obtain the predicted power consumption data of the power system to be tested within a preset period.

[0017] The power consumption prediction device obtains predicted power consumption data by inputting recent power consumption data after second-order difference processing into a power consumption prediction model constructed by using the least squares method, the model lag order and the residual variance diagram. This solves the problem that the existing power consumption prediction method requires more computing resources and time during training and the prediction results are poorly interpretable due to its complex network structure and parameters when constructing a neural network model. The weight coefficient of the model can be quickly determined by the model lag order, which saves a lot of computing resources and time and improves the prediction efficiency of power consumption.

[0018] In a third aspect, the present application provides an electronic device, including a processor and a memory, wherein the memory stores a computer program executable by the processor, and when the processor executes the computer program, it runs the steps in the power consumption prediction method described above.

[0019] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the power consumption prediction method described above are executed.

[0020] Beneficial effects: The electricity consumption prediction method, device, electronic device and storage medium provided in the present application obtain predicted electricity consumption data by inputting recent electricity consumption data after second-order difference processing into an electricity consumption prediction model constructed using the least squares method, the model lag order and the residual variance diagram. This solves the problem that the existing electricity consumption prediction method requires more computing resources and time during training and the prediction results are poorly interpretable due to its complex network structure and parameters when constructing a neural network model. The weight coefficient of the model can be quickly determined by the model lag order, which saves a lot of computing resources and time and improves the efficiency of electricity consumption prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A flowchart of a method for predicting electricity consumption provided in an embodiment of the present application.

[0022] Figure 2 A schematic diagram of the structure of the power consumption prediction device provided in an embodiment of the present application.

[0023] Figure 3A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0024] Explanation of reference numerals: 1. Acquisition module; 2. Differentiation module; 3. Construction module; 4. Prediction module; 301. Processor; 302. Memory; 303. Communication bus. DETAILED DESCRIPTION

[0025] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0026] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0027] Please refer to Figure 1 , Figure 1 A method for predicting power consumption in some embodiments of the present application is used to predict power consumption, comprising the steps of: Step S101, obtaining historical power consumption data of the power system to be tested; Step S102, using a differential method to perform second-order differential processing on the historical power consumption data to obtain differential processing data; Step S103, using the least squares method, the model lag order and the residual variance diagram, based on the difference processing data, constructing an AR model to obtain a power consumption prediction model; Step S104, obtaining recent power consumption data of the power system to be tested, and inputting the recent power consumption data after second-order difference processing into a power consumption prediction model to obtain predicted power consumption data of the power system to be tested within a preset period.

[0028] The electricity consumption prediction method obtains predicted electricity consumption data by inputting recent electricity consumption data after second-order difference processing into an electricity consumption prediction model constructed by using the least squares method, the model lag order and the residual variance diagram. This solves the problem that the existing electricity consumption prediction method requires more computing resources and time during training and the prediction results are poorly interpretable due to its complex network structure and parameters when constructing a neural network model. The weight coefficient of the model can be quickly determined by the model lag order, which saves a lot of computing resources and time and improves the efficiency of electricity consumption prediction.

[0029] Specifically, in step S101, historical power consumption data of the power system to be tested is obtained. The historical power consumption data is the historical record of power consumption. For example, it can be divided into units of preset division time (such as every hour or every day). The collected historical records of power consumption are divided into multiple data (each data is the power consumption within the corresponding division time) to produce a power consumption curve graph (each data point in the curve graph represents the power consumption within the division time, and the curve corresponds to the change in power consumption within adjacent time).

[0030] The electrical system to be tested may be a single electrical appliance or a system consisting of multiple electrical appliances.

[0031] Specifically, in step S102, the difference method is used to perform second-order difference processing on the historical power consumption data to obtain difference processing data, including: Performing a differential operation on the historical electricity consumption data to obtain primary differential processing data of the historical electricity consumption data; A differential operation is performed on the primary differential processing data to obtain differential processing data.

[0032] In step S102, in order to eliminate and weaken the non-stationarity of the time series, the original data (historical electricity consumption data) is processed by second-order difference method. ,make , that is, taking the first-order difference, we get , and so on, perform second-order difference (i.e., two difference operations) to obtain the difference processing data corresponding to the historical power consumption data. By performing secondary difference on the historical power consumption data, the periodic changes can be eliminated, making the historical power consumption data smoother.

[0033] Among them, there is a close correlation between the two difference operations. The first difference is mainly used to eliminate the overall trend of the data, while the second difference further reduces the volatility of the data. This step-by-step processing method can more finely adjust the data characteristics, making the final difference-processed data more suitable for building a prediction model.

[0034] Specifically, in step S103, the AR model is constructed according to the difference processing data by using the least square method, the model lag order and the residual variance diagram to obtain the power consumption prediction model, including: The AR model was constructed using the least squares method, model lag order and residual variance diagram to obtain a preliminary electricity consumption forecasting model; According to the differential processing data, the preliminary electricity consumption prediction model is trained and verified to obtain the electricity consumption prediction model.

[0035] Specifically, in step S103, the AR model is constructed using the least squares method, the model lag order and the residual variance diagram to obtain a preliminary power consumption prediction model, including: Build AR models; Through the autocorrelation coefficient and partial autocorrelation coefficient of the AR model, the partial autocorrelation function diagram of the AR model and the residual variance diagram of different orders are calculated to determine the model lag order of the AR model; The least square method is used to solve the weight coefficient of the AR model according to the lag order of the model, and the weight coefficient is used to optimize the AR model to obtain a preliminary electricity consumption prediction model.

[0036] In step S103, an AR model is pre-constructed. In the AR model, the autocorrelation decreases with the model lag order, that is, as the model lag order increases, the autocorrelation coefficient approaches zero. When the model lag order of the AR model is p, the model lag order will be truncated after p. This truncation property can be used to determine the model lag order of the AR model.

[0037] Among them, the calculation formula of the autocorrelation coefficient of the AR model is specifically: ; Among them, AC k is the autocorrelation coefficient; x t is the tth difference processing data when the lag order of the truncated model is p; is the mean of the difference processed data; p is the lag order of the truncated model when the lag order of the truncated model is p; n is the number of difference processed data.

[0038] Regarding the calculation of the partial autocorrelation coefficient, the difference-processed data needs to be standardized, and the obtained AR model with a lag order of p is: ; (1) in, , , , They are respectively the weight coefficient corresponding to the first model lag order when the lag order of the truncated model is p, the weight coefficient corresponding to the second model lag order, the weight coefficient corresponding to the p-1th model lag order, and the weight coefficient corresponding to the pth model lag order (the pth model lag order is the truncated model lag order).

[0039] Multiply both sides of formula (1) , and taking the expectation, we can get: ; (2) in, is the mathematical expectation symbol; Represents the weight coefficient corresponding to the j-th model lag order, j≤p.

[0040] Formula (2) combined with the autocovariance formula ,in, =0, i is the ith differential processing data, is the autocovariance of the ith difference processing data and the tth difference processing data, and we get: ; (3) in, is the autocovariance of the p-th difference processing data and the t-th difference processing data; is the autocovariance of the jpth difference processing data and the tth difference processing data.

[0041] Both sides of formula (3) are divided by the autocovariance , and expanded with the autocorrelation coefficient to construct the YW equation (parameter estimation equation): ; (4) in, As parameters, =1.

[0042] When developing formula (4), the balance of autocovariance / autocorrelation coefficient of stationary time series is used, that is, (The autocovariance between the -mth difference processing data and the tth difference processing data is equal to the autocovariance between the mth difference processing data and the tth difference processing data), (parameter With parameters equal).

[0043] Expressing formula 4 in matrix form, we get: ; Right now: ; (5) in, express ; express ; express .

[0044] For the symmetric matrix in Formula 5 Taking the inverse, we get: ; (6) Among them, in formula 6 is the partial autocorrelation coefficient of the truncated model when the lag order is p (i.e., the pth weight coefficient).

[0045] In summary, the autocorrelation coefficient and partial autocorrelation coefficient of the AR model are used to draw the partial autocorrelation function diagram and residual variance diagram to determine the model lag order of the AR model.

[0046] Among them, the partial autocorrelation function can be calculated by the Levinson-Durbin recursive algorithm. By drawing the partial autocorrelation function graph, the changing trend of the partial autocorrelation coefficient with the model lag order can be shown. When the partial autocorrelation coefficient decays rapidly to zero after a certain model lag order, the model lag order can be used as the preliminary estimated order of the model (i.e., the truncated model lag order).

[0047] At the same time, the residual variance of different orders is calculated (the residual is the difference between the predicted value and the actual value, and the residual variance is the average of all residual squares) to draw the residual variance diagram. As the model lag order increases, the residual variance usually decreases gradually, but when the order increases to a certain extent, the reduction in the residual variance becomes very small. The "inflection point" of the residual variance diagram can be used to assist in determining the appropriate model lag order.

[0048] Combining the partial autocorrelation function graph and the residual variance graph, the optimal model lag order of the AR model can be scientifically determined. This method not only takes into account the intrinsic correlation of the data, but also avoids overfitting of the model, thus laying the foundation for subsequent parameter estimation.

[0049] In step S103, the least squares method is used to solve the weight coefficient of the AR model according to the model lag order, so as to determine the corresponding weight coefficient through the optimal model lag order, and the weight coefficient is substituted into the AR model to obtain a preliminary electricity consumption prediction model.

[0050] Among them, ,make , get , multiply both sides of the equation by the transpose of A, and we get , the above formula is converted to , The weight coefficient is obtained by using the least square method. The weight coefficient is substituted into the AR model to obtain a preliminary power consumption forecasting model. The preliminary power consumption forecasting model is as follows: , is the t-th electricity consumption prediction result when the lag order of the truncated model is p. Among them, the least square method is an existing technology and will not be described in detail here.

[0051] Specifically, in step S103, the preliminary power consumption prediction model is trained and verified according to the differential processing data to obtain the power consumption prediction model, including: Based on the data used for training in the differentially processed data, a preliminary power consumption prediction model is trained to obtain a trained preliminary power consumption prediction model; The trained preliminary electricity consumption prediction model is verified based on the data not used for training in the differential processing data to obtain the electricity consumption prediction model.

[0052] Specifically, in step S103, a preliminary power consumption prediction model is trained based on the data used for training in the differentially processed data to obtain a trained preliminary power consumption prediction model, including: Input the data used for training in the differentially processed data into the preliminary electricity consumption prediction model to obtain the corresponding prediction output; Determine a training error based on the next time point data of the data used for training in the differentially processed data and the corresponding predicted output; Based on the training error, the parameters of the preliminary electricity consumption prediction model are adjusted to obtain the optimal parameters, and the preliminary electricity consumption prediction model is optimized using the optimal parameters to obtain the trained preliminary electricity consumption prediction model.

[0053] In step S103, the next time point data corresponding to the data used for training (such as the differential processing data corresponding to the number of lag orders of the optimal model obtained by the above calculation) is compared with the predicted output obtained by inputting the data used for training into the preliminary power consumption prediction model to obtain a training error, such as the degree of magnitude of the next time point data and the corresponding numerical value in the predicted output, or the difference between the number of output numerical values ​​in the predicted output and the number of numerical values ​​in the next time point data. The parameters of the preliminary power consumption prediction model are adjusted using the training error. If the training error is the degree of magnitude of the next time point data and the corresponding numerical value in the predicted output, the corresponding model parameters are modified to make the predicted output value more accurate and obtain the optimal parameters. The preliminary power consumption prediction model is optimized using the optimal parameters to obtain the trained preliminary power consumption prediction model.

[0054] For example, when the lag order of the optimal model is N, first input the data from the 1st day to the Nth day into the preliminary electricity consumption prediction model, predict the electricity consumption on the N+1th day, and then compare the prediction result with the actual electricity consumption on the N+1th day to calculate the error. Next, slide back one day, input the data from the 2nd day to the N+1th day, predict the electricity consumption on the N+2th day, and calculate the error again. Repeat this process until all the data used for training has been processed. According to the error obtained from each calculation, adjust the parameters of the preliminary electricity consumption prediction model. After multiple rounds of iterative training, a set of optimal parameters that can perform well in all time periods are obtained. Use this set of parameters to optimize the preliminary electricity consumption prediction model to obtain the final trained model, that is, the preliminary electricity consumption prediction model after training.

[0055] In step S103, the differential processed data that is not used for training is input into the trained preliminary electricity consumption prediction model to obtain a corresponding prediction output, and the prediction output is used as verification data. The verification data is compared with the data at the next time point corresponding to the differential processed data that is not used for training to determine whether the error is within an acceptable range (the acceptable error range is generally 0 to 3%, which can be modified according to actual needs), to verify the accuracy of the trained preliminary electricity consumption prediction model, and to obtain the electricity consumption prediction model.

[0056] Specifically, in step S103, before the differentially processed data used for training is input into the preliminary power consumption prediction model to obtain the corresponding prediction output, the method further includes: Initialize the parameters of the preliminary electricity consumption forecasting model.

[0057] In step S103, before inputting data to train the model, the parameters of the preliminary power consumption prediction model are initialized to ensure that the model is in normal use.

[0058] Specifically, in step S104, recent power consumption data of the power system to be tested is obtained, such as obtaining power consumption data within the last N days when the lag order of the optimal model is N, and inputting the recent power consumption data after second-order difference processing into the power consumption prediction model to obtain the predicted power consumption data of the power system to be tested within a preset period. The preset period can be set according to actual needs, and is generally set to the lag order of the optimal model.

[0059] As can be seen from the above, the power consumption prediction method obtains the historical power consumption data of the power consumption system to be tested, adopts the difference method, performs second-order difference processing on the historical power consumption data, obtains the difference processing data, uses the least squares method, the model lag order and the residual variance diagram, and constructs an AR model according to the difference processing data to obtain the power consumption prediction model, obtains the recent power consumption data of the power consumption system to be tested, and inputs the recent power consumption data after the second-order difference processing into the power consumption prediction model to obtain the predicted power consumption data of the power consumption system to be tested within a preset period; thus, by inputting the recent power consumption data after the second-order difference processing into the power consumption prediction model constructed by the least squares method, the model lag order and the residual variance diagram, the predicted power consumption data is obtained, and the existing power consumption prediction method solves the problem that when constructing a neural network model, the complex network structure and parameters lead to more computing resources and time required for training and the poor interpretation of the prediction results. The weight coefficient of the model can be quickly determined by the model lag order, which saves a lot of computing resources and time and improves the prediction efficiency of power consumption.

[0060] refer to Figure 2 The present application provides a power consumption prediction device for predicting power consumption, comprising: Acquisition module 1, used to acquire historical power consumption data of the power system to be tested; The difference module 2 is used to perform second-order difference processing on the historical power consumption data by using the difference method to obtain difference processing data; Building module 3, for building an AR model based on differential processing data using the least squares method, model lag order and residual variance diagram, and obtaining an electricity consumption prediction model; The prediction module 4 is used to obtain the recent power consumption data of the power system to be tested, and input the recent power consumption data after second-order difference processing into the power consumption prediction model to obtain the predicted power consumption data of the power system to be tested within a preset period.

[0061] The power consumption prediction device obtains predicted power consumption data by inputting recent power consumption data after second-order difference processing into a power consumption prediction model constructed by using the least squares method, the model lag order and the residual variance diagram. This solves the problem that the existing power consumption prediction method requires more computing resources and time during training and the prediction results are poorly interpretable due to its complex network structure and parameters when constructing a neural network model. The weight coefficient of the model can be quickly determined by the model lag order, which saves a lot of computing resources and time and improves the prediction efficiency of power consumption.

[0062] Specifically, when the acquisition module 1 is executed, it obtains the historical power consumption data of the power system to be tested. The historical power consumption data is the historical record of power consumption. For example, it can be divided into units of preset division time (such as every hour or every day). The collected historical records of power consumption are divided into multiple data (each data is the power consumption within the corresponding division time) to make a power consumption curve graph (each data point in the curve graph represents the power consumption within the division time, and the curve corresponds to the change in power consumption within the adjacent time).

[0063] The electrical system to be tested may be a single electrical appliance or a system consisting of multiple electrical appliances.

[0064] Specifically, when the difference module 2 uses the difference method to perform second-order difference processing on the historical power consumption data to obtain the difference processing data, it executes: Performing a differential operation on the historical electricity consumption data to obtain primary differential processing data of the historical electricity consumption data; A differential operation is performed on the primary differential processing data to obtain differential processing data.

[0065] When the difference module 2 is executed, in order to eliminate and weaken the non-stationarity of the time series, the difference method is used to perform second-order difference processing on the original data (historical electricity consumption data). ,make , that is, taking the first-order difference, we get , and so on, perform second-order difference (i.e., two difference operations) to obtain the difference processing data corresponding to the historical power consumption data. By performing secondary difference on the historical power consumption data, the periodic changes can be eliminated, making the historical power consumption data smoother.

[0066] Among them, there is a close correlation between the two difference operations. The first difference is mainly used to eliminate the overall trend of the data, while the second difference further reduces the volatility of the data. This step-by-step processing method can more finely adjust the data characteristics, making the final difference-processed data more suitable for building a prediction model.

[0067] Specifically, when the construction module 3 uses the least squares method, the model lag order and the residual variance diagram to construct the AR model according to the differential processing data and obtain the power consumption prediction model, the following is executed: The AR model was constructed using the least squares method, model lag order and residual variance diagram to obtain a preliminary electricity consumption forecasting model; According to the differential processing data, the preliminary electricity consumption prediction model is trained and verified to obtain the electricity consumption prediction model.

[0068] Specifically, when constructing the AR model using the least squares method, the model lag order and the residual variance diagram to obtain a preliminary power consumption prediction model, the construction module 3 executes: Build AR models; Through the autocorrelation coefficient and partial autocorrelation coefficient of the AR model, the partial autocorrelation function diagram of the AR model and the residual variance diagram of different orders are calculated to determine the model lag order of the AR model; The least square method is used to solve the weight coefficient of the AR model according to the lag order of the model, and the weight coefficient is used to optimize the AR model to obtain a preliminary electricity consumption prediction model.

[0069] When construction module 3 is executed, an AR model is pre-constructed. In the AR model, the autocorrelation decreases with the model lag order, that is, as the model lag order increases, the autocorrelation coefficient approaches zero. When the model lag order of the AR model is p, the model lag order will be truncated after p. This truncation property can be used to determine the model lag order of the AR model.

[0070] Among them, the calculation formula of the autocorrelation coefficient of the AR model is specifically: ; Among them, AC k is the autocorrelation coefficient; x t is the tth difference processing data when the lag order of the truncated model is p; is the mean of the difference processed data; p is the lag order of the truncated model when the lag order of the truncated model is p; n is the number of difference processed data.

[0071] Regarding the calculation of the partial autocorrelation coefficient, the difference-processed data needs to be standardized, and the obtained AR model with a lag order of p is: ; (1) in, , , , They are respectively the weight coefficient corresponding to the first model lag order when the lag order of the truncated model is p, the weight coefficient corresponding to the second model lag order, the weight coefficient corresponding to the p-1th model lag order, and the weight coefficient corresponding to the pth model lag order (the pth model lag order is the truncated model lag order).

[0072] Multiply both sides of formula (1) , and taking the expectation, we can get: ; (2) in, is the mathematical expectation symbol; Represents the weight coefficient corresponding to the j-th model lag order, j≤p.

[0073] Formula (2) combined with the autocovariance formula ,in, =0, i is the ith differential processing data, is the autocovariance of the ith difference processing data and the tth difference processing data, and we get: ; (3) in, is the autocovariance of the p-th difference processing data and the t-th difference processing data; is the autocovariance of the jpth difference processing data and the tth difference processing data.

[0074] Both sides of formula (3) are divided by the autocovariance , and expanded with the autocorrelation coefficient to construct the YW equation (parameter estimation equation): ; (4) in, As parameters, =1.

[0075] When developing formula (4), the balance of autocovariance / autocorrelation coefficient of stationary time series is used, that is, (The autocovariance between the -mth difference processing data and the tth difference processing data is equal to the autocovariance between the mth difference processing data and the tth difference processing data), (parameter With parameters equal).

[0076] Expressing formula 4 in matrix form, we get: ; Right now: ; (5) in, express ; express ; express .

[0077] For the symmetric matrix in Formula 5 Taking the inverse, we get: ; (6) Among them, in formula 6 is the partial autocorrelation coefficient when the lag order of the truncated model is p (that is, the pth weight coefficient when the lag order of the truncated model is p).

[0078] In summary, the autocorrelation coefficient and partial autocorrelation coefficient of the AR model are used to draw the partial autocorrelation function diagram and residual variance diagram to determine the model lag order of the AR model.

[0079] Among them, the partial autocorrelation function can be calculated by the Levinson-Durbin recursive algorithm. By drawing the partial autocorrelation function graph, the changing trend of the partial autocorrelation coefficient with the model lag order can be shown. When the partial autocorrelation coefficient decays rapidly to zero after a certain model lag order, the model lag order can be used as the preliminary estimated order of the model (i.e., the truncated model lag order).

[0080] At the same time, the residual variance of different orders is calculated (the residual is the difference between the predicted value and the actual value, and the residual variance is the average of all residual squares) to draw the residual variance diagram. As the model lag order increases, the residual variance usually decreases gradually, but when the order increases to a certain extent, the reduction in the residual variance becomes very small. The "inflection point" of the residual variance diagram can be used to assist in determining the appropriate model lag order.

[0081] Combining the partial autocorrelation function graph and the residual variance graph, the optimal model lag order of the AR model can be scientifically determined. This method not only takes into account the intrinsic correlation of the data, but also avoids overfitting of the model, thus laying the foundation for subsequent parameter estimation.

[0082] When the construction module 3 is executed, the least square method is used to solve the weight coefficient of the AR model according to the model lag order, so as to determine the corresponding weight coefficient through the optimal model lag order, substitute the weight coefficient into the AR model, and obtain a preliminary electricity consumption prediction model.

[0083] Among them, ,make , get , multiply both sides of the equation by the transpose of A, and we get , the above formula is converted to , The weight coefficient is obtained by using the least square method. The weight coefficient is substituted into the AR model to obtain a preliminary power consumption forecasting model. The preliminary power consumption forecasting model is as follows: , is the t-th electricity consumption prediction result when the lag order of the truncated model is p. Among them, the least square method is an existing technology and will not be described in detail here.

[0084] Specifically, when the construction module 3 trains and verifies the preliminary power consumption prediction model according to the differential processing data and obtains the power consumption prediction model, it executes: Based on the data used for training in the differentially processed data, a preliminary power consumption prediction model is trained to obtain a trained preliminary power consumption prediction model; The trained preliminary electricity consumption prediction model is verified based on the data not used for training in the differential processing data to obtain the electricity consumption prediction model.

[0085] Specifically, when the construction module 3 trains a preliminary power consumption prediction model based on the data used for training in the differential processing data and obtains the trained preliminary power consumption prediction model, the construction module 3 executes: Input the data used for training in the differentially processed data into the preliminary electricity consumption prediction model to obtain the corresponding prediction output; Determine a training error based on the next time point data of the data used for training in the differentially processed data and the corresponding predicted output; Based on the training error, the parameters of the preliminary electricity consumption prediction model are adjusted to obtain the optimal parameters, and the preliminary electricity consumption prediction model is optimized using the optimal parameters to obtain the trained preliminary electricity consumption prediction model.

[0086] When the construction module 3 is executed, the next time point data corresponding to the data used for training (such as the differential processing data corresponding to the number of lag orders of the optimal model obtained by the above calculation) is compared with the predicted output obtained by inputting the data used for training into the preliminary power consumption prediction model to obtain a training error, such as the size of the next time point data and the corresponding numerical value in the predicted output, or the difference between the number of output values ​​in the predicted output and the number of values ​​in the next time point data. The training error is used to adjust the parameters of the preliminary power consumption prediction model. If the training error is the size of the next time point data and the corresponding numerical value in the predicted output, the corresponding model parameters are modified to make the predicted output value more accurate, so as to obtain the optimal parameters. The preliminary power consumption prediction model is optimized through the optimal parameters to obtain the trained preliminary power consumption prediction model.

[0087] For example, when the lag order of the optimal model is N, first input the data from the 1st day to the Nth day into the preliminary electricity consumption prediction model, predict the electricity consumption on the N+1th day, and then compare the prediction result with the actual electricity consumption on the N+1th day to calculate the error. Next, slide back one day, input the data from the 2nd day to the N+1th day, predict the electricity consumption on the N+2th day, and calculate the error again. Repeat this process until all the data used for training has been processed. According to the error obtained from each calculation, adjust the parameters of the preliminary electricity consumption prediction model. After multiple rounds of iterative training, a set of optimal parameters that can perform well in all time periods are obtained. Use this set of parameters to optimize the preliminary electricity consumption prediction model to obtain the final trained model, that is, the preliminary electricity consumption prediction model after training.

[0088] When construction module 3 is executed, the differential processing data that is not used for training in the differential processing data is input into the preliminary electricity consumption prediction model after training to obtain the corresponding prediction output, and the prediction output is used as verification data. The verification data and the data at the next time point corresponding to the differential processing data that is not used for training are compared to determine whether the error is within an acceptable range (the acceptable error range is generally 0 to 3%, which can be modified according to actual needs), verify the accuracy of the preliminary electricity consumption prediction model after training, and obtain the electricity consumption prediction model.

[0089] Specifically, before inputting the differentially processed data used for training into the preliminary power consumption prediction model to obtain the corresponding prediction output, the construction module 3 further executes: Initialize the parameters of the preliminary electricity consumption forecasting model.

[0090] When constructing module 3, before inputting data to train the model, the parameters of the preliminary electricity consumption prediction model should be initialized to ensure that the model is in normal use.

[0091] Specifically, when the prediction module 4 is executed, it obtains the recent power consumption data of the power consumption system to be tested, such as obtaining the power consumption data in the last N days when the lag order of the optimal model is N, and inputs the recent power consumption data after second-order difference processing into the power consumption prediction model to obtain the predicted power consumption data of the power consumption system to be tested within a preset period. Among them, the preset period can be set according to actual needs, and is generally set to the lag order of the optimal model.

[0092] As can be seen from the above, the power consumption prediction device obtains the historical power consumption data of the power system to be tested, adopts the difference method, performs second-order difference processing on the historical power consumption data, obtains the difference processing data, uses the least squares method, the model lag order and the residual variance map, constructs an AR model according to the difference processing data, obtains the power consumption prediction model, obtains the recent power consumption data of the power system to be tested, and inputs the recent power consumption data after the second-order difference processing into the power consumption prediction model to obtain the predicted power consumption data of the power system to be tested within a preset period; thus, by inputting the recent power consumption data after the second-order difference processing into the power consumption prediction model constructed by the least squares method, the model lag order and the residual variance map, the predicted power consumption data is obtained, and the existing power consumption prediction method solves the problem that when constructing a neural network model, the complex network structure and parameters result in more computing resources and time required for training and the poor interpretation of the prediction results. The weight coefficient of the model can be quickly determined by the model lag order, which saves a lot of computing resources and time and improves the prediction efficiency of power consumption.

[0093] Please refer to Figure 3 , Figure 3 A structural schematic diagram of an electronic device provided in an embodiment of the present application, the present application provides an electronic device, including: a processor 301 and a memory 302, the processor 301 and the memory 302 are interconnected and communicate with each other through a communication bus 303 and / or other forms of connection mechanisms (not marked), the memory 302 stores a computer program executable by the processor 301, and when the electronic device is running, the processor 301 executes the computer program to execute the power consumption prediction method in any optional implementation of the above embodiment to achieve the following functions: obtaining historical power consumption data of the power system to be tested, using the difference method to perform second-order difference processing on the historical power consumption data to obtain difference processing data, using the least squares method, the model lag order and the residual variance diagram, according to the difference processing data, constructing an AR model to obtain a power consumption prediction model, obtaining recent power consumption data of the power system to be tested, and inputting the recent power consumption data after the second-order difference processing into the power consumption prediction model to obtain the predicted power consumption data of the power system to be tested within a preset period.

[0094] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the power consumption prediction method in any optional implementation of the above-mentioned embodiment is executed to achieve the following functions: historical power consumption data of the power system to be tested is obtained, and the historical power consumption data is subjected to second-order difference processing by a difference method to obtain difference-processed data, and an AR model is constructed according to the difference-processed data by using a least squares method, a model lag order, and a residual variance diagram to obtain a power consumption prediction model, and recent power consumption data of the power system to be tested is obtained, and the recent power consumption data after the second-order difference processing is input into the power consumption prediction model to obtain predicted power consumption data of the power system to be tested within a preset period. Among them, the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable red-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0095] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0096] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0097] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0098] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0099] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for predicting power consumption, for predicting power consumption, characterized in that: Includes steps: Obtain historical power consumption data of the power system to be tested; Using a differential method, performing second-order differential processing on the historical electricity consumption data to obtain differential processing data; Using the least squares method, the model lag order and the residual variance diagram, an AR model is constructed according to the differential processing data to obtain an electricity consumption prediction model; The recent power consumption data of the power system to be tested is obtained, and the recent power consumption data after second-order difference processing is input into the power consumption prediction model to obtain the predicted power consumption data of the power system to be tested within a preset period.

2. The power consumption prediction method according to claim 1, characterized in that: The historical power consumption data is subjected to second-order difference processing by using the difference method to obtain difference processing data, including: Performing a differential operation on the historical power consumption data to obtain primary differential processing data of the historical power consumption data; A differential operation is performed on the primary differential processing data to obtain differential processing data.

3. The power consumption prediction method according to claim 1, characterized in that: By using the least square method, the model lag order and the residual variance diagram, an AR model is constructed according to the differential processing data to obtain a power consumption prediction model, including: The AR model was constructed using the least squares method, model lag order and residual variance diagram to obtain a preliminary electricity consumption forecasting model; The preliminary power consumption prediction model is trained and verified according to the differential processing data to obtain a power consumption prediction model.

4. The power consumption prediction method according to claim 3, characterized in that: The AR model is constructed using the least squares method, model lag order and residual variance diagram to obtain a preliminary electricity consumption forecasting model, including: Build AR models; By using the autocorrelation coefficient and partial autocorrelation coefficient of the AR model, a partial autocorrelation function diagram of the AR model and residual variance diagrams of different orders are calculated to determine the model lag order of the AR model; The least square method is used to solve the weight coefficient of the AR model according to the lag order of the model, and the weight coefficient is used to optimize the AR model to obtain the preliminary electricity consumption prediction model.

5. The power consumption prediction method according to claim 3, characterized in that: The preliminary power consumption prediction model is trained and verified according to the differential processing data to obtain a power consumption prediction model, including: Based on the data used for training in the differentially processed data, training the preliminary power consumption prediction model to obtain a trained preliminary power consumption prediction model; The trained preliminary power consumption prediction model is verified based on data not used for training in the differentially processed data to obtain the power consumption prediction model.

6. The method for predicting power consumption according to claim 5, characterized in that: Based on the data used for training in the differentially processed data, the preliminary power consumption prediction model is trained to obtain the trained preliminary power consumption prediction model, including: Inputting the data used for training in the differentially processed data into the preliminary power consumption prediction model to obtain a corresponding prediction output; Determine a training error according to the next time point data of the data used for training in the differentially processed data and the corresponding predicted output; Based on the training error, the parameters of the preliminary power consumption prediction model are adjusted to obtain the optimal parameters, and the preliminary power consumption prediction model is optimized using the optimal parameters to obtain a trained preliminary power consumption prediction model.

7. The method for predicting power consumption according to claim 6, characterized in that: Before inputting the data used for training in the differentially processed data into the preliminary power consumption prediction model, the method further includes: Initialize the parameters of the preliminary electricity consumption prediction model.

8. A power consumption prediction device, used for predicting power consumption, characterized in that: include: An acquisition module is used to acquire historical power consumption data of the power system to be tested; A difference module, used for performing second-order difference processing on the historical power consumption data by using a difference method to obtain difference processing data; A construction module is used to construct an AR model based on the differential processing data using the least squares method, the model lag order and the residual variance diagram to obtain an electricity consumption prediction model; The prediction module is used to obtain the recent power consumption data of the power system to be tested, and input the recent power consumption data after second-order difference processing into the power consumption prediction model to obtain the predicted power consumption data of the power system to be tested within a preset period.

9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a computer program executable by the processor, and when the processor executes the computer program, it runs the steps in the power consumption prediction method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the power consumption prediction method according to any one of claims 1 to 7 are executed.

Citation Information

Patent Citations

  • Electricity optimizing configuration method based on big data

    CN106844594A

  • Time sequence model establishing method and device thereof

    CN107633331A

  • Method for predicting industrial sewage inflow based on ARIMA model

    CN108564229A

  • Control method and control device of intelligent microgrid

    CN111064199A