Air conditioner on-off state prediction method and device based on LSTM network

文档序号:191709 发布日期:2021-11-02 浏览:33次 中文

阅读说明:本技术 一种基于lstm网络的空调开关状态预测方法及装置 (Air conditioner on-off state prediction method and device based on LSTM network ) 是由 石晶 宋赵芳 任丽 徐颖 陈泽旭 李书剑 张紫桐 杨王旺 于 2021-07-02 设计创作,主要内容包括:本发明公开了一种基于LSTM网络的空调开关状态预测方法及装置,属于空调开关状态预测技术领域,方法包括:采集并处理不同用户空调的历史负荷数据和相应时段的历史室外温度数据,得到特征矩阵;以所述特征矩阵作为输入,以实际的空调开关状态作为输出,训练和验证基于LSTM网络的空调开关状态预测模型;利用训练好的基于LSTM网络的空调开关状态预测模型,预测待预测日各个时段的空调开关状态。本发明中LSTM网络,可以解决传统神经网络不能持续记忆的问题,预测准确率更高。考虑到单户空调每日的运行特性,将单户空调实际的负荷序列转化为开关状态序列,进而建立LSTM分类网络,同时考虑到室外温度等因素的影响,可以进一步提高空调次日开关状态的预测精度。(The invention discloses an air conditioner on-off state prediction method and device based on an LSTM network, belonging to the technical field of air conditioner on-off state prediction, and the method comprises the following steps: acquiring and processing historical load data of different user air conditioners and historical outdoor temperature data in corresponding time periods to obtain a characteristic matrix; training and verifying an air conditioner on-off state prediction model based on an LSTM network by taking the characteristic matrix as input and taking the actual air conditioner on-off state as output; and predicting the air conditioner on-off state of each time period of the day to be predicted by using the trained air conditioner on-off state prediction model based on the LSTM network. The LSTM network can solve the problem that the traditional neural network cannot continuously memorize, and has higher prediction accuracy. The method has the advantages that the daily operating characteristics of the single-family air conditioner are considered, the actual load sequence of the single-family air conditioner is converted into the on-off state sequence, an LSTM classification network is further established, meanwhile, the influence of factors such as outdoor temperature and the like is considered, and the prediction accuracy of the on-off state of the air conditioner on the next day can be further improved.)

1. An air conditioner on-off state prediction method based on an LSTM network is characterized by comprising the following steps:

s1, collecting and processing historical load data of different user air conditioners and historical outdoor temperature data in corresponding time periods to obtain a characteristic matrix;

s2, training and verifying an air conditioner switch state prediction model based on an LSTM network by taking the characteristic matrix as input and the actual air conditioner switch state as output;

and S3, predicting the air conditioner on-off state of each time period of the day to be predicted by using the air conditioner on-off state prediction model based on the LSTM network trained in S2.

2. The LSTM network-based air conditioner on-off state prediction method of claim 1, wherein the collecting of historical load data of different user air conditioners and historical outdoor temperature data of corresponding time periods in S1 comprises:

s11, sampling N ephemeris history load data of the air conditioner at a sampling rate of M sampling points every day to obtain an N ephemeris history load data matrix L of the air conditioner:

s12, sampling at the sampling rate of G sampling points each day, and obtaining a historical outdoor temperature data matrix W of each day in N days:

3. the LSTM network-based air conditioner on-off state prediction method of claim 2, wherein the processing of the historical load data of different user air conditioners and the historical outdoor temperature data of corresponding time periods in S1 comprises:

s11', dividing the air conditioner load data of M sampling points each day into n time intervals, and calculating the total air conditioner running time T in each time interval each dayN(n) and comparing with a threshold λ; if TN(N) is larger than lambda, the user is considered to use the air conditioner in the nth time period on the Nth day, and the on-off state S of the air conditioner is recordedN(n) 1, if TN(N) is less than lambda, then the user is considered not to use the air conditioner in the nth time period on the Nth day, and the on-off state S of the air conditioner is recordedN(n)=0;

Converting an N-calendar history load data matrix L of the air conditioner into an on-off state sequence matrix S of the air conditioner:

