An energy consumption prediction method and system based on time series analysis and BP neural network

By combining a time series analysis and BP neural network-based energy consumption prediction method with DeepAR neural network and ARIMA time series model, the shortcomings of existing energy consumption prediction methods in long-term accuracy and generalization ability to new data are solved, and higher accuracy energy consumption prediction is achieved.

CN119476989BActive Publication Date: 2025-10-28NANJING DAQO ELECTRICAL INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411494738.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-10-28
Estimated Expiration
2044-10-24

AI Technical Summary

Technical Problem

Existing energy consumption prediction methods struggle to respond to external changes when dealing with energy consumption data affected by external factors, especially exhibiting low accuracy in long-term predictions. Furthermore, machine learning models lack the ability to generalize to new data, resulting in significant prediction errors.

Method used

An energy consumption prediction method based on time series analysis and BP neural network is adopted. By screening relevant features, DeepAR neural network and ARIMA time series model are used to predict load data in combination with historical load and feature data, and compensation processing is performed to improve accuracy.

Benefits of technology

It improves the accuracy and robustness of energy consumption prediction, takes into account both the long-term prediction performance of machine learning models and the short-term prediction performance of BP neural networks, and effectively overcomes the shortcomings of traditional prediction models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119476989B_ABST
    Figure CN119476989B_ABST
Patent Text Reader

Abstract

This invention discloses an energy consumption prediction method and system based on time series analysis and BP neural network. It employs a time series model and a DeepAR neural network model, acquiring historical load data of equipment within energy consumption sites and historical feature data of the energy consumption sites to establish a hybrid load prediction model based on time series analysis and machine learning. The energy consumption prediction method and system disclosed in this invention can balance the long-term prediction performance of machine learning models with the short-term prediction performance of BP neural networks, effectively overcoming the problems of traditional prediction models such as over-reliance on feature data, short prediction step size, and insufficient stability, thus greatly improving the accuracy and robustness of load data prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of energy management technology, specifically relating to an energy consumption prediction method and system based on time series analysis and BP neural network. Background Technology

[0002] As enterprises expand their production capacity, the number of devices at energy consumption sites increases, and operational complexity rises, energy consumption shows a year-on-year upward trend. This places greater energy pressure on enterprises, not only increasing operating costs but also impacting overall production efficiency. Against the backdrop of global energy scarcity and increasingly stringent environmental requirements, effectively controlling and managing energy consumption has become a key issue for enterprises to enhance their competitiveness.

[0003] Existing energy consumption forecasting methods are mainly based on time series models and machine learning models, but each model has its limitations and drawbacks. Time series models: 1. Time series models perform well in short-term forecasting, but their accuracy often drops significantly when used for long-term forecasting. 2. Time series models typically can only handle single-variable time variations; they struggle to cope with complex scenarios when combining multi-dimensional data to predict energy consumption. 3. Time series models assume that the data has a stable trend or seasonal pattern; for non-stationary data like energy consumption, which is easily affected by various external factors, the prediction accuracy is low.

[0004] Machine learning models have several drawbacks: 1. While capable of handling complex nonlinear relationships, they are typically "black box" models, unable to explain the formation process of prediction results. 2. When training data is imbalanced or insufficient, machine learning models exhibit unstable prediction results, are prone to overfitting or underfitting, and suffer from poor generalization ability to new data, resulting in larger prediction errors. 3. The training effectiveness of machine learning models is highly dependent on the quantity and quality of data; missing data, noise, and outliers can all negatively impact model performance.

[0005] Therefore, existing prediction models are inadequate in responding to external changes when dealing with energy consumption data affected by external factors, and their performance is not ideal when facing dynamic and complex real-world environments. Summary of the Invention

[0006] This invention provides an energy consumption prediction method and system based on time series analysis and BP neural network to solve the problem that existing technologies cannot accurately predict the energy consumption of equipment within energy consumption sites.

[0007] To address the aforementioned technical problems, the present invention discloses the following technical solutions:

[0008] One aspect of the present invention provides an energy consumption prediction method based on time series analysis and BP neural network for predicting load data of equipment within an energy consumption site, the method comprising:

[0009] Based on historical characteristic data of energy consumption sites and historical load data of all equipment within the energy consumption sites, target features with a correlation coefficient exceeding a preset correlation threshold are selected.

[0010] The BP backpropagation algorithm is used to train a DeepAR neural network based on historical feature data of target features and historical load data of pre-selected target equipment, so as to obtain an energy consumption prediction model for predicting equipment load data.

[0011] Input the data of any target feature in the previous T days into the ARIMA time series model to obtain the predicted data of any target feature on day T+1.

[0012] Input the data of all target features in the first T days and the predicted data on day T+1, as well as the load data of all target devices in the first T days, into the energy consumption prediction model to predict the load data of each target device on day T+1.

[0013] For each target device, the measured load data and predicted load data of day T are used to compensate the predicted load data of day T+1.

[0014] Optionally, before performing the step of filtering out target features whose correlation coefficient with the load data exceeds a threshold based on historical characteristic data of the energy consumption site and historical load data of all equipment within the energy consumption site, the method further includes:

[0015] Historical load data of each device in the energy consumption site is obtained. The load data is the load value collected at interval t1, where t1 ≤ a first set duration and t1 × n1 = 24 hours, where n1 is an integer representing the total number of time granularities of the load data in a day.

