Intelligent environment prediction, regulation and control method for sunlight greenhouse
Through deep learning technology combined with CNN and GRU models, the temperature and humidity in the greenhouse are predicted and regulated, and the problem of difficult to predict and regulate the greenhouse environment in the existing technology is solved, and high-precision environmental prediction and real-time regulation are achieved.
Patent Information
- Application Number
- CN202411559828.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-18
AI Technical Summary
The prior art is difficult to effectively predict and regulate the complex timing and nonlinear characteristics in greenhouses, especially under the influence of factors such as external meteorological conditions and greenhouse geographical location.
Deep learning method is adopted, combining convolutional neural network (CNN) and gated recurrent unit neural network (GRU), to model the spatiotemporal distribution of greenhouse temperature and humidity, build a multi-point temperature and humidity prediction model, and control it through environmental control based on PID controller The module performs real-time regulation.
Accurate prediction and regulation of greenhouse temperature and humidity is achieved, the prediction accuracy and environmental control efficiency are improved, complex nonlinear timing data can be processed, and the greenhouse environment is kept within the optimal range.
Smart Images

Figure CN119474736A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of artificial intelligence, and specifically discloses a method for intelligent environmental prediction and regulation of a solar greenhouse. Background Art
[0002] Agriculture is the country's primary industry, the basis of human survival, and an important guarantee for the continuous development and progress of the entire national economy. The development of agriculture will directly affect the development trend of the national economy, and its importance is self-evident. After going through the stages of improved varieties, water conservancy, chemicalization, and mechanization, agricultural modernization has entered the stage of automation and intelligence. At this stage, the digital transformation of agriculture will become the core, and the combination of a new generation of digital information technology and traditional agriculture is becoming a necessary means to promote the high-quality development of modern agriculture and realize the rural revitalization strategy.
[0003] There are many traditional statistical methods for greenhouse environmental prediction, such as History Average (HA), Vector Autoregressive model (VAR), Support Vector Machine (SVR), and Auto-Regressive Moving Average Model (ARIMA). However, these methods need to meet the stationarity assumption of time series. Benefiting from the representation ability of deep neural networks, these methods use Graph Neural Networks (GNNs) to capture spatial correlation, use Recurrent Neural Networks (RNNs) to extract temporal correlation, and integrate different networks to explore spatiotemporal correlation, thereby achieving more accurate prediction of solar greenhouse environment. However, these methods all have certain limitations to a greater or lesser extent.
[0004] The microclimate environment such as temperature and humidity in the greenhouse has complex temporal and nonlinear characteristics, and is affected by many factors such as external meteorological conditions, the geographical location of the greenhouse, and the control system of the greenhouse. In order to couple the characteristic information that affects the temperature and humidity in the greenhouse, fully explore the internal potential connections and spatial laws of these characteristics, and accurately predict the spatial distribution of temperature and humidity in the greenhouse, the present invention proposes a prediction method based on deep learning technology, which uses convolutional neural network (CNN) and gated recurrent unit neural network (GRU) to simultaneously model the spatiotemporal distribution of greenhouse temperature and humidity, so as to achieve accurate prediction of greenhouse temperature and humidity. Summary of the invention
[0005] The main purpose of the present invention is to couple the characteristic information that affects the temperature and humidity in the greenhouse, fully explore the internal potential connections and spatial laws of these characteristics, adopt deep learning methods, establish a multi-point temperature and humidity prediction model in the greenhouse, and accurately predict the spatial distribution of temperature and humidity in the greenhouse.
[0006] The present invention provides a method for intelligently predicting and controlling the environment of a solar greenhouse, comprising the following steps:
[0007] S1. Collect greenhouse data and meteorological data outside the greenhouse, and merge the greenhouse data and the meteorological data outside the greenhouse to form a greenhouse environment data set, and perform data noise processing, screening, correlation analysis and data normalization on the data in the greenhouse environment data set in turn to obtain a prediction data set;
[0008] S2. Construct and train a greenhouse temperature and humidity prediction model, wherein the greenhouse temperature and humidity prediction model includes: an input layer, a convolutional neural network layer, and a gated recurrent unit neural network layer;
[0009] S3. Input the predicted data set into the greenhouse temperature and humidity prediction model, train, verify and adjust the greenhouse temperature and humidity prediction model hyperparameters to obtain the greenhouse temperature and humidity prediction results;
[0010] S4. Construct a greenhouse environment control module to adjust the greenhouse environment based on the optimal temperature and humidity information for crop growth and the greenhouse temperature and humidity prediction results obtained in step S3.
[0011] According to a method for intelligent environmental prediction and control of a solar greenhouse in some embodiments of the present application, step S1 includes:
[0012] S110. Reading greenhouse environment data from the equipment in the greenhouse to construct a greenhouse data set, wherein the greenhouse environment data includes: indoor temperature, indoor humidity, soil temperature, soil humidity, indoor lighting, and fan cooling and dehumidification parameters of the solar greenhouse;
[0013] S120. Collecting greenhouse weather data from the official website of the Meteorological Bureau based on the time period and target area information, the greenhouse weather data including: temperature, relative humidity, wind speed, precipitation, and air pressure;
[0014] S130. Merging the greenhouse external meteorological data into the greenhouse data set constructed in step S110 to form the greenhouse environment data set, wherein the greenhouse environment data set stores time series feature vectors;
[0015] S140. Using DBSCAN algorithm to perform noise processing on the data in the greenhouse environment data set;
[0016] S150. Screening the data after noise processing in step S140;
[0017] S150. Use formula (1) to perform correlation analysis on the data filtered in step S150.
[0018]
[0019] Among them, X i is the i-th observation of variable X, Y i is the ith observation value of variable Y, All X i The arithmetic mean of All Y i The arithmetic mean of
[0020] S170. Normalize the data after the correlation analysis in step S160, and map the data in the greenhouse environment data set to the range of [-1, 1] to obtain a prediction data set, as shown in formula (2):
[0021]
[0022] Among them, x represents the original value, mean(x) represents the sample mean, std represents the sample variance, and x′ represents the normalized value.
[0023] According to a method for intelligent environmental prediction and control of a solar greenhouse in some embodiments of the present application, in step S110, greenhouse environmental data is read from equipment in the greenhouse at a frequency of once per minute to construct the greenhouse data set.
[0024] According to a method for intelligent environmental prediction and control of a solar greenhouse in some embodiments of the present application, step S150 includes completing the data after noise reduction processing in step S140 based on the greenhouse data set dynamically collected in step S110, and performing data processing according to a preset aggregation window.
[0025] According to a method for intelligent environmental prediction and control of a solar greenhouse in some embodiments of the present application, the step S170 further includes:
[0026] S180. Generate the prediction data set data using a sliding window based on a preset window size: {X,Y label}, where X is the input variable, Y label Actual data collected by the system.
[0027] S190. Divide the prediction data set into a training set, a validation set, and a test set in a ratio of 6:2:2. According to some embodiments of the present application, a method for predicting and controlling an intelligent solar greenhouse environment comprises:
[0028] S210. Constructing the input layer of the greenhouse temperature and humidity prediction model to preprocess the greenhouse environment data, including concatenating the indoor temperature and humidity data at the same time with the greenhouse external meteorological data into a new time series feature vector, and the data in the greenhouse environment data set is expressed as a two-dimensional matrix of time step × feature vector;
[0029] S220. Constructing the convolutional neural network layer of the greenhouse temperature and humidity prediction model to capture the deep temporal and spatial characteristics of the input historical sequence, the convolutional neural network layer is obtained by connecting 2 convolutional layers, 1 maximum pooling layer, 2 convolutional layers, and 1 maximum pooling layer in series in sequence;
[0030] S230. Performing a Flatten operation on the output data of the convolutional neural network layer;
[0031] S240. Constructing a gated recurrent unit neural network layer of the greenhouse temperature and humidity prediction model, wherein the gated recurrent unit neural network layer has a two-layer structure, an activation function is a ReLU activation function, and the number of neurons is 64 and 128 respectively;
[0032] S250. Denormalize the network output to obtain temperature and humidity prediction data.
[0033] According to a method for predicting and controlling an intelligent solar greenhouse environment in some embodiments of the present application, in step S220, the convolution layer is a 4-layer convolution layer with a convolution kernel of 3×3 and the number of convolution kernels being 16, 16, 32, and 32 respectively, and the convolution layer adopts a Relu activation function;
[0034] The maximum pooling layer size is 2.
[0035] According to a method for intelligent environmental prediction and control of a solar greenhouse in some embodiments of the present application, step S3 includes:
[0036] S310. Batch input the data X in the prediction data set into the greenhouse temperature and humidity prediction model to obtain greenhouse temperature and humidity prediction values;
[0037] S320. Using the loss function to compare the greenhouse temperature and humidity prediction value with Y label Calculate the loss value and use the Adam optimizer to optimize the model's learnable parameters. The mean absolute error of the evaluation index is calculated as shown in formula (3):
[0038]
[0039] Among them, MAE represents the mean absolute error, N is the total number of prediction results, and y i is the actual temperature and humidity value of the i-th sampling point, Predict the temperature and humidity values for the i-th sampling point,
[0040] The calculation of the root mean square error of the evaluation index is as shown in formula (4);
[0041]
[0042] Among them, RMSE means root mean square error,
[0043] The calculation of the mean absolute percentage error of the evaluation index is as shown in formula (5):
[0044]
[0045] Wherein, MAPE stands for mean absolute percentage error,
[0046] The calculation of the determination coefficient of the evaluation index is as shown in formula (6):
[0047]
[0048] Among them, R 2 represents the coefficient of determination, is the actual average temperature and humidity of the i-th sampling point;
[0049] S330. Using the training set obtained in step S190 to train the greenhouse temperature and humidity prediction model, and recording the model training time when the loss function value of the model training tends to be stable. The shorter the training time, the higher the model prediction efficiency;
[0050] S340. Using the validation set obtained in step S190, the hyperparameters of the greenhouse temperature and humidity prediction model are adjusted;
[0051] S350. Output the greenhouse temperature and humidity prediction results.
[0052] According to a method for intelligent environmental prediction and control of a solar greenhouse in some embodiments of the present application, step S4 includes:
[0053] S410. Construct a greenhouse environment control module based on a PID controller, wherein the PID controller is as shown in formula (7):
[0054]
[0055] Where: U(r) is the control output, err(t) is the difference between the set value and the actual value, kp is the proportional gain, T I is the integration time constant, T D is the differential time constant;
[0056] S420. Input the known optimal temperature and humidity information for crop growth into the greenhouse environment control module constructed in step S410;
[0057] S430. The greenhouse environment control module calculates the greenhouse control equipment regulation strategy according to the greenhouse temperature and humidity prediction results and the optimal temperature and humidity information for crop growth, and adjusts the greenhouse environment.
[0058] According to a method for intelligent environmental prediction and control of a solar greenhouse in some embodiments of the present application, the step S410 of constructing a greenhouse environmental control module based on a PID controller includes:
[0059] S411. Initialize parameter control and set PID controller kp, T I and T D Parameters, set the initial greenhouse data of the greenhouse environment control module and the initial greenhouse external meteorological data;
[0060] S412. Greenhouse temperature and humidity error calculation: in each PID control cycle, the error err(t) between the actual greenhouse temperature and humidity and the set greenhouse temperature and humidity is calculated;
[0061] S413. Control output calculation, using formula (7) to calculate the control output U(t) of the greenhouse environment;
[0062] S414. Execute greenhouse environment control action, and adjust the operation state of greenhouse control equipment according to the control output U(t);
[0063] S415. Real-time monitoring and adjustment of greenhouse environment, continuous monitoring of greenhouse environment data changes, recording the error between the actual value and the target value, and regular adjustment of the PID control parameters kp, T I and T D ;
[0064] S416. Greenhouse environment control feedback, establish a feedback mechanism, dynamically adjust the control target and the PID control parameters according to the actual greenhouse environment changes and crop growth needs;
[0065] S417. Optimize greenhouse environmental control, using the greenhouse temperature and humidity prediction results of the greenhouse temperature and humidity prediction model to adjust the greenhouse control equipment control strategy in advance and adjust the greenhouse environment.
[0066] The beneficial effects of the technical solution of the present invention specifically include:
[0067] (1) In terms of data preprocessing, the present invention ensures the high quality and consistency of input data by screening, denoising and normalizing the environmental data collected by the sensor network, reduces the impact of missing and abnormal sensor data, and improves the stability and robustness of the model.
[0068] (2) The present invention adopts a deep learning method combining convolutional neural network (CNN) and gated recurrent unit (GRU) neural network, which can more accurately capture the spatiotemporal distribution characteristics of temperature and humidity in the greenhouse, and significantly improve the accuracy of temperature and humidity prediction. Compared with traditional statistical methods such as historical average method (HA), vector autoregression (VAR), support vector regression (SVR) and autoregressive integrated moving average (ARIMA), the present invention is not limited by the assumption of time series stability and can process complex nonlinear time series data.
[0069] (3) The present invention is not limited to the prediction of temperature and humidity, but also applies the prediction results to greenhouse environment control. Through the automation strategy of the greenhouse control system, the greenhouse temperature and humidity are accurately controlled to promote crop growth and avoid losses caused by extreme weather. This real-time feedback and dynamic adjustment mechanism enables the greenhouse environment to always be kept within the optimal range. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 This is a schematic flow chart of a method for intelligent environmental prediction and control of a solar greenhouse provided by an embodiment of the present invention;
[0071] Figure 2 It is a data graph after processing and screening provided by an embodiment of the present invention;
[0072] Figure 3 It is a CNN-GRU network hybrid model diagram provided by an embodiment of the present invention;
[0073] Figure 4 It is a control flow chart provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0074] The following embodiments of the present invention are described in further detail in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0075] Example 1: This example provides a method for intelligent environmental prediction and control of a solar greenhouse. The process is as follows: Figure 1 As shown, the following steps are included:
[0076] S1. Collect greenhouse data and meteorological data outside the greenhouse, and merge the greenhouse data and the meteorological data outside the greenhouse to form a greenhouse environment data set, and perform data noise processing, screening, correlation analysis and data normalization on the data in the greenhouse environment data set in turn to obtain a prediction data set.
[0077] S2. Construct and train a greenhouse temperature and humidity prediction model, which includes: an input layer, a convolutional neural network layer Convolutional Neural Network, CNN, and a gated recurrent unit neural network layer Gated Recurrent Unit, GRU.
[0078] S3. Input the prediction data set into the greenhouse temperature and humidity prediction model, train, verify and adjust the greenhouse temperature and humidity prediction model hyperparameters to obtain the greenhouse temperature and humidity prediction results.
[0079] S4. Construct a greenhouse environment control module to adjust the greenhouse environment based on the optimal temperature and humidity information for crop growth and the greenhouse temperature and humidity prediction results obtained in step S3.
[0080] Embodiment 2: This embodiment provides a method for predicting and controlling the intelligent environment of a solar greenhouse.
[0081] S110. Reading greenhouse environment data from the equipment in the greenhouse to construct a greenhouse data set, wherein the greenhouse environment data includes: indoor temperature, indoor humidity, soil temperature, soil humidity, indoor lighting, and fan cooling and dehumidification parameters of the solar greenhouse. Preferably, in this step, the greenhouse environment data is read from the equipment in the greenhouse at a frequency of 1 time / minute to construct the greenhouse data set.
[0082] S120. Collecting greenhouse meteorological data from the official website of the Meteorological Bureau based on the time period and target area information, wherein the greenhouse meteorological data includes: temperature, relative humidity, wind speed, precipitation, and air pressure.
[0083] S130. Merging the greenhouse external meteorological data into the greenhouse data set constructed in step S110 to form the greenhouse environment data set, wherein the greenhouse environment data set stores time series feature vectors.
[0084] S140. Use the DBSCAN algorithm to perform noise processing on the data in the greenhouse environment data set. Preferably, in this embodiment, the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) density clustering algorithm is used to perform noise processing.
[0085] S150. Filter the data after the noise processing in step S140. In this embodiment, this step includes supplementing the data after the noise reduction processing in step S140 based on the greenhouse data set dynamically collected in step S110, and processing the data according to the preset aggregation window. Preferably, in this embodiment, the data set after noise reduction and supplementation is as follows: Figure 2, contains 5783 records, aggregated into data with a window size of 20 minutes, and the data is collected by sensors at a frequency of once per minute.
[0086] S160. Use formula (1) to perform correlation analysis on the data filtered in step S150.
[0087]
[0088] Among them, X i is the i-th observation of variable X, Y i is the ith observation value of variable Y, All X i The arithmetic mean of All Y i The arithmetic mean of .
[0089] The changing trend of temperature and humidity in the greenhouse is jointly determined by multiple factors, including outdoor meteorological factors, other indoor environmental factors, etc. Knowing the correlation between these factors and the temperature and humidity in the greenhouse in advance is the key basis for building a model. The key factors affecting indoor temperature and humidity can be screened out, and some insignificant factors can be eliminated. This can not only improve the prediction accuracy by reducing data redundancy, but also improve the operating efficiency of the model. The data correlation analysis of step S160 of this embodiment uses the commonly used Pearson Correlation Coefficient (Pearson) on the SPSS software to judge and analyze the correlation between the meteorological factors outside the greenhouse, the various environmental factors in the greenhouse, and the air temperature and relative humidity in the greenhouse.
[0090] S170. Use formula (2) to normalize the data after the correlation analysis in step S160, and map the data in the greenhouse environment data set to the range of [-1,1] to obtain a predicted data set.
[0091]
[0092] Among them, x represents the original value, mean(x) represents the sample mean, std represents the sample variance, and x′ represents the normalized value.
[0093] Preferably, this embodiment also includes the following steps of making a model training set, a validation set, and a test set:
[0094] S180. Generate the prediction data set data using a sliding window based on a preset window size: {X,Y label}, where X is the input variable, Y labelis the actual data collected by the system. Preferably, in this specific embodiment, the environmental data of the past 20 time steps are used to predict the environmental data of the next 20 time steps. The required data is generated using a sliding window with a sliding window size of 20. The generated data includes two parts: {X,Y label}.
[0095] S190. Divide the prediction data set into a training set, a validation set, and a test set in a ratio of 6:2:2.
[0096] S210. Construct the input layer of the greenhouse temperature and humidity prediction model to preprocess the greenhouse environment data, that is, the indoor temperature and humidity data at the same time and the meteorological data outside the greenhouse are connected in series to form a new time series feature vector, and the historical meteorological data outside the greenhouse and the historical microclimate data inside the greenhouse are expressed as a two-dimensional matrix of time step × feature vector. Preferably, in this embodiment, the temperature and humidity at a certain moment in the greenhouse and its related outdoor air temperature, outdoor air relative humidity, outdoor wind speed, indoor substrate temperature, indoor light intensity, environmental distribution characteristics, ventilation characteristics and humidification characteristics are connected in series to form a new time series feature vector.
[0097] Preferably, this embodiment constructs the following after the input layer: Figure 3 The convolutional neural network layer and the gated recurrent unit neural network layer shown are constructed as follows:
[0098] S220. Construct the convolutional neural network layer of the greenhouse temperature and humidity prediction model to capture the deep temporal and spatial characteristics of the input historical sequence. The convolutional neural network layer is obtained by connecting 2 convolutional layers, 1 maximum pooling layer, 2 convolutional layers, and 1 maximum pooling layer in series. In the preferred embodiment, in step S220, the convolutional layer is a 4-layer convolutional layer (Conv2D) with a convolution kernel of 3×3 and the number of convolution kernels of 16, 16, 32, and 32, respectively. The convolutional layer uses a Relu activation function; the size of the maximum pooling layer (MaxPooling2D) is 2.
[0099] S230. Perform a Flatten operation on the output data of the convolutional neural network layer.
[0100] S240. Construct a gated recurrent unit neural network layer of the greenhouse temperature and humidity prediction model. The gated recurrent unit neural network layer has a two-layer structure, the activation function is the ReLU activation function, and the number of neurons is 64 and 128 respectively.
[0101] S250. Denormalize the network output to obtain temperature and humidity prediction data.
[0102] S310. Batch input the data X in the prediction data set into the greenhouse temperature and humidity prediction model to obtain greenhouse temperature and humidity prediction values.
[0103] S320. Using the loss function to compare the greenhouse temperature and humidity prediction value with Y label Calculate the loss value and use the Adam optimizer to optimize the model's learnable parameters. The calculation of the evaluation indicator mean absolute error (MAE) is as shown in formula (3):
[0104]
[0105] The calculation of the evaluation index root mean square error (RMSE) is as shown in formula (4);
[0106]
[0107] The calculation of the evaluation index mean absolute percentage error (MAPE) is as shown in formula (5):
[0108]
[0109] The determination coefficient of the evaluation index (R 2 ) is calculated as shown in formula (6)
[0110]
[0111] Among them, N is the total number of prediction results, y i is the actual temperature and humidity value of the i-th sampling point, Predict the temperature and humidity values for the i-th sampling point, is the actual average temperature and humidity of the ith sampling point.
[0112] S330. Use the training set obtained in step S190 to train the greenhouse temperature and humidity prediction model, and record the model training time when the loss function value of the model training tends to be stable. The shorter the training time, the higher the model prediction efficiency. Preferably, in this embodiment, the loss function adopts the mean square error.
[0113] S340. Use the verification set obtained in step S190 to adjust the hyperparameters of the greenhouse temperature and humidity prediction model.
[0114] S350. Output the greenhouse temperature and humidity prediction results.
[0115] Preferably, this implementation also includes: Figure 4 The greenhouse environment control method based on the intelligent environment prediction data of the solar greenhouse shown in the figure needs to be implemented based on the greenhouse environment control module. The steps of constructing the greenhouse environment control module are as follows:
[0116] S410. Construct a greenhouse environment control module based on a PID controller, wherein the PID controller is as shown in formula (7):
[0117]
[0118] Where: U(t) is the control output, err(t) is the difference between the set value and the actual value, kp is the proportional gain, T I is the integration time constant, T D is the differential time constant.
[0119] S420. Collect the optimal temperature and humidity information for crop growth based on known information and input it into the greenhouse environment control module constructed in step S410. Preferably, in this embodiment, the optimal temperature and humidity information for crop growth is collected from public documents such as agricultural manuals and papers.
[0120] S430. The greenhouse environment control module calculates the greenhouse control equipment regulation strategy according to the greenhouse temperature and humidity prediction results and the optimal temperature and humidity information for crop growth, and adjusts the greenhouse environment.
[0121] Preferably, in step S410 of this embodiment, constructing a greenhouse environment control module based on a PID controller includes:
[0122] S411. Initialize parameter control and set PID controller kp, T I and T D Parameters, set the initial greenhouse data of the greenhouse environment control module and the initial greenhouse external meteorological data.
[0123] S412. Greenhouse temperature and humidity error calculation: In each PID control cycle, the error err(t) between the actual greenhouse temperature and humidity and the set greenhouse temperature and humidity is calculated. Preferably, the set temperature target is 23°C, the actual temperature is 21°C, and the error is: err(t) = 23-21 = 2°C.
[0124] S413. Calculate the control output, using formula (7) to calculate the control output U(t) of the greenhouse environment. In this embodiment, the control output includes three parts: proportional control kp·err(t), which is the response to the current error. Integral control That is, respond to the accumulated error and eliminate the long-term deviation. That is, the response error change rate is used to improve the dynamic response of the system.
[0125] S414. Execute greenhouse environment control action, and adjust the operation state of greenhouse control equipment according to the control output U(t). In this embodiment, the greenhouse control equipment includes: a ventilator and a humidifier, etc. During regulation, if the control output U(t) is positive, the temperature or humidity is increased; if it is negative, the temperature or humidity is reduced. For example, if the control output is positive, the ventilator will accelerate operation, increase air flow, and increase temperature or humidity.
[0126] S415. Real-time monitoring and adjustment of greenhouse environment, continuous monitoring of greenhouse environment data changes, recording the error between the actual value and the target value, and regular adjustment of the PID control parameters kp, T I and T D , in order to optimize the control effect and reduce overshoot and oscillation.
[0127] S416. Greenhouse environment control feedback: establish a feedback mechanism to dynamically adjust the control target and the PID control parameters according to actual greenhouse environment changes and crop growth requirements.
[0128] S417. Optimize greenhouse environmental control, using the greenhouse temperature and humidity prediction results of the greenhouse temperature and humidity prediction model to adjust the greenhouse control equipment control strategy in advance and adjust the greenhouse environment.
[0129] This embodiment fully couples the characteristic information that affects the temperature and humidity in the greenhouse, mines the potential connections and spatial laws within the characteristic information, and accurately predicts the spatial distribution of temperature and humidity in the greenhouse. This embodiment adopts a deep learning method to establish a multi-point temperature and humidity prediction model in the greenhouse. First, based on the new generation of numerical weather forecast system of Dalian Meteorological Bureau, more fine-grained meteorological information is obtained for each greenhouse location. Environmental data of different areas of the greenhouse are collected through a sensor network, and a two-dimensional matrix is constructed according to a time series of outdoor meteorological forecast data, indoor microclimate historical data, environmental distribution characteristics, humidification characteristics and ventilation characteristics as input. The convolutional neural network is used to mine the high-dimensional effective features contained in the data that reflect the interconnection of greenhouse environmental data, and the extracted feature vectors are constructed as a time series, which is input into the gated recurrent unit neural network for temperature and humidity prediction. Furthermore, this embodiment regulates the greenhouse environment based on the greenhouse temperature and humidity prediction data to achieve intelligent environmental prediction and precise regulation of the solar greenhouse.
[0130] The embodiments of the present invention are given for the purpose of illustration and description, and are not intended to be exhaustive or to limit the invention to the disclosed forms. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiments are selected and described in order to better illustrate the principles and practical applications of the present invention and to enable those of ordinary skill in the art to understand the present invention and thereby design various embodiments with various modifications suitable for specific uses.
Claims
1. A method for intelligent environmental prediction and control of a solar greenhouse, characterized in that: The steps include: S1. Collect greenhouse data and meteorological data outside the greenhouse, and merge the greenhouse data and the meteorological data outside the greenhouse to form a greenhouse environment data set, and perform data noise processing, screening, correlation analysis and data normalization on the data in the greenhouse environment data set in turn to obtain a prediction data set; S2. Construct and train a greenhouse temperature and humidity prediction model, wherein the greenhouse temperature and humidity prediction model includes: an input layer, a convolutional neural network layer, and a gated recurrent unit neural network layer; S3. Input the predicted data set into the greenhouse temperature and humidity prediction model, train, verify and adjust the greenhouse temperature and humidity prediction model hyperparameters to obtain the greenhouse temperature and humidity prediction results; S4. Construct a greenhouse environment control module to adjust the greenhouse environment based on the optimal temperature and humidity information for crop growth and the greenhouse temperature and humidity prediction results obtained in step S3.
2. The method for predicting and controlling the intelligent environment of a solar greenhouse according to claim 1, characterized in that: The step S1 comprises: S110. Reading greenhouse environmental data from the equipment in the greenhouse to construct a greenhouse data set, wherein the greenhouse environmental data includes indoor temperature, indoor humidity, soil temperature, soil humidity, indoor lighting and fan cooling and dehumidification parameters of the solar greenhouse; S120. Collecting greenhouse weather data from the official website of the Meteorological Bureau based on the time period and target area information, wherein the greenhouse weather data includes temperature, relative humidity, wind speed, precipitation and air pressure; S130. Merging the greenhouse external meteorological data into the greenhouse data set constructed in step S110 to form the greenhouse environment data set, wherein the greenhouse environment data set stores time series feature vectors; S140. Using DBSCAN algorithm to perform noise processing on the data in the greenhouse environment data set; S150. Screening the data after the noise processing in step S140; S160. Perform correlation analysis on the data screened in step S150, as shown in formula (1): Among them, X i is the i-th observation of variable X, Y i is the ith observation value of variable Y, All X i The arithmetic mean of All Y i The arithmetic mean of S170. Normalize the data after the correlation analysis in step S160, and map the data in the greenhouse environment data set to the range of [-1, 1] to obtain a prediction data set, as shown in formula (2): Among them, x represents the original value, mean(x) represents the sample mean, std represents the sample variance, and x′ represents the normalized value.
3. The method for predicting and controlling the intelligent environment of a solar greenhouse according to claim 2, characterized in that: In the step S110, the greenhouse environment data is read from the equipment in the greenhouse at a frequency of once per minute to construct the greenhouse data set.
4. The method for predicting and controlling the intelligent environment of a solar greenhouse according to claim 3, characterized in that: The step S150 includes completing the data after the noise reduction processing in step S140 based on the greenhouse data set dynamically collected in step S110, and performing data processing according to a preset aggregation window.
5. The method for predicting and controlling the intelligent environment of a solar greenhouse according to claim 4, characterized in that: After step S170, the following steps are further included: S180. Generate the prediction data set data using a sliding window based on a preset window size: {X,Y label }, where X is the input variable, Y label Actual data collected for the system; S190. Divide the prediction data set into a training set, a validation set, and a test set in a ratio of 6:2:
2.
6. A method for predicting and controlling the intelligent environment of a solar greenhouse according to claim 5, characterized in that: The step S2 comprises: S210. Constructing the input layer of the greenhouse temperature and humidity prediction model to preprocess the greenhouse environment data, including concatenating the indoor temperature and humidity data at the same time with the greenhouse external meteorological data into a new time series feature vector, and the data in the greenhouse environment data set is expressed as a two-dimensional matrix of time step × feature vector; S220. Constructing the convolutional neural network layer of the greenhouse temperature and humidity prediction model to capture the deep temporal and spatial characteristics of the input historical sequence, the convolutional neural network layer is obtained by connecting 2 convolutional layers, 1 maximum pooling layer, 2 convolutional layers, and 1 maximum pooling layer in series in sequence; S230. Performing a Flatten operation on the output data of the convolutional neural network layer; S240. Constructing a gated recurrent unit neural network layer of the greenhouse temperature and humidity prediction model, wherein the gated recurrent unit neural network layer has a two-layer structure, an activation function is a ReLU activation function, and the number of neurons is 64 and 128 respectively; S250. Denormalize the network output to obtain temperature and humidity prediction data.
7. A method for predicting and controlling the intelligent environment of a solar greenhouse according to claim 6, characterized in that: In step S220, the convolution layer is a 4-layer convolution layer with a convolution kernel of 3×3 and the number of convolution kernels being 16, 16, 32, and 32 respectively, and the convolution layer adopts a Relu activation function; The maximum pooling layer size is 2.
8. The method for predicting and controlling the intelligent environment of a solar greenhouse according to claim 7, characterized in that: The step S3 comprises: S310. Batch input the data X in the prediction data set into the greenhouse temperature and humidity prediction model to obtain greenhouse temperature and humidity prediction values; S320. Using the loss function to compare the greenhouse temperature and humidity prediction value with Y label Calculate the loss value and use the Adam optimizer to optimize the model's learnable parameters. The mean absolute error of the evaluation index is calculated as shown in formula (3): Among them, MAE represents the mean absolute error, N is the total number of prediction results, and y i is the actual temperature and humidity value of the i-th sampling point, Predict the temperature and humidity values for the i-th sampling point, The calculation of the root mean square error of the evaluation index is as shown in formula (4): Among them, RMSE means root mean square error, The calculation of the mean absolute percentage error of the evaluation index is as shown in formula (5): Wherein, MAPE stands for mean absolute percentage error, The calculation of the determination coefficient of the evaluation index is as shown in formula (6): Among them, R 2 represents the coefficient of determination, is the actual average temperature and humidity of the i-th sampling point; S330. Using the training set obtained in step S190 to train the greenhouse temperature and humidity prediction model, and recording the model training time when the loss function value of the model training tends to be stable. The shorter the training time, the higher the model prediction efficiency; S340. Using the validation set obtained in step S190, the hyperparameters of the greenhouse temperature and humidity prediction model are adjusted; S350. Output the greenhouse temperature and humidity prediction results.
9. The method for predicting and controlling the intelligent environment of a solar greenhouse according to claim 8, characterized in that: The step S4 comprises: S410. Construct a greenhouse environment control module based on a PID controller, wherein the PID controller is as shown in formula (7): Among them, U(t) is the control output, err(t) is the difference between the set value and the actual value, kp is the proportional gain, T I is the integration time constant, T D is the differential time constant; S420. Input the known optimal temperature and humidity information for crop growth into the greenhouse environment control module constructed in step S410; S430. The greenhouse environment control module calculates the greenhouse control equipment regulation strategy according to the greenhouse temperature and humidity prediction results and the optimal temperature and humidity information for crop growth, and adjusts the greenhouse environment.
10. The method for intelligent environmental prediction and control of a solar greenhouse according to claim 9, characterized in that: The step S410 of constructing a greenhouse environment control module based on a PID controller includes: S411. Initialize parameter control and set PID controller kp, T I and T D Parameters, set the initial greenhouse data of the greenhouse environment control module and the initial greenhouse external meteorological data; S412. Greenhouse temperature and humidity error calculation: in each PID control cycle, the error err(t) between the actual greenhouse temperature and humidity and the set greenhouse temperature and humidity is calculated; S413. Control output calculation, using formula (7) to calculate the control output U(t) of the greenhouse environment; S414. Execute greenhouse environment control action, and adjust the operation state of greenhouse control equipment according to the control output U(t); S415. Real-time monitoring and adjustment of greenhouse environment, continuous monitoring of greenhouse environment data changes, recording the error between the actual value and the target value, and regular adjustment of the PID control parameters kp, T I and T D ; S416. Greenhouse environment control feedback, establish a feedback mechanism, dynamically adjust the control target and the PID control parameters according to the actual greenhouse environment changes and crop growth needs; S417. Optimize greenhouse environmental control, using the greenhouse temperature and humidity prediction results of the greenhouse temperature and humidity prediction model to adjust the greenhouse control equipment control strategy in advance and adjust the greenhouse environment.
Citation Information
Patent Citations
Bearing metal temperature prediction method based on CNN-GRU algorithm
CN115358137A
Facility greenhouse temperature prediction method based on small samples
CN115796040A
Greenhouse agricultural product environment Internet of Things intelligent optimization monitoring method and system
CN116520917A
Intelligent constant-temperature control method based on low-temperature constant-temperature bath
CN117891286A
Improved bidirectional LSTM-based fusion network sunlight greenhouse temperature and humidity prediction method
CN117933488A
Cited By
Intelligent temperature and humidity regulation and control method for oyster mushrooms
CN119759154A
An intelligent temperature and humidity control method for Pleurotus ostreatus
CN119759154B
Greenhouse temperature data monitoring method and system based on data analysis
CN119845360A
Incremental PID (Proportion Integration Differentiation) control-based commercial crop remote sensing data complementation method and device
CN120448373A
Harmonic optimization method and system for photovoltaic power distribution network
CN120613729A