Greenhouse environment space distribution prediction method and device
By combining convolutional networks and time series networks in the prediction model, the problem of inaccurate prediction of environmental factor distribution in greenhouse mushroom growing rooms has been solved, achieving high-precision environmental prediction and control decisions, and improving the intelligent and automated management of greenhouse crop production.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-17
- Publication Date
- 2026-03-03
AI Technical Summary
Existing technologies cannot accurately predict the distribution of environmental factors inside greenhouse mushroom growing rooms, resulting in a lag in the regulation of the microclimate environment inside the growing rooms, which affects crop growth.
A prediction model combining convolutional networks and time series networks is adopted. By extracting and processing multiple sets of time series features of the indoor and outdoor environment of the greenhouse, the model is trained using an adaptive moment estimation optimization algorithm. Linear interpolation and mean method are combined to handle missing and outlier data, thereby achieving high-precision environmental prediction.
It has improved the accuracy and stability of greenhouse environment forecasting, reduced forecast errors and fluctuations, provided a precise basis for environmental regulation decisions, and enhanced the intelligent and automated management of greenhouse crop production.
Smart Images

Figure CN114297907B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural information processing, and in particular to a method and apparatus for predicting the spatial distribution of greenhouse environments. Background Technology
[0002] Most methods for regulating mushroom cultivation rooms in greenhouses rely on current environmental variables to make control decisions, which cannot address the significant lag in the microclimate environment within the mushroom cultivation room, thus hindering crop growth. Developing high-precision predictive models with the main environmental factors of the mushroom cultivation room as output variables can help predict the future distribution trends of these factors, serving as a crucial prerequisite for efficient and accurate environmental early warning and pre-regulation of mushroom cultivation rooms.
[0003] Environmental variables affecting the growth and development of edible fungi in greenhouse mushroom cultivation rooms are dynamic variables that change over time. These variables interact and are coupled with each other, exhibiting spatial variability and unevenness. Currently, based on their temporal and nonlinear characteristics, the prediction methods used for greenhouse mushroom cultivation room microclimates mainly include time series analysis, regression prediction, support vector machines, and artificial neural networks. However, these methods have significant limitations in predicting the complex and ever-changing microclimate data of mushroom cultivation rooms, making it difficult to accurately extract the temporal and spatial correlations of greenhouse environmental data, thus leading to inaccurate prediction results. Summary of the Invention
[0004] To address the problems existing in the prior art, the present invention provides a method and apparatus for predicting the spatial distribution of greenhouse environment.
[0005] This invention provides a method for predicting the spatial distribution of greenhouse environment, comprising: determining a feature vector matrix including multiple sets of time-series features based on multiple sets of environmental features at the current and previous times of the prediction point, wherein the environmental features include indoor and outdoor environmental features; inputting the feature vector matrix into the convolutional network of a trained prediction model for feature extraction to obtain an extracted global feature vector; inputting the global feature vector into the time-series network of the prediction model to output the predicted results of temperature, humidity, light intensity, and carbon dioxide content at the prediction point in the greenhouse after a preset time; wherein the prediction model is obtained by training based on the known indoor temperature, humidity, light intensity, and carbon dioxide content in the greenhouse after a preset time and determining samples of the feature vector matrix, and the prediction model includes a convolutional network and a time-series network.
[0006] According to an embodiment of the greenhouse environment spatial distribution prediction method of the present invention, the environmental characteristics inside the greenhouse include substrate temperature, air temperature, air humidity, light intensity and carbon dioxide concentration; the environmental characteristics outside the greenhouse include air humidity, air temperature and wind speed.
[0007] According to an embodiment of the greenhouse environment spatial distribution prediction method of the present invention, the environmental characteristics further include spatial sparse characteristics, which include regional characteristics, ventilation characteristics and humidification characteristics of the prediction point.
[0008] According to an embodiment of the greenhouse environment spatial distribution prediction method of the present invention, before determining the feature vector matrix including multiple sets of time series features based on multiple sets of environmental features at the current and previous times of the prediction point, the method further includes: imputing missing data using linear interpolation and smoothing outlier data using the mean method; wherein the imputation and smoothing methods respectively include:
[0009]
[0010]
[0011] Among them, 0 <i<j,x a+i For the missing data at time a+i, x a and x a+j For the original data at times a and a+j, x k This is abnormal data, x k-1 x k+1 These are adjacent valid data.
[0012] According to an embodiment of the present invention, the method for predicting the spatial distribution of greenhouse environment includes inputting the feature vector matrix into the convolutional network of a trained prediction model for feature extraction, comprising: inputting the feature vector matrix into the convolutional network, performing four convolutions through the convolutional network, and outputting a dimensionality-reduced global feature vector based on a flattening operation and an activation function; wherein, after every two convolutions, a max pooling operation is performed.
[0013] According to an embodiment of the present invention, a method for predicting the spatial distribution of greenhouse environment includes inputting the global feature vector into the time series network of the prediction model and outputting the predicted results of temperature, humidity, light intensity, and carbon dioxide content at predicted points in the greenhouse after a preset time period. This includes: inputting the global feature vector into the time series network, sequentially processing it through two layers of gated recurrent unit (GRU) network layers; and outputting the predicted results of temperature, humidity, light intensity, and carbon dioxide content in the greenhouse after a preset time period after inverse normalization, based on a fully connected layer with a linear rectified unit (RELU) activation function.
[0014] According to an embodiment of the present invention, a method for predicting the spatial distribution of greenhouse environment, before determining the feature vector matrix including multiple sets of time series features based on multiple sets of environmental features at the current and previous times of the prediction point, further includes: acquiring sample data of temperature and humidity, light intensity, and carbon dioxide content in the greenhouse after a known preset time period, respectively labeling temperature and humidity, light intensity, and carbon dioxide content as samples, and determining the feature vector matrix of the samples; using the sample data, adjusting the model parameters based on the adaptive moment estimation (Adam) optimization algorithm, and training to obtain the prediction model.
[0015] The present invention also provides a greenhouse environment spatial distribution prediction device, comprising: a data acquisition module, used to determine a feature vector matrix including multiple sets of time series features based on multiple sets of environmental features at the current and previous times of the prediction point, wherein the environmental features include greenhouse internal environmental features and greenhouse external environmental features; a first processing module, used to input the feature vector matrix into the convolutional network of a trained prediction model for feature extraction to obtain an extracted global feature vector; and a second processing module, used to input the global feature vector into the time series network of the prediction model and output the prediction results of temperature, humidity, light intensity, and carbon dioxide content at the prediction point in the greenhouse after a preset time; wherein the prediction model is obtained by training based on the known temperature, humidity, light intensity, and carbon dioxide content in the greenhouse after a preset time and the samples of the feature vector matrix, and the prediction model includes a convolutional network and a time series network.
[0016] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the above-described methods for predicting the spatial distribution of greenhouse environments.
[0017] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the greenhouse environment spatial distribution prediction method as described above.
[0018] The greenhouse environment spatial distribution prediction method and device provided by this invention can accurately mine the characteristics of large lag, temporal sequence, nonlinearity, and spatial distribution differences of greenhouse microclimate environmental data by extracting multiple sets of time series features of features inside and outside the greenhouse. Combining convolutional networks can better handle feature correlation, and combining time series networks can better mine time correlation, thereby reducing prediction errors and fluctuations. It can more accurately predict the spatial distribution trend of multi-point environment in the greenhouse at future times, and provide a decision-making basis for the overall environmental regulation of the greenhouse. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 This is one of the flowcharts illustrating the greenhouse environment spatial distribution prediction method provided by the present invention;
[0021] Figure 2 This is the second flowchart of the greenhouse environment spatial distribution prediction method provided by the present invention;
[0022] Figure 3 This is a structural diagram of the CNN-GRU neural network model provided by the present invention;
[0023] Figure 4 This is a diagram of the internal structure unit of the GRU provided by the present invention;
[0024] Figure 5 This is a schematic diagram of the greenhouse environment spatial distribution prediction device provided by the present invention;
[0025] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0027] This invention can be applied to predict the distribution of environmental characteristics in mushroom houses, and can also be applied to predict the indoor environmental characteristics of greenhouses for other crops. The following example illustrates this through the prediction of mushroom house environment.
[0028] The following is combined Figures 1-6 The present invention describes a method and apparatus for predicting the spatial distribution of greenhouse environments. Figure 1 This is one of the flowcharts illustrating the greenhouse environment spatial distribution prediction method provided by the present invention, such as... Figure 1 As shown, the present invention provides a method for predicting the spatial distribution of greenhouse environments, including:
[0029] 101. Based on multiple sets of environmental features at the current and previous times of the prediction point, determine a feature vector matrix including multiple sets of time series features, wherein the environmental features include indoor greenhouse environmental features and outdoor greenhouse environmental features;
[0030] Previously, the entire model was built upon a foundation of massive amounts of indoor environmental data from greenhouse mushroom houses and outdoor meteorological data for training. For example, three data loggers were evenly placed in each of two mushroom houses to collect indoor environmental data. Every twenty minutes, the instruments transmitted the data to a server for storage via a GPRS network module. The downloaded data was saved as an Excel file, and one-hot encoding was used to encode the environmental features, resulting in the processed indoor environmental characteristics. Outdoor meteorological data was collected from an outdoor weather station 20 meters from the greenhouse mushroom houses. 90% of the data from each collection point was used as the training set, and 10% as the test set, resulting in the processed outdoor environmental characteristics. Multiple sets of environmental features could be collected at fixed time steps, such as collecting environmental features every 20 minutes.
[0031] During prediction, the collection and training of multiple sets of environmental features are identical, ultimately generating a feature vector matrix. For example, the environmental features inside the greenhouse include substrate temperature, air temperature, air humidity, light intensity, and carbon dioxide concentration, while the environmental features outside the greenhouse include air humidity, air temperature, and wind speed. Finally, a two-dimensional matrix of time step × feature vector is obtained.
[0032] This invention may include various data preprocessing methods, such as normalization:
[0033] All parameters and the target variable are normalized. The calculation formula includes:
[0034]
[0035] In the formula, x max x is the maximum value; min The minimum value; x * This is the normalized value.
[0036] 102. Input the feature vector matrix into the convolutional network of the trained prediction model to extract features and obtain the extracted global feature vector.
[0037] Convolutional networks primarily capture deep-seated features and patterns in the input historical sequence, reducing the dimensionality of the extracted high-dimensional features, compressing the data, and accelerating processing efficiency. The final result is a dimensionality-reduced global feature vector obtained through convolutional network processing. For the specific construction of the input layer, refer to the convolutional networks used in image recognition processing.
[0038] 103. Input the global feature vector into the time series network of the prediction model, and output the predicted results of temperature, humidity, light intensity, and carbon dioxide content at the predicted points in the greenhouse after a preset time. The prediction model is obtained by training based on the known temperature, humidity, light intensity, and carbon dioxide content in the greenhouse after a preset time, and by determining the samples of the feature vector matrix. The prediction model includes a convolutional network and a time series network.
[0039] Time series networks learn global feature vectors extracted by convolutional networks. Time series networks can include networks such as GRU and LSTM.
[0040] The prediction model is trained using samples of temperature, humidity, light intensity, and carbon dioxide content within the greenhouse after a predetermined time period. The model comprises a two-layer network structure: a convolutional network and a time-series network. The parameters input to the model are feature vector matrices extracted using the same method as described in section 101.
[0041] The greenhouse environment spatial distribution prediction method of the present invention can accurately mine the characteristics of large lag, temporal sequence, nonlinearity and spatial distribution difference of greenhouse microclimate environmental data by extracting multiple sets of time series features of features inside and outside the greenhouse. Combining convolutional networks can better handle feature correlation, and combining time series networks can better mine time correlation, thereby reducing prediction error and volatility. It can more accurately predict the spatial distribution trend of multi-point environment in the greenhouse in the future, and provide a decision basis for the overall environmental regulation of the greenhouse.
[0042] This invention applies a greenhouse mushroom house prediction and early warning system with deep learning to greenhouse edible fungi production, enabling intelligent perception of the environment, growth, and information of edible fungi. By predicting environmental changes as the basis for altering the growth environment, it changes traditional environmental control and decision-making management methods, improving management efficiency while reducing human resources, and realizing intelligent and automated greenhouse crop production.
[0043] In one embodiment, the environmental characteristics inside the greenhouse include substrate temperature, air temperature, air humidity, light intensity, and carbon dioxide concentration; the environmental characteristics outside the greenhouse include air humidity, air temperature, and wind speed, as illustrated above.
[0044] In one embodiment, the environmental features further include spatial sparse features, which include regional features of the prediction point, ventilation features, and humidification features.
[0045] When windows are opened for ventilation, humidifiers are turned on and off, or there are brief changes in outdoor weather, indoor temperature and humidity levels can fluctuate significantly, affecting prediction accuracy. To obtain a more accurate prediction result, this embodiment of the invention takes spatial sparseness into account.
[0046] The regional features can include the distance between the prediction point and the ventilation and humidification systems. Ventilation features can include whether ventilation is in place and the air volume. Humidification features can include whether humidification is in place and the degree of humidification. Quantifying this information yields the corresponding spatial sparsity features.
[0047] Specifically, in this embodiment of the invention, the air temperature, relative humidity, and carbon dioxide concentration at a certain moment in the mushroom house, as well as the outdoor air temperature, outdoor air humidity, outdoor wind speed, indoor substrate temperature, indoor light intensity, environmental distribution characteristics, ventilation characteristics, and humidification characteristics are concatenated into a new time series feature vector. The historical outdoor meteorological data and indoor microclimate data of the mushroom house, as well as the current outdoor meteorological data and indoor microclimate data of the mushroom house, are expressed as a two-dimensional matrix of time step × feature vector. After preprocessing, this matrix is input into the prediction model.
[0048] This invention incorporates regional features, ventilation features, and humidification features into time series features. Based on temporal correlation, it can further explore the spatial correlation between various features, thereby improving prediction accuracy.
[0049] In one embodiment, before determining the feature vector matrix of multiple time series based on the environmental characteristics inside and outside the greenhouse at different times before the current time, the method further includes: interpolating missing data using linear interpolation and smoothing outlier data using the mean method.
[0050] The interpolation and smoothing methods respectively include:
[0051]
[0052]
[0053] Where, x a+i For the missing data at time a+i, x a and x a+j For the original data at times a and a+j, x k This is abnormal data, x k-1 x k+1 These are adjacent valid data.
[0054] Because the humidity levels in greenhouses such as mushroom houses are high, the accuracy of sensors placed inside for monitoring for extended periods can be affected. Furthermore, issues such as network transmission quality, equipment malfunctions, and human interference can lead to data anomalies and missing data during data acquisition. Therefore, linear interpolation using formula (2) is used to fill in short-term data gaps. If a large amount of data is lost or the time interval is long, data from the same weather type or the same time period within a few adjacent days is used to fill the gaps. For abnormal data processing, the mean method using formula (3) is used for data smoothing and repair.
[0055] In one embodiment, the step of inputting the feature vector matrix into the convolutional network layer of the trained prediction model for feature extraction includes: inputting the feature vector matrix into the convolutional network, performing four convolutions through the convolutional network, and outputting a dimensionality-reduced global feature vector based on a flattening operation and an activation function; wherein, after every two convolutions, a max pooling operation is performed.
[0056] When the greenhouse is used as a mushroom house, considering the complex and variable microclimate environment of the input data, this invention specifically designs four convolutional layers (Conv2D), with the number of convolutional kernels being 16, 16, 32, and 32 respectively, and selecting the ReLU activation function for activation. Max pooling (MaxPooling2D) is performed after every two consecutive convolutions. To fully utilize the existing mushroom house environmental distribution data, this invention sets the convolutional kernel size to 3×3 and the pool size to 2. Finally, a flattening operation is performed, transforming the multidimensional feature vector into a one-dimensional global feature vector, thus reducing dimensionality and converting it into a global feature vector as the input to the GRU layer.
[0057] The greenhouse environment spatial distribution prediction method of this invention, through the characteristics of local connectivity and weight sharing of CNN, can capture high-level features while reducing the dimensionality of pooling layer features, thereby reducing parameters.
[0058] In one embodiment, the step of inputting the global feature vector into the time series network of the prediction model and outputting the predicted results of temperature, humidity, light intensity, and carbon dioxide content at the predicted points in the greenhouse after a preset time period includes: inputting the global feature vector into the time series network and performing feature processing through two layers of GRU network in sequence; and outputting the predicted results of temperature, humidity, light intensity, and carbon dioxide content in the greenhouse after a preset time period after inverse normalization based on the fully connected layer with the ReLU activation function.
[0059] Figure 2This is the second flowchart illustrating the greenhouse environment spatial distribution prediction method provided by this invention. As shown in the figure, through continuous improvement of the experiments conducted by this invention, it was found that constructing a two-layer GRU structure achieved the best prediction effect. The activation function used was the ReLU activation function, with 64 and 128 neurons respectively. Finally, the fully connected (Dense) layer is denormalized and outputs the temperature, humidity, and carbon dioxide vectors after a preset time, such as 20 minutes. Figure 3 This is a structural diagram of the CNN-GRU neural network model provided by this invention, which can be found here. Figure 3 . Figure 4 This is a diagram of the internal structure of the GRU provided by the present invention, such as... Figure 4 As shown, the calculation formula for a gated recurrent unit neural network (GRU) is as follows:
[0060]
[0061] In the formula, r t and z t These are the reset door and the update door, respectively. r To reset the weight matrix of the gate, W z To update the weight matrix of the gate. x t For input, h t The output of the hidden layer, Is input x t and past hidden state h t-1 In summary, σ(·) is the activation function sigmoid; tanh(·) is the activation function tanh.
[0062] The greenhouse environmental spatial distribution prediction method of this invention, through the combination of CNN-GRU, significantly speeds up the training time compared to LSTM neural networks and GRU neural networks, and also results in lower model loss and better prediction performance. The results show that CNN-GRU has excellent adaptability to complex and variable mushroom house microclimate data, while also improving model operating efficiency.
[0063] In one embodiment, before determining the feature vector matrix including multiple sets of time series features based on multiple sets of environmental features at the current and previous times of the prediction point, the method further includes: acquiring sample data of temperature and humidity, light intensity, and carbon dioxide content in the greenhouse after a known preset time period, using temperature and humidity, light intensity, and carbon dioxide content as labels for the samples, and determining the feature vector matrix of the samples; using the sample data, adjusting the model parameters based on the Adam optimization algorithm, and training the prediction model.
[0064] This invention sets the model's time step to 9 minutes and uses the Adam optimization algorithm to continuously adjust the model's parameters. The Adam optimization algorithm is an extension of the stochastic gradient descent algorithm, combining the advantages of Adagrad and RMSProp algorithms. It is suitable for large-scale data and can more efficiently optimize model performance. To avoid the model getting trapped in local minima, after multiple experiments and analyses, this embodiment sets the initial learning rate to 0.001, adjusting it to 10% of the original rate every 100 iterations until the loss value stabilizes, at which point the model's performance reaches its best.
[0065] Examples of the present invention:
[0066] Taking the application of greenhouse mushroom houses as an example, the greenhouse prediction and early warning system can evaluate the overall environmental performance of the mushroom houses through the spatial distribution prediction results of the greenhouse mushroom houses of this invention, and provide accurate early warning and control decision information.
[0067] Data acquisition and preprocessing: Indoor environmental data is acquired through six data acquisition devices distributed in two adjacent greenhouse mushroom houses (three in each greenhouse), with data points encoded using One-hot encoding. The monitoring equipment utilizes greenhouse cloud environmental data acquisition devices, each mounted on a tripod. Each data acquisition device measures air temperature, relative humidity, soil temperature, CO2, and light intensity, sending the data to a remote cloud server for storage at set time intervals (20 minutes). Outdoor meteorological data, such as air temperature, relative humidity, and wind speed, are automatically collected by a HOBO weather station approximately 20 meters away. The greenhouse forecasting and early warning system can use web crawling technology to retrieve indoor environmental and outdoor meteorological data in real time. Administrators can also manually access and read the downloaded data. Before issuing forecasts and warnings, management personnel need to process any abnormal data through a data preprocessing step.
[0068] Greenhouse Prediction and Early Warning System Construction: The prediction and early warning system is built using PyCharm, developed with PyQt5 and QtDesigner. The prediction model is implemented based on the Keras deep learning tool, with Tensorflows deep learning framework as the backend support, and Python as the programming language. The prediction and early warning system mainly consists of three modules: data acquisition, data prediction, and data early warning. It encapsulates the suitable growth conditions for different edible fungi, combining spatial distribution prediction results with the encapsulated suitable environmental conditions to provide early warnings and control decision-making information for each region. The decision-making information is transmitted to the application layer, enabling personnel involved in greenhouse mushroom production to clearly understand the growth status and environmental information of greenhouse edible fungi.
[0069] The greenhouse environment spatial distribution prediction device provided by the present invention is described below. The greenhouse environment spatial distribution prediction device described below and the greenhouse environment spatial distribution prediction method described above can be referred to and correspond to each other.
[0070] Figure 5 This is a schematic diagram of the greenhouse environment spatial distribution prediction device provided by the present invention, as shown below. Figure 5 As shown, the greenhouse environmental spatial distribution prediction device includes: a data acquisition module 501, a first processing module 502, and a second processing module 503. The data acquisition module 501 determines a feature vector matrix comprising multiple sets of time-series features based on multiple sets of environmental features at the current and previous times of the prediction point. These environmental features include both internal and external greenhouse environmental features. The first processing module 502 inputs the feature vector matrix into the convolutional network of a trained prediction model for feature extraction, obtaining an extracted global feature vector. The second processing module 503 inputs the global feature vector into the time-series network of the prediction model, outputting prediction results for temperature, humidity, light intensity, and carbon dioxide content at the prediction point within the greenhouse after a preset time. The prediction model is obtained by training based on known internal greenhouse temperature, humidity, light intensity, and carbon dioxide content after a preset time, and by determining samples of the feature vector matrix. The prediction model includes a convolutional network and a time-series network.
[0071] The apparatus embodiments provided in this invention are for implementing the above-described method embodiments. For specific processes and details, please refer to the above-described method embodiments, which will not be repeated here.
[0072] The greenhouse environment spatial distribution prediction device provided in this invention can accurately mine the characteristics of large lag, temporal sequence, nonlinearity, and spatial distribution differences in greenhouse microclimate environmental data by extracting multiple sets of time series features of features inside and outside the greenhouse. Combining convolutional networks can better handle feature correlations, and combining time series networks can better mine time correlations, thereby reducing prediction errors and fluctuations. It can more accurately predict the spatial distribution trend of multi-point environment in the greenhouse at future times, and can provide a decision-making basis for the overall environmental regulation of the greenhouse.
[0073] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 6As shown, the electronic device may include: a processor 601, a communication interface 602, a memory 603, and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604. The processor 601 can call logical instructions in the memory 603 to execute a greenhouse environment spatial distribution prediction method. This method includes: determining a feature vector matrix comprising multiple sets of time-series features based on multiple sets of environmental features at the current and previous times of the prediction point, wherein the environmental features include both indoor and outdoor environmental features; inputting the feature vector matrix into a trained prediction model's convolutional network for feature extraction to obtain an extracted global feature vector; inputting the global feature vector into the prediction model's time-series network to output prediction results for temperature, humidity, light intensity, and carbon dioxide content at the prediction point within the greenhouse after a preset time period; wherein the prediction model is obtained by training based on known indoor temperature, humidity, light intensity, and carbon dioxide content within the greenhouse after a preset time period, and by determining samples of the feature vector matrix; the prediction model includes a convolutional network and a time-series network.
[0074] Furthermore, the logical instructions in the aforementioned memory 603 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0075] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, wherein when the program instructions are executed by a computer, the computer is able to execute the greenhouse environment spatial distribution prediction method provided by the above methods, the method comprising: determining a feature vector matrix comprising multiple sets of time series features based on multiple sets of environmental features at the current and previous times of the prediction point, wherein the environmental features include greenhouse internal environmental features and greenhouse external environmental features; inputting the feature vector matrix into a convolutional network of a trained prediction model for feature extraction to obtain an extracted global feature vector; inputting the global feature vector into the time series network of the prediction model to output the prediction results of temperature, humidity, light intensity and carbon dioxide content at the prediction point in the greenhouse after a preset time; wherein the prediction model is obtained by training based on the known temperature, humidity, light intensity and carbon dioxide content in the greenhouse after a preset time and determining samples of the feature vector matrix, the prediction model comprising a convolutional network and a time series network.
[0076] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the greenhouse environment spatial distribution prediction method provided in the above embodiments. The method includes: determining a feature vector matrix comprising multiple sets of time-series features based on multiple sets of environmental features at the current and previous times of the prediction point, wherein the environmental features include indoor and outdoor environmental features; inputting the feature vector matrix into a convolutional network of a trained prediction model for feature extraction to obtain an extracted global feature vector; inputting the global feature vector into the time-series network of the prediction model to output prediction results of temperature, humidity, light intensity, and carbon dioxide content at the prediction point in the greenhouse after a preset time; wherein the prediction model is obtained by training based on known indoor temperature, humidity, light intensity, and carbon dioxide content after a preset time and by determining samples of the feature vector matrix, and the prediction model includes a convolutional network and a time-series network.
[0077] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0078] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0079] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method of predicting the spatial distribution of a greenhouse environment, characterized in that, The method comprises the steps of: According to the multiple sets of environment characteristics of the prediction point at the current and previous time, a feature vector matrix including multiple sets of time series characteristics is determined, wherein the environment characteristics include indoor and outdoor environment characteristics of the greenhouse; The feature vector matrix is input into the convolution network of the trained prediction model for feature extraction, and a global feature vector after extraction is obtained; The global feature vector is input into the time series network of the prediction model, and the temperature and humidity, light intensity, and carbon dioxide content prediction results of the prediction point in the greenhouse after a preset time are output; The prediction model is obtained after training according to the known temperature and humidity, light intensity, and carbon dioxide content in the greenhouse after a preset time and the determination of the feature vector matrix, and the prediction model comprises a convolution network and a time series network; The environment characteristics also include spatial sparse characteristics, and the spatial sparse characteristics include regional characteristics, ventilation characteristics, and humidification characteristics of the prediction point; The global feature vector is input into the time series network, and the global feature vector is sequentially processed by two layers of gated recurrent unit network layers of the time series network; According to the full connection layer based on the linear rectification activation function, the temperature and humidity, light intensity, and carbon dioxide content prediction results in the greenhouse after a preset time are output after inverse normalization. The indoor environment characteristics of the greenhouse include substrate temperature, air temperature, air humidity, light intensity, and carbon dioxide concentration; 2. The method of claim 1, wherein, The outdoor environment characteristics of the greenhouse include air humidity, air temperature, and wind speed. Before determining the feature vector matrix including multiple sets of time series characteristics according to the multiple sets of environment characteristics of the prediction point at the current and previous time, the method further comprises the steps of:
3. The method of claim 1, wherein, The missing data is interpolated by a linear interpolation method, and the abnormal data is smoothed by a mean method; The interpolation and smoothing methods respectively comprise: The feature vector matrix is input into the convolution network of the trained prediction model for feature extraction, and a global feature vector after extraction is obtained; Wherein, 0 < i < j, x a+i is the missing data at a+i moment, x a and x a+j are the original data at a and a+j moment, x k is the abnormal data, x k-1 , x k+1 is x k adjacent valid data.
4. The method of claim 1, wherein, The feature vector matrix is input into the convolution network, and the global feature vector after dimension reduction is output after four convolutions of the convolution network, flattening operation, and activation function; After each two convolutions, maximum pooling is performed. Before determining the feature vector matrix including multiple sets of time series characteristics according to the multiple sets of environment characteristics of the prediction point at the current and previous time, the method further comprises the steps of:
5. The method of claim 1, wherein, Sample data of the known temperature and humidity, light intensity, and carbon dioxide content in the greenhouse after a preset time are obtained, the temperature and humidity, light intensity, and carbon dioxide content are respectively taken as labels of the sample, and the feature vector matrix of the sample is determined; The model parameters are adjusted based on the adaptive matrix estimation optimization algorithm by using the sample data, and the prediction model is trained. The method comprises the steps of:
6. A device for predicting the spatial distribution of a greenhouse environment, characterized in that A data acquisition module is configured to determine a feature vector matrix including multiple sets of time series characteristics according to multiple sets of environment characteristics of a prediction point at a current and previous time, wherein the environment characteristics include indoor and outdoor environment characteristics of a greenhouse; The first processing module is configured to input the feature vector matrix into a convolution network of a trained prediction model for feature extraction to obtain an extracted global feature vector; The second processing module is configured to input the global feature vector into a time series network of the prediction model to output a prediction result of the temperature and humidity, light intensity, and carbon dioxide content in the greenhouse after a preset time period; The prediction model is obtained after training according to known temperature and humidity, light intensity, and carbon dioxide content in the greenhouse after a preset time period and determination of the sample of the feature vector matrix, and the prediction model comprises the convolution network and the time series network; The environmental features further comprise spatial sparse features, and the spatial sparse features comprise regional features, ventilation features, and humidification features of the prediction point; and the second processing module is specifically configured to: input the global feature vector into the time series network, and sequentially perform feature processing on the global feature vector through two layers of gated recurrent unit network layers of the time series network; output the prediction result of the temperature and humidity, light intensity, and carbon dioxide content in the greenhouse after a preset time period through a full connection layer based on a linear rectifier activation function after de-normalization.
7. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the steps of the greenhouse environmental spatial distribution prediction method according to any one of claims 1 to 5.
8. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the greenhouse environmental spatial distribution prediction method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Greenhouse environment regulation and control method and system with environment factor prediction function
CN112527037A