[0016] Historical characteristic data of energy consumption stations are obtained. The characteristic data consists of indoor and outdoor environmental data, time data, information data and control parameters collected at intervals of t2, where t2 ≤ the second set duration and t2 × n2 = 24 hours, where n2 is an integer representing the total number of time granularities of the characteristic data in a day.

[0017] Data cleaning of historical load data and historical characteristic data, including:

[0018] The proportion of missing values ​​in historical load data and historical feature data is calculated daily, and the missing values ​​are filled using the corresponding preset imputation method according to the preset proportion range to which the missing value proportion belongs.

[0019] Identify outliers in historical load data and historical feature data, and repair the data values ​​of all outliers.

[0020] Optionally, the step of filtering target features whose correlation coefficient with the load data exceeds a preset correlation threshold based on historical characteristic data of the energy consumption site and historical load data of all equipment within the energy consumption site includes:

[0021] The correlation coefficient between each feature and all equipment load data was calculated using the Pearson correlation coefficient algorithm.

[0022] Determine if there are features where the absolute value of the correlation coefficient exceeds a preset correlation threshold.

[0023] If so, the aforementioned feature is taken as the target feature.

[0024] Optionally, the method further includes selecting the target device in the following manner:

[0025] The historical load data of all devices are clustered using the K-Means clustering algorithm to obtain the centroid value of each cluster.

[0026] The device corresponding to the cluster with the largest centroid value is selected as the target device.

[0027] Optionally, the step of employing the BP backpropagation algorithm to train a DeepAR neural network based on historical feature data of the target features and historical load data of the pre-selected target equipment, to obtain an energy consumption prediction model for predicting equipment load data, including:

[0028] Use historical feature data of the target and historical load data of the target device as training data;

[0029] The DeepAR neural network is trained using the BP backpropagation algorithm based on the training data, and the training ends when the prediction error does not exceed the set error threshold, thus obtaining an energy consumption prediction model for predicting equipment load data.

[0030] Optionally, the step of inputting data of any target feature within the previous T days into the ARIMA time series model to obtain predicted data of any target feature on day T+1 includes:

[0031] For each target feature, the predicted data for day T+1 is obtained using the following method:

[0032] Obtain the data X of the target feature within the previous T days. T_ALL ,

[0033]

[0034] Where, x 1,1 The target feature is the data at the first time granularity in day 1. For the target feature, the data at the n2th time granularity in day 1, and so on.

[0035] The target feature is the data at the n2th time granularity on day T;

[0036] X the data of the target feature in the previous T days T_ALL Input the ARIMA time series model to obtain the predicted data of the target feature on day T+1.

[0037]

[0038] in, This represents the predicted value of the target feature at the first time granularity of data on day T+1, and so on. This represents the predicted value of the training feature at the n2th time granularity on day T+1.

[0039] Optionally, the step of inputting the data of all target features for the first T days and the predicted data for day T+1, as well as the load data of all target devices for the first T days, into the energy consumption prediction model to predict the load data of each target device for day T+1, includes:

[0040] For each target device, load data Y for the preceding T days is acquired. T_ALL ,

[0041]

[0042] Among them, y 1,1 The load data for the target device at the first time granularity of the first day. This refers to the load data of the target device at the n1th time granularity on day 1, and so on. The load data of the target device at the n1-th time granularity on day T;

[0043] X the data for each target feature in the previous T days T_ALL And the forecast data on day T+1 And, the load data Y of each target device in the first T days. T_ALL Input the energy consumption prediction model to predict the load data of any target device on day T+1.

[0044] Optionally, for each target device, the predicted load data for day T+1 is compensated using the measured load data and predicted load data from day T, including:

[0045] Input the data of each target feature in the first T days, and the load data of each target device in the first T-1 days, into the energy consumption prediction model to predict the load data of any target device on day T.

[0046] For each target device, the predicted load data for day T+1 is compensated using the following method:

[0047]

[0048] Among them, Y T+1 The load data after compensation for the target device;

[0049] The predicted load data of the target device on day T+1 Expressed as:

[0050]

[0051] This is the predicted value of the load data at the first time granularity in day T+1 of the target device, and so on. This is the predicted value of the load data at the n1st time granularity in day T+1.

[0052] The load data Y of the target equipment obtained by actual measurement on day T T Expressed as:

[0053]

[0054] y T,1 This refers to the measured value of the load data at the first time granularity on day T for the target device, and so on. This is the measured value of the n1st time-granularity load data in day T;

[0055] The predicted load data of the target device on day T Expressed as:

[0056]

[0057] This is the predicted value of the load data at the first time granularity in day T for the target device, and so on. This is the predicted value of the load data at the n1-th time granularity in day T.

[0058] Optionally, the method further includes:

[0059] At the end of each day, the energy consumption prediction model is retrained based on the load data and characteristic data collected that day.

[0060] The retrained energy consumption prediction model is used to predict the load data of each target device for the next day;

[0061] Determine whether the number of target devices is less than or equal to N.

[0062] If so, all target devices should be considered high-value devices;

[0063] If not, calculate the RFM value for each target device.

[0064] RFM=R*(-1)+F+M+100

[0065] Where R represents that the target device last operated R days before the current date; F represents the average number of operating days per month for the target device; and M represents the total number of operating days for the target device in one year.

[0066] The top N target devices with the highest RFM values ​​are considered high-value devices.

[0067] Based on the load data of any high-value device on the following day, a corresponding load forecast report is generated and provided to the user.

[0068] Another aspect of the present invention provides an energy consumption prediction system based on time series analysis and BP neural network for predicting load data of equipment within an energy consumption site, wherein the system executes the energy consumption prediction method based on time series analysis and BP neural network provided in the above aspects.