s12', performing linear normalization processing on the historical outdoor temperature data matrix W in the following mode:

Dmin=Wmin-α|Wmax-Wmin|

Dmax=Wmax+α|Wmax-Wmin|

wherein, WN(G) Is the outdoor temperature value at the G sampling point on the nth day,is the normalized outdoor temperature value; wmaxAnd WminIs the maximum and minimum values in the historical outdoor temperature data matrix W, and α is a scale factor.

4. The LSTM network-based air conditioner on-off state prediction method of claim 3, wherein the S2 specifically includes: on day dOutdoor temperature data T of j time periodo,j,dAnd the air conditioner switch state data corresponding to the j time periods of the d-1 day, the d-2 day and the d-7 day are used as input, the air conditioner switch state data corresponding to the j time period of the d day are used as output, and the air conditioner switch state prediction model based on the LSTM network is trained and verified.

5. The method for predicting the on-off state of the air conditioner based on the LSTM network as claimed in any one of claims 1 to 4, wherein in S2, the prediction of the on-off state of the air conditioner of each household is performed by using a multi-model univariate prediction method, specifically: and a plurality of air conditioner on-off state prediction submodels based on the LSTM network are adopted, and each air conditioner on-off state prediction submodel based on the LSTM network predicts the air conditioner on-off state of a certain user in a period of time every day.

6. The method for predicting the on-off state of the air conditioner based on the LSTM network as claimed in any one of claims 1 to 4, wherein the log-likelihood loss is used as a loss function of the LSTM network, and the optimal predicted value of the on-off state of the air conditioner corresponding to the j time period on the day d is obtained by minimizing the loss function.

7. An air conditioner on-off state prediction device based on an LSTM network is characterized by comprising the following components:

the data acquisition and processing module is used for acquiring and processing historical load data of different user air conditioners and historical outdoor temperature data in corresponding time periods to obtain a characteristic matrix;

the training and verifying module is used for training and verifying an air conditioner on-off state prediction model based on an LSTM network by taking the characteristic matrix as input and taking the actual air conditioner on-off state as output;

and the air conditioner on-off state prediction module is used for predicting the air conditioner on-off state of each time period of the day to be predicted by using the trained air conditioner on-off state prediction model based on the LSTM network.

Technical Field

The invention belongs to the technical field of air conditioner on-off state prediction, and particularly relates to an air conditioner on-off state prediction method and device based on an LSTM network.

Background

Demand response is widely developed in recent years in China as a main interaction means between a power grid and users under the reform of a power system. In the aspect of power grid, demand response can improve a load curve, reduce peak-valley difference and simultaneously relieve the problem of power grid construction investment caused by increased load. For the aspect of users, the demand response can optimize the electricity utilization behavior of the users and reduce the electricity utilization cost. Among the demand-side resources, flexible equipment of residential users, represented by air conditioners, can flexibly participate in demand response through flexible load control technology. Under the condition of not influencing the comfort of residents, the set temperature of the air conditioner is properly changed, and the operating power of the air conditioner can be changed to a certain extent. The premise of the implementation of the demand response is that the next-day demand response potential of the air conditioner load must be accurately analyzed and estimated, and guidance is provided for formulation of a next-day demand response scheme and flexible scheduling of the power system. However, the next day on-off state of each resident air conditioner directly affects the potential, and if the resident does not use the air conditioner in the next day demand response period, the demand response potential of the resident is zero. Therefore, the on-off state of the air conditioner must be predicted to accurately estimate the future demand response potential of the air conditioner load of the residential user, and then the users meeting the demand response requirements on objective conditions are screened out. For the prediction of the on-off state of the air conditioner, on one hand, the use time and habits of different residential users on the air conditioning equipment have randomness and difference; on the other hand, there is a clear seasonality of the use of air conditioners. Therefore, how to consider the uncertainty of the using behavior of the air conditioner and establish a high-precision and strong-robustness air conditioner load day-ahead on-off state prediction model is a problem which needs to be considered.

