Temperature and humidity prediction and reverse optimization method for small-sized closed space

文档序号:68799 发布日期:2021-10-01 浏览:13次 中文

阅读说明:本技术 一种小型密闭空间温湿度预测及反向优化方法 (Temperature and humidity prediction and reverse optimization method for small-sized closed space ) 是由 柴毅 鄢利清 刘切 孙成杰 郭茂耘 贾建伟 范林川 龚思宇 于 2020-12-29 设计创作,主要内容包括:本发明涉及一种小型密闭空间温湿度预测及反向优化方法,属于温湿度预测技术领域。在特征向量选择方面,建立了基于随机森林的主要操作变量的筛选方法,解决了传统的数据关联模型中变量相对较少的情况。在模型预测方面采用了基于机器学习的GBDT模型预测,解决了传统机理建模调节参数多,模型控制复杂,对于复杂对象不易建模的问题。通过机器学习的方式得到预测结果,减少了无关或者影响因子小的变量对预测结果的影响,温湿度的预测结果更加准确。通过将GBDT模型引入到粒子群寻优算法中,从而实现对操作变量的反向优化,得到限定小型密闭空间温湿度数值下的操作变量值,为实现缺少反馈情况下小型密闭空间温湿度控制提供思路,并为降低控温过程能耗提供参考。(The invention relates to a temperature and humidity prediction and reverse optimization method for a small-sized closed space, and belongs to the technical field of temperature and humidity prediction. In the aspect of feature vector selection, a screening method of main operation variables based on a random forest is established, and the problem that the traditional data association model has relatively few variables is solved. In the aspect of model prediction, GBDT model prediction based on machine learning is adopted, and the problems that the traditional mechanism modeling has more adjusting parameters, the model control is complex, and the modeling of a complex object is difficult are solved. The prediction result is obtained in a machine learning mode, the influence of irrelevant variables or variables with small influence factors on the prediction result is reduced, and the prediction result of the temperature and the humidity is more accurate. The GBDT model is introduced into the particle swarm optimization algorithm, so that reverse optimization of the operation variables is realized, the operation variable values under the limited small-sized closed space temperature and humidity numerical values are obtained, an idea is provided for realizing the small-sized closed space temperature and humidity control under the condition of lack of feedback, and a reference is provided for reducing the energy consumption in the temperature control process.)

1. A method for predicting and reversely optimizing temperature and humidity of a small-sized closed space is characterized by comprising the following steps of: the method comprises the following steps:

1) extracting data in the site sensor, and collecting temperature and humidity values of the small closed space of each sample under the condition of different operating variables;

2) preprocessing the acquired data, performing primary screening, and removing partial bad values;

3) sorting the importance of different operation variables about the numerical influence of the temperature and humidity of the small closed space by adopting a random forest feature vector importance sorting algorithm, removing the operation variables which are irrelevant or have small influence factors, and screening out main feature variables;

4) dividing the sample into a training set and a testing set according to the screened main variables;

5) importing the training set samples into a GBDT model for training to obtain a temperature and humidity value prediction model of the small-sized closed space, and importing the test set data into the prediction model for verification;

6) an initial particle swarm in a D-dimensional space ofm is the number of particles of the particle swarm, each particle independently searches for an optimal solution in a search space, and the number of the particles is determined by an empirical formula;

7) the position coordinates of the particles being vector XiThe particle position coordinates are solutions of a group of operation variables, namely the dimension of the particle positions in the particle swarm optimization algorithm is the number of the operation variables to be optimized, namely the number of the screened main operation variables;

8) particle velocity value ViThe position optimal value vector searched by the particle is PBESTiThe particles mutually know the optimal values of each other, the position optimal value searched by the particle swarm is GBEST, and the optimal value is determined through a fitness function;

9) the fitness function is the mean square error between the output of the prediction model and an expected value; the particles update the position and the speed by tracking two optimal values to continuously optimize variables to evolve to a real optimal solution, and finally expected operation variables are obtained;

10) the initialized value of the particle position is the value of the manipulated variable to be adjusted, the velocity of the particle is initialized to be random assignment, and the optimized step number, namely the iteration frequency is determined by an experimental method;