[0069] This invention discloses an energy consumption prediction method and system based on time series analysis and a backpropagation (BP) neural network. It employs a time series model and a DeepAR neural network model, acquiring historical load data of equipment within energy consumption sites and historical feature data of the energy consumption sites to establish a hybrid load prediction model based on time series analysis and machine learning. The energy consumption prediction method and system disclosed in this invention can balance the long-term prediction performance of machine learning models with the short-term prediction performance of BP neural networks, effectively overcoming the problems of traditional prediction models such as over-reliance on feature data, short prediction step size, and insufficient stability, thus greatly improving the accuracy and robustness of load data prediction. Attached Figure Description

[0070] Figure 1 A flowchart illustrating an energy consumption prediction method based on time series analysis and a backpropagation neural network, provided in an embodiment of the present invention;

[0071] Figure 2 A flowchart illustrating another energy consumption prediction method based on time series analysis and BP neural network provided in an embodiment of the present invention;

[0072] Figure 3 An implementation provided by an embodiment of the present invention Figure 1 A flowchart illustrating step S100;

[0073] Figure 4 This is a schematic diagram of a process for selecting a target device provided in an embodiment of the present invention;

[0074] Figure 5 An implementation provided by an embodiment of the present invention Figure 1 A flowchart illustrating step S200;

[0075] Figure 6 A flowchart illustrating another energy consumption prediction method based on time series analysis and BP neural network provided in an embodiment of the present invention. Detailed Implementation

[0076] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0077] Figure 1 This is a flowchart illustrating an energy consumption prediction method based on time series analysis and a backpropagation (BP) neural network, disclosed in an embodiment of the present invention, used to predict load data of equipment within an energy consumption site. An energy consumption site is a dedicated building or space used by an enterprise to house various equipment and systems, typically used to accommodate and maintain the enterprise's core operating equipment, such as communication equipment, power equipment, heating and cooling systems, etc. Figure 1 As shown, the method includes the following steps:

[0078] Step S100: Based on the historical characteristic data of the energy consumption site and the historical load data of all equipment in the energy consumption site, select target features whose correlation coefficient with the load data exceeds the preset correlation threshold.

[0079] In one embodiment of the present invention, such as Figure 2 As shown, before performing step S100, the following steps are also included:

[0080] Step S010: Obtain historical load data for each device within the energy consumption site.

[0081] The load data is the load value collected at intervals t1, where t1 ≤ the first set duration and t1 × n1 = 24 hours, where n1 is an integer representing the total number of time granularities of the load data in a day.

[0082] In a specific embodiment of this invention, t1 is 10 minutes, meaning that data is collected from each device within the energy consumption site every 10 minutes; n1 is 144, meaning that in a 24-hour day, at a collection frequency of once every 10 minutes, data can be collected from each device 144 times. The time granularity is associated with the collection sequence number in a day; for example, the data at the first time granularity is the data obtained during the first collection.

[0083] Step S020: Obtain historical characteristic data of energy consumption sites.

[0084] The feature data consists of indoor and outdoor environmental data, time data, information data, and control parameters collected at intervals of t2, where t2 ≤ the second set duration and t2 × n2 = 24 hours, where n2 is an integer representing the total number of time granularities of the feature data in a day.

[0085] Feature data can be:

[0086] 1. Indoor environmental data: indoor temperature and humidity;

[0087] 2. Outdoor environmental data: outdoor temperature, humidity, pressure, and weather type;

[0088] 3. Time data: Date type (weekday / weekend, public holiday), day of the week, month;

[0089] 4. Information data: space volume, number of devices, weighted operating rate of devices, total power of devices, peak and off-peak load periods;

[0090] 5. Control parameters: Energy storage output control parameters and power output corresponding to the power load of each device in the energy consumption site.

[0091] The features disclosed in this invention include, but are not limited to, the above-mentioned features.

[0092] In a specific embodiment of the present invention, t2 is 2 hours, that is, data is collected once for each feature every 2 hours, and n2 is 12, that is, in a 24-hour day, data can be collected 12 times for each feature at a collection frequency of once every 2 hours.

[0093] All collected data can be uploaded to the cloud for later data organization, analysis, and application.

[0094] Step S030: Perform data cleaning on historical load data and historical feature data.

[0095] Data cleaning includes missing value imputation and outlier handling. In the embodiments disclosed in this invention, step S030 can be completed using the following sub-steps.

[0096] Step S0301: Calculate the proportion of missing values ​​in historical load data and historical feature data on a daily basis, and fill in the missing values ​​using the corresponding preset imputation method according to the preset proportion range to which the missing value proportion belongs.

[0097] The proportion of missing values ​​in historical load data and historical feature data is calculated daily. The proportion of missing load data for any device on any day is the ratio of the total number of missing load data for that device on that day to the total number of all load data collected for that device on that day. The proportion of missing data for any feature on any day is the ratio of the total number of missing data for that feature on that day to the total number of all data for that feature collected on that day.

[0098] (i) For each device, missing values ​​in the load data are imputed using the following method:

[0099] (1) Set the proportion thresholds for missing values ​​to L1 and L2, where L1 <L2。

[0100] (2) When the proportion of missing load data of the device on a certain day A is greater than L2 (the proportion of missing values ​​is within the range of proportions greater than L2), that is, the ratio of the total number of missing load data of the device on day A to the total number of load data of the device collected on that day is greater than L2, then all load data of the device on day A shall be deleted.

