A method and device for predicting temperature in a multi-source heat storage flexible solar greenhouse

By establishing a comprehensive heat transfer model and machine learning model, combining Gaussian hybrid model and visual optimization technology, the problem of low efficiency and accuracy of greenhouse temperature prediction is solved, and efficient, accurate and flexible greenhouse temperature prediction and control is achieved.

CN119167722BActive Publication Date: 2025-03-25INTELLIGENT EQUIPMENT RESEARCH CENTER BEIJING ACADEMY OF AGRICULTURE AND FORESTRY SCIENCES

Patent Information

Application Number
CN202411669735.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-03-25
Estimated Expiration
2044-11-21

AI Technical Summary

Technical Problem

In the prior art, the efficiency and accuracy of greenhouse temperature prediction are not high, and it is difficult to effectively consider complex factors such as multi-source heat storage, flexible structure, mesothermal thermal frequency conversion control, porosity and non-uniformity of greenhouses. The diversity, multimodality, high-dimensionality and sparseness of historical data are difficult to effectively fit and predict with traditional data analysis methods.

Method used

The heat transfer model is established by using nonlinear finite element method and multi-scale coordination method, and the machine learning model is established by combining multi-scale convolutional neural networks and spatiotemporal feature extraction methods. The machine learning model is optimized by using Gaussian hybrid model and adaptive weight generation method, and the model is visualized through visual optimization methods of gradient weighted class activation mapping and backpropagation to form a greenhouse temperature prediction model that comprehensively utilizes physical models and data models.

Benefits of technology

It improves the efficiency and accuracy of greenhouse temperature prediction, realizes efficient, accurate, flexible and interpretable prediction and control of greenhouse temperatures, enhances the generalization ability and credibility of the model, reduces the energy consumption and environmental pollution of the greenhouse, and extends the production season.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119167722B_ABST
    Figure CN119167722B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of greenhouse temperature prediction and control, and specifically to a method and device for predicting temperature in a multi-source heat storage type flexible solar greenhouse, the method comprising: establishing a heat transfer model using a nonlinear finite element method and a multi-scale coordination method; establishing a machine learning model using a multi-scale convolutional neural network and a spatiotemporal feature extraction method; optimizing the machine learning model using a Gaussian mixture model and an adaptive weight generation method; visualizing the optimized machine learning model using a gradient weighted class activation mapping and a back-propagation visualization optimization method to obtain a visualized machine learning model; generating a greenhouse temperature prediction model based on the heat transfer model and the visualized machine learning model to predict and control the greenhouse temperature. Combining the advantages of the heat transfer model and the machine learning model, using multi-scale coordination, spatiotemporal feature extraction, adaptive weight generation, and visualization optimization, the efficiency and accuracy of greenhouse temperature prediction are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of greenhouse temperature prediction and control, and in particular to a method and device for predicting the temperature of a multi-source heat storage type flexible solar greenhouse. Background Art

[0002] The temperature of the greenhouse is a key factor affecting the growth and quality of plants in the greenhouse, and is also the main determinant of the greenhouse's energy consumption and operating costs. Therefore, accurately predicting and controlling the temperature of the greenhouse is of great significance and value for improving the production efficiency and economic benefits of the greenhouse and reducing the energy consumption and environmental pollution of the greenhouse. With the development of science and technology and the demand of the market, the structure and function of the greenhouse are also constantly improving and innovating. New greenhouses such as multi-source heat storage flexible solar greenhouses have emerged, which use a variety of energy sources (solar energy, geothermal energy, biomass energy, etc.) for heat storage, and use flexible materials (polymers, fibers, etc.) to build the framework and covering layer of the greenhouse to achieve adaptive regulation and intelligent control of the greenhouse. It has the advantages of good thermal insulation performance, strong heat storage capacity, light structure, high plasticity, low cost, and good environmental protection. It is the forefront of greenhouse technology and the future development direction. However, the prediction and control of greenhouse temperature faces huge challenges and difficulties. Due to the influence of factors such as multi-source heat storage, flexible structure, geothermal frequency conversion control, porosity and non-uniformity of the greenhouse, the heat transfer process inside and outside the greenhouse becomes complex and nonlinear, and it is difficult to accurately describe and predict it using traditional mathematical models. At the same time, due to the diversity, multimodality, high dimensionality and sparsity of greenhouse historical data, it is difficult to effectively fit and predict using traditional data analysis methods. Therefore, a new technical method is needed that can comprehensively utilize the advantages of physical models and data models to achieve efficient, accurate, flexible and explainable prediction and control of greenhouse temperature. Summary of the invention

[0003] The present invention provides a multi-source heat storage type flexible solar greenhouse temperature prediction method and device, which is used to solve the defects of low efficiency and accuracy of greenhouse temperature prediction in the prior art, improve the efficiency and accuracy of greenhouse temperature prediction, and realize efficient, accurate, flexible and explainable prediction and control of greenhouse temperature. The technical solutions proposed by the present invention are as follows:

[0004] In a first aspect, the present invention provides a method for predicting temperature in a multi-source heat storage flexible solar greenhouse, comprising:

[0005] A heat transfer model is established using a nonlinear finite element method and a multi-scale coordination method; wherein the heat transfer model takes into account the greenhouse's multi-source heat storage, flexible structure, geothermal frequency conversion control, porosity, and non-uniformity, and describes the heat transfer process inside and outside the greenhouse;

[0006] Build machine learning models using multi-scale convolutional neural networks and spatiotemporal feature extraction methods;

[0007] The machine learning model is optimized by using a Gaussian mixture model and an adaptive weight generation method to obtain an optimized machine learning model;

[0008] Visualizing the optimized machine learning model using a gradient weighted class activation mapping and back-propagation visualization optimization method to obtain a visualized machine learning model;

[0009] A greenhouse temperature prediction model is generated based on the heat transfer model and the visualized machine learning model, so as to predict and control the greenhouse temperature based on the greenhouse temperature prediction model.

[0010] Optionally, the heat transfer model is established by using a nonlinear finite element method and a multi-scale coordination method, comprising:

[0011] Establish the geometric model, heat conduction model and heat convection model of the greenhouse respectively;

[0012] The heat transfer model is obtained by coupling the geometric model, heat conduction model and heat convection model of the greenhouse.

[0013] Optionally, the method of establishing a machine learning model using a multi-scale convolutional neural network and a spatiotemporal feature extraction method includes:

[0014] The spatiotemporal feature extraction method is used to extract spatiotemporal related features from the greenhouse historical data to obtain the spatiotemporal feature matrix;

[0015] Using the spatiotemporal feature matrix and actual temperature corresponding to the historical data of the greenhouse as training data, a multi-scale convolutional neural network is trained to minimize the error between the greenhouse temperature prediction value and the actual temperature, thereby obtaining a trained multi-scale convolutional neural network; wherein the multi-scale convolutional neural network extracts multi-level features from the spatiotemporal feature matrix to obtain a greenhouse temperature prediction value;

[0016] The trained multi-scale convolutional neural network is tested using the real-time data of the greenhouse as test data, and the process of training and testing the multi-scale convolutional neural network is repeated until the prediction performance of the multi-scale convolutional neural network meets the preset requirements, thereby obtaining the machine learning model.

[0017] Optionally, the spatiotemporal feature extraction method is used to extract spatiotemporal related features from the historical data of the greenhouse to obtain a spatiotemporal feature matrix, including:

[0018] The historical data of the greenhouse is divided according to the dimensions of time and space to obtain multiple spatiotemporal data blocks;

[0019] Extract spatiotemporal features from each spatiotemporal data block to obtain the corresponding spatiotemporal feature vector;

[0020] The spatiotemporal feature matrix is ​​obtained by combining the spatiotemporal feature vectors of each spatiotemporal data block.

[0021] Optionally, the multi-scale convolutional neural network includes an input layer, a fully connected layer, an output layer, and a plurality of convolutional layers and pooling layers;

[0022] The multi-scale convolutional neural network extracts multi-level features from the spatiotemporal feature matrix to obtain greenhouse temperature prediction values, including:

[0023] Taking the spatiotemporal feature matrix as the input of the input layer, the input layer converts the spatiotemporal feature matrix into a multi-channel two-dimensional tensor;

[0024] The multi-channel two-dimensional tensor is used as the input of the first convolution layer, and each convolution layer and pooling layer uses convolution kernels and pooling kernels of different scales to extract features of different scales from the input layer or the output of the previous layer;

[0025] The fully connected layer converts the output of the last pooling layer into a one-dimensional vector, and the output layer converts the output of the fully connected layer into a scalar as the predicted value of the greenhouse temperature.

[0026] Optionally, the method of optimizing the machine learning model by using a Gaussian mixture model and an adaptive weight generation method to obtain an optimized machine learning model includes:

[0027] Use Gaussian mixture model to cluster the input data and obtain clustering results;

[0028] According to different input data and output targets, the clustering results of the Gaussian mixture model are used to dynamically adjust the contribution weight of each factor to the greenhouse temperature prediction to obtain an optimized machine learning model.

[0029] Optionally, the input data includes multiple data points, and according to different input data and output targets, the clustering results of the Gaussian mixture model are used to dynamically adjust the contribution weights of various factors to the greenhouse temperature prediction to obtain an optimized machine learning model, including:

[0030] According to the clustering results of the Gaussian mixture model, the label of the Gaussian component is assigned to each data point;

[0031] Assign target values ​​to each Gaussian component according to different output targets;

[0032] Generate a weight vector for each data point based on the label and target value of the Gaussian component of each data point;

[0033] The generated weight vector is used to optimize the machine learning model, and the contribution weight of each factor to the greenhouse temperature prediction is dynamically adjusted to obtain the optimized machine learning model.

[0034] Optionally, the visualization optimization method using gradient weighted class activation mapping and back propagation is used to visualize the optimized machine learning model to obtain a visualized machine learning model, including:

[0035] Use gradient-weighted class activation mapping to visualize the machine learning model, generate the activation area of ​​the model, and obtain the gradient-weighted class activation map of the target layer;

[0036] The gradient weighted class activation mapping of the target layer is optimized using a back-propagation visualization optimization method to obtain the visualized machine learning model.

[0037] Optionally, the method of visualizing the machine learning model by using gradient weighted class activation mapping to generate an activation region of the model and obtain a gradient weighted class activation mapping of a target layer includes:

[0038] Select the target layer and calculate the gradient of each feature map of the target layer according to the predicted value of the output layer;

