Greenhouse climate prediction control method and device, electronic equipment and storage medium
Through deep neural network, Bayesian inference and random chance constraint technology, the problem of insufficient accuracy and adaptability of traditional greenhouse climate control technology is solved, high-precision and efficient greenhouse climate control are achieved, and modern production needs are met.
Patent Information
- Application Number
- CN202411181161.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2025-01-10
AI Technical Summary
Traditional greenhouse climate control technology is difficult to achieve high accuracy and adaptability, and cannot meet the needs of modern production. How to better predictive control of greenhouse climate has become an urgent problem that the industry needs to solve.
Using deep neural network technology, Bayesian inference technology and stochastic opportunity constraint optimization technology, the optimization problem of greenhouse climate control is established and solved through multi-source data fusion, nonlinear dynamic model training, parameter uncertain propagation and multi-objective optimization. , obtain high-precision and adaptable control strategies.
It achieves high accuracy, high adaptability, high efficiency and high reliability of greenhouse climate control, improves the effects and benefits of climate control, meets crop growth needs and reduces energy consumption and environmental impacts.
Smart Images

Figure CN119292365A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of agricultural technology, and in particular to a greenhouse climate prediction and control method, device, electronic equipment and storage medium. Background Art
[0002] Greenhouse production systems use artificial control to simulate and adjust the climate conditions inside and outside the greenhouse to promote the growth and development of crops. Climate control in greenhouse production systems usually refers to adjusting the greenhouse's control inputs (such as temperature, humidity, light, carbon dioxide, etc.) according to the needs and goals of the crops to affect the greenhouse's output (crop growth status), thereby achieving the goals of the greenhouse production system (such as maximizing yield and quality, minimizing energy consumption and environmental impact, etc.).
[0003] The traditional climate control technology method of greenhouse production systems is mainly based on experience and expert knowledge to formulate fixed control rules, such as set values and control ranges of temperature, humidity, light, etc., to control the control input of the greenhouse. However, this adjustment method is often not precise enough to meet the needs of modern production. Therefore, how to better predict and control the greenhouse climate has become an urgent problem to be solved in the industry. Summary of the invention
[0004] The present invention provides a greenhouse climate prediction and control method, device, electronic device and storage medium to solve the problem of how to better perform greenhouse climate prediction and control in the prior art, which has become an urgent problem to be solved in the industry.
[0005] The present invention provides a greenhouse climate prediction and control method, comprising: Acquire climate data and crop data in the greenhouse, and fuse multi-source data to obtain multi-source fusion data; Based on the multi-source fusion data, taking the crop growth status as output, training and validating a deep neural network, and obtaining a nonlinear dynamic model of the greenhouse climate system; Through Bayesian inference technology, the parameters of the nonlinear dynamics model are used as random variables, and the climate data inside and outside the greenhouse are used as observation data to establish the posterior distribution of parameter uncertainty, thereby obtaining the posterior distribution model of output uncertainty; According to the nonlinear dynamics model of greenhouse climate system, the posterior distribution model of parameter uncertainty and the goal of greenhouse production system, a multi-objective random chance constrained MPC optimization problem is established. The multi-objective random chance constrained MPC optimization problem is solved to obtain the control input and control strategy of the greenhouse.
[0006] According to a greenhouse climate prediction and control method provided by the present invention, the step of acquiring climate data and crop data in the greenhouse and fusing multi-source data to obtain multi-source fused data includes: Represent the climate data and crop data inside and outside the greenhouse as vectors and summarize them into a data matrix; The multi-layer perceptron is used as the data fusion model, and the model parameters are optimized by the stochastic gradient descent method to obtain the fused feature data matrix; Using isolation forest as an anomaly detection model, outliers and noise in the feature data matrix are identified and removed; The feature data matrix is screened through mutual information to obtain multi-source fusion data.
[0007] According to a greenhouse climate prediction and control method provided by the present invention, the training method of the nonlinear dynamic model of the greenhouse climate system is specifically as follows: The time-varying characteristics of the greenhouse climate system are captured through a bidirectional long short-term memory network, the multi-input and multi-output characteristics of the greenhouse climate system are enhanced through an attention mechanism, and the depth and complexity of the greenhouse climate system are increased through residual connections; The cross entropy is used as the loss function of the model, and the parameters of the model are optimized by stochastic gradient descent method; The model's fit and generalization ability were evaluated through cross-validation methods, and the model's structure and parameters were adjusted; Through deep reinforcement learning technology, the nonlinear dynamic model of the greenhouse climate system is automatically explored and learned with the goal of the greenhouse production system as the reward function; Through meta-learning technology, a universal model is learned through data from multiple different greenhouse climate systems, and through model compression technology, the parameters and calculation amount of the model are reduced to obtain a nonlinear dynamic model of the greenhouse climate system.
[0008] According to a greenhouse climate prediction and control method provided by the present invention, the posterior distribution of parameter uncertainty is established by using Bayesian inference technology, taking the parameters of the nonlinear dynamic model as random variables and the climate data inside and outside the greenhouse as observation data, thereby obtaining a posterior distribution model of output uncertainty, including: By using Bayesian inference technology, the parameters of the nonlinear dynamic model are used as random variables, and the climate data inside and outside the greenhouse are used as observation data, a posterior distribution of parameter uncertainty is established, thereby obtaining a distribution of output uncertainty; Gaussian process techniques are used to establish the posterior distribution of parameter uncertainty in a non-parametric way; Using a reparameterization technique, sampling parameter uncertainty from a posterior distribution of the parameter uncertainty and propagating the parameter uncertainty to an output of the model; Monte Carlo technology is used to sample parameter uncertainty from the posterior distribution of the parameter uncertainty in a random manner, and the parameter uncertainty is propagated to the output of the model to obtain a posterior distribution model of the output uncertainty.
[0009] According to a greenhouse climate prediction and control method provided by the present invention, a multi-objective random chance constrained MPC optimization problem is established based on a nonlinear dynamic model of a greenhouse climate system, a posterior distribution model of parameter uncertainty, and a target of a greenhouse production system, including: With the goal of meeting crop needs while maximizing yield and quality and minimizing energy consumption and environmental impact, multi-criteria decision making (MCDM) technology is used to weigh and rank multiple objectives of the greenhouse production system in a systematic and quantitative way. Through random chance constraints, the distribution of output uncertainty is guaranteed to meet the preset conditions with preset probability, and fuzzy logic technology is used to express the conditions and probabilities of random chance constraints in a flexible and fuzzy way to establish a multi-objective random chance constrained MPC optimization problem.
[0010] According to a greenhouse climate prediction and control method provided by the present invention, the multi-objective random chance constraint MPC optimization problem is solved to obtain the control input and control strategy of the greenhouse, including: Using adaptive moment estimation technology as a stochastic gradient descent optimizer to update the decision variables of the optimization problem in the direction of the gradient; Through the proximal strategy optimization technology, the strategy variables of the optimization problem are updated with the tailored objective function, and according to the alternating direction multiplier method technology, the decomposition and coordination of the optimization problem are processed to obtain the control input and control strategy of the greenhouse.
[0011] According to a greenhouse climate prediction and control method provided by the present invention, after solving the multi-objective random chance constraint MPC optimization problem to obtain the control input and control strategy of the greenhouse, the method further includes: According to the solution of the optimization problem, the climate control of the greenhouse production system is implemented to adjust the control input of the greenhouse and affect the output of the greenhouse, that is, the growth status of the crops; Use visualization technology to show the process and results of climate control in greenhouse production systems in the form of graphics and animations; Using reinforcement learning technology, the greenhouse control strategy is continuously updated and optimized with the effect and benefit of the climate control of the greenhouse production system as the reward function.
[0012] The present invention also provides a greenhouse climate prediction and control device, comprising: A fusion module is used to obtain climate data and crop data in the greenhouse and fuse multi-source data to obtain multi-source fused data; A training module, for training and verifying a deep neural network based on the multi-source fusion data and taking the crop growth status as output, to obtain a nonlinear dynamic model of a greenhouse climate system; An inference module is used to establish a posterior distribution of parameter uncertainty by using Bayesian inference technology, taking the parameters of the nonlinear dynamics model as random variables and the climate data inside and outside the greenhouse as observation data, thereby obtaining a posterior distribution model of output uncertainty; Establishing a module for establishing a multi-objective random chance constrained MPC optimization problem based on a nonlinear dynamics model of the greenhouse climate system, a posterior distribution model of parameter uncertainty, and the objectives of the greenhouse production system; The solution module is used to solve the multi-objective random chance constrained MPC optimization problem to obtain the control input and control strategy of the greenhouse.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any one of the greenhouse climate prediction and control methods described above is implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the greenhouse climate prediction and control method as described in any one of the above is implemented.
[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the greenhouse climate prediction and control method as described above is implemented.
[0016] The greenhouse climate prediction and control method, device, electronic device and storage medium provided by the present invention realize the method of climate control of greenhouse production system through deep neural network technology, Bayesian inference technology and random chance constrained optimization technology. The method of the present invention can effectively simulate and learn the dynamic model of greenhouse climate system, effectively model and propagate parameter uncertainty and output uncertainty of greenhouse climate system, effectively establish and solve the multi-objective random chance constrained optimization problem of greenhouse production system, thereby realizing the improvement of climate control effect and benefit of greenhouse production system. The method of the present invention has the advantages of high precision, high adaptability, high efficiency, high reliability and high robustness. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 A schematic diagram of a greenhouse climate prediction and control method flow chart provided in an embodiment of the present application; Figure 2 A schematic diagram of the structure of a greenhouse climate prediction and control device provided in an embodiment of the present application; Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0020] In the embodiments of the present application, the climate control technology of the greenhouse production system is also constantly innovating and improving, which is mainly reflected in the following three aspects of technical progress: Deep neural network technology. It uses multi-layer artificial neural networks to simulate and learn the dynamic models and control strategies of complex systems. Deep neural network technology has powerful nonlinear fitting and adaptive learning capabilities, and can automatically extract and represent the characteristics and laws of the system from a large amount of data, thereby avoiding dependence on prior knowledge and assumptions of the system and improving the accuracy and adaptability of the system. The application of deep neural network technology in the climate control of greenhouse production systems mainly includes the following aspects: First, deep neural network technology, such as long short-term memory network, attention mechanism, residual connection, etc., is used to approximate the nonlinear dynamic model of the greenhouse climate system, so as to achieve efficient and accurate prediction of the greenhouse output; Second, deep neural network technology, such as convolutional neural network, autoencoder, variational autoencoder, etc., is used to effectively process the climate data and crop data inside and outside the greenhouse, such as data fusion, anomaly detection, feature selection, dimensionality reduction, etc., so as to improve the quality and efficiency of the data; Third, deep neural network technology, such as deep reinforcement learning, meta-learning, model compression, etc., is used to optimize the training and verification of the dynamic model and control strategy of the greenhouse climate system, such as automated exploration and learning, rapid generalization and migration, efficient operation and storage, etc., so as to improve the autonomy and adaptability, generalization and migration capabilities, efficiency and deployability of the model.
[0021] Bayesian inference technology uses probability theory and statistical methods to model and propagate the parameter uncertainty and output uncertainty of complex systems. Bayesian inference technology has powerful uncertainty quantification and processing capabilities, and can automatically update and represent the uncertainty of the system from limited data, thereby avoiding assumptions and restrictions on the prior distribution and form of uncertainty, and improving the flexibility and expression of uncertainty. The application of Bayesian inference technology in the climate control of greenhouse production systems mainly includes the following aspects: First, Bayesian inference techniques, such as Gaussian process, Markov chain Monte Carlo, etc., are used to model and propagate the posterior distribution of parameter uncertainty of greenhouse climate systems, so as to achieve effective and reliable expression and processing of parameter uncertainty; Second, Bayesian inference techniques, such as reparameterization techniques, variational inference, etc., are used to sample parameter uncertainty from the posterior distribution of parameter uncertainty and propagate it to the output of the model to obtain the distribution of output uncertainty, so as to achieve effective and reliable expression and processing of output uncertainty; Third, Bayesian inference techniques, such as Bayesian optimization, Bayesian experimental design, etc., are used to optimize the sampling and propagation of parameter uncertainty and output uncertainty of greenhouse climate systems, such as automated sampling and propagation, optimal sampling and propagation, etc., so as to improve the accuracy and reliability of uncertainty.
[0022] Random chance constrained optimization technology. A technology that uses random optimization and chance constraints to establish and solve multi-objective optimization problems of complex systems. Random chance constrained optimization technology has powerful multi-objective trade-off and optimization capabilities. It can quantify and sort the system's goals from multiple angles and levels, thereby avoiding conflicts and contradictions between goals and improving the consistency and solvability of optimization problems. The application of random chance constrained optimization technology in climate control of greenhouse production systems mainly includes the following aspects: First, using random chance constrained optimization technology, such as multi-criteria decision-making, fuzzy logic, etc., to establish multi-objective random chance constrained optimization problems, thereby achieving reasonable and feasible trade-offs and optimization of the goals of greenhouse production systems; second, using random chance constrained optimization technology, such as stochastic gradient descent, proximal strategy optimization, etc., to solve multi-objective random chance constrained optimization problems, thereby achieving effective and performance optimization of greenhouse control inputs and control strategies; third, using random chance constrained optimization technology, such as alternating direction multiplier method, distributed optimization, etc., to deal with the decomposition and coordination of multi-objective random chance constrained optimization problems, thereby improving the convergence and stability of optimization problems.
[0023] Figure 1 A flow chart of a greenhouse climate prediction and control method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, including: Step 110, obtaining climate data and crop data in the greenhouse, and performing multi-source data fusion to obtain multi-source fusion data; In an embodiment of the present application, sensors, cameras and other equipment are used to collect climate data and crop data inside and outside the greenhouse, including temperature, humidity, light, carbon dioxide, crop growth status, etc. Then, multi-source data fusion (MDF) technology is used to fuse data from different devices and different locations, thereby improving the integrity and consistency of the data. Then, anomaly detection (AD) technology is used to identify and remove outliers and noise in the data, thereby improving the accuracy and credibility of the data. Finally, feature selection (FS) technology is used to screen out features that have an important impact on the model and optimization problems, thereby improving the simplicity and relevance of the data. The data acquisition and preprocessing steps of the present invention provide high-quality and effective data for subsequent modeling and analysis.
[0024] Optionally, the acquiring of climate data and crop data in the greenhouse and performing multi-source data fusion to obtain multi-source fused data includes: Represent the climate data and crop data inside and outside the greenhouse as vectors and summarize them into a data matrix; The multi-layer perceptron is used as the data fusion model, and the model parameters are optimized by the stochastic gradient descent method to obtain the fused feature data matrix; Using isolation forest as an anomaly detection model, outliers and noise in the feature data matrix are identified and removed; The feature data matrix is screened through mutual information to obtain multi-source fusion data.
[0025] More specifically, the present invention uses sensors, cameras and other equipment to collect climate data and crop data inside and outside the greenhouse, including temperature, humidity, light, carbon dioxide, crop growth status, etc. The present invention sets a data collection cycle , that is, every The present invention sets a data collection area. , that is, the rectangular area inside and outside the greenhouse, whose length is , width is , Gao Wei The present invention Evenly arranged inside A temperature sensor, humidity sensor, Light sensors, A carbon dioxide sensor, The present invention sets the measurement range and accuracy of each sensor, as well as the resolution and viewing angle of each camera.
[0026] The present invention represents the data of each device as a vector, namely:
[0027] ; in, Indicates The temperature value of a temperature sensor, Indicates The humidity value of the humidity sensor, Indicates The light value of the light sensor, Indicates The CO2 concentration value of each CO2 sensor, Indicates The present invention aggregates the data of all devices into a data matrix ,Right now: ; Then, the present invention utilizes multi-source data fusion technology to fuse data from different devices and different locations, thereby improving the integrity and consistency of the data.
[0028] The present invention adopts a multi-layer perceptron (MLP) as a data fusion model, and its structure is as follows: ; in, is the output of data fusion, and are the weights and biases of the model, is the activation function. The present invention sets the input dimension of the model to ,in, is the dimension of the image data of each camera, and the output dimension is , that is, the feature dimension after data fusion. The present invention sets the hidden layer dimension of the model to , and the ReLU function is used as the activation function.
[0029] The present invention uses mean squared error (MSE) as the loss function of data fusion, that is: ; in, is the amount of data, It is The true characteristics of the data, It is The data fusion output of each data.
[0030] The present invention uses the Stochastic Gradient Descent (SGD) method to optimize the model parameters of data fusion, that is,
[0031] ; in, is the learning rate, is the gradient operator. The present invention sets the number of training times of the data fusion model , that is, the model is performed on all data The present invention sets the batch size of the data fusion model , that is, each time the model parameters are updated, a random sample is drawn from all the data The present invention sets the learning rate of the data fusion model , and uses the exponential decay (ED) technology to gradually reduce the learning rate as the number of training times increases, thereby improving the convergence and stability of the model.
[0032] The present invention sets the initial learning rate of the data fusion model , and the decay rate ,Right now: ; in, The present invention utilizes the data label, that is, the growth state of the crop, as the real feature of the data during the data fusion process, thereby improving the effectiveness and supervision of the data fusion.
[0033] The present invention expresses the growth status of crops as dimensional vector, that is: ; in, Indicates The present invention uses the image data of the camera to extract the value of the growth status of the crop through image processing and analysis technology, thereby improving the observability and quantification of the data.
[0034] Next, the present invention uses anomaly detection technology to identify and remove outliers and noise in the data, thereby improving the accuracy and credibility of the data. The present invention uses Isolation Forest (IF) as an anomaly detection model.
[0035] Finally, the present invention uses feature selection technology to screen out features that have an important impact on the dynamic model of the greenhouse climate system and the optimization problem of the random chance constrained MPC, thereby improving the simplicity and relevance of the data. The present invention uses mutual information (MI) as a feature selection method, and its principle is as follows: ; in, It is a feature set and the target variable The mutual information between and It is a feature set and the target variable The entropy of It is a feature set and the target variable The mutual information reflects the joint entropy of the feature set. and the target variable The correlation between them, the larger the mutual information, the stronger the feature set. For the target variable The greater the influence of , the smaller the mutual information, indicating that the feature set For the target variable Therefore, mutual information can be used to evaluate the importance of features and thus perform feature selection.
[0036] The present invention sets the objective function of feature selection, namely:
[0037] ; in, It is a feature set The size of is the maximum number of features for feature selection. The present invention uses a greedy algorithm (GA) to solve the objective function of feature selection, that is, from all features, the feature with the largest mutual information is selected each time until the maximum number of features is reached or the mutual information gain is less than the threshold. The present invention sets the maximum number of features for feature selection , and the threshold of mutual information gain , that is, when When , feature selection stops, where is a candidate feature. The present invention uses the mutual information method to detect abnormal data. Feature selection is performed to screen out features that have a significant impact on the dynamic model of the greenhouse climate system and the optimization problem of the random chance constrained MPC, thereby improving the simplicity and relevance of the data.
[0038] The data collection and preprocessing steps of the present invention provide high-quality and effective data for subsequent modeling and analysis.
[0039] Step 120, training and verifying a deep neural network based on the multi-source fusion data and taking the crop growth status as output to obtain a nonlinear dynamic model of the greenhouse climate system; In an embodiment of the present application, a deep neural network (DNN) technology is used to train a nonlinear dynamic model of a greenhouse climate system with climate data inside and outside the greenhouse as input and crop growth status as output. The present invention uses a long short-term memory network (LSTM) to capture the time-varying characteristics of the greenhouse climate system, an attention mechanism (AM) to enhance the multi-input and multi-output characteristics of the greenhouse climate system, and a residual connection (RC) to increase the depth and complexity of the greenhouse climate system. The present invention uses methods such as cross validation (CV) to evaluate the fit and generalization ability of the model, and adjust the structure and parameters of the model to improve the accuracy and adaptability of the model. The present invention also uses deep reinforcement learning (DRL) technology, with the goal of the greenhouse production system as the reward function, to automatically explore and learn the dynamic model of the greenhouse climate system, thereby improving the autonomy and adaptability of the model. The present invention also uses Meta-learning (ML) technology to learn a universal model using data from multiple different greenhouse climate systems, which can quickly adapt to the data of new greenhouse climate systems, thereby improving the generalization and migration capabilities of the model. Finally, the present invention also uses Model Compression (MC) technology to reduce the parameters and calculation amount of the model, improve the running speed and storage space of the model, and thus improve the efficiency and deployability of the model. The model training and verification steps of the present invention provide a high-performance and efficient model for subsequent analysis and optimization.
[0040] Optionally, the training method of the nonlinear dynamic model of the greenhouse climate system is specifically: The time-varying characteristics of the greenhouse climate system are captured through a bidirectional long short-term memory network, the multi-input and multi-output characteristics of the greenhouse climate system are enhanced through an attention mechanism, and the depth and complexity of the greenhouse climate system are increased through residual connections; The cross entropy is used as the loss function of the model, and the parameters of the model are optimized by stochastic gradient descent method; The model's fit and generalization ability were evaluated through cross-validation methods, and the model's structure and parameters were adjusted; Through deep reinforcement learning technology, the nonlinear dynamic model of the greenhouse climate system is automatically explored and learned with the goal of the greenhouse production system as the reward function; Through meta-learning technology, a universal model is learned through data from multiple different greenhouse climate systems, and through model compression technology, the parameters and calculation amount of the model are reduced to obtain a nonlinear dynamic model of the greenhouse climate system.
[0041] Specifically, the present invention uses deep neural network technology, takes climate data inside and outside the greenhouse as input, and takes crop growth status as output to train a nonlinear dynamic model of the greenhouse climate system. The present invention uses a bidirectional long short-term memory network (BiLSTM) to capture the time-varying characteristics of the greenhouse climate system, uses an attention mechanism (AM) to enhance the multi-input and multi-output characteristics of the greenhouse climate system, and uses residual connections (RC) to increase the depth and complexity of the greenhouse climate system. The structure of the deep neural network of the present invention is as follows:
[0042] ; in, It is The input of time steps is the climate data inside and outside the greenhouse. It is The hidden state of time steps, It is The attention weights for time steps, It is The context vector of time steps, It is The output of the time step is It is The prediction of time steps, that is, the crop growth status. , , , , , are the weights and biases of the model, is the matrix of hidden states at all time steps, i.e. , is the total number of time steps.
[0043] BiLSTM is a bidirectional long short-term memory network. Its principle is to splice the outputs of the LSTM networks in two directions, thereby integrating the forward and backward time series information. AM is an attention mechanism. Its principle is to calculate the attention weight based on the current hidden state and all hidden states, and then weighted average all hidden states to obtain the context vector, which reflects the correlation between the current input and output. RC is a residual connection. Its principle is to add the context vector and the output of the linear transformation, thereby increasing the depth and complexity of the model and avoiding the problem of gradient disappearance. is an activation function, the principle of which is to normalize the output vector into a probability distribution, thereby representing the possibility of each output category. The present invention sets the input dimension of the model to , which is the feature dimension after data collection and preprocessing, and the output dimension is , that is, the number of categories of crop growth status, and the hidden layer dimension is , the output layer dimension is .
[0044] The present invention uses cross entropy (CE) as the loss function of the model, namely: ; in, is the amount of data, It is The data The true labels of the output categories, It is The data The present invention uses the stochastic gradient descent method to optimize the parameters of the model, namely:
[0045] ; in, is the learning rate, is the gradient operator.
[0046] The present invention sets the number of training times of the model , that is, the model is performed on all data The present invention sets the batch size of the model , that is, each time the model parameters are updated, a random sample is drawn from all the data The present invention sets the learning rate of the model , and uses exponential decay technology to make the learning rate gradually decrease with the increase of training times, thereby improving the convergence and stability of the model.
[0047] The present invention uses methods such as cross-validation CV to evaluate the model's fit and generalization ability, and adjusts the model's structure and parameters to improve the model's accuracy and adaptability. The present invention sets the cross-validation fold , that is, all data are divided into Each time, a subset of them is used as the test set, and the remaining subsets are used as the training set. Repeat The performance indicators of the model on each test set, such as accuracy, recall rate, F1 value, etc., are calculated, and then the average value is taken as the final performance indicator of the model. , the output layer dimension The optimal model structure and parameters.
[0048] The present invention also utilizes deep reinforcement learning technology, taking the objectives of the greenhouse production system as the reward function, to automatically explore and learn the dynamic model of the greenhouse climate system, thereby improving the autonomy and adaptability of the model.
[0049] The present invention adopts Policy Gradient (PG) as a method of deep reinforcement learning. Its principle is to update the model's strategy based on the model's output and the environment's feedback, thereby maximizing the cumulative reward. The process of deep reinforcement learning of the present invention is as follows:
[0050] ; in, is the strategy of the model, i.e., in state Next, select Action The probability of It is The state of the time step, that is, the climate data inside and outside the greenhouse, It is The action of the time step is the control input of the greenhouse, are the strategy parameters of the model, including and , is the weight of the strategy, It is a bias in strategy. It is a dynamic model of the greenhouse climate system, that is, based on the current state and action, predict the next state. and Parameters of the kinetic model. is the reward function of the greenhouse production system, that is, the reward value is calculated based on the current state and action, reflecting the goal of the greenhouse production system. and are the parameters of the reward function. is the objective function of the model, i.e. the expected value of the cumulative reward, is a discount factor that balances current and future rewards, is the learning rate, is the gradient operator.
[0051] The present invention sets the state dimension of the model as , which is the feature dimension after data collection and preprocessing, and the action dimension is , which is the dimension of the greenhouse control input, and the strategy dimension is , which is the output dimension of the strategy. The present invention sets the discount factor of the model , learning rate , and the number of training , that is, the model is performed on all data The present invention uses the policy gradient method to update the policy parameters of the model according to the output of the model and the feedback of the environment, thereby maximizing the cumulative reward.
[0052] The present invention also uses meta-learning technology to learn a universal model using data from multiple different greenhouse climate systems, which can quickly adapt to the data of new greenhouse climate systems, thereby improving the generalization and migration capabilities of the model. The present invention uses Model-Agnostic Meta-Learning (MAML) as a meta-learning method. The principle is to train the initial model parameters on a meta-training set so that it can achieve better performance on a meta-test set after a small amount of gradient updates. The meta-learning process of the present invention is as follows: ; in, are the model parameters after meta-learning, are the model parameters before meta-learning, It is The loss function of each task is is the number of tasks, is the learning rate. The present invention sets the number of tasks in the meta-training set and the meta-test set , and the learning rate of meta-learning , and use the stochastic gradient descent method to optimize the meta-learning objective function to obtain universal model parameters that can quickly adapt to the data of the new greenhouse climate system.
[0053] The present invention also uses model compression technology to reduce the parameters and calculation amount of the model, improve the running speed and storage space of the model, and thus improve the efficiency and deployability of the model. The present invention uses knowledge distillation (KD) as a model compression method. The principle is to use a large model (teacher model) to guide the learning of a small model (student model), so that the student model can learn the knowledge of the teacher model, thereby improving the performance of the student model. The model compression process of the present invention is as follows:
[0054] ; in, and are the parameters of the student model, and are the parameters of the teacher model, is the cross entropy loss function of the student model, is the KL divergence loss function between the output of the student model and the teacher model, is the weight coefficient of the loss function, is the temperature parameter used to smooth the output of the teacher model, The present invention sets the structure and parameters of the student model and the teacher model, as well as the weight coefficient of the loss function of the model compression. , temperature parameters , learning rate , and uses the stochastic gradient descent method to optimize the loss function of the model compression, thereby obtaining a small and efficient model that can predict the climate data and crop growth status inside and outside the greenhouse in real time in the climate control of the greenhouse production system, thereby improving the efficiency and deployability of the model.
[0055] The model training and verification steps of the present invention provide a high-performance and high-efficiency model for subsequent analysis and optimization.
[0056] Step 130, using Bayesian inference technology, taking the parameters of the nonlinear dynamics model as random variables and the climate data inside and outside the greenhouse as observation data, establish a posterior distribution of parameter uncertainty, thereby obtaining a posterior distribution model of output uncertainty; The present invention uses Bayesian Inference (BI) technology, takes the parameters of the dynamic model of the greenhouse climate system as random variables, and takes the climate data inside and outside the greenhouse as observation data to establish the posterior distribution of parameter uncertainty. The present invention uses Gaussian Process (GP) technology to establish the posterior distribution of parameter uncertainty in a non-parametric way, thereby avoiding assumptions and restrictions on the distribution form of parameter uncertainty and improving the flexibility and expression ability of parameter uncertainty. The present invention uses the reparameterization trick (RT) technology to sample parameter uncertainty from the posterior distribution of parameter uncertainty and propagate it to the output of the model to obtain the distribution of output uncertainty. The present invention uses Monte Carlo (MC) technology to sample parameter uncertainty from the posterior distribution of parameter uncertainty in a randomized way and propagate it to the output of the model, thereby avoiding approximation and simplification of the propagation process of parameter uncertainty and improving the accuracy and reliability of parameter uncertainty. The modeling and propagation steps of parameter uncertainty of the present invention provide effective and reliable expression and processing of uncertainty for subsequent optimization.
[0057] Optionally, the method uses Bayesian inference technology to establish a posterior distribution of parameter uncertainty by taking the parameters of the nonlinear dynamics model as random variables and the climate data inside and outside the greenhouse as observation data, thereby obtaining a posterior distribution model of output uncertainty, including: By using Bayesian inference technology, the parameters of the nonlinear dynamic model are used as random variables, and the climate data inside and outside the greenhouse are used as observation data, a posterior distribution of parameter uncertainty is established, thereby obtaining a distribution of output uncertainty; Gaussian process techniques are used to establish the posterior distribution of parameter uncertainty in a non-parametric way; Using a reparameterization technique, sampling parameter uncertainty from a posterior distribution of the parameter uncertainty and propagating the parameter uncertainty to an output of the model; Monte Carlo technology is used to sample parameter uncertainty from the posterior distribution of the parameter uncertainty in a random manner, and the parameter uncertainty is propagated to the output of the model to obtain a posterior distribution model of the output uncertainty.
[0058] The present invention uses Bayesian inference technology, takes the parameters of the dynamic model of the greenhouse climate system as random variables, and takes the climate data inside and outside the greenhouse as observation data to establish the posterior distribution of parameter uncertainty. The present invention uses Bayesian Theorem (BT) as the Bayesian inference method, and its principle is as follows: ; in, is a parameter In the observation data The posterior distribution under It is observational data In the parameters The likelihood function under is a parameter The prior distribution of It is observational data The marginal distribution of .
[0059] The meaning of Bayes' formula is that according to the observed data , update the parameters The prior distribution of The posterior distribution of The present invention sets the parameters of the dynamic model of the greenhouse climate system The dimension is ,Right now , observational data The dimension is ,Right now ,in, is the feature dimension after data collection and preprocessing, is the total number of time steps, It is The input is the climate data inside and outside the greenhouse.
[0060] The present invention sets the likelihood function of the dynamic model of the greenhouse climate system to be a Gaussian distribution, that is: ; in, It is a dynamic model of the greenhouse climate system, that is, according to the previous state and previous action , predict the current state , is the variance of the observation noise, is the identity matrix.
[0061] The present invention sets the prior distribution of the dynamic model of the greenhouse climate system to be a Gaussian distribution, that is,
[0062] ; in, is the mean of the prior distribution, is the covariance matrix of the prior distribution. The present invention sets the variance of the observation noise , and the mean of the prior distribution and the covariance matrix , thereby improving the effectiveness and supervision of Bayesian inference.
[0063] The present invention adopts Gaussian process technology to establish the posterior distribution of parameter uncertainty in a non-parametric way, thereby avoiding assumptions and restrictions on the distribution form of parameter uncertainty and improving the flexibility and expression ability of parameter uncertainty. The present invention adopts Gaussian Process Regression (GPR) as the Gaussian process method, and its principle is as follows:
[0064] ; in, and are the mean and covariance matrices of the posterior distribution, , , is the calculation result of the kernel function (KF), that is: ; in, is a kernel function used to measure the similarity between two inputs. The meaning of Gaussian process regression is that according to the observed data , update the parameters The prior distribution of The posterior distribution of The present invention sets the type and parameters of kernel functions, such as radial basis function (RBF), exponential function (EF), polynomial function (PF), etc., so as to improve the flexibility and expression ability of Gaussian process regression.
[0065] The present invention uses the reparameterization technique to sample parameter uncertainty from the posterior distribution of parameter uncertainty and propagate it to the output of the model, thereby obtaining the distribution of output uncertainty. The reparameterization technique is a method of sampling parameter uncertainty from the posterior distribution of parameter uncertainty. The idea is to decompose the sampling process of parameter uncertainty into two steps, namely, sampling random variables from a standard normal distribution and , and then through the differentiable transformation function, Mapped to the posterior distribution of parameter uncertainty, we get parameter uncertainty The sampling process of parameter uncertainty can be used to calculate the gradient through the back-propagation algorithm, thereby improving the sampling efficiency and differentiability of parameter uncertainty.
[0066] The present invention sets the transformation function of the reparameterization technique as the product of the mean and covariance matrix of the Gaussian distribution, that is:
[0067] in, and is the mean and covariance matrix of the posterior distribution of parameter uncertainty, is the identity matrix.
[0068] The present invention uses the reparameterization technique to sample parameter uncertainty from the posterior distribution of parameter uncertainty and propagate it to the output of the model, thereby obtaining the distribution of output uncertainty, namely
[0069] in, It is a dynamic model of the greenhouse climate system, that is, according to the previous state and previous action , predict the current state , is the output model of the greenhouse climate system, that is, according to the current state , predict the current output , that is, the growth status of crops.
[0070] The present invention sets the output dimension of the model to be , that is, the number of categories of crop growth status, the distribution of output uncertainty is multinomial distribution, that is:
[0071] in, It is The time step The probability of the output class, It is The time step The true labels of the output categories.
[0072] The present invention utilizes the reparameterization technique to sample output uncertainty from the distribution of output uncertainty and propagate it into the optimization problem, thereby improving the robustness and reliability of the optimization problem.
[0073] Step 140, establishing a multi-objective random chance constrained MPC optimization problem based on the nonlinear dynamics model of the greenhouse climate system, the posterior distribution model of parameter uncertainty, and the objectives of the greenhouse production system; The present invention establishes a multi-objective optimization problem based on the goal of the greenhouse production system, that is, maximizing yield and quality while meeting crop needs and minimizing energy consumption and environmental impact. The present invention uses multi-criteria decision making (MCDM) technology to weigh and rank the multiple objectives of the greenhouse production system in a systematic and quantitative way, thereby avoiding conflicts and contradictions between objectives and improving the consistency and solvability of the optimization problem.
[0074] The present invention introduces a stochastic chance constraint (SCC) into the optimization problem, that is, to ensure that the distribution of output uncertainty satisfies some preset conditions with a certain probability, thereby ensuring the robustness of the optimization problem. The present invention uses fuzzy logic (FL) technology to express the conditions and probabilities of stochastic chance constraints in a flexible and fuzzy way, thereby avoiding overly strict and precise requirements for uncertainty and improving the adaptability of the optimization problem. The establishment steps of the optimization problem of the stochastic chance constraint MPC of the present invention provide a reasonable and feasible optimization problem for subsequent optimization.
[0075] Optionally, the multi-objective random chance constrained MPC optimization problem is established according to the nonlinear dynamics model of the greenhouse climate system, the posterior distribution model of parameter uncertainty and the target of the greenhouse production system, including: With the goal of meeting crop needs while maximizing yield and quality and minimizing energy consumption and environmental impact, multi-criteria decision making (MCDM) technology is used to weigh and rank multiple objectives of the greenhouse production system in a systematic and quantitative way. Through random chance constraints, the distribution of output uncertainty is guaranteed to meet the preset conditions with preset probability, and fuzzy logic technology is used to express the conditions and probabilities of random chance constraints in a flexible and fuzzy way to establish a multi-objective random chance constrained MPC optimization problem.
[0076] The present invention establishes a multi-objective optimization problem based on the goal of the greenhouse production system, that is, maximizing yield and quality while meeting crop needs and minimizing energy consumption and environmental impact. Specifically, the present invention represents the goal of the greenhouse production system as a vector ,in, is the total number of targets, that is The present invention records the goals of the greenhouse production system as , respectively represent output, quality, energy consumption and environmental impact. The present invention calculates the target of the greenhouse production system as follows:
[0077] in, is the total type of crops, It is The unit price of crops, It is The yield of crops, It is The quality of crops grown, is the total control variable of the greenhouse, It is The value of the control variable, is the total environmental variable of the greenhouse, It is The value of an environment variable.
[0078] The present invention uses multi-criteria decision making (MCDM) technology to weigh and rank the multiple objectives of the greenhouse production system in a systematic and quantitative manner, thereby avoiding conflicts and contradictions between the objectives and improving the consistency and solvability of the optimization problem. Specifically, the present invention adopts a multi-criteria decision-making method based on the Analytic Hierarchy Process (AHP) to decompose the multiple objectives of the greenhouse production system into different levels and sub-goals, evaluate and compare the importance of different levels and sub-goals, and obtain the weights of different levels and sub-goals, thereby obtaining the comprehensive weights of the multiple objectives of the greenhouse production system. The structure of the multi-criteria decision of the present invention is as follows: Goal Layer: The overall goal of the greenhouse production system is to maximize yield and quality while meeting crop needs and minimizing energy consumption and environmental impact.
[0079] Criterion Layer: The four sub-goals of the greenhouse production system, namely output, quality, energy consumption and environmental impact.
[0080] Alternative Layer: Different control strategies for greenhouse production systems, that is, different combinations of control variable values.
[0081] The present invention uses the following formula to calculate the weights of different levels and sub-goals, namely: ; in, is the weight vector of different levels or sub-goals, is the pairwise comparison matrix of different levels or sub-goals, is the largest eigenvalue of the pairwise comparison matrix, is the number of different levels or sub-goals, are the eigenvectors of the pairwise comparison matrix.
[0082] The present invention uses the following formula to calculate the comprehensive weight of multiple objectives of the greenhouse production system, namely: ; in, is the comprehensive weight vector of multiple objectives of the greenhouse production system, is the weight vector between the target layer and the criterion layer, is the weight vector between the criterion layer and the solution layer, Represents a tensor product.
[0083] The present invention uses multi-criteria decision-making to weigh and sort the multiple objectives of the greenhouse production system, thereby avoiding conflicts and contradictions between the objectives and improving the consistency and solvability of the optimization problem. The present invention introduces a stochastic chance constraint (SCC) into the optimization problem, that is, to ensure that the distribution of output uncertainty meets some preset conditions with a certain probability, thereby ensuring the robustness of the optimization problem. Specifically, the present invention expresses the stochastic chance constraint in the following form, namely: ; in, represents the probability, A function that represents the distribution of output uncertainty, represents a given probability threshold, .
[0084] The present invention uses fuzzy logic (FL) technology to express the conditions and probabilities of random chance constraints in a flexible and fuzzy way, thereby avoiding overly strict and precise requirements for uncertainty and improving the adaptability of optimization problems. Specifically, the present invention expresses the conditions and probabilities of random chance constraints as fuzzy sets, namely:
[0085] in, is a fuzzy set, and its membership function (MF) indicates the degree to which the distribution of output uncertainty satisfies the conditions. represents a given fuzzy threshold, .
[0086] The optimization problem of the random chance constrained MPC of the present invention can be expressed in the following form, namely:
[0087] in, is the comprehensive weight vector of multiple objectives of the greenhouse production system, is the multi-objective vector of the greenhouse production system, is the control variable vector of the greenhouse, is a function of the distribution of output uncertainty, is a fuzzy set, whose membership function indicates the degree to which the distribution of output uncertainty satisfies the conditions. is a given blur threshold, is the lower bound of the control variable, is the upper bound of the control variable.
[0088] The steps for establishing the optimization problem of the random chance constrained MPC of the present invention provide a reasonable and feasible optimization problem for subsequent optimization.
[0089] Step 150, solving the multi-objective random chance constrained MPC optimization problem to obtain the control input and control strategy of the greenhouse.
[0090] The present invention uses Stochastic Gradient Descent (SGD) and Proximal Policy Optimization (PPO) technology to solve the optimization problem of random chance constrained MPC. The present invention uses Adaptive Moment Estimation (Adam) technology as an optimizer for stochastic gradient descent to update the decision variables of the optimization problem in the direction of the gradient, that is, the control input of the greenhouse. The present invention uses Proximal Policy Optimization with Clipped Objective Function (PPO-CT) technology to update the policy variables of the optimization problem with the clipped objective function, that is, the control strategy of the greenhouse. The present invention uses the Alternating Direction Method of Multipliers (ADMM) technology to handle the decomposition and coordination of the optimization problem, thereby improving the convergence and stability of the optimization problem. The solution steps of the optimization problem of random chance constrained MPC of the present invention provide an effective and high-performance solution to the optimization problem for subsequent control.
[0091] Specifically, the present invention uses Stochastic Gradient Descent (SGD) and Proximal Policy Optimization (PPO) technology to solve the optimization problem of random chance constrained MPC. Specifically, the present invention expresses the optimization problem of random chance constrained MPC in the following form, namely:
[0092] in, is the comprehensive weight vector of multiple objectives of the greenhouse production system, is the multi-objective vector of the greenhouse production system, is the control variable vector of the greenhouse, is the control strategy vector for the greenhouse, is a function of the distribution of output uncertainty, is a fuzzy set, whose membership function indicates the degree to which the distribution of output uncertainty satisfies the conditions. is a given blur threshold, is the lower bound of the control variable, is the upper bound of the control variable, is the feasible set of control strategies.
[0093] The present invention denotes the decision variables and strategy variables of the optimization problem as , and the objective function and constraint function of the optimization problem are respectively and ,Right now:
[0094] The present invention uses the Adaptive Moment Estimation (Adam) technique as a stochastic gradient descent optimizer to update the decision variables of the optimization problem, i.e., the control input of the greenhouse, in the direction of the gradient. Specifically, the present invention uses the following formula to calculate the gradient of the decision variables of the optimization problem, i.e.:
[0095] in, is the partial derivative of the objective function of the optimization problem with respect to the control variable, is the partial derivative of the objective function of the optimization problem with respect to the control strategy.
[0096] The present invention uses the following formula to update the value of the decision variable of the optimization problem, namely:
[0097] in, is the learning rate, It is The bias-corrected first-order moment estimate of the gradient of the iteration is calculated as follows:
[0098] in, is the exponential decay rate of the first-order moment estimate, It is The first-order moment estimate of the gradient of the iteration, It is The first-order moment estimate of the gradient of the iteration. Through adaptive moment estimation, the decision variables of the optimization problem, i.e., the control input of the greenhouse, are updated in the direction of the gradient.
[0099] The present invention uses the proximal policy optimization with clipped objective function (PPO-CT) technology to update the policy variables of the optimization problem, that is, the control strategy of the greenhouse, with the clipped objective function. Specifically, the present invention uses the following formula to calculate the probability ratio of the policy variables of the optimization problem, that is:
[0100] in, It is The control strategy for the next iteration is It is The control strategy for the next iteration.
[0101] The present invention uses the following formula to calculate the advantage function of the strategy variable of the optimization problem, namely:
[0102] in, It is The state-action value function of the iteration, It is The present invention uses the following formula to calculate the trimming objective function of the strategy variable of the optimization problem, namely:
[0103] in, is the trimming function, is the clipping threshold, The present invention uses the following formula to update the value of the strategy variable of the optimization problem, namely:
[0104] The present invention uses the trimmed objective function of the proximal strategy optimization to update the strategy variables of the optimization problem, that is, the control strategy of the greenhouse, with the trimmed objective function. The present invention uses the Alternating Direction Method of Multipliers (ADMM) technology to deal with the decomposition and coordination of the optimization problem, thereby improving the convergence and stability of the optimization problem. Specifically, the present invention decomposes the objective function and constraint function of the optimization problem into the following forms, namely:
[0105] in, is the part of the objective function of the optimization problem with respect to the control variables, is the part of the objective function of the optimization problem for the control strategy, is the part of the constraint function of the optimization problem on the control variables, It is the part of the constraint function of the optimization problem to the control strategy. The present invention uses the following formula to update the Lagrange multiplier and penalty factor of the optimization problem, namely:
[0106] in, is the Lagrange multiplier vector of the optimization problem, is the penalty factor for the optimization problem, is the growth rate of the penalty factor, is the maximum value of the penalty factor.
[0107] The present invention uses the following formula to update the decision variables and strategy variables of the optimization problem, namely:
[0108] in, is the part of the objective function of the optimization problem with respect to the control variables, is the part of the objective function of the optimization problem for the control strategy, is the part of the constraint function of the optimization problem on the control variables, is the part of the control strategy for the constraint function of the optimization problem, is the Lagrange multiplier vector of the optimization problem elements, is the Lagrange multiplier vector of the optimization problem elements, is the penalty factor for the optimization problem, is the total control variable of the greenhouse, is the total environmental variable of the greenhouse. The decomposition and coordination of the optimization problem are processed by the alternating direction multiplier method, thereby improving the convergence and stability of the optimization problem.
[0109] The step of solving the optimization problem of the random chance constrained MPC of the present invention provides an effective and efficient solution to the optimization problem for subsequent control.
[0110] Optionally, after solving the multi-objective random chance constrained MPC optimization problem to obtain the control input and control strategy of the greenhouse, the method further includes: According to the solution of the optimization problem, the climate control of the greenhouse production system is implemented to adjust the control input of the greenhouse and affect the output of the greenhouse, that is, the growth status of the crops; Use visualization technology to show the process and results of climate control in greenhouse production systems in the form of graphics and animations; Using reinforcement learning technology, the greenhouse control strategy is continuously updated and optimized with the effect and benefit of the climate control of the greenhouse production system as the reward function.
[0111] The present invention implements the climate control of the greenhouse production system according to the solution of the optimization problem, that is, according to the control strategy of the greenhouse, the control input of the greenhouse, such as temperature, humidity, light, carbon dioxide, etc., is adjusted, thereby affecting the output of the greenhouse, such as the growth status of crops. The present invention uses visualization (Visualization, VZ) technology to display the process and results of the climate control of the greenhouse production system in the form of graphics and animation, thereby improving the observability and interpretability of the climate control of the greenhouse production system. The present invention uses reinforcement learning (Reinforcement Learning, RL) technology, taking the effect and benefit of the climate control of the greenhouse production system as the reward function, and continuously updates and optimizes the control strategy of the greenhouse, thereby improving the adaptability and optimization of the climate control of the greenhouse production system. The application steps of the climate control of the greenhouse production system of the present invention provide effective and efficient implementation and optimization of the climate control of the greenhouse production system.
[0112] Specifically, the present invention optimizes the solution of the problem, that is, the control variable vector of the greenhouse and control strategy vector As the control input of the greenhouse, it is input into the control system of the greenhouse to adjust the control equipment of the greenhouse (heater, fan, light, sprayer, etc.), thereby changing the climate conditions of the greenhouse such as temperature, humidity, light, carbon dioxide, etc., and further affecting the growth status of the crops in the greenhouse (such as leaf area, root length, biomass, etc. output). The implementation steps of the climate control of the greenhouse production system of the present invention are as follows: ① The present invention reads the control variable vector of the greenhouse from the solution of the optimization problem and control strategy vector ,in, is the total control variable of the greenhouse.
[0113] ② The present invention converts the greenhouse control variable vector and control strategy vector , as the control input of the greenhouse, it is input into the control system of the greenhouse, thereby adjusting the control equipment of the greenhouse, such as heaters, fans, lights, sprayers, etc., thereby changing the climate conditions of the greenhouse.
[0114] The present invention monitors the climate conditions of the greenhouse through greenhouse sensors such as temperature sensors, humidity sensors, light sensors, carbon dioxide sensors, etc., so as to feedback the control effect of the greenhouse, such as the climate status of the greenhouse.
[0115] The present invention monitors the growth status of the output crops of the greenhouse through cameras of the greenhouse, such as an infrared camera, a visible light camera, a near-infrared camera, etc., so as to provide feedback on the production effect of the greenhouse.
[0116] The present invention uses visualization (VZ) technology to display the process and results of climate control of a greenhouse production system in the form of graphics and animation, thereby improving the observability and interpretability of climate control of the greenhouse production system. Specifically, the present invention uses the following formula to generate graphics and animations of climate control of a greenhouse production system, namely:
[0117] in, is a graphic and animation of the climate control of a greenhouse production system, is the visualization function, is the control variable vector of the greenhouse, is the control strategy vector for the greenhouse, is the output vector of the greenhouse, is the climate state vector of the greenhouse. The visualization steps of the climate control of the greenhouse production system of the present invention are as follows: From the greenhouse control system, read the greenhouse control variable vector and control strategy vector , read the greenhouse output vector from the greenhouse's sensors and cameras and the climate state vector ; The greenhouse control variable vector and control strategy vector , the output vector of the greenhouse and the climate state vector , as input to the visualization function, which generates graphics and animations of the climate control of the greenhouse production system ; Graphics and animations of climate control for greenhouse production systems , displayed on a monitor or projector in the greenhouse, thereby showing the process and results of climate control of the greenhouse production system, thereby improving the observability and interpretability of climate control of the greenhouse production system.
[0118] The present invention uses reinforcement learning (RL) technology, takes the effect and benefit of the greenhouse production system's climate control as the reward function, and continuously updates and optimizes the greenhouse's control strategy, thereby improving the adaptability and optimization of the greenhouse production system's climate control. Specifically, the present invention uses the following formula to define the reinforcement learning problem of greenhouse production system's climate control, namely:
[0119] in, is the control strategy of the greenhouse, is the locus of climate control in greenhouse production systems, is the probability distribution of the trajectory of climate control of the greenhouse production system, is the total duration of climate control in the greenhouse production system, is the discount factor, , is the reward function for climate control of the greenhouse production system, is the climate state vector of the greenhouse production system, is the vector of control variables for the greenhouse.
[0120] The present invention uses the following formula to define the reward function of the climate control of the greenhouse production system, namely:
[0121] in, is the comprehensive weight vector of multiple objectives of the greenhouse production system, is the multi-objective vector of the greenhouse production system, is the regularization coefficient, is the constraint function vector of the optimization problem.
[0122] The present invention uses the following formula to update the control strategy of the greenhouse, namely:
[0123] The present invention uses reinforcement learning, takes the effect and benefit of the climate control of the greenhouse production system as a reward function, and continuously updates and optimizes the control strategy of the greenhouse, thereby improving the adaptability and optimization of the climate control of the greenhouse production system.
[0124] The application steps of the climate control of the greenhouse production system of the present invention provide effective and efficient implementation and optimization of the climate control of the greenhouse production system.
[0125] In the embodiments of the present application, a nonlinear dynamic model capable of taking into account parameter uncertainty and output uncertainty is established by using deep neural networks, Bayesian inference and stochastic gradient descent techniques, so that the state and response of the greenhouse climate system can be accurately predicted. The present invention also uses random chance constraint technology to establish a multi-objective optimization problem capable of ensuring the stability of the greenhouse climate, so that the influence of uncertainty and conflicting objectives can be effectively avoided. Through these techniques, the present invention can achieve an improvement in the accuracy and robustness of greenhouse climate control, thereby reducing the risk and cost of the greenhouse climate system.
[0126] In addition, the present invention utilizes multi-source data fusion, anomaly detection and feature selection technology to collect and pre-process climate data and crop data inside and outside the greenhouse, so as to obtain the growth status and demand of greenhouse crops. The present invention also utilizes multi-criteria decision-making and fuzzy logic technology to establish a multi-objective optimization problem that can balance the growth quality of greenhouse crops and energy saving efficiency, effectively meet the growth conditions of greenhouse crops and optimize the energy consumption of the greenhouse, and can achieve the improvement of the growth quality of greenhouse crops and energy saving efficiency, thereby increasing the income and competitiveness of the greenhouse.
[0127] In an optional embodiment, the greenhouse climate prediction and control method with random chance constraint optimization proposed in the present invention is carried out according to the following example steps.
[0128] (1) Data acquisition
[0129] The present invention needs to obtain climate data and crop data inside and outside the greenhouse, including the following categories: Temperature: air temperature and soil temperature inside and outside the greenhouse, in degrees Celsius (℃), collected once every hour.
[0130] Humidity: relative humidity of air inside and outside the greenhouse and soil moisture content, expressed in percentage (%), ranging from 0 to 100%, and collected once an hour.
[0131] Lighting: Light intensity and spectral distribution inside and outside the greenhouse, in lux (lx), collected once an hour.
[0132] Carbon dioxide: The concentration of carbon dioxide in the greenhouse, in parts per million (ppm), is collected once an hour.
[0133] Crop growth status: the growth height (cm), leaf area (cm2), growth stage, fruit number (n) and quality of crops in the greenhouse. The collection frequency is once a week.
[0134] The present invention performs the following processing on the acquired data so as to be used in the model: Data cleaning: Check the integrity, consistency, and validity of the data, delete or correct missing values, duplicate values, outliers, and error values, and use functions such as dropna, drop_duplicates, isna, and isnull in the pandas library.
[0135] Data fusion: Align, match, and integrate data from different devices and locations using the merge, join, concat, and other functions of the pandas library.
[0136] Data standardization: Scale or transform the numerical range of data to eliminate the impact of the dimension and scale of the data, using the StandardScaler, MinMaxScaler, Normalizer and other classes of the sklearn library.
[0137] Data dimensionality reduction: compress or select the dimensions of the data to eliminate the redundancy and noise of the data, using classes such as PCA, LDA, and SelectKBest of the sklearn library.
[0138] Data segmentation: Divide the data samples for model training, validation and testing, using functions such as train_test_split, KFold, and StratifiedKFold of the sklearn library.
[0139] (3) Model construction
[0140] This paper uses deep neural networks, Bayesian inference and stochastic gradient descent technology to construct the following three core model components: Dynamic model of greenhouse climate system: predict the control output of greenhouse and the growth status of crops according to the control input and external environmental factors of greenhouse. The tensorflow library and keras library are used to build, train and verify deep neural networks. The functions that can be used are: Sequential function to create sequential models, Dense function to add fully connected layers, LSTM function to add long short-term memory layers, Activation function to add activation functions, compile function to compile models, fit function to train models, evaluate function to verify models, etc. The input dimension of the model is the sum of the dimensions of control input and external environmental factors, the output dimension of the model is the sum of the dimensions of control output and crop growth status, the hidden layer of the model is 3 layers, the number of neurons in each layer is 64, the activation function of the model is ReLU, the loss function of the model is mean square error, the optimizer of the model is Adam, the learning rate of the model is 0.001, the batch size of the model is 32, the number of training rounds of the model is 100, and the verification split ratio of the model is 0.2.
[0141] Posterior distribution of parameter uncertainty: Based on the parameters and observation data of the nonlinear dynamics model of the greenhouse climate system, the posterior distribution of parameter uncertainty is estimated to obtain the distribution of output uncertainty. The tensorflow library and tensorflow_probability library are used for Gaussian process and Monte Carlo modeling and propagation. The functions that can be used are: GaussianProcess function to create Gaussian process model, kernel function to set kernel function, log_prob function to calculate log-likelihood function, sample function to sample posterior distribution, predict function to predict output distribution, etc. The input dimension of the model is the dimension of the parameter, the output dimension of the model is the dimension of the output, the kernel function of the model is the radial basis function, the noise level of the model is 0.01, the number of sampling times of the model is 1000, and the number of prediction times of the model is 100.
[0142] Solution of the optimization problem of random chance constrained MPC: According to the nonlinear dynamics model of the greenhouse climate system, the posterior distribution model of parameter uncertainty and the goal of the greenhouse production system, a multi-objective random chance constrained MPC optimization problem is established to realize the control input and control strategy of the greenhouse. Python's cvxpy library and scipy library are used to establish and solve multi-criteria decision-making and fuzzy logic. The functions that can be used are: Variable function to create variables, Minimize function to create objective functions, ProbabilisticConstraint function to create random chance constraints, Problem function to create optimization problems, solve function to solve optimization problems, etc. The input dimension of the model is the dimension of the output, and the output dimension of the model is the dimension of the control input. The objective function of the model is the weighted sum of crop yield, quality, disease resistance and cost. The weights of the model are 0.4, 0.3, 0.2 and 0.1. The random chance constraints of the model are that the control output and crop growth status meet a certain probability level. The probability level of the model is 0.95. The solution method of the model is distributed optimization and deep neural network.
[0143] The greenhouse climate prediction and control device provided by the present invention is described below. The greenhouse climate prediction and control device described below and the greenhouse climate prediction and control method described above can be referenced to each other.
[0144] Figure 2 A schematic diagram of the structure of a greenhouse climate prediction and control device provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, including: The fusion module 210 is used to obtain climate data and crop data in the greenhouse, and perform multi-source data fusion to obtain multi-source fusion data; The training module 220 is used to train and verify the deep neural network based on the multi-source fusion data and take the crop growth status as output to obtain a nonlinear dynamic model of the greenhouse climate system; The inference module 230 is used to establish the posterior distribution of parameter uncertainty by using the Bayesian inference technology, taking the parameters of the nonlinear dynamic model as random variables and the climate data inside and outside the greenhouse as observation data, so as to obtain the posterior distribution model of output uncertainty; Establishing module 240 is used to establish a multi-objective random chance constrained MPC optimization problem based on a nonlinear dynamic model of the greenhouse climate system, a posterior distribution model of parameter uncertainty, and a goal of the greenhouse production system; The solution module 250 is used to solve the multi-objective random chance constrained MPC optimization problem to obtain the control input and control strategy of the greenhouse.
[0145] The greenhouse climate prediction and control method, device, electronic device and storage medium provided by the present invention realize the method of climate control of greenhouse production system through deep neural network technology, Bayesian inference technology and random chance constrained optimization technology. The method of the present invention can effectively simulate and learn the dynamic model of greenhouse climate system, effectively model and propagate parameter uncertainty and output uncertainty of greenhouse climate system, effectively establish and solve the multi-objective random chance constrained optimization problem of greenhouse production system, thereby realizing the improvement of climate control effect and benefit of greenhouse production system. The method of the present invention has the advantages of high precision, high adaptability, high efficiency, high reliability and high robustness.
[0146] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the greenhouse climate prediction and control method, which includes: acquiring climate data and crop data in the greenhouse, and performing multi-source data fusion to obtain multi-source fusion data; Based on the multi-source fusion data, taking the crop growth status as output, training and validating a deep neural network, and obtaining a nonlinear dynamic model of the greenhouse climate system; Through Bayesian inference technology, the parameters of the nonlinear dynamics model are used as random variables, and the climate data inside and outside the greenhouse are used as observation data to establish the posterior distribution of parameter uncertainty, thereby obtaining the posterior distribution model of output uncertainty; According to the nonlinear dynamics model of greenhouse climate system, the posterior distribution model of parameter uncertainty and the goal of greenhouse production system, a multi-objective random chance constrained MPC optimization problem is established. The multi-objective random chance constrained MPC optimization problem is solved to obtain the control input and control strategy of the greenhouse.
[0147] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0148] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the greenhouse climate prediction and control method provided by the above methods, the method includes: obtaining climate data and crop data in the greenhouse, and performing multi-source data fusion to obtain multi-source fusion data; Based on the multi-source fusion data, taking the crop growth status as output, training and validating a deep neural network, and obtaining a nonlinear dynamic model of the greenhouse climate system; Through Bayesian inference technology, the parameters of the nonlinear dynamics model are used as random variables, and the climate data inside and outside the greenhouse are used as observation data to establish the posterior distribution of parameter uncertainty, thereby obtaining the posterior distribution model of output uncertainty; According to the nonlinear dynamics model of greenhouse climate system, the posterior distribution model of parameter uncertainty and the goal of greenhouse production system, a multi-objective random chance constrained MPC optimization problem is established. The multi-objective random chance constrained MPC optimization problem is solved to obtain the control input and control strategy of the greenhouse.
[0149] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the greenhouse climate prediction and control method provided by the above methods, the method comprising: acquiring climate data and crop data in the greenhouse, and performing multi-source data fusion to obtain multi-source fusion data; Based on the multi-source fusion data, taking the crop growth status as output, training and validating a deep neural network, and obtaining a nonlinear dynamic model of the greenhouse climate system; Through Bayesian inference technology, the parameters of the nonlinear dynamics model are used as random variables, and the climate data inside and outside the greenhouse are used as observation data to establish the posterior distribution of parameter uncertainty, thereby obtaining the posterior distribution model of output uncertainty; According to the nonlinear dynamics model of greenhouse climate system, the posterior distribution model of parameter uncertainty and the goal of greenhouse production system, a multi-objective random chance constrained MPC optimization problem is established. The multi-objective random chance constrained MPC optimization problem is solved to obtain the control input and control strategy of the greenhouse.
[0150] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0151] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0152] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A greenhouse climate prediction and control method, characterized in that: include: Acquire climate data and crop data in the greenhouse, and fuse multi-source data to obtain multi-source fusion data; Based on the multi-source fusion data, taking the crop growth status as output, training and validating a deep neural network, and obtaining a nonlinear dynamic model of the greenhouse climate system; Through Bayesian inference technology, the parameters of the nonlinear dynamics model are used as random variables, and the climate data inside and outside the greenhouse are used as observation data to establish the posterior distribution of parameter uncertainty, thereby obtaining the posterior distribution model of output uncertainty; According to the nonlinear dynamics model of greenhouse climate system, the posterior distribution model of parameter uncertainty and the goal of greenhouse production system, a multi-objective random chance constrained MPC optimization problem is established. The multi-objective random chance constrained MPC optimization problem is solved to obtain the control input and control strategy of the greenhouse.
2. The greenhouse climate prediction and control method according to claim 1, characterized in that: The method of acquiring climate data and crop data in the greenhouse and fusing multi-source data to obtain multi-source fused data includes: Represent the climate data and crop data inside and outside the greenhouse as vectors and summarize them into a data matrix; The multi-layer perceptron is used as the data fusion model, and the model parameters are optimized by the stochastic gradient descent method to obtain the fused feature data matrix; Using isolation forest as an anomaly detection model, outliers and noise in the feature data matrix are identified and removed; The feature data matrix is screened through mutual information to obtain multi-source fusion data.
3. The greenhouse climate prediction and control method according to claim 1, characterized in that: The training method of the nonlinear dynamic model of the greenhouse climate system is specifically as follows: The time-varying characteristics of the greenhouse climate system are captured through a bidirectional long short-term memory network, the multi-input and multi-output characteristics of the greenhouse climate system are enhanced through an attention mechanism, and the depth and complexity of the greenhouse climate system are increased through residual connections; The cross entropy is used as the loss function of the model, and the parameters of the model are optimized by stochastic gradient descent method; The model's fit and generalization ability were evaluated through cross-validation methods, and the model's structure and parameters were adjusted; Through deep reinforcement learning technology, the nonlinear dynamic model of the greenhouse climate system is automatically explored and learned with the goal of the greenhouse production system as the reward function; Through meta-learning technology, a universal model is learned through data from multiple different greenhouse climate systems, and through model compression technology, the parameters and calculation amount of the model are reduced to obtain a nonlinear dynamic model of the greenhouse climate system.
4. The greenhouse climate prediction and control method according to claim 1, characterized in that: The Bayesian inference technique is used to establish the posterior distribution of parameter uncertainty by taking the parameters of the nonlinear dynamics model as random variables and the climate data inside and outside the greenhouse as observation data, thereby obtaining the posterior distribution model of output uncertainty, including: By using Bayesian inference technology, the parameters of the nonlinear dynamic model are used as random variables, and the climate data inside and outside the greenhouse are used as observation data, a posterior distribution of parameter uncertainty is established, thereby obtaining a distribution of output uncertainty; Gaussian process techniques are used to establish the posterior distribution of parameter uncertainty in a non-parametric way; Using a reparameterization technique, sampling parameter uncertainty from a posterior distribution of the parameter uncertainty and propagating the parameter uncertainty to an output of the model; Monte Carlo technology is used to sample parameter uncertainty from the posterior distribution of the parameter uncertainty in a random manner, and the parameter uncertainty is propagated to the output of the model to obtain a posterior distribution model of the output uncertainty.
5. The greenhouse climate prediction and control method according to claim 1, characterized in that: According to the nonlinear dynamics model of the greenhouse climate system, the posterior distribution model of parameter uncertainty and the goal of the greenhouse production system, a multi-objective random chance constrained MPC optimization problem is established, including: With the goal of meeting crop needs while maximizing yield and quality and minimizing energy consumption and environmental impact, multi-criteria decision-making techniques are used to weigh and rank multiple objectives of greenhouse production systems in a systematic and quantitative manner; Through random chance constraints, the distribution of output uncertainty is guaranteed to meet the preset conditions with preset probability, and fuzzy logic technology is used to express the conditions and probabilities of random chance constraints in a flexible and fuzzy way to establish a multi-objective random chance constrained MPC optimization problem.
6. The greenhouse climate prediction and control method according to claim 1, characterized in that: The multi-objective random chance constrained MPC optimization problem is solved to obtain the control input and control strategy of the greenhouse, including: Using adaptive moment estimation technology as a stochastic gradient descent optimizer to update the decision variables of the optimization problem in the direction of the gradient; Through the proximal strategy optimization technology, the strategy variables of the optimization problem are updated with the tailored objective function, and according to the alternating direction multiplier method technology, the decomposition and coordination of the optimization problem are processed to obtain the control input and control strategy of the greenhouse.
7. The greenhouse climate prediction and control method according to claim 1, characterized in that: After solving the multi-objective random chance constrained MPC optimization problem to obtain the control input and control strategy of the greenhouse, the method further includes: According to the solution of the optimization problem, the climate control of the greenhouse production system is implemented to adjust the control input of the greenhouse and affect the output of the greenhouse, that is, the growth status of the crops; Use visualization technology to show the process and results of climate control in greenhouse production systems in the form of graphics and animations; Using reinforcement learning technology, the greenhouse control strategy is continuously updated and optimized with the effect and benefit of the climate control of the greenhouse production system as the reward function.
8. A greenhouse climate prediction and control device, characterized in that: include: A fusion module is used to obtain climate data and crop data in the greenhouse and fuse multi-source data to obtain multi-source fused data; A training module, for training and verifying a deep neural network based on the multi-source fusion data and taking the crop growth status as output, to obtain a nonlinear dynamic model of a greenhouse climate system; An inference module is used to establish a posterior distribution of parameter uncertainty by using Bayesian inference technology, taking the parameters of the nonlinear dynamics model as random variables and the climate data inside and outside the greenhouse as observation data, thereby obtaining a posterior distribution model of output uncertainty; Establishing a module for establishing a multi-objective random chance constrained MPC optimization problem based on a nonlinear dynamics model of the greenhouse climate system, a posterior distribution model of parameter uncertainty, and the objectives of the greenhouse production system; The solution module is used to solve the multi-objective random chance constrained MPC optimization problem to obtain the control input and control strategy of the greenhouse.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the greenhouse climate prediction and control method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the greenhouse climate prediction and control method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Control method and device for automatic landing of fixed-wing unmanned aerial vehicle and storage medium
CN119620771A
Ground temperature gradient prediction and target region optimization method and system based on multi-well combined Bayesian calibration
CN121902098A
A geothermal gradient prediction and target optimization method and system based on multi-well joint bayesian calibration
CN121902098B
Information gain driven rice field ecological process active assimilation method
CN122492389A
Network traffic classification method and related equipment based on Bayesian rule distillation
CN122678985A