[0101] (3) When the proportion of missing values ​​in the load data of the device on a certain day A is greater than or equal to L1, but less than or equal to L2 (the proportion of missing values ​​is within the range of [L1, L2]), the missing values ​​are filled using the load data of similar days B (day B with the smallest Euclidean distance between day A and the load data of the most recent two weeks) within similar time periods (within 30 minutes before and after the time t_lost corresponding to the missing value in similar day B, i.e., similar time period = [t_lost-30 minutes, t_lost+30 minutes], where t_lost is the time corresponding to a certain missing value in day A. When there are multiple missing values ​​in day A, there are also multiple similar time periods corresponding to them in day B). For example, if the time corresponding to a certain missing data is 10:30, then the time period from 10:00 to 11:00 in similar day B is taken as its similar time period.

[0102] Take a missing data point from day A as an example:

[0103] Assume that the load values ​​for similar time periods on similar day B are (a1, a2, ..., a6).

[0104] First, determine if there is data within 30 minutes before and after the time t_lost corresponding to the missing data in day A.

[0105] If data is available within this time period, it will be further processed as follows:

[0106] If there is only one data point in this time period, denote that data point as b1, and denote the missing data to be filled as b2.

[0107] If there are multiple data points within this time period, such as three, these data points can be represented as (b1, b3, b5).

[0108] If there is no data during that period, then

[0109] (4) When the proportion of missing values ​​in the load data of the equipment on a certain day A is less than L1 (the proportion of missing values ​​is within the range of less than L1), the missing data is filled by front and back interpolation.

[0110] Take a missing data point from day A as an example:

[0111] First, determine if there is data within 30 minutes before and after the time t_lost corresponding to the missing data.

[0112] If data is available within this time period, it will be further processed as follows:

[0113] If there is only one data point in the time period, the missing data point b2 to be filled will be directly set to that data value;

[0114] If there are multiple data points within this time period, the missing data point b2 to be filled is set to the mean of these values;

[0115] If there is no data within that time period, the search range is expanded by 30 minutes. That is, the search continues to check whether there is data within 60 minutes before and after the time t_lost corresponding to the missing data. The above steps are repeated until a value is found to fill the missing data.

[0116] (ii) For each feature, missing values ​​are imputed using the following method:

[0117] (1) Set the missing value ratio thresholds to P1 and P2, where P1 <P2。

[0118] (2) When the proportion of missing values ​​for this feature on a certain day A is greater than P2 (the proportion of missing values ​​is within the range of greater than P2), then delete all data for this feature on that day.

[0119] (3) When the proportion of missing values ​​for this feature on day A is greater than or equal to P1, but less than or equal to P2 (the proportion of missing values ​​falls within the range of [P1, P2]), this feature is turned into an indicator variable, i.e., a 0-1 variable. If the data for this feature is empty, the data for this feature is recorded as 0; otherwise, the data for this feature is updated to 1.

[0120] (4) When the proportion of missing values ​​for this feature on day A is less than P1 (the proportion of missing values ​​is within the range of less than P1), the missing data is filled by front-to-back interpolation.

[0121] If the feature is numerical data, step (4) in the missing value imputation method for load data is adopted to impute the missing data of the feature with the mean of the preceding and following data.

[0122] If the feature is non-numerical data, then step (4) similar to the missing value imputation method for load data is used to impute it using the data that appears most frequently in the nearest time period, that is, the mode is used to impute it.

[0123] Step S0302: Locate outliers in historical load data and historical feature data, and repair the data values ​​of all outliers.

[0124] (a) For each device, the following methods are used to handle outlier values ​​in the load data:

[0125] (1) Use algorithmic models to identify days with abnormal load data:

[0126] Set the threshold for the maximum number of abnormal days to D, and the threshold for the total percentage of abnormal days to E.

[0127] This invention uses a weekly timeframe to determine whether load data is abnormal. Taking the most recent week as an example:

[0128] Obtain historical load data for the most recent week and divide the load data into 5 peak and valley periods using the Fisher optimal segmentation model. The periods obtained after optimal segmentation are called load peak and valley periods, including peak periods and valley periods (e.g., load rising period (8:00-12:00), load intermittent period (12:00-14:00), load stable period (14:00-20:00), load falling period (20:00-00:00), and load rest period (00:00-8:00), where the load rising period and load stable period are peak periods).

[0129] Let t be the time point corresponding to the maximum load data on day A. m If two or more maximum values ​​occur on the same day, the corresponding time points are denoted as (t). m_1 ,t m_2 ,…).

[0130] Obtain the number of days within the past week where the time point corresponding to the maximum value falls entirely within the peak period. If this number of days is not less than the threshold D, it indicates that no anomalies occurred in the past week. If this number of days is less than the threshold D, it indicates that an anomaly occurred in the past week, and the following method is used to investigate the abnormal days:

[0131] If the ratio of the total load value during peak hours on day A to the total load value for the entire day is greater than or equal to the threshold E, then the load data for day A is considered to be normal; otherwise, day A is considered an abnormal day for the load data.

[0132] (2) Assuming that day A is an abnormal day for the load data, the algorithm model is then used to find the abnormal load values, as follows:

[0133] Set the abnormal amplitude threshold to A0, and record the load value collected at time t as y. t Its amplitude is

[0134] When A > A0, the amplitude at that moment is considered abnormal, and that moment is taken as an abnormal load value point. All abnormal points in the abnormal day A are identified, the data corresponding to the abnormal points is cleared, and the missing value imputation method for load data described in the previous embodiment is used for repair and filling.