11) based on the prediction model, the particle swarm optimization algorithm, namely the PSO algorithm, is used for carrying out reverse optimization on the operation variables, and the temperature and humidity control of the small-sized closed space is realized, so that the corresponding operation variable values of the small-sized closed space under the condition of limiting the temperature and humidity values are obtained.

2. The method for predicting and reversely optimizing the temperature and the humidity of the small-sized closed space according to claim 1, wherein the method comprises the following steps: in the above 9), the update formula of the speed and the position is:

Vid=ωVid+C1random(0,1)(Pid-Xid)+C2random(0,1)(Pgd-Xid) (1)

Xid=Xid+Vid (2)

the fitness function calculation formula is as follows:

where ω is an inertia factor and is a non-negative value, the algorithm results are usually biased toward a global optimal solution or a local optimal solution, C, by adjusting its value1And C2For individual and social learning factors, Random (0,1) is the interval [0,1 ]]Random number of (2), PidFor the position optimum of the individual particles, PgdAs global particle bitsSetting an optimal solution; n is the number of particles in the particle group, observediPredicted for desired target temperature and humidity valuesiIs a predicted temperature and humidity value.

3. The method for predicting and reversely optimizing the temperature and the humidity of the small-sized closed space according to claim 2, wherein the method comprises the following steps: said C is1=C2∈[1,4]。

Technical Field

The invention belongs to the technical field of temperature and humidity prediction, and relates to a temperature and humidity prediction and reverse optimization method for a small-sized closed space.

Background

The precision instrument has extremely high requirements on the temperature and the humidity of the environment, so the precision instrument needs to be stored in a small-sized closed space, and the temperature and the humidity in the small-sized closed space are controlled by a return air-free air conditioner. External environment variables are strong disturbance factors for the small-sized closed space, influence on the temperature and humidity inside the small-sized closed space is great, a period of non-feedback time exists in the control process, and in addition, a plurality of operation variables bring great challenges to the temperature and humidity control of the small-sized closed space. Although the prior art provides some traditional temperature and humidity control methods, the effect of temperature and humidity prediction for a small enclosed space cannot be effectively demonstrated. The idea of reversely optimizing the operation variables aiming at the prediction result is lacked, the traditional processing method is usually to continuously adjust the operation variables according to positive and negative feedback, and the direct input variable control under the temperature and humidity limit value of the small-sized closed space cannot be realized.

Aiming at the problem, a temperature and humidity prediction model in a small-sized closed space is urgently needed, and the temperature and humidity can be rapidly and accurately predicted. Meanwhile, under the condition of ensuring the prediction accuracy, how to realize the reverse optimization of the operation variables is also a problem which needs to be considered in the temperature and humidity control of the small-sized closed space.

Disclosure of Invention

In view of the above, the present invention provides a method for predicting and reversely optimizing temperature and humidity in a small enclosed space, so as to establish a prediction model with high prediction accuracy and involving a plurality of variables, and make the variables representative and independent, thereby accurately predicting temperature and humidity values in the small enclosed space according to changes of manipulated variables (control variables), and providing a fitness function value for further optimizing the manipulated variables (control variables) in the following. And finally, regarding the main operation variables as the number of particle swarms in the evolutionary algorithm, and comparing the particle swarms with the individual historical optimal solution and the global historical optimal solution to change the speed and the position of each particle, so that the specific position of each operation variable, namely the value of the control variable, is solved under the expected temperature and humidity value of the small-sized closed space, and finally the purpose of reversely optimizing the operation variable according to the temperature and humidity value requirement of the small-sized closed space is achieved.

In order to achieve the purpose, the invention provides the following technical scheme:

a method for predicting and reversely optimizing temperature and humidity of a small-sized closed space comprises the following steps:

1) extracting data in the site sensor, and collecting temperature and humidity values of the small-sized closed space under the condition of different operation variable values of each sample;

2) preprocessing the acquired data, performing primary screening, and removing partial bad values;

3) the method comprises the steps of performing importance sorting on temperature and humidity numerical value influences of different operation variables on a small closed space by adopting a random forest feature vector importance sorting algorithm, removing the operation variables which are irrelevant or have small influence factors, screening out main feature variables, and performing correlation matrix detection;