[0039] Calculate the global average of the gradients of each feature map of the target layer to obtain the weight of the target layer;

[0040] Multiply the weight of each feature map of the target layer by the corresponding feature map element by element, sum all weighted feature maps to get the activation area of ​​the target layer;

[0041] The activation regions of the target layer are post-processed to obtain the gradient-weighted class activation map of the target layer.

[0042] Optionally, the visualization optimization method using back propagation is used to optimize the gradient weighted class activation mapping of the target layer to obtain the visualized machine learning model, including:

[0043] Calculate the gradient of the output layer, where the gradient of the output layer is the partial derivative of the predicted value of the output layer with respect to the data of the input layer;

[0044] Post-process the gradient of the output layer, set the negative value of the gradient to zero, and normalize it to obtain the gradient map of the back propagation of the output layer;

[0045] The back-propagated gradient map of the output layer is fused with the gradient weighted class activation map of the target layer to obtain an optimized gradient weighted class activation map;

[0046] The optimized gradient weighted class activation map is superimposed on the input data to generate a visualized greenhouse temperature prediction map, thereby obtaining the visualized machine learning model.

[0047] Optionally, the predicting and controlling the greenhouse temperature based on the greenhouse temperature prediction model includes:

[0048] Use heat transfer models to make physical predictions of greenhouse temperatures, and use visualized machine learning models to make data predictions of greenhouse temperatures;

[0049] fusing the output results of the heat transfer model and the visualized machine learning model to obtain a final predicted value of the greenhouse temperature;

[0050] According to the final predicted value of greenhouse temperature, the control parameters of the greenhouse are adjusted so that the greenhouse temperature reaches the expected target value.

[0051] In a second aspect, the present invention also provides a multi-source heat storage type flexible solar greenhouse temperature prediction device, comprising the following modules:

[0052] A heat transfer model building module is used to establish a heat transfer model using a nonlinear finite element method and a multi-scale coordination method; wherein the heat transfer model takes into account the greenhouse's multi-source heat storage, flexible structure, geothermal frequency conversion control, porosity, and non-uniformity, and describes the heat transfer process inside and outside the greenhouse;

[0053] The spatiotemporal feature learning module is used to build a machine learning model using multi-scale convolutional neural networks and spatiotemporal feature extraction methods;

[0054] A model optimization and adjustment module is used to optimize the machine learning model using a Gaussian mixture model and an adaptive weight generation method to obtain an optimized machine learning model;

[0055] A model visualization module, used to visualize the optimized machine learning model using a gradient weighted class activation mapping and back propagation visualization optimization method to obtain a visualized machine learning model;

[0056] A greenhouse temperature prediction module is used to generate a greenhouse temperature prediction model based on the heat transfer model and the visualized machine learning model, so as to predict and control the greenhouse temperature based on the greenhouse temperature prediction model.

[0057] In a third aspect, the present invention further 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 computer program, the method for predicting air temperature in a multi-source thermal storage type flexible solar greenhouse as described in the first aspect above is implemented.

[0058] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the temperature prediction method for a multi-source thermal storage type flexible solar greenhouse as described in the first aspect above.

[0059] In a fifth aspect, the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the multi-source heat storage type flexible solar greenhouse temperature prediction method as described in the first aspect above.

[0060] Based on the above technical solution, the beneficial effects of the present invention compared with the prior art are as follows:

[0061] The multi-source heat storage type flexible solar greenhouse temperature prediction and device provided by the present invention establishes a heat transfer model by considering the multi-source heat storage, flexible structure, geothermal frequency conversion control, porosity and non-uniformity of the greenhouse to describe the heat transfer process inside and outside the greenhouse, and by combining nonlinear finite element method, multi-scale coordination method, MSCNN and GMM and other technologies, it can more accurately capture the spatiotemporal variation characteristics and nonlinear relationship of greenhouse temperature, thereby improving the efficiency and accuracy of prediction. The application of adaptive weight generation method and GMM helps the generalization ability of the model when processing different data sets and complex environments, making the model more reliable. The prediction mechanism and key features of the model are displayed by visualization technology, and the correlation strength and influence direction between greenhouse temperature and various factors are intuitively displayed, which improves the interpretability and credibility of the model, helps users better understand the decision-making process of the model, and performs targeted optimization and adjustment. Based on the results of the prediction model, intelligent control of greenhouse temperature can be achieved, and the growth environment and yield quality of greenhouse crops can be improved. The present invention can integrate the advantages of physical models and data models, and utilize advanced technical methods such as multi-scale coordination, spatiotemporal feature extraction, adaptive weight generation, and visualization optimization to achieve efficient, accurate, flexible, and explainable prediction and control of greenhouse temperature, thereby effectively improving the efficiency and accuracy of greenhouse temperature prediction.

[0062] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0063] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] 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.

[0065] Figure 1It is a flow chart of the temperature prediction method of the multi-source heat storage type flexible solar greenhouse provided by the present invention.

[0066] Figure 2 It is a structural schematic diagram of the multi-source heat storage type flexible solar greenhouse temperature prediction device provided by the present invention.

[0067] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0068] 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.

[0069] Traditional greenhouse temperature prediction methods can be divided into two categories: physical model-based and data model-based methods.

[0070] (1) The method based on physical model uses the knowledge of physics and mathematics to establish the heat transfer equation inside and outside the greenhouse, and obtains the predicted value of the greenhouse temperature by solving the equation. It has strong physical significance and prior knowledge, reflects the internal laws and mechanisms of the greenhouse, and is also convenient for the optimization design and formulation of control strategies for the greenhouse. However, its disadvantage is that it is difficult to consider the influence of various complex factors such as multi-source heat storage, flexible structure, geothermal frequency conversion control, porosity and non-uniformity of the greenhouse, resulting in low accuracy and stability of the model, and it is difficult to adapt to the changes and uncertainties of the greenhouse.

[0071] (2) The data model-based method uses data mining and machine learning techniques to extract features and patterns from historical data of greenhouses, and obtains greenhouse temperature prediction values ​​through training and testing. Its advantages are strong data fitting and prediction capabilities, capturing the complex and nonlinear relationship between greenhouse temperature and various factors, and adapting to the dynamics and randomness of greenhouses. However, it lacks physical constraints and prior knowledge, resulting in low interpretability and credibility of the model, making it difficult to optimize the design of greenhouses and formulate control strategies.

[0072] In recent years, some new technical methods have emerged to help overcome the shortcomings of traditional greenhouse temperature prediction methods, mainly including the following three aspects: (1) Hybrid model linkage architecture, which uses the advantages of heat transfer models and machine learning models to achieve greenhouse temperature prediction. By effectively integrating and coordinating physical models and data models, a unified greenhouse temperature prediction model is formed, which can not only reflect the inherent laws and mechanisms of the greenhouse, but also capture the dynamics and randomness of the greenhouse, and achieve the goal of efficient, accurate, flexible and interpretable greenhouse temperature prediction. (2) Multi-scale coordination method, which uses different scales and angles to model and analyze the heat transfer process of the greenhouse. By decomposing the heat transfer process of the greenhouse into different scales and levels, namely microscale, mesoscale and macroscale or spatial scale, time scale and frequency scale, and then establishing corresponding models and algorithms at each scale, finally, by coordinating and integrating the results of different scales, the greenhouse temperature prediction value is obtained. Its advantage is that it can fully consider the influence of complex factors such as the porosity and non-uniformity of the greenhouse, and improve the accuracy and stability of the model. (3) Adaptive weight generation method, which uses the characteristics and objectives of the data to dynamically adjust the weight of the model. By using machine learning techniques such as Gaussian mixture model, convolutional neural network, gradient weighted class activation mapping, etc., data are clustered, feature extracted, and visualized optimized. Then, according to different clustering results and optimization goals, different weight vectors are adaptively generated to dynamically adjust the contribution weight of each factor to greenhouse temperature prediction, thereby enhancing the generalization and migration capabilities of the model. The advantage is that it can adapt to different data distributions and prediction goals, and improve the flexibility and adaptability of the model.

[0073] Based on this, the present invention proposes a greenhouse temperature prediction method based on a hybrid model linkage architecture. This method combines the advantages of heat transfer models and machine learning models, and uses advanced technical methods such as multi-scale coordination, spatiotemporal feature extraction, adaptive weight generation, and visualization optimization to improve the greenhouse's thermal insulation and heat storage capacity, reduce energy consumption, and extend the production season, providing an efficient, accurate, flexible, and interpretable solution for greenhouse temperature prediction. In order to optimize and improve the greenhouse temperature prediction method based on physical models or data models, the hybrid model linkage architecture, multi-scale coordination method, spatiotemporal feature extraction method, adaptive weight generation method, visualization optimization method and other technologies are comprehensively used to overcome the shortcomings of existing technical solutions, improve the efficiency and accuracy of greenhouse temperature prediction, as well as the greenhouse's thermal insulation and heat storage capacity, reduce energy consumption, and extend the production season.

[0074] Combine the following Figure 1-Figure 2 The present invention describes a method and device for predicting air temperature in a multi-source heat storage flexible solar greenhouse.

[0075] The multi-source heat storage flexible solar greenhouse temperature prediction method provided by the present invention combines the advantages of heat transfer models and machine learning models, and utilizes advanced technical methods such as multi-scale coordination, spatiotemporal feature extraction, adaptive weight generation, and visualization optimization to effectively improve the greenhouse's thermal insulation and heat storage capacity, reduce energy consumption, and extend the production season, providing an efficient, accurate, flexible, and explainable solution for greenhouse temperature prediction.

[0076] In order to implement the present invention, the following types of data need to be obtained:

[0077] Environmental data inside and outside the greenhouse, including temperature, humidity, light, wind speed, wind direction, precipitation, carbon dioxide and other indicators, reflect the heat transfer of the greenhouse and the conditions for crop growth. It is collected through sensor equipment installed inside and outside the greenhouse, such as temperature and humidity sensors, light sensors, wind speed and direction sensors, rainfall sensors, carbon dioxide sensors, etc.

[0078] The control data of the greenhouse, including control parameters such as heat storage, ventilation, and irrigation, reflects the energy consumption of the greenhouse and the intervention of crop growth. It is collected through controller devices installed in the greenhouse, such as heat storage controllers, ventilation controllers, irrigation controllers, etc.

[0079] Greenhouse crop data, including crop varieties, growth periods, growth status and other indicators, reflects the greenhouse production efficiency and crop quality. It is collected through manual recording or using image recognition and other technologies, such as crop variety recognition, crop growth period recognition, crop disease and pest recognition, etc.