[0135] (ii) For each feature, the following methods are used to handle outliers in the data.

[0136] (1) Identify days with abnormal characteristic data:

[0137] When a certain day is an abnormal day for load data, that day is also an abnormal day for characteristic data.

[0138] (2) Assuming that day A is an abnormal day for the feature data, the algorithm model is then used to find the outlier points of the feature values, as follows:

[0139] If the feature data is numerical data, the feature value outliers are handled in a manner similar to step (2) in the outlier handling method for load data.

[0140] If the feature data is non-numerical, then set the Euclidean distance threshold B0, and set the feature value collected at time t to x. t The Euclidean distance between its relative values ​​before and after is

[0141]

[0142] When B > B0, the amplitude at that moment is considered abnormal, and that moment is taken as an outlier point in the feature value. All outliers in the abnormal day A are identified, the data corresponding to the outliers is cleared, and the missing value imputation method for feature data described in the previous embodiment is used for repair and filling.

[0143] In one embodiment of the present invention, such as Figure 3 As shown, step S100 can be implemented by the following sub-steps:

[0144] S101: Calculate the correlation coefficient between each feature and all equipment load data using the Pearson correlation coefficient algorithm.

[0145] For each feature, the Pearson correlation coefficient algorithm was used to calculate the correlation coefficient between its data and the load data of all equipment.

[0146] The Pearson correlation coefficient measures the linear correlation between two variables. It ranges from -1 to 1, where: 1 indicates a perfect positive correlation (both variables change in the same direction); -1 indicates a perfect negative correlation (both variables change in opposite directions); and 0 indicates no linear correlation (there is no obvious linear relationship between the two variables). The larger the absolute value, the stronger the correlation between the variables.

[0147] S102: Determine whether there are features whose absolute value of the feature correlation coefficient exceeds the preset correlation threshold.

[0148] A pre-set correlation threshold Cr is used to determine whether the absolute value of the correlation coefficient of each feature exceeds the preset correlation threshold.

[0149] When the absolute value of the correlation coefficient between a certain feature and the equipment load data is greater than Cr, the two variables are considered to be correlated, that is, the feature is correlated with the equipment load data, and the feature is then taken as the target feature.

[0150] If no feature has an absolute value of correlation coefficient exceeding the preset correlation threshold, the preset correlation threshold is adjusted according to the preset mode, and the system continues to determine whether there is a feature whose absolute value of correlation coefficient exceeds the preset correlation threshold, until a feature has an absolute value of correlation coefficient exceeding the preset correlation threshold.

[0151] Step S200: Using the BP backpropagation algorithm, a DeepAR neural network is trained based on the historical feature data of the target features and the historical load data of the pre-selected target equipment to obtain an energy consumption prediction model for predicting equipment load data.

[0152] In one embodiment of the present invention, such as Figure 4 As shown, the target device can be selected in the following ways:

[0153] Step S040: Perform cluster analysis on the historical load data of all devices based on the K-Means clustering algorithm to obtain the centroid value of each cluster.

[0154] K-Means is an unsupervised clustering algorithm that aims to divide data points into K clusters such that the distance between each data point and the centroid of its cluster is minimized. The algorithm finds the cluster structure by iteratively optimizing the cluster allocation and the position of the centroid.

[0155] The K-Means algorithm is used to perform cluster analysis on historical load data from recent dates to obtain load category labels for each device. Based on these load categories, the devices are divided into clusters, resulting in the cluster with the highest load and the corresponding devices. Details are as follows:

[0156] Let the sum of squared errors of the load data be... Where K is the number of clusters, m i For the i-th class set c i The centroid (i.e., the mean) is denoted by x, where x represents the value of the sample point.

[0157] To obtain the optimal number of clusters, let the error reduction coefficient be denoted as . Let the profile coefficient be... in Represents sample point x i The similarity between a sample and other samples in its own cluster is equal to the average distance between the sample and all other points in the same cluster. Represents sample point x i The similarity between a sample and samples in other clusters is equal to the average distance between the sample and all points in the next nearest cluster. The average silhouette coefficient of cluster c is... Where m is the number of samples in cluster c.

[0158] Given the maximum number of clusters K max Using the K-Means algorithm, starting with K=2, we increase the value until K=K. max Clustering is performed sequentially to maximize the objective function α+β. c The optimal K value and the optimal cluster are obtained, denoted as K0 and K1 respectively. best and Let the centroid value of each cluster be...

[0159] Step S050: Select the device corresponding to the cluster with the largest centroid value as the target device.

[0160] Find the cluster with the largest centroid value, and use the devices contained in that cluster as the target devices.

[0161] In another embodiment of the present invention, all devices may be selected as target devices in advance.