The artificial neural network is widely applied to the field of power load prediction due to the self-adaption, self-learning and self-organization capabilities. The existing neural networks applied to the field of power load prediction are various, such as a BP neural network, an ELMAN neural network, an RBF neural network and the like. The long-short term memory network (LSTM) is a recurrent neural network, can solve the problem that the traditional neural network cannot continuously memorize, has advantages in learning the nonlinear characteristics of sequence data, and is more suitable for short-term prediction. However, the prediction of the on-off state of a single air conditioner is more challenging than the traditional aggregate load prediction problem. After the air conditioner is started, the power curve of the air conditioner is periodically changed, and the accurate prediction of the starting time and the closing time of the air conditioner has difficulty. Meanwhile, the air conditioner can keep the current state for a period of time after being turned on or turned off, namely, the user can not turn on or turn off the air conditioner frequently. Therefore, in consideration of the above-mentioned operation characteristics of the air conditioner, how to extract key feature quantities of the on-off state of the air conditioner as the input and output of the LSTM prediction network is an urgent problem to be solved.

Disclosure of Invention

Aiming at the defects or the improvement requirements of the prior art, the invention provides an air conditioner on-off state prediction method and device based on an LSTM network, aiming at accurately predicting the on-off state of an air conditioner of each household the next day by considering the randomness and the difference of the air conditioners used by different household users, and further providing a foundation support for the screening of demand response target users and the prediction of demand response potential.

In order to achieve the above object, the present invention provides an air conditioner on-off state prediction method based on an LSTM network, comprising the steps of:

s1, collecting and processing historical load data of different user air conditioners and historical outdoor temperature data in corresponding time periods to obtain a characteristic matrix;

s2, training and verifying an air conditioner switch state prediction model based on an LSTM network by taking the characteristic matrix as input and the actual air conditioner switch state as output;

and S3, predicting the air conditioner on-off state of each time period of the day to be predicted by using the air conditioner on-off state prediction model based on the LSTM network trained in S2.

Further, in S1, collecting historical load data of different user air conditioners and historical outdoor temperature data of corresponding time periods includes:

s11, sampling N ephemeris history load data of the air conditioner at a sampling rate of M sampling points every day to obtain an N ephemeris history load data matrix L of the air conditioner:

s12, sampling at the sampling rate of G sampling points each day, and obtaining a historical outdoor temperature data matrix W of each day in N days:

further, in S1, the processing the historical load data of the different user air conditioners and the historical outdoor temperature data of the corresponding time period includes:

s11', dividing the air conditioner load data of M sampling points each day into n time intervals, and calculating the total air conditioner running time T in each time interval each dayN(n) and comparing with a threshold λ; if TN(N) is larger than lambda, the user is considered to use the air conditioner in the nth time period on the Nth day, and the on-off state S of the air conditioner is recordedN(n) 1, if TN(N) is less than lambda, then the user is considered not to use the air conditioner in the nth time period on the Nth day, and the on-off state S of the air conditioner is recordedN(n)=0;

Converting an N-calendar history load data matrix L of the air conditioner into an on-off state sequence matrix S of the air conditioner:

s12', performing linear normalization processing on the historical outdoor temperature data matrix W in the following mode:

Dmin=Wmin-α|Wmax-Wmin|

Dmax=Wmax+α|Wmax-Wmin|

wherein, WN(G) Is the outdoor temperature value at the G sampling point on the nth day,is the normalized outdoor temperature value; wmaxAnd WminIs the maximum and minimum values in the historical outdoor temperature data matrix W, and α is a scale factor.

Further, the S2 specifically includes: outdoor temperature data T at j time period on day do,j,dAnd the air conditioner switch state data corresponding to the j time periods of the d-1 day, the d-2 day and the d-7 day are used as input, the air conditioner switch state data corresponding to the j time period of the d day are used as output, and the air conditioner switch state prediction model based on the LSTM network is trained and verified.

Further, in S2, the predicting of the on-off state of each air conditioner by using a multi-model univariate prediction method specifically includes: and a plurality of air conditioner on-off state prediction submodels based on the LSTM network are adopted, and each air conditioner on-off state prediction submodel based on the LSTM network predicts the air conditioner on-off state of a certain user in a period of time every day.