[0080] In addition, some data are obtained through public access or self-collection:

[0081] Public access on the Internet: Use the Internet or other public platforms to obtain relevant data inside and outside the greenhouse, such as meteorological data, agricultural data, market data, etc., as a reference or supplement for greenhouse temperature forecasts.

[0082] In order to use the acquired data for model construction and prediction, the data needs to be processed, including structured storage, data cleaning, data standardization, data analysis and other practical operations. The following Python libraries and functions are needed:

[0083] Structured warehousing uses the pandas library (https: / / pandas.pydata.org / ) and the sqlite3 library (https: / / docs.python.org / 3 / library / sqlite3.html) to convert data into a data frame format and store it in a SQLite database to facilitate subsequent data processing and query. Use the following functions: pandas.read_csv() reads a data file in CSV format and returns a data frame object; pandas.to_sql() writes the data frame object to the SQLite database and creates a data table; sqlite3.connect() connects to the SQLite database and returns a database connection object; sqlite3.Cursor() creates a database cursor object for executing SQL statements.

[0084] Data cleaning uses the numpy library (https: / / numpy.org / ) and the scipy library (https: / / www.scipy.org / ) to process missing values, outliers, duplicate values, etc. in the data to improve the quality and integrity of the data. Use the following functions: numpy.isnan() determines whether the data is a missing value (NaN) and returns a Boolean array; numpy.nanmean() calculates the mean of the data and ignores missing values; numpy.nanfill() fills missing values ​​with specified values; scipy.stats.zscore() calculates the standard score (Z-score) of the data for detecting outliers; scipy.stats.iqr() calculates the interquartile range (IQR) of the data for detecting outliers; pandas.drop_duplicates() deletes duplicate values ​​in the data and returns a new data frame object.

[0085] Data standardization uses the sklearn library (https: / / scikit-learn.org / ) to normalize or standardize the data, eliminate the impact of the dimension and scale of the data, and improve the comparability and stability of the data. Use the following functions: sklearn.preprocessing.MinMaxScaler() creates a minimum and maximum normalized converter object to convert the data to a value between 0 and 1; sklearn.preprocessing.StandardScaler() creates a standardized converter object to convert the data to a value with a mean of 0 and a standard deviation of 1; sklearn.preprocessing.fit_transform() fits and transforms the data and returns a new array object.

[0086] Data analysis uses the matplotlib library (https: / / matplotlib.org / ) and the seaborn library (https: / / seaborn.pydata.org / ) to visualize and statistically analyze the data, explore the distribution, correlation, trend and other characteristics of the data, and provide a basis for model construction and prediction. Use the following functions: matplotlib.pyplot.figure() creates a graphic object for drawing charts; matplotlib.pyplot.plot() draws a line graph to show the changing trend of data; matplotlib.pyplot.scatter() draws a scatter plot to show the distribution and correlation of data; matplotlib.pyplot.bar() draws a bar chart to show the frequency and proportion of data; matplotlib.pyplot.hist() draws a histogram to show the distribution and density of data; matplotlib.pyplot.boxplot() draws a box plot to show the quantiles and outliers of data; seaborn.heatmap() draws a heat map to show the correlation coefficient matrix of data; seaborn.pairplot() draws a paired graph to show the pairwise relationship of data; seaborn.regplot() draws a regression graph to show the linear relationship and confidence interval of data.

[0087] Reference Figure 1 As shown, the method includes the following:

[0088] Step S101, establishing a heat transfer model using nonlinear finite element method and multi-scale coordination method.

[0089] This heat transfer model takes into account factors such as multi-source heat storage, flexible structure, geothermal frequency conversion control, porosity and non-uniformity of the greenhouse, and describes the heat transfer process inside and outside the greenhouse. The role of this step is to provide physical constraints and prior knowledge to provide a basis for greenhouse temperature prediction. The nonlinear finite element method numerical analysis method is used to solve complex nonlinear partial differential equations, which is applicable to nonlinear heat conduction problems in greenhouses. The multi-scale coordination method numerical analysis method models the thermal convection problem of the greenhouse at different scales, taking into account the porosity and non-uniformity of the greenhouse to improve the accuracy and stability of the model.

[0090] Step S102: Establish a machine learning model using a multi-scale convolutional neural network (MSCNN) and a spatiotemporal feature extraction method.

[0091] By using the powerful feature extraction and expression capabilities of multi-scale convolutional neural networks, we can extract spatiotemporal features from historical greenhouse data and capture the complex and nonlinear relationship between greenhouse temperature and various factors. By capturing the multi-scale features and spatiotemporal dependencies in greenhouse temperature data, we can improve the accuracy of predictions.

[0092] Step S103: Optimize the machine learning model using a Gaussian mixture model (GMM) and an adaptive weight generation method to obtain an optimized machine learning model.

[0093] According to different input data and output targets, the Gaussian mixture model is used to cluster the data. According to different clustering results, different weight vectors are adaptively generated to dynamically adjust the contribution weights of various factors to greenhouse temperature prediction, thereby enhancing the generalization and migration capabilities of the model. The Gaussian mixture model is used to process the nonlinear and non-convex distribution characteristics of the data, and the adaptive weight generation method is used to adjust the model parameters to improve the generalization ability and prediction accuracy of the model.

[0094] Step S104: visualize the optimized machine learning model using a gradient weighted class activation mapping (Grad-CAM) and back-propagation visualization optimization method to obtain a visualized machine learning model.

[0095] By visualizing the activation area and gradient information of the model, the results of Grad-CAM are optimized, noise and artifacts are eliminated, and the correlation strength and influence direction between greenhouse temperature and various factors are intuitively displayed, thereby improving the interpretability and credibility of the model.

[0096] Step S105: generating a greenhouse temperature prediction model based on the heat transfer model and the visualized machine learning model, so as to predict and control the greenhouse temperature based on the greenhouse temperature prediction model.

[0097] The heat transfer model describes the heat transfer process inside and outside the greenhouse, providing physical constraints and prior knowledge for greenhouse temperature prediction. The output results of the heat transfer model and the machine learning model are used to form a hybrid model, namely the greenhouse temperature prediction model mentioned above, to achieve the prediction and control of greenhouse temperature.

[0098] The present invention can more accurately capture the spatiotemporal variation characteristics and nonlinear relationship of greenhouse temperature by combining various technologies such as nonlinear finite element method, multi-scale coordination method, MSCNN and GMM, thereby improving the accuracy of prediction. The application of adaptive weight generation method and GMM helps the generalization ability of the model when processing different data sets and complex environments, making the model more reliable. The prediction mechanism and key features of the model are displayed by visualization technology, which helps users better understand the decision-making process of the model and perform targeted optimization and adjustment. Based on the results of the prediction model, intelligent control of greenhouse temperature can be achieved, and the growth environment and yield quality of greenhouse crops can be improved.

[0099] Moreover, this method fully considers the influence of various complex factors of greenhouses (such as multi-source heat storage, flexible structure, geothermal frequency conversion control, porosity and non-uniformity, etc.) to improve the accuracy and stability of the model. At the same time, it also makes full use of the information of historical data and future data of the greenhouse, that is, the characteristics of time and space, dynamic and random laws, adaptive and optimized weights, etc., to improve the data fitting and prediction capabilities of the model. By effectively integrating and coordinating the heat transfer model and the machine learning model, a unified greenhouse temperature prediction model is formed, which can not only reflect the inherent laws and mechanisms of the greenhouse, but also capture the dynamics and randomness of the greenhouse, and achieve the goal of efficient, accurate, flexible and interpretable greenhouse temperature prediction. This method overcomes the limitations of traditional physical models and data models, comprehensively utilizes the advantages of the two models, and improves the quality and efficiency of greenhouse temperature prediction. In addition, this method also provides model visualization and optimization, improves the interpretability and credibility of the model, and provides a more scientific and effective basis and guarantee for greenhouse temperature control.

[0100] This method uses a variety of energy sources (solar energy, geothermal energy, biomass energy, etc.) to store heat, and uses flexible materials (polymers, fibers, etc.) to build the framework and cover of the greenhouse to achieve adaptive regulation and intelligent control of the greenhouse. It has the advantages of good thermal insulation performance, strong heat storage capacity, light structure, high plasticity, low cost, good environmental protection, etc., effectively reducing greenhouse energy consumption and environmental pollution, extending the production season of the greenhouse, and improving the production efficiency and economic benefits of the greenhouse.

[0101] In an optional embodiment, the heat transfer model is used to describe the heat transfer process inside and outside the greenhouse. The present invention considers factors such as multi-source heat storage, flexible structure, geothermal frequency conversion control, porosity and non-uniformity of the greenhouse to construct the heat transfer model. The heat transfer model established by using the nonlinear finite element method and the multi-scale coordination method described in the above step S101 includes:

[0102] S1011. Establish the geometric model, heat conduction model and heat convection model of the greenhouse respectively.

[0103] The geometric model of the greenhouse is established, including the shape, size, structure, material and other parameters of the greenhouse, as well as the parameters of the crops, soil, water and other parameters in the greenhouse. The geometric model of the greenhouse is divided into finite element meshes, each mesh unit is represented by a node, and the connection relationship between nodes is described by the unit stiffness matrix and unit mass matrix. The geometric model of the greenhouse is expressed by the following formula:

[0104]

[0105] in, is the total mass matrix, is the total damping matrix, is the total stiffness matrix, is the node displacement vector, is the nodal load vector, and are the node velocity vector and the node acceleration vector respectively.

[0106] S1.2 Establish a heat conduction model for the greenhouse, using a nonlinear partial differential equation to describe it, taking into account factors such as the nonlinear heat conduction coefficient, heat capacity, thermal radiation, and thermal convection of the greenhouse, as well as boundary conditions such as temperature, humidity, wind speed, and solar radiation inside and outside the greenhouse. The heat conduction model for the greenhouse is expressed by the following formula:

[0107]

[0108] in, is the density, is the specific heat capacity, is the temperature, It's time. is the thermal conductivity, is the heat source term, is the gradient operator, It is the dot multiplication operation.

[0109] S1.3 Establish a thermal convection model for the greenhouse. The model is described by a multi-scale coordination method, taking into account the porosity and non-uniformity of the greenhouse, as well as factors such as air flow, humidity changes, and water vapor condensation in the greenhouse. The thermal convection model for the greenhouse is expressed by the following formula:

[0110]