[0162] In another embodiment of the present invention, the total load data of all devices on the most recent date is denoted as (a'1, a'2, ..., a'). q ), where q is the total number of devices, a′ qThis represents the total daily load of the q-th device. Based on the total daily load of the devices, each device can be labeled with an energy consumption rating of "High," "Medium," or "Low" according to a preset grouping method. Devices labeled "Low" will not be predicted when subsequently forecasting device energy consumption data.

[0163] In one embodiment of the present invention, such as Figure 5 As shown, step S200 can be implemented in the following way:

[0164] Step S201: Use the historical feature data of the target features and the historical load data of the pre-selected target equipment as training data.

[0165] Historical load data of the pre-selected target equipment for the energy consumption site within the previous year (e.g., from January 1, 2023 to December 31, 2023), as well as historical characteristic data of the target features.

[0166] During model training, all target features are treated as covariates. Training is iteratively performed in 12-hour increments starting from the current date (e.g., January 1, 2024), continuing until 24:00 on three consecutive full days (e.g., January 3, 2024). (Each iteration predicts only 12 time steps, in hours, for a total of 48 batches). During this period, newly acquired target feature data and target device load data are added to the training data and participate in the model training.

[0167] Step S202: Train the DeepAR neural network using the BP backpropagation algorithm based on the training data, and end the training when the prediction error does not exceed the set error threshold to obtain an energy consumption prediction model for predicting equipment load data.

[0168] DeepAR is a probabilistic prediction model based on RNN (Recurrent Neural Network). In this embodiment of the invention, it is trained using the backpropagation (BP) algorithm. This algorithm can adjust the model weights through optimization algorithms such as gradient descent to reduce prediction errors. Training ends when the model's prediction error is lower than a preset error threshold.

[0169] 1. Data Preparation

[0170] DeepAR's input is a multi-dimensional time series. The input data includes historical feature data of the target and historical load data of the target device. The input data is time series data. During model training, the time series data is divided into multiple segments, and the model can learn local temporal dependencies from each segment.

[0171] 2. Backpropagation (BP)

[0172] DeepAR training uses the backpropagation (BP) algorithm, which updates the model's weights through gradient descent. The backpropagation steps are as follows:

[0173] Gradient calculation:

[0174] Using the chain rule, the gradient of each layer's weights is calculated sequentially, and the gradient of each parameter from the output layer to the input layer is calculated.

[0175] For RNNs, this process involves backpropagation because RNNs are neural networks that process sequential data, and their gradients depend not only on the current time step but also on the state of previous time steps.

[0176] Weight update:

[0177] The calculated gradient is passed to the optimizer (such as SGD or Adam), which adjusts the weights based on the gradient, with the goal of minimizing the loss function. The step size for updates is determined by the learning rate.

[0178] 3. Training termination conditions

[0179] A preset error threshold is set, and the prediction error R² is calculated using the following formula:

[0180]

[0181] Where n is the number of samples; Let be the predicted value for the i-th sample; Let be the true value of the i-th sample.

[0182] Training ends when the model's prediction error is below a preset error threshold, thus obtaining an energy consumption prediction model for predicting equipment load data.

[0183] If the model's prediction error consistently exceeds the preset threshold, the neural network model's training parameters will be adjusted or training samples will be increased according to the preset mode, and the model will be retrained until the model's prediction error (the difference between the true value and the predicted value) meets the preset target.

[0184] Using the energy consumption prediction model obtained in step S200, the load data can be predicted through steps S300 and S400.

[0185] Step S300: Input the data of any target feature in the previous T days into the ARIMA time series model to obtain the predicted data of any target feature on day T+1.

[0186] The purpose of step S300 is to predict the target feature data for day T+1. In subsequent embodiments, day T+1 will be used to represent tomorrow, i.e., to predict the load data for tomorrow.

[0187] In one embodiment of the present invention, step S300 can be completed in the following manner:

[0188] For each target feature, the predicted data for day T+1 is obtained using the following method:

[0189] Obtain the target feature data X obtained from actual measurements within the first T days. T_ALL ,

[0190]

[0191] Where, x 1,1 For the target feature, the data is at the first time granularity within day 1. For the target feature, the data is at the n2-th time granularity within day 1, and so on. The target feature is the data at the n2th time granularity on day T.

[0192] X the data of the target feature in the previous T days T_ALL Input an ARIMA time series model to obtain predicted data for the target feature on day T+1.

[0193]

[0194] in, This represents the predicted value of the target feature at the first time granularity of data on day T+1, and so on. The predicted value of the training feature at the n2th time granularity on day T+1.

[0195] The ARIMA time series model is a statistical model used for time series analysis and forecasting. It makes short-term predictions by capturing patterns such as trends and random fluctuations in time series. This model can handle non-stationary time series, making them stationary through differencing before modeling.

[0196] In a specific embodiment of the present invention, T=30. After the prediction of the target features for tomorrow, i.e. the 31st day, is completed, step S400 is executed using the target feature data for tomorrow to complete the prediction of the load data for tomorrow.

[0197] Step S400: Input the data of all target features in the first T days and the predicted data on day T+1, as well as the load data of all target devices in the first T days, into the energy consumption prediction model to predict the load data of each target device on day T+1.

[0198] After obtaining the predicted data for each target feature on tomorrow (day T+1), the measured data of all target features in the previous 30 days and the predicted data for tomorrow, as well as the measured load data of all target devices in the previous 30 days, are input into the energy consumption prediction model to predict the load data of each target device on tomorrow (day 31).

[0199] When using an energy consumption prediction model to forecast load data, it is necessary to use the target characteristics' data on and before the forecast date, as well as the target equipment's data before the forecast date, as input data in order to obtain the load data for the forecast date.

[0200] In one embodiment of the present invention, step S400 can be completed in the following manner:

[0201] For each target device, the load data Y actually measured within the first T days is obtained. T_ALL ,

[0202]

[0203] Among them, y 1,1 The load data for the target device at the first time granularity of day 1. y represents the load data of the target device at the n1st time granularity on day 1, and so on, where y represents the load data of the target device at the n1st time granularity on day T.

[0204] X represents the measured data for each target feature over the previous T days. T_ALL And the forecast data on day T+1 And, the load data Y measured for each target device in the first T days. T_ALL Input the energy consumption prediction model to predict the load data of any target device on day T+1.

[0205] Step S500: For each target device, the measured load data and predicted load data of day T are used to compensate the predicted load data of day T+1.

[0206] In the embodiments disclosed in this invention, after predicting the load data of any target device on day T+1, the predicted data needs to be compensated in the following way to obtain more accurate predicted data:

[0207] (1) Input the measured data of each target feature in the first T days, and the measured load data of each target device in the first T-1 days into the energy consumption prediction model to predict the load data of any target device on day T.

[0208] For example, by inputting the data of each target feature in the first 30 days, and the load data of each target device in the first 29 days, into the energy consumption prediction model, the load data of any target device on the 30th day can be predicted.

[0209] (2) For each target device, the predicted load data for day T+1 is compensated using the following method:

[0210]

[0211] Among them, Y T+1 The load data after compensation for the target equipment;

[0212] The predicted load data of the target equipment on day T+1 Expressed as:

[0213]

[0214] This is the predicted value of the load data at the first time granularity in day T+1 of the target equipment, and so on. This is the predicted value of the load data at the n1st time granularity in day T+1.

[0215] The actual measured load data Y of the target equipment on day T T Expressed as:

[0216]

[0217] y T,1 This refers to the measured value of the first time-granularity load data for the target equipment on day T, and so on. This is the measured value of the n1st time-granularity load data in day T;

[0218] The predicted load data of the target equipment on day T Expressed as:

[0219]

[0220] This is the predicted value of the load data at the first time granularity of the target device on day T, and so on. This is the predicted value of the load data at the n1-th time granularity in day T.

[0221] The energy consumption prediction method disclosed in the embodiments of this invention, such as Figure 6 As shown, it also includes the following steps:

[0222] Step S510: After the end of each day, retrain the energy consumption prediction model based on the load data and feature data collected that day.

[0223] At the end of each day, i.e., in the early morning of the next day, the load data and feature data collected that day are added to the training dataset, and the energy consumption prediction model is retrained using the method described in the previous embodiment.

[0224] Step S520: Use the retrained energy consumption prediction model to predict the load data of each target device for the next day.

[0225] Using the prediction method described in the aforementioned embodiments, the retrained energy consumption prediction model is used to predict the load data of each target device on the following day.

[0226] Step S530: Determine whether the number of target devices is less than or equal to N.

[0227] Pre-set an upper limit N for the number of key monitoring devices, for example, N=10.

[0228] If the number of target devices is less than or equal to N, then proceed to step S540.

[0229] Step S540: Treat all target devices as high-value devices.

[0230] If the number of target devices is greater than N, proceed to step S550.

[0231] Step S550: Calculate the RFM value for each target device.

[0232] RFM=R*(-1)+F+M+100

[0233] Where R represents that the target device was last used R days ago; F represents the average usage frequency of the target device; and M represents the total usage time of the target device. All of these parameters can be obtained from daily record tables.

[0234] Step S560: Select the top N target devices with the highest RFM values ​​as high-value devices.

[0235] After obtaining the RFM value of each target device, the top N target devices with the highest RFM values ​​are identified as high-value devices.

[0236] Step S570: Based on the load data of any high-value device on the next day, generate a corresponding load forecast report and provide it to the user.

[0237] Load forecasting reports enable users to focus on monitoring the load status of high-value equipment.

[0238] The energy consumption prediction method disclosed in this invention also includes the following:

[0239] After obtaining the load forecast value for each target device for tomorrow, calculate whether the load forecast value for each time granularity for tomorrow is greater than the corresponding historical average energy consumption level. The historical average energy consumption level can be the average value of the time granularity load data within the past 30 days.

[0240] For time granularities exceeding historical average energy consumption levels, the current energy storage output control parameters are adjusted and updated according to a pre-designed optimization configuration strategy (e.g., optimizing proportional parameters based on historical peak and off-peak load parameters). The adjusted power output is then predicted and extrapolated based on this optimization configuration strategy. Load data is then re-predicted based on the newly adjusted characteristics until the predicted value is lower than the historical average energy consumption level. Simultaneously, an optimization report is generated based on the optimization configuration strategy and provided to the user.

[0241] The present invention also discloses an energy consumption prediction system based on time series analysis and BP neural network, which is used to predict the load data of equipment in energy consumption sites. The system executes the energy consumption prediction method based on time series analysis and BP neural network disclosed in the foregoing embodiments.

[0242] It is understood that the above embodiments are merely exemplary implementations used to illustrate the principles of the present invention, and the present invention is not limited thereto. For those skilled in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.

Claims

1. An energy consumption prediction method based on time series analysis and BP neural network, used to predict the load data of equipment within an energy consumption site, characterized in that, The method includes: Based on historical characteristic data of energy consumption sites and historical load data of all equipment within the energy consumption sites, target features with a correlation coefficient exceeding a preset correlation threshold are selected. The BP backpropagation algorithm is used to train a DeepAR neural network based on historical feature data of target features and historical load data of pre-selected target equipment, so as to obtain an energy consumption prediction model for predicting equipment load data. The target equipment is selected using the following methods: The historical load data of all devices are clustered using the K-Means clustering algorithm to obtain the centroid value of each cluster. The device corresponding to the cluster with the largest centroid value is taken as the target device; Input the data of any target feature in the previous T days into the ARIMA time series model to obtain the predicted data of any target feature on day T+1. Input the data of all target features in the first T days and the predicted data on day T+1, as well as the load data of all target devices in the first T days, into the energy consumption prediction model to predict the load data of each target device on day T+1. For each target device, the measured load data and predicted load data of day T are used to compensate the predicted load data of day T+1. At the end of each day, the energy consumption prediction model is retrained based on the load data and characteristic data collected that day. The retrained energy consumption prediction model is used to predict the load data of each target device for the next day; Determine whether the number of target devices is less than or equal to N. If so, all target devices should be considered high-value devices; If not, calculate the RFM value for each target device. Where R represents that the target device last operated R days before the current date; F represents the average number of operating days per month for the target device; and M represents the total number of operating days for the target device within a year. The top N target devices with the highest RFM values ​​are considered high-value devices. Based on the load data of any high-value device on the following day, a corresponding load forecast report is generated and provided to the user.

2. The energy consumption prediction method according to claim 1, characterized in that, Before performing the step of filtering out target features whose correlation coefficient with the load data exceeds a threshold based on historical characteristic data of the energy consumption site and historical load data of all equipment within the energy consumption site, the method further includes: Acquire historical load data for each device within the energy consumption site, wherein the load data is for each interval. The load value obtained from the data collection over a period of time The first set duration, and Hour, This is an integer representing the total number of time-granularities of the load data throughout the day; Obtain historical characteristic data of energy consumption stations, wherein the characteristic data is for each interval. The indoor and outdoor environmental data, time data, information data, and control parameters collected over a period of time. The second set duration, and Hour, This is an integer representing the total number of time-granularities of the feature data throughout the day; Data cleaning of historical load data and historical characteristic data, including: The proportion of missing values ​​in historical load data and historical feature data is calculated daily, and the missing values ​​are filled using the corresponding preset imputation method according to the preset proportion range to which the missing value proportion belongs. Identify outliers in historical load data and historical feature data, and repair the data values ​​of all outliers.

3. The energy consumption prediction method according to claim 1, characterized in that, The step of filtering target features based on historical characteristic data of energy consumption sites and historical load data of all equipment within the energy consumption sites, where the correlation coefficient with the load data exceeds a preset correlation threshold, includes: The correlation coefficient between each feature and all equipment load data was calculated using the Pearson correlation coefficient algorithm. Determine if there are features where the absolute value of the correlation coefficient exceeds a preset correlation threshold. If so, the aforementioned feature is taken as the target feature.

4. The energy consumption prediction method according to claim 1, characterized in that, The method employs the BP backpropagation algorithm to train a DeepAR neural network based on historical feature data of the target features and historical load data of pre-selected target equipment, thereby obtaining an energy consumption prediction model for predicting equipment load data, including: Use historical feature data of the target and historical load data of the target device as training data; The DeepAR neural network is trained using the BP backpropagation algorithm based on the training data, and the training ends when the prediction error does not exceed the set error threshold, thus obtaining an energy consumption prediction model for predicting equipment load data.

5. The energy consumption prediction method according to claim 2, characterized in that, The step of inputting data of any target feature within the previous T days into the ARIMA time series model to obtain predicted data of any target feature on day T+1 includes: For each target feature, the predicted data for day T+1 is obtained using the following method: Obtain the data of the target feature within the previous T days. , in, The target feature is the data at the first time granularity in day 1. For the target feature in day 1 Data at each time granularity, and so on. For the target feature in day T, the Data at a time granularity; Data of the target feature within the previous T days Input the ARIMA time series model to obtain the predicted data of the target feature on day T+1. , in, This represents the predicted value of the target feature at the first time granularity of data on day T+1, and so on. The training feature represents the training feature in the (T+1)th (day) Predicted values ​​for time-granular data.

6. The energy consumption prediction method according to claim 5, characterized in that, The process involves inputting data from all target features within the first T days and predicted data for day T+1, along with load data from all target devices within the first T days, into the energy consumption prediction model to predict the load data for each target device on day T+1, including: For each target device, load data for the preceding T days is acquired. , in, The load data for the target device at the first time granularity of the first day. For the target device in the first day Load data at a time granularity, and so on. For the target device on day T, the Load data at a time granularity; Data for each target feature within the previous T days And the forecast data on day T+1 And, the load data of each target device in the previous T days. Input the energy consumption prediction model to predict the load data of any target device on day T+1.

7. The energy consumption prediction method according to claim 6, characterized in that, For each target device, the predicted load data for day T+1 is compensated using the measured load data and predicted load data from day T, including: Input the data of each target feature in the first T days, and the load data of each target device in the first T-1 days, into the energy consumption prediction model to predict the load data of any target device on day T. For each target device, the predicted load data for day T+1 is compensated using the following method: in, The load data after compensation for the target device; The predicted load data of the target device on day T+1 Expressed as: This is the predicted value of the load data at the first time granularity in day T+1 of the target device, and so on. For the 1st day of T+1 Predicted values ​​of load data at each time granularity; The load data of the target equipment obtained by actual measurement on day T Expressed as: This refers to the measured value of the load data at the first time granularity on day T for the target device, and so on. For the Tth day Measured values ​​of time-granularity load data; The predicted load data of the target device on day T Expressed as: This is the predicted value of the load data at the first time granularity in day T for the target device, and so on. For the Tth day Predicted values ​​of time-granularity load data.

8. An energy consumption prediction system based on time series analysis and BP neural network, used to predict load data of equipment within an energy consumption site, characterized in that, The system performs the energy consumption prediction method based on time series analysis and BP neural network as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Convolutional neural network-based time sequence load prediction method

    CN114648156A

  • Prediction method based on periodic feature extraction and time sequence attention

    CN116341712A