Further, the log-likelihood loss is adopted as a loss function of the LSTM network, and the optimal predicted value of the air conditioner on-off state corresponding to the j time period on the day d is obtained by minimizing the loss function.

In order to achieve the above object, the present invention further provides an air conditioner on-off state prediction device based on an LSTM network, including:

the data acquisition and processing module is used for acquiring and processing historical load data of different user air conditioners and historical outdoor temperature data in corresponding time periods to obtain a characteristic matrix;

the training and verifying module is used for training and verifying an air conditioner on-off state prediction model based on an LSTM network by taking the characteristic matrix as input and taking the actual air conditioner on-off state as output;

and the air conditioner on-off state prediction module is used for predicting the air conditioner on-off state of each time period of the day to be predicted by using the trained air conditioner on-off state prediction model based on the LSTM network.

Generally, by the above technical solution conceived by the present invention, the following beneficial effects can be obtained:

(1) the LSTM is used as a circulating neural network, can solve the problem that the traditional neural network cannot continuously memorize, has advantages in learning the nonlinear characteristics of sequence data, is more suitable for the problem of ultra-short-term prediction, and has higher prediction accuracy. The method has the advantages that the daily operating characteristics of the single-family air conditioner are considered, the actual load sequence of the single-family air conditioner is converted into the on-off state sequence, an LSTM classification network is further established, meanwhile, the influence of factors such as outdoor temperature and the like is considered, and the prediction accuracy of the on-off state of the air conditioner on the next day can be further improved. The method provides reference for analysis and estimation of the next-day demand response potential of the air conditioner load, and provides guidance for formulation of a next-day demand response scheme and flexible scheduling of a power system, so that the method has important practical significance and good application prospect.

(2) The method considers that the days d-1 and d-2 are closer to the day d in the time dimension, the air conditioner load data of the two days have larger relevance with the air conditioner load data of the day d, and the load data of the days d-1 and d-2 are considered when the air conditioner on-off state of the day d is predicted; meanwhile, in the power system, the load data shows obvious cycle periodicity besides day periodicity, so that the air conditioner load data of d-7 days are considered when the air conditioner on-off state at a certain moment in the d day is predicted. Thus, the prediction accuracy can be effectively improved.

(3) The method adopts a multi-model univariate prediction method to predict the on-off state of each air conditioner, namely an LSTM prediction model predicts the on-off state of the air conditioner in a time period of a certain user day, and each prediction model is independent from each other, so that the prediction precision of the on-off state of the air conditioner on the next day is further improved.

Drawings

Fig. 1 is a flowchart of an air conditioner on-off state prediction method based on an LSTM network according to an embodiment of the present invention;

FIG. 2 is a schematic diagram of a 24-hour day time division according to an embodiment of the present invention;

FIG. 3 is a diagram of a prediction model structure of the air conditioner on-off state based on the LSTM network according to an embodiment of the present invention;

FIG. 4 is a histogram of the predicted accuracy of the random on/off state for four months for a 10-user air conditioner in accordance with an embodiment of the present invention;

FIG. 5 is a box-type chart of the predicted accuracy of the switches of the 80-user air conditioners in different months according to the embodiment of the invention;

fig. 6 is a block diagram of an air conditioner on-off state prediction apparatus based on an LSTM network according to an embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.

In the present application, the terms "first," "second," and the like (if any) in the description and the drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.

Referring to fig. 1, the present invention will be described in further detail with reference to fig. 2 to 5. Fig. 1 is a flowchart illustrating a method for predicting a state of an air conditioner switch based on an LSTM network according to an embodiment of the present invention, where the method includes operations S1-S3.

And operation S1, collecting and processing historical load data of different user air conditioners and historical outdoor temperature data of corresponding time periods to obtain a feature matrix. Specifically, the method comprises the following steps:

the method for collecting historical load data and historical outdoor temperature data of different user air conditioners in corresponding time periods comprises the following steps:

s11, sampling N ephemeris history load data of the air conditioner at a sampling rate of M sampling points every day to obtain an N ephemeris history load data matrix L of the air conditioner:

s12, sampling at the sampling rate of G sampling points each day, and obtaining a historical outdoor temperature data matrix W of each day in N days:

the method for processing historical load data and historical outdoor temperature data of different user air conditioners in corresponding time periods comprises the following steps:

s11', dividing the air conditioner load data of M sampling points each day into n time intervals, and calculating the total air conditioner running time T in each time interval each dayN(n) and comparing with a threshold λ; if TN(N) is larger than lambda, the user is considered to use the air conditioner in the nth time period on the Nth day, and the on-off state S of the air conditioner is recordedN(n) 1, if TN(N) is less than lambda, then the user is considered not to use the air conditioner in the nth time period on the Nth day, and the on-off state S of the air conditioner is recordedN(n)=0;

Converting an N-calendar history load data matrix L of the air conditioner into an on-off state sequence matrix S of the air conditioner:

and S12', after the outdoor temperature data matrix is obtained, preprocessing is needed to be carried out on the data. The activation function in the LSTM prediction model has the characteristic of easy saturation, and if the original data are directly imported into the LSTM prediction model, the LSTM prediction model tends to be saturated to cause a large deviation of a prediction result, so that the main effect of data preprocessing is to equivalently change the original data into data meeting the input of the LSTM prediction model, namely normalization. Performing linear normalization processing on the historical outdoor temperature data matrix W in the following way:

Dmin=Wmin-α|Wmax-Wmin|

Dmax=Wmax+α|Wmax-Wmin|

wherein, WN(G) Is the outdoor temperature value at the G sampling point on the nth day,is the normalized outdoor temperature value; wmaxAnd WminIs the maximum and minimum values in the historical outdoor temperature data matrix W, DmaxAnd DminExpanding the normalized upper and lower ranges to WmaxAnd WminIn addition, α is a scale factor.

And operation S2, training and verifying the LSTM network-based air conditioner on-off state prediction model with the feature matrix as an input and the actual air conditioner on-off state as an output. Specifically, the method comprises the following steps:

outdoor temperature data T at j time period on day do,j,dAnd the air conditioner switch state data corresponding to the j time periods of the d-1 day, the d-2 day and the d-7 day are used as input, the air conditioner switch state data corresponding to the j time period of the d day are used as output, and the air conditioner switch state prediction model based on the LSTM network is trained and verified.

Further, the prediction of the on-off state of each air conditioner is carried out by adopting a multi-model univariate prediction method, which specifically comprises the following steps: and a plurality of air conditioner on-off state prediction submodels based on the LSTM network are adopted, and each air conditioner on-off state prediction submodel based on the LSTM network predicts the air conditioner on-off state of a certain user in a period of time every day.

Further, the log-likelihood loss is adopted as a loss function of the LSTM network, and the optimal predicted value of the air conditioner on-off state corresponding to the j time period on the day d is obtained by minimizing the loss function.

Wherein S isi,j,dIs the real category of the air-conditioning state of the user i at the d day and the j time period, piIs prediction of Si,j,dProbability of belonging to class 1.

Further, the air conditioner on-off state prediction model based on the LSTM network is trained by using the data of the training set, and the prediction accuracy of the trained prediction model is checked by using the data of the test set. Put forward the quantization index A of the prediction precisioniThe prediction accuracy of the on-off state of each user air conditioner is calculated, Ai=niN wherein NiAnd predicting the sum of the number of the time intervals with correct results in multiple days for the user i, and N is the sum of the number of all the time intervals in the multiple days.

And operation S3, predicting the air conditioner on-off state of each time period of the day to be predicted by using the LSTM network-based air conditioner on-off state prediction model trained in operation S2.

The present invention will be described in further detail with reference to specific examples.

It is known that the air conditioning load data of 80 resident users per household in a certain area from 1/2018 to 12/31/2018 has a load sampling frequency of 1min, namely 1440 load data sampling points per day, and besides, the weather factor data of 2018 per day also comprises outdoor temperature.