[0111] in, is the air velocity vector, It's pressure. is the dynamic viscosity, is the coefficient of thermal expansion, is the acceleration due to gravity, is the reference temperature, is the vertical unit vector, is the porosity coefficient of the greenhouse, is the thermal diffusivity, is the heat convection source term.

[0112] S1012. The geometric model, heat conduction model and heat convection model of the greenhouse are coupled to obtain the heat transfer model. The heat transfer model describes the heat transfer process inside and outside the greenhouse and provides physical constraints and prior knowledge for greenhouse temperature prediction. The heat transfer model is expressed by the following formula:

[0113]

[0114] The meanings of the symbols are the same as above. is the thermal conductivity of the earth, is the geothermal temperature, It represents the difference between the temperature in the greenhouse and the geothermal temperature. The term represents the effect of geothermal heat on greenhouse temperature. The steps to construct the above heat transfer model are as follows:

[0115] a. Using nonlinear finite element method and multi-scale coordination method, the heat conduction equation and heat convection equation of the greenhouse are established to describe the solid heat conduction and fluid heat convection of the greenhouse respectively;

[0116] b. Using boundary conditions and initial conditions, determine the thermal boundary and thermal initial state of the greenhouse, including the external environment temperature, internal heat storage temperature, geothermal temperature, etc. of the greenhouse;

[0117] The above boundary conditions include greenhouse external boundary conditions, greenhouse internal boundary conditions and underground boundary conditions. The greenhouse external boundary conditions refer to the external environment temperature, which is the reference temperature in the above thermal convection model. The internal boundary condition of the greenhouse refers to the internal heat storage temperature, which is the temperature in the above heat transfer model. The underground boundary condition refers to the geothermal temperature , as the temperature boundary condition at the bottom of the greenhouse.

[0118] The above initial conditions include the temperature distribution of each point in the greenhouse at the initial time (t=0) T(x,y,z,0) , velocity distribution of airflow in the greenhouse at the initial moment w(x,y,z,0) , and the pressure distribution in the greenhouse at the initial moment p(x,y,z,0) .

[0119] The above boundary conditions and initial conditions are used to solve the heat transfer model equations given in the previous article. By specifying these boundary conditions and initial conditions, the solution of the heat transfer model can be uniquely determined, thereby calculating the temperature field distribution at any time and any position in the greenhouse.

[0120] c. Use numerical solution methods to solve the heat conduction equation and heat convection equation of the greenhouse, and obtain the thermal field distribution and heat flow rate distribution of the greenhouse, as well as the average temperature and maximum temperature of the greenhouse. Specifically, the following parameters are obtained:

[0121] (1) Node displacement vector u , represents the deformation state of the greenhouse structure;

[0122] (2) Temperature field T , represents the temperature distribution of each point in the greenhouse;

[0123] (3) Air velocity vector w , indicating the flow state of air in the greenhouse.

[0124] The FEniCS library (https: / / fenicsproject.org / ) and the PyAMG library (https: / / pyamg.org / ) are used to build and solve the heat transfer model. The functions listed in Table 1 are required:

[0125] Table 1

[0126]

[0127] The present invention can more accurately describe the heat transfer process inside the greenhouse by establishing a geometric model, a heat conduction model and a heat convection model respectively and coupling them. At the same time, the accuracy of the model can be further improved by solving and optimizing using a nonlinear finite element method and a multi-scale coordination method. The heat transfer model established takes into account factors such as multi-source heat storage, flexible structure, geothermal frequency conversion control, porosity and non-uniformity of the greenhouse, so it has a wider range of applicability. It can be used for heat transfer analysis under different types of greenhouses and different environmental conditions. The heat transfer model established can provide an important physical basis for subsequent greenhouse temperature prediction and control. By combining technologies such as machine learning, intelligent prediction and control of greenhouse temperature can be achieved, providing more stable and controllable environmental conditions for the growth of greenhouse crops.

[0128] In an optional embodiment, the method of establishing a machine learning model using a multi-scale convolutional neural network and a spatiotemporal feature extraction method described in step S102 includes:

[0129] S1021. Use a spatiotemporal feature extraction method to extract spatiotemporal related features from the historical data of the greenhouse to obtain a spatiotemporal feature matrix.

[0130] First, the collected historical data and actual temperature of the greenhouse are preprocessed, such as data cleaning and normalization, to obtain preprocessed training data. Secondly, the structure of the multi-scale convolutional neural network is designed, including the input layer, multiple parallel convolutional layers (each convolutional layer uses convolution kernels of different sizes), pooling layers, fully connected layers, etc.

[0131] The spatiotemporal feature extraction method is then used to extract spatiotemporal related features from the preprocessed training data to obtain the spatiotemporal feature matrix.

[0132] S1022. Use the spatiotemporal feature matrix corresponding to the historical data of the greenhouse and the actual temperature as training data to train the multi-scale convolutional neural network so that the error between the predicted greenhouse temperature and the actual temperature is minimized, the fitting ability and prediction ability of the network are improved, and a trained multi-scale convolutional neural network is obtained.

[0133] The spatiotemporal feature matrix is ​​input into the multi-scale convolutional neural network, which extracts multi-level features from the spatiotemporal feature matrix to obtain the greenhouse temperature prediction value. The weights and biases of the network are adjusted through the back propagation algorithm and optimizer (such as Adam, RMSprop, etc.) to minimize the error between the greenhouse temperature prediction value and the actual temperature. During the training process, the multi-scale convolutional neural network extracts multi-level features from the spatiotemporal feature matrix. These features integrate information at different scales and help to more accurately predict the greenhouse temperature.

[0134] The present invention uses mean square error (MSE) as the loss function of the machine learning model to measure the error of greenhouse temperature prediction. Stochastic gradient descent (SGD) is used as the optimization algorithm of the machine learning model to update the network parameters of greenhouse temperature prediction. The TensorFlow library (https: / / www.tensorflow.org / ) and Keras library (https: / / keras.io / ) are used to build and train the machine learning model, and the functions in Table 2 below are required:

[0135] Table 2

[0136]

[0137] The training process is expressed by the following formula:

[0138]

[0139] in, are the parameters of the network, is the number of training data, It is The actual temperature of the training data, It is The predicted temperature of the training data, It is The squared error of the training data, is the mean square error of the training data, is the operation to solve the minimization problem.

[0140] S1023. Use the real-time data of the greenhouse as test data to test the trained multi-scale convolutional neural network, and repeat the process of training and testing the multi-scale convolutional neural network until the prediction performance of the multi-scale convolutional neural network meets the preset requirements, thereby obtaining the machine learning model.

[0141] Real-time environmental parameters and temperature data are collected from the greenhouse and preprocessed to obtain preprocessed real-time data. The above-mentioned spatiotemporal feature extraction method is also used to extract spatiotemporal related features from the preprocessed real-time data to obtain a spatiotemporal feature matrix. The spatiotemporal feature matrix corresponding to the real-time data is input into the trained multi-scale convolutional neural network to obtain the predicted value of the greenhouse temperature. The difference between the predicted value and the actual value is compared to evaluate the prediction performance of the model. According to the evaluation results, the multi-scale convolutional neural network is fine-tuned, and retrained and tested, and the above steps S1021-S1023 are executed repeatedly until the prediction performance of the model meets the preset requirements.

[0142] The present invention uses the following indicators to measure the prediction performance of the evaluation network:

[0143] Root mean square error (RMSE): It is the square root of the square error between the predicted temperature and the actual temperature, reflecting the accuracy of the prediction. The smaller the better. RMSE is expressed by the following formula:

[0144]

[0145] Correlation coefficient (R): Indicates the linear correlation between the predicted temperature and the actual temperature, reflecting the consistency of the prediction. The closer it is to 1, the better. R is expressed by the following formula:

[0146]

[0147] Coefficient of determination (R 2 ): It indicates the degree of variation between the predicted temperature and the actual temperature, reflecting the goodness of fit of the prediction. The closer to 1, the better. It is expressed by the following formula:

[0148]

[0149] The meanings of the symbols are the same as above. and are the means of the actual and predicted temperatures, respectively.

[0150] A root mean square error threshold, a correlation coefficient threshold, and a determination coefficient threshold may be pre-set. When the root mean square error is less than the root mean square error threshold, the correlation coefficient is less than the correlation coefficient threshold, and the determination coefficient is less than the determination coefficient threshold, the prediction performance is considered to have met the requirements.

[0151] The present invention can extract multi-level features from the spatiotemporal feature matrix through a multi-scale convolutional neural network, integrate information of different scales, and help to more accurately predict the greenhouse temperature. Through the process of cyclic training and testing, the model can gradually adapt to different data distributions and changes, improving the robustness and generalization ability of the model. The trained multi-scale convolutional neural network can quickly process real-time greenhouse data and give accurate temperature prediction values, providing timely decision support for greenhouse management.

[0152] In an optional embodiment, a machine learning model is established using a multi-scale convolutional neural network (MSCNN) and a spatiotemporal feature extraction method, and the powerful feature extraction and expression capabilities of the multi-scale convolutional neural network are used to extract spatiotemporal related features from the historical data of the greenhouse, capturing the complex and nonlinear relationship between the greenhouse temperature and various factors. The role of this step is to provide data fitting and prediction capabilities to provide support for greenhouse temperature prediction. The multi-scale convolutional neural network, a deep learning model, uses multi-scale convolution kernels and pooling layers to extract multi-level features from the data to enhance the model's expression and prediction capabilities. Through the spatiotemporal feature extraction method, a data processing method, the spatiotemporal related features are extracted from the historical data of the greenhouse using time series and spatial information to enhance the input information and output quality of the model. The spatiotemporal feature extraction method described in the above step S1021 extracts spatiotemporal related features from the historical data of the greenhouse using the spatiotemporal feature extraction method to obtain a spatiotemporal feature matrix, including:

[0153] S10211. Divide the historical data of the greenhouse according to the dimensions of time and space to obtain multiple spatiotemporal data blocks. Each spatiotemporal data block contains greenhouse data such as temperature, humidity, wind speed, solar radiation, etc. within a certain spatial range within a certain time range. The spatiotemporal data block is represented by the following formula:

[0154]

[0155] in, It is The spatial region and spatiotemporal data blocks of time regions, The space-time data block is The data vector at each time point, is the time length of the spatiotemporal data block.

[0156] S10212. Extract spatiotemporal features from each spatiotemporal data block to obtain a corresponding spatiotemporal feature vector.