4) dividing the sample into a training set and a testing set according to the screened main variables;

5) importing the training set samples into a GBDT model for training to obtain a temperature and humidity numerical prediction model of a small-sized closed space, and importing the test set data into the prediction model for verification;

6) an initial particle swarm in a D-dimensional space ofm is the number of particles of the particle swarm, each particle independently searches for an optimal solution in a search space, and the number of the particles is determined by an empirical formula;

7) the particle position coordinates are vectors Xi, the particle position coordinates are solutions of a group of operation variables, namely the dimension of the particle position in the particle swarm algorithm is the number of the operation variables to be optimized, namely the number of the screened main operation variables.

8) The particle velocity value is Vi, the position optimal value vector searched by the particles is PBEST, the optimal values of the particles are mutually known, the position optimal value searched by the particle swarm is GBEST, the optimal value is determined by a fitness function,

9) in the algorithm, the fitness function is the mean square error between the output of the prediction model and an expected value. The particles update the position and the speed by tracking two optimal values so as to continuously optimize the evolution of the variables to the true optimal solution, and finally obtain the expected operation variables.

10) The initialized value of the particle position is the value of the operation variable to be adjusted, the velocity of the particle is initialized to be random assignment, and the optimized step number, namely the iteration frequency is determined through an experimental method.

11) Based on the prediction model, the particle swarm optimization algorithm, namely the PSO algorithm, is used for carrying out reverse optimization on the operation variables, so that the temperature and humidity control of the small-sized closed space is realized, and the corresponding operation variable values under the condition of limiting the temperature and humidity values of the small-sized closed space are obtained.

The invention has the beneficial effects that:

1. the invention relates to a method for predicting and reversely optimizing temperature and humidity of a small-sized closed space, wherein the main characteristic variables are selected by a random forest method for importance sequencing, and the problem that the traditional data correlation model has relatively few variables is solved. The influence weight of all the operation variables on the temperature and humidity numerical value of the small-sized closed space is given, so that the characteristic variables can be selected in the temperature and humidity prediction modeling process of the small-sized closed space according to the requirements of the small-sized closed space. Specific indications of original operation variables are well preserved, and the requirement of traditional mechanism modeling on high analysis requirements of raw materials is avoided.

2. The invention relates to a temperature and humidity prediction and reverse optimization method for a small-sized closed space, which solves the problems that the traditional mechanism modeling has more adjusting parameters, the model control is complex and the modeling is difficult for complex objects by introducing a GBDT model in machine learning in the aspect of temperature and humidity prediction of the small-sized closed space. The prediction result is obtained in a machine learning mode, the influence of irrelevant or small-influence-factor variables on the prediction result is further reduced, and the temperature and humidity prediction result of the small-sized closed space is more and more accurate in the continuous data learning process.

3. The invention relates to a temperature and humidity prediction and reverse optimization method for a small-sized closed space, which is characterized in that values of main operation variables under the condition of limiting temperature and humidity values of the small-sized closed space are obtained by introducing a gradient lifting prediction model into a particle swarm optimization algorithm, so that the problem of the values of the operation variables when feedback is lacked in temperature and humidity control of the small-sized closed space is solved, and an idea is provided for accurate temperature and humidity control under the condition of lack of feedback.

Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention. The objectives and other advantages of the invention may be realized and attained by the means of the instrumentalities and combinations particularly pointed out hereinafter.

Drawings

For the purposes of promoting a better understanding of the objects, aspects and advantages of the invention, reference will now be made to the following detailed description taken in conjunction with the accompanying drawings in which:

FIG. 1 is a flow diagram of data preprocessing;

FIG. 2 is a flow chart of random forest screening;

FIG. 3 is a diagram of results of random forest screening;

FIG. 4 is a flow chart of GBDT modeling;

FIG. 5 is a flow chart of a particle swarm reverse optimization step;

FIG. 6 is a comparison graph of predicted values and true values of randomly drawn test samples;

FIG. 7 is a line graph of absolute error for randomly drawn test samples;

FIG. 8 is a plot of the relative error line for randomly drawn test samples.