In this embodiment, the load sampling frequency is 1 minute, i.e., M1440; the outdoor temperature is slowly changed, and the sampling frequency of the outdoor temperature is 60 minutes, namely G is 24.

In this example, n is 6, i.e. a day 24 is divided into 6 time periods every 4 hours. The threshold lambda is 20 minutes, namely the actual running time of the air conditioner compressor in the air conditioner refrigerating or heating process is more than 20 minutes in a certain period of time, and the air conditioner is considered to be in an open state in the period of time and is 1; otherwise, the state is closed and is 0. Through the processing, the actual load sequence of the air conditioner for N days can be converted into the state sequence matrix S with the values of 0 and 1. Fig. 2 is a schematic diagram of the time division of 24 hours a day.

In the example, the value of the scale factor alpha is 0.2, so that the problems of low accuracy and the like caused by the LSTM activation function in data mapping are solved.

In the example, the air conditioning load data of 80 resident users of 5 months from 3 months to 7 months in 2018 are selected, and the prediction model is divided into a training group and a testing group according to the proportion of 8:2 to train and test the training result. And selecting data of 4 months from 8 months to 11 months in 2018, and performing system verification on the prediction effect of the prediction model. If the prediction result of the air conditioner on-off state is from 12 to 18 points in 8/2018, the input of the LSTM prediction model is from 12 to 18 points in three days of 8/7/2018, 6/2018/8/1/2018, and the outdoor temperature data in the period from 12 to 18 points in 8/2018/18 is also selected as the input of the prediction model. Fig. 3 is a model structure diagram of air-conditioning state prediction at different time intervals on a certain day according to the present embodiment.

In the embodiment, the prediction model of the air conditioning state of each household is trained on the basis of the air conditioning load data of 80 household users of 5 months from 3 months to 7 months in 2018. And performing system test on the prediction accuracy of the residential air-conditioning state prediction model of each household by using data from 8 months to 11 months every day in 2018. Fig. 4 shows the overall prediction accuracy for each month in 8 to 11 months for 10 residents randomly selected among 80 residents. It can be seen that the prediction accuracy is different for each user in different months.

FIG. 5 is a box-type graph of the prediction accuracy results of all users in different months, and the box-type graph can better analyze the data distribution of the prediction results of each user. In all months, the prediction accuracy of the on-off state of most of the user air conditioners is over 80%, and the effectiveness of the prediction model is further proved. In addition, the overall prediction accuracy of the user in month 8 is high, because the weather in month 8 is hot, most air conditioners are in an open state for a long time, and the prediction is relatively easy. The distribution of the prediction results of the users in the month 11 is large, because the randomness of the states of the air conditioner switches in the month 11 is large, and therefore the prediction is relatively difficult.

Fig. 6 is a block diagram of an air conditioner on-off state prediction apparatus based on an LSTM network according to an embodiment of the present invention. Referring to fig. 6, the LSTM network-based air conditioner on-off state prediction apparatus 600 includes a data collection and processing module 610, a training and verification module 620, and an air conditioner on-off state prediction module 630.

The collecting and processing module 610, for example, performs operation S1, and is configured to collect and process historical load data of different user air conditioners and historical outdoor temperature data in corresponding time periods to obtain a feature matrix;

the training and verifying module 620 performs, for example, operation S2 for training and verifying an LSTM network-based air conditioner on-off state prediction model with the feature matrix as an input and the actual air conditioner on-off state as an output;

the air conditioner on-off state prediction module 630 performs, for example, operation S3, to predict the air conditioner on-off state of each time period of the day to be predicted, using the trained LSTM network-based air conditioner on-off state prediction model.

The LSTM network based air conditioner on-off state prediction apparatus 600 is used to perform the LSTM network based air conditioner on-off state prediction method in the embodiment shown in fig. 1. Please refer to the method for predicting the on/off state of the air conditioner based on the LSTM network in the embodiment shown in fig. 1, which is not described herein again.

It will be understood by those skilled in the art that the foregoing is only a preferred embodiment of the present invention, and is not intended to limit the invention, and that any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the present invention.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种检测模型的训练方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!