[0157] Spatiotemporal feature extraction is performed on each spatiotemporal data block. The spatiotemporal related features are extracted from the spatiotemporal data block using the time series and space information, such as the mean, variance, maximum value, minimum value, autocorrelation coefficient, mutual correlation coefficient, spectrum analysis, etc. of the spatiotemporal data block. Spatiotemporal feature extraction is expressed by the following formula:

[0158]

[0159] in, It is The spatial region and The spatiotemporal feature vector of the spatiotemporal data block in the time region, is the spatiotemporal feature extraction function.

[0160] S10213. Combine the spatiotemporal feature vectors of each spatiotemporal data block to obtain the spatiotemporal feature matrix.

[0161] The spatiotemporal feature matrix is ​​used as the input of the subsequent multi-scale convolutional neural network. The spatiotemporal feature matrix reflects the spatiotemporal correlation of the greenhouse's historical data and enhances the input information and output quality of the model. The spatiotemporal feature matrix is ​​expressed by the following formula:

[0162]

[0163] in, is the spatiotemporal feature matrix, It is The spatial region and The spatiotemporal feature vector of the spatiotemporal data block in the time region, is the number of spatial regions, is the number of time zones.

[0164] The present invention can clearly define the source and scope of the data by dividing the historical data of the greenhouse according to the dimensions of time and space, which is helpful for subsequent data processing and analysis. This division method makes the data more structured, easy to manage and store, and also facilitates the subsequent spatiotemporal feature extraction. By extracting the spatiotemporal features of each spatiotemporal data block, the changing law of the internal environmental parameters of the greenhouse with time and space can be accurately captured. These feature vectors contain rich spatiotemporal information, can reflect the dynamic changes of the internal environment of the greenhouse, and provide strong support for the subsequent temperature prediction. By combining the spatiotemporal feature vectors of each spatiotemporal data block into a spatiotemporal feature matrix, a feature set containing rich spatiotemporal information can be formed. This feature matrix can be used as the input of a multi-scale convolutional neural network for training and optimizing the model to improve the prediction performance of the model. Because the spatiotemporal feature matrix contains rich spatiotemporal information, the model can more accurately capture the changing law of the internal environmental parameters of the greenhouse, thereby more accurately predicting the greenhouse temperature. By introducing the spatiotemporal feature matrix, the model can learn the changing law of the internal environmental parameters of the greenhouse at different time and space scales. This enables the model to better adapt and generalize when facing new and unknown data, and improves the robustness and reliability of the model. At the same time, the construction of the spatiotemporal feature matrix also facilitates subsequent model interpretation and visualization, helping users to better understand the prediction mechanism of the model.

[0165] In an optional embodiment, a multi-scale convolutional neural network is used to extract multi-level features from the spatiotemporal feature matrix, and the powerful feature extraction and expression capabilities of the multi-scale convolutional neural network are used to capture the complex and nonlinear relationship between greenhouse temperature and various factors. The multi-scale convolutional neural network in the present invention includes an input layer, a fully connected layer, an output layer, and multiple convolutional layers and pooling layers. The multi-scale convolutional neural network described in step S1022 extracts multi-level features from the spatiotemporal feature matrix to obtain a greenhouse temperature prediction value, including:

[0166] S10221. The spatiotemporal feature matrix is ​​used as the input of the input layer, and the input layer converts the spatiotemporal feature matrix into a multi-channel two-dimensional tensor. Each channel corresponds to a spatiotemporal feature vector, and each element corresponds to a spatiotemporal feature value. The input layer is represented by the following formula:

[0167]

[0168] in, is the input layer, is the spatiotemporal feature matrix.

[0169] S10222. The multi-channel two-dimensional tensor is used as the input of the first convolution layer. Each convolution layer and pooling layer uses convolution kernels and pooling kernels of different scales to extract features of different scales from the input layer or the output of the previous layer to enhance the expression and prediction capabilities of the model. The convolution layer and pooling layer are represented by the following formula:

[0170]

[0171] in, It is The output of the convolutional layer, It is The output of the pooling layer, is the activation function, It is The convolution kernel of the convolution layer, It is The bias term of the convolutional layer, is the convolution operation, is a pooling operation, is the input of the first convolutional layer.

[0172] S10223. The fully connected layer converts the output of the last pooling layer into a one-dimensional vector, and the output layer converts the output of the fully connected layer into a scalar as the predicted value of the greenhouse temperature. The fully connected layer and the output layer are expressed by the following formula:

[0173]

[0174] in, is the output of the fully connected layer, is the output of the output layer, is the activation function, is the weight matrix of the fully connected layer, is the bias vector of the fully connected layer, is the output of the last pooling layer, is the weight vector of the output layer, is the bias scalar of the output layer.

[0175] The present invention converts the spatiotemporal feature matrix into a multi-channel two-dimensional tensor through an input layer, and this step provides a suitable input format for subsequent convolution operations. By representing the features in the spatiotemporal feature matrix in the form of multiple channels, the advantages of convolutional neural networks in processing image data can be fully utilized, thereby more effectively extracting spatiotemporal features. Each convolution layer and pooling layer uses convolution kernels and pooling kernels of different scales to extract features of different scales from the output of the input layer or the previous layer. This multi-scale feature extraction method can capture the changing laws of greenhouse internal environmental parameters at different time and space scales, thereby more comprehensively reflecting the complexity and diversity of greenhouse temperature. By combining features of different scales, the model can learn richer information and improve the accuracy of prediction.

[0176] With the stacking of convolutional layers and pooling layers, the network can gradually extract higher-level features. These high-level features not only contain the detailed information of the original data, but also integrate a wider range of temporal and spatial context information, which helps the model to more accurately understand the dynamic changes of environmental parameters inside the greenhouse.

[0177] The fully connected layer converts the output of the last pooling layer into a one-dimensional vector. This process integrates and compresses the features extracted by the previous convolutional layer and pooling layer. Through the processing of the fully connected layer, the model can integrate the scattered feature information into a compact feature representation, providing effective input for the subsequent output layer. The output layer converts the output of the fully connected layer into a scalar as the predicted value of the greenhouse temperature. Through training and optimization, the model can learn the complex mapping relationship from input features to output temperature, thereby achieving accurate greenhouse temperature prediction. The multi-scale convolutional neural network can significantly improve the accuracy and robustness of greenhouse temperature prediction by combining multi-scale feature extraction and hierarchical feature representation. Even in the face of complex and changeable greenhouse environmental parameters and temperature trends, the model can give reliable prediction results. The structure and parameters of the multi-scale convolutional neural network can be optimized through the training process to adapt to different data sets and prediction tasks.

[0178] In an optional embodiment, the machine learning model is optimized using a Gaussian mixture model (GMM) and an adaptive weight generation method. According to different input data and output targets, the Gaussian mixture model is used to cluster the data. According to different clustering results, different weight vectors are adaptively generated to dynamically adjust the contribution weights of various factors to greenhouse temperature prediction, thereby enhancing the generalization and migration capabilities of the model. The purpose of this step is to improve the adaptability and flexibility of the model and provide a guarantee for greenhouse temperature prediction. The Gaussian mixture model, a probabilistic model, uses Gaussian distribution to cluster data and is suitable for multimodal and nonlinear data distributions in greenhouses. The adaptive weight generation method is an optimization method that uses the clustering results of the Gaussian mixture model to adaptively generate different weight vectors, dynamically adjust the contribution weights of various factors to greenhouse temperature prediction, and improve the flexibility and adaptability of the model. The above-mentioned step S103 described the use of the Gaussian mixture model and the adaptive weight generation method to optimize the machine learning model to obtain an optimized machine learning model, including:

[0179] S1031. Cluster the input data using a Gaussian mixture model to obtain a clustering result.

[0180] The above input data includes multiple data points. It is assumed that the generation process of the data points consists of a mixture of multiple Gaussian distributions. Each Gaussian distribution represents a potential cluster in the data. The model learns the parameters of these Gaussian distributions, including the mean, standard deviation and their weights, through Maximum Likelihood Estimation (MLE).

[0181] The above input data comes from the continuous records of the greenhouse environment monitoring system. The data needs to be preprocessed, including missing value filling, outlier detection and processing, etc., to ensure the accuracy and consistency of the data. Use a Gaussian mixture model to cluster the input data. During the training process, the Gaussian mixture model tries to find the best combination of Gaussian distributions to maximize the likelihood of the data. This usually involves an iterative optimization process, such as the expectation-maximization (EM) algorithm. After the training is completed, the Gaussian mixture model outputs the clustering results, that is, the probability of each data point being assigned to a Gaussian distribution. These clustering results reflect the inherent structure and pattern of historical temperature data. The use of Gaussian distribution to perform probabilistic modeling of data is suitable for multimodal and nonlinear data distributions in greenhouses. The specific steps include:

[0182] S10311. Assume that the input data obeys a Gaussian mixture distribution, that is, each data point is composed of multiple Gaussian components, each Gaussian component is represented by a mean vector, a covariance matrix, and a mixing coefficient. The Gaussian mixture distribution It is expressed by the following formula:

[0183]

[0184] in, is the input data, is the number of Gaussian components, It is The mixing coefficient of Gaussian components satisfies , It is The probability density function of the Gaussian components is It is The mean vector of the Gaussian components, It is The covariance matrix of the Gaussian components.

[0185] S10312, using the EM algorithm to estimate the parameters of the Gaussian mixture model, that is, solving the mean vector, covariance matrix and mixing coefficient of the Gaussian component that maximizes the log-likelihood function of the input data, the EM algorithm includes the following steps:

[0186] S103121. Initialize the parameters of the Gaussian mixture model, that is, randomly or according to some heuristic rules, give the initial values ​​of the mean vector, covariance matrix and mixing coefficient of the Gaussian component, denoted as , .

[0187] S103122. Execute step E, that is, calculate the posterior probability of each data point belonging to each Gaussian component according to the current parameter value, that is, the expected value of the latent variable. The posterior probability is expressed by the following formula:

[0188]

[0189] in, It is The data point belongs to The posterior probability of the Gaussian components is It is The hidden variable of a data point indicates which Gaussian component it belongs to. It is The observed value of data points, is the number of iterations.

[0190] S103123, execute M steps, update the parameters of the Gaussian mixture model according to the current posterior probability, so that the mean vector, covariance matrix and mixing coefficient of the Gaussian component of the log-likelihood function of the input data with respect to the maximum expectation of the latent variable are obtained. The parameter update is expressed by the following formula:

[0191]

[0192] in, It is The mean vector, covariance matrix and updated values ​​of the mixing coefficients of the Gaussian components, is the number of input data.