Detailed Description

The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention in a schematic way, and the features in the following embodiments and examples may be combined with each other without conflict.

Wherein the showings are for the purpose of illustrating the invention only and not for the purpose of limiting the same, and in which there is shown by way of illustration only and not in the drawings in which there is no intention to limit the invention thereto; to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of an actual product; it will be understood by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.

The same or similar reference numerals in the drawings of the embodiments of the present invention correspond to the same or similar components; in the description of the present invention, it should be understood that if there is an orientation or positional relationship indicated by terms such as "upper", "lower", "left", "right", "front", "rear", etc., based on the orientation or positional relationship shown in the drawings, it is only for convenience of description and simplification of description, but it is not an indication or suggestion that the referred device or element must have a specific orientation, be constructed in a specific orientation, and be operated, and therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes, and are not to be construed as limiting the present invention, and the specific meaning of the terms may be understood by those skilled in the art according to specific situations.

The temperature and humidity value of the small-sized closed space is predicted by the temperature and humidity prediction and reverse optimization method of the small-sized closed space, and the problem that the number of variables in a traditional data association model is relatively small is solved. Compared with the traditional prediction method, the prediction accuracy of the prediction method based on machine learning is improved to a certain extent. By introducing the gradient lifting prediction model into the particle swarm optimization algorithm, the numerical optimization problem of input variables (operation variables) under the condition of limiting the temperature and humidity numerical values of a small-sized closed space is solved.

Which comprises the following steps:

1) extracting data in the site sensor, and collecting temperature and humidity values of the small-sized closed space under the condition of different operation variable values of each sample;

taking data acquired in a temperature and humidity control experiment of a certain small space as an example, 325 groups of sample data are acquired in total, and 67 variables are involved;

2) preprocessing the acquired data, performing primary screening, and removing partial bad values;

the flow chart of the specific processing steps is shown in figure 1, because the variation range of each variable is different, normalization processing is carried out before preprocessing data, the variation range of part of the variables can be prevented from being very small by normalizing all the operation variables, so that the variance is very low and is deleted by mistake, variance screening is carried out after the normalization processing, and the operation variables with small variance in the sample are removed;

3) and (3) sorting the importance of the temperature and humidity numerical value influences of different operation variables on the small closed space by adopting a random forest feature vector importance sorting algorithm, removing the operation variables which are irrelevant or have small influence factors, and screening out main feature variables. And (3) performing correlation matrix screening on the screened main operation variables, removing the operation variables with higher correlation in two or more groups, and only keeping the operation variables with higher random forest characteristic influence values, wherein the specific execution steps are shown as the attached figure 2. By the method, the influence of unexpected fluctuation of data on the prediction result is eliminated, the operation variables with the same temperature and humidity numerical value influence condition in the small-sized closed space are eliminated, and the introduction of repeated operation variable data is avoided. So that the screened characteristic variables are representative and independent. The screening results taking data collected in a temperature and humidity control experiment of a certain small space as an example of main variables are shown in the attached figure 3;

4) dividing the sample into a training set and a testing set according to the screened main variables;

usually, 75% of the collected sample data volume is used as a training set, and 25% is used as a prediction set for subsequent model training and verification, the specific proportion of the process can be changed according to the personal needs, and the larger the data volume of the training set is, the higher the accuracy of the training model is;

5) importing the training set samples into a GBDT model for training to obtain a small-sized closed space temperature and humidity prediction model, and importing the test set data into the prediction model for verification;

in the traditional mechanism modeling process, a plurality of adjusting parameters are provided, the model control is complex, and the modeling of a complex object is difficult. The method has the advantages that the traditional mechanism modeling has inherent defects in the temperature and humidity prediction of a small closed space, the GBDT model can well solve the problem, the prediction result is obtained in a machine learning mode, and the influence of irrelevant variables or variables with small influence factors on the prediction result is further reduced. In the continuous data learning process, the temperature and humidity prediction result of the small-sized closed space is more and more accurate. Through continuous correction of the test data, the test data is used for verification after modeling is performed by using the training data each time, and finally an optimal temperature and humidity prediction model of the small-sized closed space is obtained, wherein a specific modeling process is shown as an attached diagram 4;