[0193] The above-mentioned E-step and M-step iterative cycles are executed alternately.

[0194] S103124 determines whether the convergence condition is met, that is, whether the growth of the log-likelihood function of the input data is less than a given threshold, or whether the number of iterations exceeds a given upper limit. If yes, the iteration is stopped and the parameters of the Gaussian mixture model are output. If no, the iteration is returned to S103122 to continue. The log-likelihood function of the input data is expressed by the following formula:

[0195]

[0196] in, is the input data, are the parameters of the Gaussian mixture model, is the number of Gaussian components.

[0197] S1032. According to different input data and output targets, the clustering results of the Gaussian mixture model are used to dynamically adjust the contribution weights of various factors to the greenhouse temperature prediction to obtain an optimized machine learning model.

[0198] In greenhouse temperature prediction, multiple factors are involved, such as temperature, humidity, light, wind speed, etc. The clustering results of the Gaussian mixture model can provide a basis for weight allocation for these factors. Using the clustering results of the Gaussian mixture model, the contribution weights of each factor to the prediction can be dynamically adjusted. After determining the contribution weights of each factor, the contribution weights can be incorporated into the machine learning model for temperature prediction. By continuously adjusting the weights and model parameters, the prediction performance of the model can be optimized. This dynamic weight adjustment method can fully consider the impact of different factors on greenhouse temperature prediction, and reasonably allocate weights based on the clustering results of historical data, thereby improving the accuracy of the prediction.

[0199] As an unsupervised probability model, the Gaussian mixture model assumes that the data is composed of multiple Gaussian distributions superimposed, and each Gaussian distribution represents a potential category or cluster in the data space. This mixture model can characterize nonlinear and non-convex data distributions and has a strong modeling ability for multivariate data distributions. The present invention clusters the input data through the Gaussian mixture model, and can divide the data into different Gaussian distributions, each of which represents a specific temperature mode. This division helps the model better capture the potential laws and structures in the data, thereby improving the accuracy of greenhouse temperature prediction. Under different input data and output targets, the adaptive weight can dynamically adjust the contribution weight of each factor to the greenhouse temperature prediction according to the clustering results of the Gaussian mixture model. This means that the model can flexibly adjust the weights of each factor according to the actual situation to adapt to different data distributions and task requirements. The adaptive weight adjustment strategy enables the model to respond more flexibly to different input data changes, thereby improving the adaptability and generalization ability of the model. This is particularly important for complex tasks such as greenhouse temperature prediction, because the greenhouse environment may be affected by multiple factors, and the relationship between these factors may change over time. Through reasonable weight adjustment, unnecessary calculation and memory overhead can be reduced while maintaining the accuracy of the model. This is of great significance for improving the operating efficiency of machine learning models and reducing computing costs.

[0200] The Gaussian mixture model of the present invention provides the probability of belonging to each Gaussian component for each data point, which helps to explain the prediction results of the model. At the same time, the adaptive weight adjustment process also provides more internal information of the model, making the model more transparent and explainable. By combining Gaussian mixture model clustering and adaptive weight adjustment method, the accuracy of greenhouse temperature prediction can be significantly improved. This helps greenhouse managers better understand the temperature changes in the greenhouse, so as to take corresponding measures to optimize the greenhouse environment. The optimization process enhances the robustness of the machine learning model, enabling it to better cope with noise and outliers in the data. This is of great significance for improving the stability and reliability of the model.

[0201] In an optional embodiment, the above step S1032 uses the clustering results of the Gaussian mixture model to dynamically adjust the contribution weights of various factors to the greenhouse temperature prediction according to different input data and output targets to obtain an optimized machine learning model, including:

[0202] S10321. According to the clustering result of the Gaussian mixture model, a label of a Gaussian component is assigned to each data point, that is, to which Gaussian component the data point is most likely to belong. The label is expressed by the following formula:

[0203]

[0204] in, It is The labels of the Gaussian components of the data points, It is The data point belongs to The posterior probability of the Gaussian components.

[0205] S10322. Assign a target value to each Gaussian component according to different output targets, indicating the expected value of the greenhouse temperature corresponding to the Gaussian component. The target value is expressed by the following formula:

[0206]

[0207] in, It is The target value of the Gaussian component, is the objective function, which is set according to different output targets. For example, the objective function for maximizing greenhouse temperature is set as:

[0208]

[0209] in, It is The actual temperature of the data point, It is The labels of the Gaussian components of the data points.

[0210] S10323. According to the label and target value of the Gaussian component of each data point, a weight vector is generated for each data point, that is, the contribution weight of the data point to the greenhouse temperature prediction, which is expressed by the following formula:

[0211]

[0212] in, It is The weight vector of the data points, It is The target value of the Gaussian component to which the data point belongs, It is The labels of the Gaussian components of the data points, represents the index of any data point, It is The labels of the Gaussian components of the data points.

[0213] S10324. Optimize the machine learning model using the generated weight vector, dynamically adjust the contribution weight of each factor to the greenhouse temperature prediction according to different input data and output targets, improve the generalization and migration capabilities of the model, and obtain an optimized machine learning model. The optimization process is expressed by the following formula:

[0214]

[0215] in, are the parameters of the machine learning model, is the number of input data, It is The weight vector of the data points, It is The actual temperature of the data point, It is The predicted temperature for each data point, It is The squared error of the data points, is the weighted mean square error, is the operation to solve the minimization problem.

[0216] The Gaussian component labels of the above data points reflect the characteristics of the cluster or data distribution to which they belong, and provide a basis for weight allocation in subsequent steps. By assigning a target value to each Gaussian component, the association between data distribution and output target can be established, providing a basis for the generation of weight vectors in subsequent steps. The weight vector reflects the importance of different factors in greenhouse temperature prediction, and provides key information for model optimization in subsequent steps. The generated weight vector is used as one of the inputs of the machine learning model and is used together with other features to train the model. During the training process, the model dynamically adjusts the contribution weights of each factor to greenhouse temperature prediction according to the weight vector. Through methods such as iterative optimization and cross-validation, an optimized machine learning model can be obtained, which has better performance in greenhouse temperature prediction. By dynamically adjusting the weights, the model of the present invention can more accurately capture the impact of different factors on greenhouse temperature prediction, thereby improving the accuracy and reliability of the prediction. The optimized machine learning model can better adapt to different input data and output targets, and improve the generalization ability and robustness of the model.

[0217] In an optional embodiment, the machine learning model is visualized using a gradient-weighted class activation mapping (Grad-CAM) and a visualization optimization method of back propagation. By visualizing the activation area and gradient information of the model, the results of Grad-CAM are optimized, noise and artifacts are eliminated, and the correlation strength and influence direction between the greenhouse temperature and various factors are intuitively displayed, thereby improving the interpretability and credibility of the model. The role of this step is to improve the transparency and reliability of the model and provide a basis for greenhouse temperature prediction. The present invention uses the gradient information of the model through the visualization technology of gradient-weighted class activation mapping (Grad-CAM) to generate the activation area of ​​the model and express the focus and judgment basis of the model. Through the visualization optimization method of back propagation, the results of Grad-CAM are optimized using the gradient information of back propagation, noise and artifacts are eliminated, and the visualization quality and interpretability of the model are improved. The visualization optimization method of using gradient-weighted class activation mapping and back propagation described in the above step S104 to visualize the optimized machine learning model to obtain a visualized machine learning model, including:

[0218] S1041. Use gradient weighted class activation mapping to visualize the machine learning model, generate the activation area of ​​the model, and obtain the gradient weighted class activation mapping of the target layer.

[0219] In a machine learning model, a convolutional layer or a pooling layer is selected as the target layer. This layer usually contains high-level features and retains spatial information, which is suitable for visualization. The input data is forward propagated through the model to obtain the feature maps of the target layer. For the category you want to explain, calculate the gradient of the category score relative to the feature map of the target layer. Multiply the gradient with the feature map and take the average to obtain an initial heat map (i.e., Grad-CAM map). This heat map represents the area that the model pays most attention to during classification, and intuitively displays the activation area of ​​the model.

[0220] S1042. Optimize the gradient weighted class activation mapping of the target layer using a back-propagation visualization optimization method to obtain the visualized machine learning model.

[0221] After obtaining the Grad-CAM graph, the back-propagation algorithm can be used to further optimize the visualization effect. Through multiple iterations of forward propagation, gradient calculation, Grad-CAM graph generation, and back-propagation optimization, the visualized machine learning model can be gradually improved.

[0222] Through the visualization optimization method of back propagation, the clarity and accuracy of the Grad-CAM graph can be further improved, so as to more accurately reflect the decision-making process of the model. The optimized visualization model not only helps to understand the decision logic of the model, but also improves the performance and generalization ability of the model. The visualization optimization method can also promote the interpretability of the model, making it easier to understand the working principle and output results of the model.

[0223] In an optional embodiment, the above step S1041 uses the gradient weighted class activation map to visualize the machine learning model, generate the activation area of ​​the model, obtain the gradient weighted class activation map of the target layer, and express the focus and judgment basis of the model, including:

[0224] S10411. Select a target layer, and calculate the gradient of each feature map of the target layer according to the prediction value of the output layer.

[0225] Select the convolution layer or pooling layer as the visualization object, that is, the target layer. The output of the target layer reflects the high-level features of the model, such as spatial position, shape, texture, etc. The target layer is expressed by the following formula:

[0226]

[0227] in, is the output of the target layer, The target layer feature map, is the number of feature maps of the target layer.

[0228] Calculate the gradient of the target layer. The gradient of the target layer is the partial derivative of the output of the target layer with respect to the predicted value of the output layer, reflecting the contribution of each feature map of the target layer to the predicted value. The gradient is expressed by the following formula:

[0229]

[0230] in, is the gradient of the target layer, is the predicted value of the output layer, The target layer feature map, is the number of feature maps of the target layer.

[0231] S10412. Calculate the global average of the gradients of each feature map of the target layer to obtain the weight of the target layer. The weight reflects the importance of each feature map of the target layer to the predicted value. The weight is expressed by the following formula:

[0232]

[0233] in, The target layer The weight of the feature map, is the number of elements in the feature map, and is the spatial coordinate of the feature map, is the feature map elements, is the feature map The gradient of an element.

[0234] S10413. Calculate the activation area of ​​the target layer, that is, multiply the weight of each feature map of the target layer by the corresponding feature map element by element, sum all weighted feature maps, and obtain the activation area of ​​the target layer, which reflects the focus and judgment basis of the model, and is expressed by the following formula:

[0235]

[0236] in, is the activation area of ​​the target layer, The target layer The weight of the feature map, The target layer feature map, is the number of feature maps of the target layer.

[0237] S10414. Post-process the activation area of ​​the target layer to obtain the gradient weighted class activation map of the target layer. Specifically, the negative values ​​of the activation area are set to zero, and then normalized to obtain the gradient weighted class activation map (Grad-CAM) of the target layer, which intuitively displays the activation area of ​​the model, expressed by the following formula:

[0238]

[0239] in, is the gradient weighted class activation map (Grad-CAM) of the target layer, is the activation area of ​​the target layer, is the operation of setting the negative values ​​of the activation area to zero. is the maximum value of the activation area.

[0240] By calculating the gradient, the present invention can capture the feature area that the model pays most attention to when making predictions, and provide key information for the subsequent generation of Grad-CAM graphs. Selecting a suitable target layer is crucial to generating a meaningful Grad-CAM graph, because the feature representations of different layers have different abstraction levels and spatial resolutions. By calculating the global average, the gradient information of the feature map can be simplified, providing a concise weight representation for the subsequent generation of the Grad-CAM graph. The size of the weight reflects the contribution of the feature map in the model decision-making process, which helps to understand the decision logic of the model. The weight of each feature map of the target layer is multiplied element by element with its corresponding feature map. All weighted feature maps are summed to obtain the activation area of ​​the target layer (i.e., Grad-CAM graph). The Grad-CAM graph intuitively shows the image area that the model pays most attention to when making predictions, which helps to understand the decision-making process of the model. According to the visualization results and the performance evaluation of the model, the above-mentioned machine learning model can be further optimized. For example, the architecture of the model is adjusted, the number of layers is increased or decreased, the activation function is changed, and regularization techniques are used.

[0241] In an optional embodiment, the step S1042 above uses the back-propagation visualization optimization method to optimize the gradient weighted class activation mapping of the target layer to obtain the visualized machine learning model, including:

[0242] S10421. Calculate the gradient of the output layer. The gradient of the output layer is the partial derivative of the predicted value of the output layer with respect to the data of the input layer, reflecting the influence of each data point of the input layer on the predicted value, and is expressed by the following formula:

[0243]

[0244] in, is the gradient of the output layer, is the predicted value of the output layer, is the input layer data points, is the number of data in the input layer.

[0245] S10422. Post-process the gradient of the output layer, set the negative value of the gradient to zero, and then normalize it to obtain the gradient map of the back propagation of the output layer, which reflects the direction of influence of each data point in the input layer on the predicted value. The mapping is expressed by the following formula:

[0246]

[0247] in, is the back propagation gradient map (BP-Grad) of the output layer, is the gradient of the output layer, is the operation that sets the negative value of the gradient to zero. is the maximum value of the gradient.

[0248] S10423, the back-propagated gradient map of the output layer is fused with the gradient weighted class activation map of the target layer to obtain an optimized gradient weighted class activation map. The mapping comprehensively considers the activation area and gradient information of the model, eliminates noise and artifacts, and improves the visualization quality and interpretability of the model. The mapping is expressed by the following formula:

[0249]

[0250] in, is the optimized Gradient Weighted Class Activation Mapping (Grad-CAM++), is the gradient weighted class activation map (Grad-CAM) of the target layer, is the back-propagation gradient map (BP-Grad) of the output layer, It is an element-wise multiplication operation.

[0251] S10424. Superimpose the optimized Gradient Weighted Class Activation Map (Grad-CAM++) with the input data to generate a visualized greenhouse temperature prediction graph, and obtain the visualized machine learning model. The graph intuitively shows the correlation strength and influence direction between the greenhouse temperature and various factors, improving the interpretability and credibility of the model. The graph is represented by the following formula:

[0252]

[0253] in, It is a visual greenhouse temperature forecast map. is the optimized Gradient Weighted Class Activation Mapping (Grad-CAM++), is the input data, It is an overlay operation.

[0254] The present invention uses the scikit-learn library (https: / / scikit-learn.org / ) and the matplotlib library (https: / / matplotlib.org / ) to implement the construction and visualization of the hybrid model, and requires the use of the functions in Table 3 below:

[0255] Table 3

[0256]

[0257] The heat transfer model predicts the change of greenhouse temperature based on physical laws and greenhouse environmental parameters (such as solar radiation, greenhouse materials, ventilation conditions, etc.). The visualized machine learning model is trained based on historical data and can capture the complex relationship between greenhouse temperature and various input features (such as ambient temperature and humidity, light intensity, soil moisture, etc.). By integrating the prediction results of the two models, the physical accuracy of the heat transfer model and the data-driven ability of the machine learning model can be fully utilized to improve the accuracy and robustness of the prediction. According to the prediction results, the control parameters of the greenhouse (such as vent size, heating system power, sunshade opening and closing, etc.) can be adjusted automatically or manually to maintain the greenhouse temperature within a suitable range. By integrating the prediction results of the heat transfer model and the machine learning model, the present invention can comprehensively consider the advantages of physical laws and data-driven, and improve the accuracy and reliability of greenhouse temperature prediction. The machine learning model can handle complex data relationships, while the heat transfer model provides physical background support. The combination of the two makes the model more stable when facing different environmental conditions and input data. Based on accurate prediction results, the control parameters of the greenhouse can be adjusted more accurately, the refined management of greenhouse temperature can be achieved, and the growth quality and yield of crops can be improved. Through the visualized machine learning model, users can intuitively understand how the model makes predictions, so that they can make decisions and adjustments more quickly.

[0258] In an optional embodiment, the output results of the heat transfer model and the machine learning model are combined with physical constraints and data fitting to form a hybrid model, namely the above-mentioned greenhouse temperature prediction model, to achieve the prediction and control of the greenhouse temperature. The purpose of this step is to comprehensively utilize the advantages of the two models to improve the efficiency and accuracy of greenhouse temperature prediction. The hybrid model comprehensive model utilizes the output results of the heat transfer model and the machine learning model, combined with physical constraints and data fitting, to form a unified greenhouse temperature prediction model to achieve efficient and accurate greenhouse temperature prediction and control. The prediction and control of the greenhouse temperature based on the greenhouse temperature prediction model in the above-mentioned step S105 includes:

[0259] S1051. Use the heat transfer model to physically predict the greenhouse temperature. The model uses the geometric model, heat conduction model and heat convection model of the greenhouse to describe the heat transfer process inside and outside the greenhouse, and provides physical constraints and prior knowledge for greenhouse temperature prediction. The model is expressed by the following formula:

[0260]

[0261] The meaning of each symbol is the same as that of the aforementioned S101.

[0262] The visualized machine learning model is used to predict greenhouse temperature data. The model uses a multi-scale convolutional neural network and spatiotemporal feature extraction method to extract spatiotemporal related features from the historical data of the greenhouse, capture the complex and nonlinear relationship between greenhouse temperature and various factors, and provide data fitting and prediction capabilities for greenhouse temperature prediction. The model is expressed by the following formula:

[0263]

[0264] in, is the predicted greenhouse temperature, is the spatiotemporal feature matrix, are the parameters of the machine learning model, is the activation function, is the convolution operation, It is a pooling operation.

[0265] S1052. The output results of the heat transfer model and the visualized machine learning model are integrated to obtain the output result of the hybrid model, i.e., the final predicted value of the greenhouse temperature. The predicted value comprehensively considers physical constraints and data fitting to improve the efficiency and accuracy of greenhouse temperature prediction. The predicted value is expressed by the following formula:

[0266]

[0267] in, is the final predicted value of greenhouse temperature, is the predicted greenhouse temperature, which is the output of the machine learning model. is the output of the heat transfer model, It is an adjustable weight coefficient used to balance the impact of the output results of the two models.

[0268] S1053. According to the final predicted value of the greenhouse temperature, adjust the control parameters of the greenhouse so that the greenhouse temperature reaches the expected target value.

[0269] Specifically, it is to adjust the greenhouse's multi-source heat storage, geothermal frequency conversion control and other control parameters so that the greenhouse temperature reaches the expected target value and the greenhouse temperature is predicted and controlled. The control process is expressed by the following formula:

[0270]

[0271] in, is the control parameter of the greenhouse, is the control function, is the final predicted value of greenhouse temperature, is the target value for greenhouse temperature.

[0272] The present invention innovatively integrates and coordinates the heat transfer model and the machine learning model effectively to form a unified greenhouse temperature prediction model, which can not only reflect the internal laws and mechanisms of the greenhouse, but also capture the dynamics and randomness of the greenhouse, and achieve the goal of efficient, accurate, flexible and interpretable greenhouse temperature prediction. This method overcomes the limitations of traditional physical models and data models, comprehensively utilizes the advantages of the two models, and improves the quality and efficiency of greenhouse temperature prediction. It also innovatively uses the Gaussian mixture model to cluster the data, and adaptively generates different weight vectors according to different clustering results and optimization goals, dynamically adjusts the contribution weights of various factors to greenhouse temperature prediction, and enhances the generalization and migration capabilities of the model. This method overcomes the shortcomings of traditional fixed weights or manually adjusted weights, realizes the intelligence and automation of weights, and improves the flexibility and adaptability of the model.

[0273] The temperature prediction method for a multi-source heat storage flexible solar greenhouse provided by the present invention can comprehensively utilize the advantages of physical models and data models to achieve efficient, accurate, flexible, and interpretable prediction and control of greenhouse temperature. It can fully consider the influence of various complex factors of the greenhouse (such as multi-source heat storage, flexible structure, geothermal frequency conversion control, porosity and non-uniformity, etc.) to improve the accuracy and stability of the model; at the same time, it can also make full use of the information of historical data and future data of the greenhouse, such as time-space related characteristics, dynamic and random laws, adaptive and optimized weights, etc., to improve the data fitting and prediction capabilities of the model. In addition, it can also provide model visualization and optimization, activate regional and gradient information, correlation strength and influence direction, optimize objectives and control strategies, etc., to improve the interpretability and credibility of the model.

[0274] The multi-source heat storage type flexible solar greenhouse temperature prediction device provided by the present invention is described below. The multi-source heat storage type flexible solar greenhouse temperature prediction device described below and the multi-source heat storage type flexible solar greenhouse temperature prediction method described above can be referenced to each other.

[0275] The multi-source heat storage type flexible solar greenhouse temperature prediction device provided by the present invention refers to Figure 2 As shown, including:

[0276] A heat transfer model building module 201 is used to establish a heat transfer model using a nonlinear finite element method and a multi-scale coordination method; wherein the heat transfer model takes into account multi-source heat storage, flexible structure, geothermal frequency conversion control, porosity and non-uniformity of the greenhouse, and describes the heat transfer process inside and outside the greenhouse;

[0277] A spatiotemporal feature learning module 202, for establishing a machine learning model using a multi-scale convolutional neural network and a spatiotemporal feature extraction method;

[0278] The model optimization and adjustment module 203 is used to optimize the machine learning model using a Gaussian mixture model and an adaptive weight generation method to obtain an optimized machine learning model;

[0279] A model visualization module 204 is used to visualize the optimized machine learning model using a gradient weighted class activation mapping and back propagation visualization optimization method to obtain a visualized machine learning model;

[0280] The greenhouse temperature prediction module 205 is used to generate a greenhouse temperature prediction model based on the heat transfer model and the visualized machine learning model, so as to predict and control the greenhouse temperature based on the greenhouse temperature prediction model.

[0281] 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 temperature prediction method of the multi-source heat storage type flexible solar greenhouse.

[0282] 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.

[0283] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the multi-source heat storage type flexible solar greenhouse temperature prediction method provided by the above methods.

[0284] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the multi-source heat storage type flexible solar greenhouse temperature prediction method provided by the above methods.

[0285] 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.

[0286] 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.

[0287] 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 method for predicting temperature in a multi-source heat storage flexible solar greenhouse, characterized in that: include: A heat transfer model is established using a nonlinear finite element method and a multi-scale coordination method; wherein the heat transfer model takes into account the greenhouse's multi-source heat storage, flexible structure, geothermal frequency conversion control, porosity, and non-uniformity, and describes the heat transfer process inside and outside the greenhouse; Build machine learning models using multi-scale convolutional neural networks and spatiotemporal feature extraction methods; The input data is clustered using a Gaussian mixture model to obtain a clustering result; the input data includes a plurality of data points; a label of a Gaussian component is assigned to each data point according to the clustering result of the Gaussian mixture model; a target value is assigned to each Gaussian component according to different output targets; a weight vector is generated for each data point according to the label and target value of the Gaussian component of each data point; the machine learning model is optimized using the generated weight vector, and the contribution weight of each factor to the greenhouse temperature prediction is dynamically adjusted to obtain an optimized machine learning model; Visualizing the optimized machine learning model using a gradient weighted class activation mapping and back-propagation visualization optimization method to obtain a visualized machine learning model; A greenhouse temperature prediction model is generated based on the heat transfer model and the visualized machine learning model, so as to predict and control the greenhouse temperature based on the greenhouse temperature prediction model: ; in, is the final predicted value of greenhouse temperature output by the greenhouse temperature prediction model, is the output of the machine learning model, is the output of the heat transfer model, is an adjustable weight coefficient.

2. The temperature prediction method of a multi-source heat storage flexible solar greenhouse according to claim 1 is characterized in that: The heat transfer model is established by using the nonlinear finite element method and the multi-scale coordination method, including: Establish the geometric model, heat conduction model and heat convection model of the greenhouse respectively; The heat transfer model is obtained by coupling the geometric model, heat conduction model and heat convection model of the greenhouse.

3. The temperature prediction method of a multi-source heat storage flexible solar greenhouse according to claim 1 is characterized in that: The method of establishing a machine learning model using a multi-scale convolutional neural network and a spatiotemporal feature extraction method includes: The spatiotemporal feature extraction method is used to extract spatiotemporal related features from the greenhouse historical data to obtain the spatiotemporal feature matrix; Using the spatiotemporal feature matrix and actual temperature corresponding to the historical data of the greenhouse as training data, a multi-scale convolutional neural network is trained to minimize the error between the greenhouse temperature prediction value and the actual temperature, thereby obtaining a trained multi-scale convolutional neural network; wherein the multi-scale convolutional neural network extracts multi-level features from the spatiotemporal feature matrix to obtain a greenhouse temperature prediction value; The trained multi-scale convolutional neural network is tested using the real-time data of the greenhouse as test data, and the process of training and testing the multi-scale convolutional neural network is repeated until the prediction performance of the multi-scale convolutional neural network meets the preset requirements, thereby obtaining the machine learning model.

4. The temperature prediction method for a multi-source heat storage flexible solar greenhouse according to claim 3 is characterized in that: The spatiotemporal feature extraction method is used to extract spatiotemporal related features from the historical data of the greenhouse to obtain a spatiotemporal feature matrix, including: The historical data of the greenhouse is divided according to the dimensions of time and space to obtain multiple spatiotemporal data blocks; Extract spatiotemporal features from each spatiotemporal data block to obtain the corresponding spatiotemporal feature vector; The spatiotemporal feature matrix is ​​obtained by combining the spatiotemporal feature vectors of each spatiotemporal data block.

5. The temperature prediction method for a multi-source heat storage flexible solar greenhouse according to claim 3 is characterized in that: The multi-scale convolutional neural network includes an input layer, a fully connected layer, an output layer, and a plurality of convolutional layers and pooling layers; The multi-scale convolutional neural network extracts multi-level features from the spatiotemporal feature matrix to obtain greenhouse temperature prediction values, including: Taking the spatiotemporal feature matrix as the input of the input layer, the input layer converts the spatiotemporal feature matrix into a multi-channel two-dimensional tensor; The multi-channel two-dimensional tensor is used as the input of the first convolution layer, and each convolution layer and pooling layer uses convolution kernels and pooling kernels of different scales to extract features of different scales from the input layer or the output of the previous layer; The fully connected layer converts the output of the last pooling layer into a one-dimensional vector, and the output layer converts the output of the fully connected layer into a scalar as the predicted value of the greenhouse temperature.

6. The temperature prediction method for a multi-source heat storage flexible solar greenhouse according to claim 1, characterized in that: The optimized machine learning model is visualized by using the gradient weighted class activation mapping and back propagation visualization optimization method to obtain a visualized machine learning model, including: Use gradient-weighted class activation mapping to visualize the machine learning model, generate the activation area of ​​the model, and obtain the gradient-weighted class activation map of the target layer; The gradient weighted class activation mapping of the target layer is optimized using a back-propagation visualization optimization method to obtain the visualized machine learning model.

7. The temperature prediction method for a multi-source heat storage flexible solar greenhouse according to claim 6, characterized in that: The method of visualizing the machine learning model by using the gradient weighted class activation map, generating the activation region of the model, and obtaining the gradient weighted class activation map of the target layer includes: Select the target layer and calculate the gradient of each feature map of the target layer according to the predicted value of the output layer; Calculate the global average of the gradients of each feature map of the target layer to obtain the weight of the target layer; Multiply the weight of each feature map of the target layer by the corresponding feature map element by element, sum all weighted feature maps to get the activation area of ​​the target layer; The activation regions of the target layer are post-processed to obtain the gradient-weighted class activation map of the target layer.

8. The temperature prediction method for a multi-source heat storage flexible solar greenhouse according to claim 6 is characterized in that: The method of optimizing the gradient weighted class activation map of the target layer by using the back-propagation visualization optimization method to obtain the visualized machine learning model includes: Calculate the gradient of the output layer, where the gradient of the output layer is the partial derivative of the predicted value of the output layer with respect to the data of the input layer; Post-process the gradient of the output layer, set the negative value of the gradient to zero, and normalize it to obtain the gradient map of the back propagation of the output layer; The back-propagated gradient map of the output layer is fused with the gradient weighted class activation map of the target layer to obtain an optimized gradient weighted class activation map; The optimized gradient weighted class activation map is superimposed on the input data to generate a visualized greenhouse temperature prediction map, thereby obtaining the visualized machine learning model.

9. The method for predicting temperature in a multi-source heat storage flexible solar greenhouse according to claim 1, characterized in that: The greenhouse temperature prediction and control based on the greenhouse temperature prediction model includes: Use heat transfer models to make physical predictions of greenhouse temperatures, and use visualized machine learning models to make data predictions of greenhouse temperatures; fusing the output results of the heat transfer model and the visualized machine learning model to obtain a final predicted value of the greenhouse temperature; According to the final predicted value of greenhouse temperature, the control parameters of the greenhouse are adjusted so that the greenhouse temperature reaches the expected target value.

10. A multi-source heat storage flexible solar greenhouse temperature prediction device, characterized in that: include: A heat transfer model building module is used to establish a heat transfer model using a nonlinear finite element method and a multi-scale coordination method; wherein the heat transfer model takes into account the greenhouse's multi-source heat storage, flexible structure, geothermal frequency conversion control, porosity, and non-uniformity, and describes the heat transfer process inside and outside the greenhouse; The spatiotemporal feature learning module is used to build a machine learning model using multi-scale convolutional neural networks and spatiotemporal feature extraction methods; A model optimization and adjustment module is used to cluster input data using a Gaussian mixture model to obtain a clustering result; the input data includes multiple data points; according to the clustering result of the Gaussian mixture model, a label of a Gaussian component is assigned to each data point; a target value is assigned to each Gaussian component according to different output targets; according to the label and target value of the Gaussian component of each data point, a weight vector is generated for each data point; the machine learning model is optimized using the generated weight vector, and the contribution weight of each factor to the greenhouse temperature prediction is dynamically adjusted to obtain an optimized machine learning model; A model visualization module, used to visualize the optimized machine learning model using a gradient weighted class activation mapping and back propagation visualization optimization method to obtain a visualized machine learning model; A greenhouse temperature prediction module is used to generate a greenhouse temperature prediction model of the following formula based on the heat transfer model and the visualized machine learning model, so as to predict and control the greenhouse temperature based on the greenhouse temperature prediction model: ; in, is the final predicted value of greenhouse temperature output by the greenhouse temperature prediction model, is the output of the machine learning model, is the output of the heat transfer model, is an adjustable weight coefficient.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for predicting air temperature in a multi-source thermal storage type flexible solar greenhouse as described in any one of claims 1 to 9 is implemented.

12. 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 method for predicting air temperature in a multi-source thermal storage type flexible solar greenhouse as described in any one of claims 1 to 9 is implemented.

13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for predicting air temperature in a multi-source thermal storage type flexible solar greenhouse as described in any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Energy management method and system based on big data

    CN118195361A

  • Wind power intelligent prediction method based on Transform and transfer learning

    CN118364922A

Cited By

  • Underground space shaft air temperature prediction method based on machine learning

    CN121302645A