6) first, setting the initial particle group in D-dimension space asm is the number of particles of the particle swarm, each particle independently searches for an optimal solution in a search space, and the number of the particles is determined by an empirical formula;

7) the particle position coordinates are vectors Xi, the particle position coordinates are solutions of a group of operation variables, namely the dimension of the particle position in the particle swarm optimization is the number of the operation variables to be optimized;

8) the particle speed value is Vi, the position optimal value vector searched by the particles is PBEST, the particles know the optimal values of each other, the position optimal value searched by the particle swarm is GBEST, and the optimal value is determined through a fitness function;

9) in the algorithm, the fitness function is the mean square error between the output of the prediction model and an expected value. The particles update the position and the speed by tracking two optimal values to continuously optimize the evolution of the variables to the true optimal solution, and finally obtain expected operation variables;

it should be noted that the velocity and position update formula here is:

Vid=ωVid+C1random(0,1)(Pid-Xid)+C2random(0,1)(Pgd-Xid) (1)

Xid=Xid+Vid (2)

the fitness function calculation formula is as follows:

where ω is an inertia factor and is a non-negative value, the algorithm results are usually biased toward a global optimal solution or a local optimal solution, C, by adjusting its value1And C2For individual learning and social learning factors, in this example C is taken1=C22, but it is to be noted that C is a general one1=C2∈[1,4]. Random (0,1) is the interval [0,1 ]]Random number of (2), PidFor the position optimum of the individual particles, PgdThe global particle position optimal solution is obtained; n is the number of particles in the particle group, observediPredicted for desired temperature and humidity values of small enclosed spacesiThe predicted temperature and humidity values of the small closed space are obtained.

10) The initialized value of the particle position is the value of the manipulated variable to be adjusted, the velocity of the particle is initialized to be random assignment, and the optimized step number, namely the iteration frequency is determined by an experimental method;

it should be noted that the number of steps of the optimization, i.e., the number of iterations, is determined experimentally, which means that the number of iterations when the global optimal solution is obtained is determined by continuously testing the number of iterations. Because the original data of each main operation variable to be optimized in the temperature and humidity control of the small-sized closed space often has different dimensions and dimension units, the main operation variables need to be normalized and then assigned.

11) Based on the prediction model, the particle swarm optimization algorithm, namely the PSO algorithm, is used for carrying out reverse optimization on the operation variables, and the temperature and humidity control of the small-sized closed space is realized, so that the corresponding operation variable values of the small-sized closed space under the condition of limiting the temperature and humidity values are obtained.

FIG. 5 is a flow chart of a particle swarm reverse optimization procedure.

The temperature and humidity numerical value of the small-sized closed space is predicted by adopting the temperature and humidity prediction model of the small-sized closed space in the embodiment, the difference between the predicted value and the true value of part of randomly extracted test set data can be seen from fig. 6, the average absolute percentage error MAPE value of the temperature and humidity prediction result of the small-sized closed space is calculated to be 2.3299%, and the model has a good prediction effect through judgment.

FIG. 7 shows a line graph of absolute errors of predicted values and true values of part of randomly extracted test set data, and it can be known from the graph that the variation range of the absolute errors of predicted results and true values in the test set is basically about +/-0.1, which shows that the true value condition is well predicted by the prediction method, and the result is greatly improved compared with the traditional data association model and mechanism modeling.

In fig. 8, a plot of the relative error curves for the predicted and true values of a portion of the randomly extracted test set data is shown. It can be seen that, except for individual data, the relative error curve is basically coincident with the X axis, the maximum relative difference is not more than 0.18, the mean square error MSE is calculated to be 0.0049 and is very close to a value of 0, so that the prediction model provided by the invention can well predict the temperature and humidity values of a small closed space.

Finally, the above embodiments are only intended to illustrate the technical solutions of the present invention and not to limit the present invention, and although the present invention has been described in detail with reference to the preferred embodiments, it will be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions, and all of them should be covered by the claims of the present invention.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:不同参数材料分区浇/填筑坝变形混合模型通用建立方法

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!

技术分类