Greenhouse ventilation optimization control method based on meteorological data clustering and flow field analysis
By clustering meteorological data and analyzing the flow field, combined with UDF technology and an improved FGO algorithm, the opening degree of greenhouse ventilation openings was optimized, solving the problems of uneven airflow distribution and low efficiency in traditional greenhouse ventilation control, and achieving precise control in dynamic environments.
Patent Information
- Application Number
- CN202510769554.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-10-31
AI Technical Summary
Traditional greenhouse ventilation control relies on experience-based adjustments, resulting in uneven airflow distribution, low ventilation efficiency, inability to adapt to changes in the external environment in real time, and a lack of intelligent optimization mechanisms. Consequently, simulation results lack temporal continuity and the system has limited room for optimization.
By clustering meteorological data and analyzing the flow field, a three-dimensional simulation model of the greenhouse is established. Combining UDF technology and an improved FGO algorithm, the combination of ventilation openings is optimized to achieve dynamic wind field simulation and intelligent optimization.
It enables precise control of the greenhouse ventilation system, solves the problems of uneven airflow distribution and low ventilation efficiency, ensures the best ventilation effect under various wind conditions, and improves the pertinence and efficiency of the simulation.
Smart Images

Figure CN120874648A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural environmental control technology, and more specifically, to a method for optimizing greenhouse ventilation control based on meteorological data clustering and flow field analysis. Background Technology
[0002] Greenhouses, as crucial facilities in modern agricultural production, directly impact crop growth efficiency and quality through their internal environment (temperature, humidity, CO2 concentration, etc.). Traditional greenhouse ventilation control relies heavily on experience, resulting in uneven airflow distribution and low ventilation efficiency. Uneven airflow distribution leads to excessively high local temperatures or humidity, hindering uniform crop growth. Furthermore, the reliance on manual monitoring of vent openings results in low ventilation efficiency and an inability to adapt to real-time changes in the external environment.
[0003] Greenhouse ventilation simulation can determine the optimal opening degree of the ventilation openings and avoid empirical adjustments, but traditional greenhouse ventilation simulation has the following problems:
[0004] Insufficient dynamic adaptability. Simulations are often based on fixed environmental parameters, treating information such as wind speed, wind direction, and temperature at different time points as independent samples. They only identify typical wind field states through static clustering, ignoring the dynamic changes in meteorological conditions in the real environment. This results in simulation results that lack temporal continuity and physical rationality.
[0005] The coverage of the window opening groups is limited. Comparative analysis using only a small number of preset window opening combinations carries the risk of sampling bias in the experimental design, which may miss the optimal solution (such as asymmetric window opening combinations). Furthermore, it is impossible to establish a continuous functional relationship between the vent opening degree and ventilation efficiency, thus limiting the system optimization space.
[0006] Limitations of static physical models. Using modified models and static meshes to achieve different vent openings fails to consider the bidirectional coupling between window movement and the greenhouse thermal environment, cannot characterize the gradual flow field changes caused by continuous window movement, and also ignores the impact of minute opening changes on precise environmental control and energy consumption optimization.
[0007] The system lacks intelligent optimization mechanisms. Relying on manual experience to select comparison groups without incorporating intelligent optimization methods such as genetic algorithms and reinforcement learning to explore the parameter space makes it difficult to achieve global optimization of ventilation efficiency and energy consumption. Summary of the Invention
[0008] In view of this, the present invention proposes a greenhouse ventilation optimization control method based on meteorological data clustering and flow field analysis, aiming to solve the problems existing in the current technology.
[0009] This invention proposes a greenhouse ventilation optimization control method based on meteorological data clustering and flow field analysis, comprising the following steps:
[0010] S1. Obtain the original meteorological data of the area where the greenhouse is located within a preset time period, and process the original meteorological data using a meteorological data clustering method to obtain a typical wind condition clustering dataset with dynamic change characteristics.
[0011] S2. Establish a three-dimensional simulation model of the greenhouse and integrate the typical wind condition clustering dataset mentioned in step S1. Use UDF technology to control ventilation parameters to obtain the flow field distribution results corresponding to different ventilation opening combinations under the typical wind condition clustering data.
[0012] S3. The flow field distribution results in step S2 are optimized by improving the FGO algorithm to obtain the optimal combination of ventilation openings for all ventilation openings under different ventilation conditions.
[0013] In some embodiments of this application, step S1 specifically includes the following steps:
[0014] S11. Extract statistical features from the raw meteorological data to form the final modeling features f. t That is, the sliding window statistical characteristics at hour t;
[0015] The statistical characteristics include: average wind speed Wind speed variance Average wind direction Standard deviation of wind direction σ θ Wind speed change rate Δv t and the rate of change of outdoor temperature ΔT t ;
[0016] The final modeling feature f t The formula is as follows:
[0017]
[0018] Where t is the t-th hour, t = 1, 2, ..., T; θ is the wind direction angle; T is the outdoor temperature; v is the wind speed;
[0019] S12. Apply the K-means algorithm to all the final modeling features f. t Clustering yields K static wind field states, and the wind field state sequence S is output. t ;
[0020] The clustering formula is as follows:
[0021]
[0022] Where, μ C(t) Let C(t) be the central feature vector of the Kth type of wind field state, ∈ {1, 2, ..., K}; output the wind field state sequence:
[0023] St =C(t);
[0024] S13. Using the Markov chain modeling method, the wind field state sequence S from step S12 is... t The static classification is transformed into a temporal wind field state.
[0025] The transformation process of the wind field state satisfies the homogeneous first-order Markov assumption, that is:
[0026] P(S t+1 |S t S t-1 ,…)=P(S t+1 |S t );
[0027] The transition probability matrix for wind field state transformation is defined as follows:
[0028]
[0029] Where P is the state transition probability matrix, n ij n represents the number of times wind field state i transitions to wind field state j; ik Let i be the number of times the wind field state i transitions to all possible states;
[0030] S14. Extract representative samples using a modeling method based on Markov chains;
[0031] The state transition probability matrix P is visualized as a directed graph G = (V, E), where node V represents a typical wind field state and directed edge E represents the transition relationship between wind field states.
[0032] The wind field state transition path sequence is defined by the following formula:
[0033]
[0034] Among them, the path sequence that satisfies P(S)≥A in the raw meteorological data is searched, where A is the probability threshold of the transfer path and n is the total number of wind field states in the path sequence;
[0035] Extract the actual sample segments corresponding to each path to form a representative sample sequence, and denote the representative sample sequence as X. typical And X typical ={X t1 ,X t1+1 ,…,X t1+L-1};
[0036] Where L is the selected window length;
[0037] S15. Output a typical wind condition clustering dataset containing time, temperature, wind speed, and wind direction.
[0038] In some embodiments of this application, in step S13, the wind field state sequence S from step S12 is modeled using a Markov chain method. t When transforming from static classification to temporal wind field status, it also includes:
[0039] Sample distribution intervals are generated based on dynamic wind speed interval optimization.
[0040] Let the number of wind speed intervals be m. The formula for calculating the wind speed quantile is as follows:
[0041]
[0042] q = 1, 2, ..., m-1;
[0043] get:
[0044] B1 = [v min [Q1],B2=[Q1,Q2],…,B m =[Q m-1 ,v max ];
[0045] Where Qq is the q-th quantile of wind speed; B r Let r be the r-th wind speed interval, r∈{1,2,…,m}, and each wind speed interval contains H / m samples.
[0046] In some embodiments of this application, step S2 specifically includes the following steps:
[0047] Step S21: The greenhouse outline model is obtained by modeling all segments of the greenhouse end face outline using curve fitting.
[0048] Step S22: Construct a unified function f(x) for multiple different segments in the greenhouse outline model described in step S21;
[0049] Step S23: Integrate multiple segmental functions into a continuous and differentiable global function using a Gaussian-normalized weighting function;
[0050] Step S24: Establish a regional dynamic mesh strategy. Using UDF technology, write the greenhouse outline model and the regional dynamic mesh strategy into the greenhouse CFD model to obtain the greenhouse simulation three-dimensional model. After inputting the typical wind condition dataset, output the flow field distribution results of different ventilation opening combinations under different wind conditions.
[0051] In some embodiments of this application, step S22 specifically includes the following steps:
[0052] S221. Define a curvature function based on curvature abrupt change points, with the following formula:
[0053]
[0054] Where k(x) is the curvature function; g(x) is the segment function constructed based on the profile of the greenhouse end face;
[0055] S222. Identify the local maxima x of the curvature function k(x). p As the center position of each segment model in the greenhouse outline model;
[0056] S223. Construct a unified function f(x) for each segment of the greenhouse outline model, with the specific formula as follows:
[0057]
[0058] Where M is the number of segmental functions; f (p) (x;θ p ) is the segmental function of the p-th segment; ω p (x) is the weight function corresponding to the piecewise function of the p-th segment;
[0059] Applying the Gaussian-normalized weighting function, the specific formula is as follows:
[0060]
[0061] Where α is the smoothing control parameter; x x Let x be the true spatial coordinates of the x-th sampling point;
[0062] The total parameter set is:
[0063] Θ = {θ1,…,θ M ;x1,…,x M ;α}.
[0064] The overall profile function of the greenhouse end face is obtained as follows:
[0065]
[0066] Where N is the number of sampling points on the greenhouse end face contour; y x x represents the actual contour height value of the nth sampling point; x Let x be the true spatial coordinates of the x-th sampling point.
[0067] In some embodiments of this application, step S24 specifically includes the following steps:
[0068] Step S241: Establish a regional dynamic mesh strategy:
[0069]
[0070] Where, γlower γ upper δ is the regional stiffness coefficient. lower δ upper The displacement vector of the grid node;
[0071] Step S242: Using UDF technology, the overall contour function obtained by curve fitting in step S223 and the regional dynamic mesh strategy in step S241 are written into the greenhouse CFD model to obtain the greenhouse simulation three-dimensional model. The opening degree of the ventilation opening is controlled by the dynamic mesh motion parameters. After inputting the typical wind condition dataset, the flow field distribution results under different combinations of ventilation opening degree under different wind conditions are output.
[0072] In some embodiments of this application, step S3 specifically includes the following steps:
[0073] Step S31: Establish a greenhouse ventilation optimization model;
[0074] Step S32: Construct an improved FGO algorithm to optimize the ventilation opening of the greenhouse ventilation optimization model described in step S31;
[0075] Step S33: Execute steps S31-S32 using Matlab to obtain the optimal opening combination of all vents under any combination of indoor and outdoor temperature difference and wind speed gradient corresponding to any wind direction;
[0076] Step S34: Obtain the relationship curve between the opening degree of any ventilation opening under any wind direction and the wind speed and the temperature difference between the inside and outside of the greenhouse by using a quadratic polynomial fitting method for the optimal opening degree combination in step S33, and obtain the window opening strategy model by using a radial basis function interpolation model.
[0077] In some embodiments of this application, the greenhouse ventilation optimization model in step S31 uses the opening degrees of the left top window ventilation opening x1, the left side window ventilation opening x2, the right top window ventilation opening x3, and the right side window ventilation opening x4 as optimization variables, and x1, x2, x3, x4 ∈ [0%, 100%]; the instantaneous change rate R of the greenhouse indoor temperature is used as the optimization variable. T The instantaneous rate of change of humidity inside the greenhouse, R H Temperature uniformity in greenhouse (T) uniformity And the uniformity of indoor humidity in the greenhouse H uniformity As evaluation indicators;
[0078] The comprehensive objective function of the greenhouse ventilation optimization model in step S31 is as follows:
[0079] f=ω1R T +ω2R H +ω3T uniformity +ω4H uniformity ;
[0080] Where ω1 is the instantaneous rate of change of the indoor temperature in the greenhouse, R. T The corresponding weights, where ω2 is the instantaneous rate of change R of the humidity inside the greenhouse. H The corresponding weights; ω3 is the uniformity of indoor temperature T in the greenhouse. uniformity The corresponding weights; ω4 is the uniformity of humidity inside the greenhouse H. uniformity The corresponding weights.
[0081] In some embodiments of this application, step S32 specifically includes the following steps:
[0082] Step S321: Set the population size G and the maximum number of evaluations U for the FGO algorithm. max ;
[0083] Step S322: Generate a chaotic population X based on the chaotic mapping, merge it with a randomly selected population Y, and then select the individuals with the top G fitness to form a new population Y′;
[0084] Y′=[y′ b,1 ,y′ b,2 ,…,y′ b,c ];
[0085] b = 1, 2, ... G;
[0086] Where, y′ b,c The position of the b-th fungus in dimension c;
[0087] Step S323: Update the mycelial position by combining the growth rate and growth direction. The specific formula is as follows:
[0088] Dynamic growth rate:
[0089] E = e F ;
[0090]
[0091] Where E is the growth rate; e is the exploration operator; f o Let be the fitness value of the o-th solution; r1 is a random number generated in a uniform distribution in [0,1]; z is the number of times the current function has been evaluated; z max ξ is the maximum number of evaluations for the current function; ξ is the time decay factor. This represents the normalized fitness value.
[0092] Directional perturbation mechanism:
[0093]
[0094] in, Let be the growth direction vector of the b-th hyphae during the exploration phase; The growth direction of the b-th hyphae is directed towards a direction randomly selected from the population. r4 is a random number generated in a uniform distribution in [0,1]. r6 is a vector of random numbers generated in a uniform distribution in [0,1]; r6 is a random number generated in a uniform distribution in [0,1]; R is a predefined parameter in [0,1]; β takes the random value 1 or -1, and when β is 1, the search direction is moved away from the current optimal solution;
[0095] Mycelial position update:
[0096]
[0097] in, This represents the position of the b-th hyphae in the c-th dimension in the current assessment. Candidate solutions generated for the global search phase; R c r3 is a random number generated in a uniform distribution in [0,1] for the c-th dimension; r3 is a global random threshold generated in a uniform distribution in [0,1].
[0098] Step S324: Correct the direction using the gradient direction and the population optimal solution;
[0099] Gradient direction:
[0100]
[0101] Among them, g b For the overall gradient direction; r h The local optimal direction weight parameter; r g The globally optimal direction weight parameters; For individual gradient direction; d h,b d represents the local optimal direction correction amount. g,b This is the globally optimal direction correction amount;
[0102] Population optimal solution:
[0103] Egret A gradient estimation:
[0104]
[0105] Egret B random search:
[0106]
[0107] Egret C-Surrounding Mechanism:
[0108] x C,b =(1-r h -r g )·x b +r h ·Dh +r g ·D g ;
[0109] Where, x A,b x represents the position of the new candidate solution generated by egret A at the b-th hyphal individual; B,b x represents the position of the new candidate solution generated by Egret B at the b-th hyphal individual; C,b x represents the position of the new candidate solution generated by egret C at the b-th hyphal individual; b The current individual position; step A The step size factor for the gradient search of Egret A; step B is the step size factor for the Egret B gradient search; hop is the jump coefficient; g b For the overall gradient direction; r B,b r is a random direction vector; h The local optimal direction weight parameter; r g The globally optimal direction weight parameter; D h D is the vector of differences between the individual and the local optimum. g This is the interpolation vector between the individual and the global optimal solution;
[0110] Selection mechanism:
[0111]
[0112] The optimal solution among the three is retained, or a new solution is accepted with a probability r < 0.3.
[0113] Where, x d,b Let y be the order matrix of the b-th egret group; d,b c is an array of objective function values for candidate solutions. b The index of the optimal candidate solution; y b x represents the fitness value of the current individual. b is the current individual position; r is a random number generated in a uniform distribution in [0,1].
[0114] Step S325: Update the individual and global optimal solutions;
[0115] Step S326: Repeat steps S322-S324 until the maximum number of evaluations is reached.
[0116] In some embodiments of this application, step S34 specifically includes the following steps:
[0117] Step S341: Adjust the opening degree of any of the ventilation openings to o w A quadratic polynomial relationship is established with respect to wind speed v and indoor-outdoor temperature difference ΔF. The specific formula is as follows:
[0118]
[0119] in, Let w be the predicted opening of the w-th vent, where w = x1, x2, x3, x4; ΔF is the indoor-outdoor temperature difference; β wi These are the polynomial fitting coefficients;
[0120] Step S342: Using a radial basis function interpolation model, based on known data points... The formula for outputting the opening of the unknown point (v, ΔF) is as follows:
[0121]
[0122] Where, λ k,l For the radial basis functions, Φ(||(v,ΔF)-(v) are the interpolation weighting coefficients; l ,ΔF l )||) are radial basis functions;
[0123] Step S343, Opening physical constraints, the specific formula is as follows:
[0124]
[0125] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0126] This invention can identify typical wind conditions in a preset area where a greenhouse is located, and achieve precise control of the ventilation system through batch simulation and intelligent optimization technology. First, in step S1, the raw meteorological data is processed using a meteorological data clustering method to obtain typical wind condition clustering data, solving the problem that traditional static wind field data lacks temporal information. Second, in step 2, a three-dimensional simulation model of the greenhouse is established, and ventilation parameters are controlled using UDF technology to achieve batch parametric simulation. Combined with the typical wind condition clustering dataset from step S1, the flow field distribution results corresponding to different combinations of vent openings under typical wind condition data are obtained. Finally, in step S3, the flow field distribution results corresponding to different combinations of vent openings under typical wind condition data are optimized by improving the FGO algorithm, obtaining the optimal vent opening degree under different ventilation conditions. Attached Figure Description
[0127] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0128] Figure 1A flowchart of a greenhouse ventilation optimization control method based on meteorological data clustering and flow field analysis provided in an embodiment of the present invention. Detailed Implementation
[0129] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the disclosure to those skilled in the art. It should be noted that, unless otherwise specified, embodiments and features in the embodiments of the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0130] See Figure 1 As shown, this embodiment provides a greenhouse ventilation optimization control method based on meteorological data clustering and flow field analysis, including:
[0131] S1. Obtain the original meteorological data of the greenhouse in the preset area within the preset time period, and process the original meteorological data through the meteorological data clustering method to obtain a typical wind condition clustering dataset with dynamic change characteristics.
[0132] S2. Establish a three-dimensional simulation model of the greenhouse and integrate the typical wind condition clustering dataset from step S1. Use UDF technology to control ventilation parameters to obtain the flow field distribution results corresponding to different ventilation opening combinations under the typical wind condition clustering data.
[0133] S3. The flow field distribution results in step S2 are optimized by improving the FGO algorithm to obtain the optimal combination of ventilation openings for all ventilation openings under different ventilation conditions.
[0134] Understandably, in this embodiment, by collecting raw meteorological data, firstly, typical wind condition clustering datasets are extracted using meteorological data clustering methods; then, the flow field distribution under different ventilation strategies is simulated using a greenhouse simulation 3D model and UDF technology; finally, the improved FGO algorithm is used to optimize the combination of ventilation openings to ensure that the best ventilation effect can be achieved under various typical wind conditions.
[0135] Specifically, the application of meteorological data clustering methods not only simplifies the data processing but also improves the relevance and effectiveness of simulations. Simultaneously, the clustering dataset of typical wind conditions with dynamic changing characteristics solves the problem of traditional static wind field classification lacking temporal information. The use of 3D greenhouse simulation models enables the testing of various ventilation strategies in a virtual environment without the need for expensive and time-consuming actual experiments. UDF technology provides highly flexible parameter control capabilities, making simulation results closer to reality. The improved FGO algorithm effectively solves multivariate optimization problems through intelligent search strategies, ensuring the efficient operation of the ventilation system.
[0136] Furthermore, step S1 specifically includes the following steps:
[0137] S11. Extract statistical features from the raw meteorological data to form the final modeling features f. t That is, the sliding window statistical characteristics at hour t.
[0138] Statistical characteristics include: average wind speed Wind speed variance Average wind direction Standard deviation of wind direction σ θ Wind speed change rate Δv t and the rate of change of outdoor temperature ΔT t .
[0139] Final modeling feature f t The formula is as follows:
[0140]
[0141] Where t is the t-th hour, t = 1, 2, ..., T; θ is the wind direction angle; T is the outdoor temperature; and v is the wind speed.
[0142] Specifically, in this embodiment, the original feature vector is constructed through step S11.
[0143] S12. Apply the K-means algorithm to all final modeling features f t Clustering yields K static wind field states, and the wind field state sequence S is output. t .
[0144] The clustering formula is as follows:
[0145]
[0146] Where, μ C(t) Let C(t) be the central feature vector of the Kth type of wind field state, ∈ {1, 2, ..., K}; output the wind field state sequence:
[0147] S t =C(t).
[0148] Specifically, in this embodiment, the final modeling feature f is processed through step S12. t Clustering is performed to identify typical wind field conditions.
[0149] S13. Using the Markov chain modeling method, the wind field state sequence S in step S12 is transformed into... t The static classification is transformed into a temporal wind field state.
[0150] The transformation process of the wind field state satisfies the homogeneous first-order Markov assumption, that is:
[0151] P(S t+1 |S t S t-1 ,…)=P(S t+1 |S t );
[0152] The transition probability matrix for wind field state transformation is defined as follows:
[0153]
[0154] Where P is the state transition probability matrix, n ij n represents the number of times wind field state i transitions to wind field state j; ik Let be the number of times wind field state i transitions to all possible states.
[0155] Specifically, the wind field state sequence S in step S12 t Static clustering cannot reflect the evolution trend of the wind field state over time, making it difficult to meet the dynamic control requirements of greenhouse ventilation. In this embodiment, a Markov chain modeling method is introduced in step S13 to transform the wind field state sequence S obtained from static clustering... t The model transforms into a dynamic process model, depicting the transition relationship between wind direction and wind speed from a time series perspective, thus meeting the dynamic control requirements of greenhouse ventilation.
[0156] S14. Extract representative samples using a modeling method based on Markov chains.
[0157] The state transition probability matrix P is visualized as a directed graph G = (V, E), where node V represents a typical wind field state and directed edge E represents the transition relationship between wind field states.
[0158] The wind field state transition path sequence is defined by the following formula:
[0159]
[0160] In this process, a path sequence satisfying P(S)≥A is searched in the raw meteorological data, where A is the probability threshold of the transition path and n is the total number of wind field states in the path sequence.
[0161] Extract the actual sample segments corresponding to each path to form a representative sample sequence, and denote the representative sample sequence as X. typical And X typical ={X t1 ,X t1+1 ,…,X t1+L-1}
[0162] Where L is the selected window length.
[0163] S15. Output a typical wind condition clustering dataset containing time, temperature, wind speed, and wind direction.
[0164] Specifically, in this embodiment, a typical wind condition clustering dataset is generated through steps S14-S15 for subsequent simulation calls.
[0165] Furthermore, in step S13, the wind field state sequence S from step S12 is modeled using a Markov chain method. t When transforming from static classification to temporal wind field status, it also includes:
[0166] Sample distribution intervals are generated based on dynamic wind speed interval optimization.
[0167] Let the number of wind speed intervals be m. The formula for calculating the wind speed quantile is as follows:
[0168]
[0169] q = 1, 2, ..., m-1;
[0170] get:
[0171] B1 = [v min [Q1],B2=[Q1,Q2],…,B m =[Q m-1 ,v max ];
[0172] Where Qq is the q-th quantile of wind speed; B r Let r be the r-th wind speed interval, r∈{1,2,…,m}, and each wind speed interval contains H / m samples.
[0173] Specifically, in this embodiment, the sample distribution interval is generated based on dynamic wind speed interval optimization, so that each wind speed interval contains H / m samples, ensuring the representativeness and balance of the samples within the wind speed interval.
[0174] Furthermore, step S2 specifically includes the following steps:
[0175] Step S21: The greenhouse outline model is obtained by constructing a model of all segments of the greenhouse end face outline through curve fitting.
[0176] Step S22: Construct a unified function f(x) for multiple different segments in the greenhouse outline model in step S21;
[0177] Step S23: Integrate multiple segmental functions into a continuous and differentiable global function using a Gaussian-normalized weighting function;
[0178] Step S24: Establish a regional dynamic mesh strategy. Using UDF technology, write the greenhouse outline model and the regional dynamic mesh strategy into the greenhouse CFD model to obtain a three-dimensional simulation model of the greenhouse. After inputting a typical wind condition dataset, output the flow field distribution results of different ventilation opening combinations under different wind conditions.
[0179] Specifically, in step 2 of this embodiment, a three-dimensional simulation model of the greenhouse is established based on the surface dynamic mesh technology of Gaussian-normalized weight function, and the change of ventilation opening is accurate to 1%. At the same time, the ventilation parameters are controlled by UDF technology to achieve batch parametric simulation, and the corresponding flow field distribution results are obtained by combining typical wind condition datasets.
[0180] Specifically, since the greenhouse end face contour is composed of multiple geometric segments and has segmented curvature changes, directly applying dynamic mesh technology to simulate the window opening process and control the ventilation opening may result in problems such as low accuracy and high convergence difficulty. Therefore, curve fitting is used to construct the model of the greenhouse end face contour.
[0181] Furthermore, step S22 specifically includes the following steps:
[0182] S221. Define a curvature function based on curvature abrupt change points, with the following formula:
[0183]
[0184] Where k(x) is the curvature function; g(x) is the segment function constructed based on the profile of the greenhouse end face;
[0185] S222. Identify the local maxima x of the curvature function k(x). p As the center position of each section model in the greenhouse outline model;
[0186] S223. Construct a unified function f(x) for each segment of the greenhouse outline model. The specific formula is as follows:
[0187]
[0188] Where M is the number of segmental functions; f(p) (x;θ p ) is the segmental function of the p-th segment; ω p (x) is the weight function corresponding to the piecewise function of the p-th segment;
[0189] Applying the Gaussian-normalized weighting function, the specific formula is as follows:
[0190]
[0191] Where α is the smoothing control parameter; x x Let x be the true spatial coordinates of the x-th sampling point;
[0192] The total set of parameters is:
[0193] Θ={θ1,…,θ M ;x1,…,x M ;α}.
[0194] The overall profile function of the greenhouse end face is obtained as follows:
[0195]
[0196] Where N is the number of sampling points on the greenhouse end face contour; y x x represents the actual contour height value of the nth sampling point; x Let x be the true spatial coordinates of the x-th sampling point.
[0197] Specifically, traditional single-form models (such as global polynomial, logarithmic, and exponential models) are difficult to balance global fitting accuracy and local interpretability, resulting in large modeling errors. Therefore, a Gaussian-normalized weighting function is introduced to integrate multiple segmental functions into a continuous and differentiable global function through smooth weighting. This effectively solves the problems of non-smoothness, difficulty in optimization, and inconsistent models that exist when traditional segmental functions are fitting data with varying curvature.
[0198] Furthermore, step S24 specifically includes the following steps:
[0199] Step S241: Establish a regional dynamic mesh strategy:
[0200]
[0201] Where, γ lower γ upper δ is the regional stiffness coefficient. lower δ upper The displacement vector of the grid node;
[0202] Step S242: Using UDF technology, the overall contour function obtained by curve fitting in step S223 and the regional dynamic mesh strategy in step S241 are written into the greenhouse CFD model to obtain the greenhouse simulation three-dimensional model. The opening degree of the ventilation opening is controlled by the dynamic mesh motion parameters. After inputting the typical wind condition dataset, the flow field distribution results under different wind conditions and different ventilation opening degree combinations are output.
[0203] Among them, the CFD model is a computational fluid dynamics model.
[0204] Furthermore, step S3 specifically includes the following steps:
[0205] Step S31: Establish a greenhouse ventilation optimization model;
[0206] Step S32: Construct an improved FGO algorithm to optimize the ventilation opening of the greenhouse ventilation optimization model in step S31;
[0207] Step S33: Execute steps S31-S32 using Matlab to obtain the optimal opening combination of all vents under any combination of indoor and outdoor temperature difference and wind speed gradient corresponding to any wind direction;
[0208] Step S34: Obtain the relationship curve between the opening degree of any ventilation opening under any wind direction and the wind speed and the temperature difference between the inside and outside of the greenhouse by using a quadratic polynomial fitting method for the optimal opening degree combination in step S33, and obtain the window opening strategy model by using a radial basis function interpolation model.
[0209] Specifically, in this embodiment, a multi-dimensional response surface model, namely a greenhouse ventilation optimization model, is established by curve fitting. The external wind speed and the temperature difference between the inside and outside of the greenhouse are used as inputs to construct a two-dimensional continuous response surface, so as to realize the output of the ventilation opening degree for any combination of wind speed and temperature difference.
[0210] Specifically, in this embodiment, the optimal ventilation strategy is found based on parameters such as indoor and outdoor temperature difference and wind direction. The temperature and humidity inside the greenhouse are adjusted by optimizing the opening of the vents to adapt to different external environmental conditions. The FGO algorithm is an optimization algorithm for finding the global optimum. An improved FGO algorithm is further optimized to increase search efficiency and accuracy, and is used to optimize the vent opening in the greenhouse ventilation model. By executing steps S31 and S32 in Matlab, complex numerical calculations and optimization tasks can be performed efficiently to obtain the optimal combination of vent openings under different conditions. In this embodiment, a quadratic polynomial fitting method is used to model the relationship between the optimal opening combination and wind speed and temperature difference, obtaining curves showing the change of vent opening with wind speed and temperature difference. In this embodiment, the fitted relationship curve is further processed using an RBF interpolation model to form a window opening strategy model, enabling the rapid acquisition of the optimal vent opening under arbitrary wind speed and temperature difference conditions.
[0211] Understandably, greenhouse cultivation requires precise control of the internal environment to ensure optimal crop growth conditions. Ventilation is a crucial means of regulating temperature and humidity within the greenhouse. Traditional ventilation strategies often rely on experience or simple rules, making it difficult to cope with complex and ever-changing external environments. Therefore, this embodiment establishes a greenhouse ventilation optimization model, combining an improved FGO algorithm and Matlab tools, to systematically analyze and optimize the opening degree of ventilation vents, ensuring optimal ventilation performance under various external conditions.
[0212] Furthermore, the greenhouse ventilation optimization model in step S31 uses the opening degrees of the left top window ventilation opening x1, the left side window ventilation opening x2, the right top window ventilation opening x3, and the right side window ventilation opening x4 as optimization variables, and x1, x2, x3, x4 ∈ [0%, 100%]; the instantaneous rate of change of the greenhouse indoor temperature R T The instantaneous rate of change of humidity inside the greenhouse, R H Temperature uniformity in greenhouse (T) uniformity And the uniformity of indoor humidity in the greenhouse H uniformity As evaluation indicators;
[0213] The comprehensive objective function of the greenhouse ventilation optimization model in step S31 is as follows:
[0214] f=ω1R T +ω2R H +ω3T uniformity +ω4H uniformity ;
[0215] Where ω1 is the instantaneous rate of change of the indoor temperature in the greenhouse, R. T The corresponding weights, where ω2 is the instantaneous rate of change R of the humidity inside the greenhouse. H The corresponding weights; ω3 is the uniformity of indoor temperature T in the greenhouse. uniformity The corresponding weights; ω4 is the uniformity of humidity inside the greenhouse H. uniformity The corresponding weights.
[0216] Furthermore, step S32 specifically includes the following steps:
[0217] Step S321: Set the population size G and the maximum number of evaluations U for the FGO algorithm. max ;
[0218] Step S322: Generate a chaotic population X based on the chaotic mapping, merge it with a randomly selected population Y, and then select the individuals with the top G fitness to form a new population Y′;
[0219] Y′=[y′ b,1 ,y′ b,2 ,…,y′ b,c ];
[0220] b = 1, 2, ... G;
[0221] Where, y′ b,c The position of the b-th fungus in dimension c;
[0222] Step S323: Update the mycelial position by combining the growth rate and growth direction. The specific formula is as follows:
[0223] Dynamic growth rate:
[0224] E = e F ;
[0225]
[0226] Where E is the growth rate; e is the exploration operator; f o Let be the fitness value of the o-th solution; r1 is a random number generated in a uniform distribution in [0,1]; z is the number of times the current function has been evaluated; z max ξ is the maximum number of evaluations for the current function; ξ is the time decay factor. This represents the normalized fitness value.
[0227] Directional perturbation mechanism:
[0228]
[0229] in, Let be the growth direction vector of the b-th hyphae during the exploration phase; The growth direction of the b-th hyphae is directed towards a direction randomly selected from the population. r4 is a random number generated in a uniform distribution in [0,1]. r6 is a vector of random numbers generated in a uniform distribution in [0,1]; r6 is a random number generated in a uniform distribution in [0,1]; R is a predefined parameter in [0,1]; β takes the random value 1 or -1, and when β is 1, the search direction is moved away from the current optimal solution;
[0230] Mycelial position update:
[0231]
[0232] in, This represents the position of the b-th hyphae in the c-th dimension in the current assessment. Candidate solutions generated for the global search phase; R c r3 is a random number generated in a uniform distribution in [0,1] for the c-th dimension; r3 is a global random threshold generated in a uniform distribution in [0,1].
[0233] Step S324: Correct the direction using the gradient direction and the population optimal solution;
[0234] Gradient direction:
[0235]
[0236] Among them, g b For the overall gradient direction; r h The local optimal direction weight parameter; r g The globally optimal direction weight parameters; For individual gradient direction; d h,b d represents the local optimal direction correction amount. g,b This is the globally optimal direction correction amount;
[0237] Population optimal solution:
[0238] Egret A gradient estimation:
[0239]
[0240] Egret B random search:
[0241]
[0242] Egret C-Surrounding Mechanism:
[0243] x C,b =(1-r h -r g )·x b +r h ·D h +r g ·D g ;
[0244] Where, x A,b x represents the position of the new candidate solution generated by egret A at the b-th hyphal individual; B,b x represents the position of the new candidate solution generated by Egret B at the b-th hyphal individual; C,b x represents the position of the new candidate solution generated by egret C at the b-th hyphal individual; b The current individual position; step A The step size factor for the gradient search of Egret A; step B is the step size factor for the Egret B gradient search; hop is the jump coefficient; g b For the overall gradient direction; r B,b r is a random direction vector; h The local optimal direction weight parameter; r g The globally optimal direction weight parameter; D h D is the vector of differences between the individual and the local optimum. g This is the interpolation vector between the individual and the global optimal solution;
[0245] Selection mechanism:
[0246]
[0247] The optimal solution among the three is retained, or a new solution is accepted with a probability r < 0.3.
[0248] Where, x d,b Let y be the order matrix of the b-th egret group; d,b c is an array of objective function values for candidate solutions. b The index of the optimal candidate solution; y b x represents the fitness value of the current individual. b is the current individual position; r is a random number generated in a uniform distribution in [0,1].
[0249] Step S325: Update the individual and global optimal solutions;
[0250] Step S326: Repeat steps S322-S324 until the maximum number of evaluations is reached.
[0251] Furthermore, step S34 specifically includes the following steps:
[0252] Step S341: Adjust the opening degree of any vent to o w A quadratic polynomial relationship is established with respect to wind speed v and indoor-outdoor temperature difference ΔF. The specific formula is as follows:
[0253]
[0254] in, Let w be the predicted opening of the w-th vent, where w = x1, x2, x3, x4; ΔF is the indoor-outdoor temperature difference; β wi These are the polynomial fitting coefficients;
[0255] Step S342: Using a radial basis function interpolation model, based on known data points... The formula for outputting the opening of the unknown point (v, ΔF) is as follows:
[0256]
[0257] Where, λ k,l For the radial basis functions, Φ(||(v,ΔF)-(v) are the interpolation weighting coefficients; l ,ΔF l )||) are radial basis functions;
[0258] Step S343, Opening physical constraints, the specific formula is as follows:
[0259]
[0260] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for optimizing and controlling greenhouse ventilation based on meteorological data clustering and flow field analysis, characterized in that, Includes the following steps: S1. Obtain the original meteorological data of the area where the greenhouse is located within a preset time period, and process the original meteorological data using a meteorological data clustering method to obtain a typical wind condition clustering dataset with dynamic change characteristics. S2. Establish a three-dimensional simulation model of the greenhouse and integrate the typical wind condition clustering dataset mentioned in step S1. Use UDF technology to control ventilation parameters to obtain the flow field distribution results corresponding to different ventilation opening combinations under the typical wind condition clustering data. S3. The flow field distribution results in step S2 are optimized by improving the FGO algorithm to obtain the optimal combination of ventilation openings for all ventilation openings under different ventilation conditions.
2. The greenhouse ventilation optimization control method based on meteorological data clustering and flow field analysis according to claim 1, characterized in that, Step S1 specifically includes the following steps: S11. Extract statistical features from the raw meteorological data to form the final modeling features f. t That is, the sliding window statistical characteristics at hour t; The statistical characteristics include: average wind speed Wind speed variance Average wind direction Standard deviation of wind direction σ θ Wind speed change rate Δv t and the rate of change of outdoor temperature ΔT t ; The final modeling feature f t The formula is as follows: Where t is the t-th hour, t = 1, 2, ..., T; θ is the wind direction angle; T is the outdoor temperature; v is the wind speed; S12. Apply the K-means algorithm to all the final modeling features f. t Clustering yields K static wind field states, and the wind field state sequence S is output. t ; The clustering formula is as follows: Where, μ C(t) Let C(t) be the central feature vector of the Kth type of wind field state, where C(t)∈{1,2,…,K}; Output wind field state sequence: S t =C(t); S13. Using the Markov chain modeling method, the wind field state sequence S from step S12 is... t The static classification is transformed into a temporal wind field state. The transformation process of the wind field state satisfies the homogeneous first-order Markov assumption, that is: P(S t+1 |S t ,S t-1 ,…)=P(S t+1 |S t ); The transition probability matrix for wind field state transformation is defined as follows: Where P is the state transition probability matrix, n ij n represents the number of times wind field state i transitions to wind field state j; ik Let i be the number of times the wind field state i transitions to all possible states; S14. Extract representative samples using a modeling method based on Markov chains; The state transition probability matrix P is visualized as a directed graph G = (V, E), where node V represents a typical wind field state and directed edge E represents the transition relationship between wind field states. The wind field state transition path sequence is defined by the following formula: Among them, the path sequence that satisfies P(S)≥A in the raw meteorological data is searched, where A is the probability threshold of the transfer path and n is the total number of wind field states in the path sequence; Extract the actual sample segments corresponding to each path to form a representative sample sequence, and denote the representative sample sequence as X. typical And X typical ={X t1 ,X t1+1 ,…,X t1+L-1 }; Where L is the selected window length; S15. Output a typical wind condition clustering dataset containing time, temperature, wind speed, and wind direction.
3. The greenhouse ventilation optimization control method based on meteorological data clustering and flow field analysis according to claim 2, characterized in that, In step S13, the wind field state sequence S from step S12 is modeled using a Markov chain method. t When transforming from static classification to temporal wind field status, it also includes: Sample distribution intervals are generated based on dynamic wind speed interval optimization. Let the number of wind speed intervals be m. The formula for calculating the wind speed quantile is as follows: get: B1=[v min ,Q1],B2=[Q1,Q2],…,B m =[Q m-1 ,v max ]; Where Qq is the q-th quantile of wind speed; B r Let r be the r-th wind speed interval, r∈{1,2,…,m}, and each wind speed interval contains H / m samples.
4. The greenhouse ventilation optimization control method based on meteorological data clustering and flow field analysis according to claim 1, characterized in that, Step S2 specifically includes the following steps: Step S21: The greenhouse outline model is obtained by modeling all segments of the greenhouse end face outline using curve fitting. Step S22: Construct a unified function f(x) for multiple different segments in the greenhouse outline model described in step S21; Step S23: Integrate multiple segmental functions into a continuous and differentiable global function using a Gaussian-normalized weighting function; Step S24: Establish a regional dynamic mesh strategy. Using UDF technology, write the greenhouse outline model and the regional dynamic mesh strategy into the greenhouse CFD model to obtain the greenhouse simulation three-dimensional model. After inputting the typical wind condition dataset, output the flow field distribution results of different ventilation opening combinations under different wind conditions.
5. The greenhouse ventilation optimization control method based on meteorological data clustering and flow field analysis according to claim 4, characterized in that, Step S22 specifically includes the following steps: S221. Define a curvature function based on curvature abrupt change points, with the following formula: Where k(x) is the curvature function; g(x) is the segment function constructed based on the profile of the greenhouse end face; S222. Identify the local maxima x of the curvature function k(x). p As the center position of each segment model in the greenhouse outline model; S223. Construct a unified function f(x) for each segment of the greenhouse outline model, with the specific formula as follows: Where M is the number of segmental functions; f (p) (x;θ p ) is the segmental function of the p-th segment; ω p (x) is the weight function corresponding to the piecewise function of the p-th segment; Applying the Gaussian-normalized weighting function, the specific formula is as follows: Where α is the smoothing control parameter; x x Let x be the true spatial coordinates of the x-th sampling point; The total parameter set is: Θ={θ1,…,θ M ;x1,…,x M ;a}. The overall profile function of the greenhouse end face is obtained as follows: Where N is the number of sampling points on the greenhouse end face contour; y x x represents the actual contour height value of the nth sampling point; x Let x be the true spatial coordinates of the x-th sampling point.
6. The greenhouse ventilation optimization control method based on meteorological data clustering and flow field analysis according to claim 5, characterized in that, Step S24 specifically includes the following steps: Step S241: Establish a regional dynamic mesh strategy: Where, γ lower γ upper δ is the regional stiffness coefficient. lower δ upper The displacement vector of the grid node; Step S242: Using UDF technology, the overall contour function obtained by curve fitting in step S223 and the regional dynamic mesh strategy in step S241 are written into the greenhouse CFD model to obtain the greenhouse simulation three-dimensional model. The opening degree of the ventilation opening is controlled by the dynamic mesh motion parameters. After inputting the typical wind condition dataset, the flow field distribution results under different combinations of ventilation opening degree under different wind conditions are output.
7. The greenhouse ventilation optimization control method based on meteorological data clustering and flow field analysis according to claim 1, characterized in that, Step S3 specifically includes the following steps: Step S31: Establish a greenhouse ventilation optimization model; Step S32: Construct an improved FGO algorithm to optimize the ventilation opening of the greenhouse ventilation optimization model described in step S31; Step S33: Execute steps S31-S32 using Matlab to obtain the optimal opening combination of all vents under any combination of indoor and outdoor temperature difference and wind speed gradient corresponding to any wind direction; Step S34: Obtain the relationship curve between the opening degree of any ventilation opening under any wind direction and the wind speed and the temperature difference between the inside and outside of the greenhouse by using a quadratic polynomial fitting method for the optimal opening degree combination in step S33, and obtain the window opening strategy model by using a radial basis function interpolation model.
8. The greenhouse ventilation optimization control method based on meteorological data clustering and flow field analysis according to claim 7, characterized in that, The greenhouse ventilation optimization model in step S31 uses the opening degrees of the left top window vent x1, left side window vent x2, right top window vent x3, and right side window vent x4 as optimization variables, where x1, x2, x3, x4 ∈ [0%, 100%]; and the instantaneous rate of change R of the greenhouse indoor temperature is used as the optimization variable. T The instantaneous rate of change of humidity in the greenhouse, R H Temperature uniformity in greenhouse (T) uniformity And the uniformity of indoor humidity in the greenhouse H uniformity As evaluation indicators; The comprehensive objective function of the greenhouse ventilation optimization model in step S31 is as follows: f=ω1R T +ω2R H +ω3T uniformity +ω4H uniformity ; Where ω1 is the instantaneous rate of change of the indoor temperature in the greenhouse, R. T The corresponding weights, where ω2 is the instantaneous rate of change R of the humidity inside the greenhouse. H The corresponding weights; ω3 is the uniformity of indoor temperature T in the greenhouse. uniformity The corresponding weights; ω4 is the uniformity of humidity inside the greenhouse H. uniformity The corresponding weights.
9. The greenhouse ventilation optimization control method based on meteorological data clustering and flow field analysis according to claim 7, characterized in that, Step S32 specifically includes the following steps: Step S321: Set the population size G and the maximum number of evaluations U for the FGO algorithm. max ; Step S322: Generate a chaotic population X based on the chaotic mapping, merge it with a randomly selected population Y, and then select the individuals with the top G fitness to form a new population Y′; Y′=[y′ b,1 ,and' b,2 ,…,and' b,c ]; b = 1, 2, ... G; Where, y′ b,c The position of the b-th fungus in dimension c; Step S323: Update the mycelial position by combining the growth rate and growth direction. The specific formula is as follows: Dynamic growth rate: And=and F ; Where E is the growth rate; e is the exploration operator; f o Let be the fitness value of the o-th solution; r1 is a random number generated in a uniform distribution in [0,1]; z is the number of times the current function has been evaluated; z max ξ is the maximum number of evaluations for the current function; ξ is the time decay factor. This represents the normalized fitness value. Directional perturbation mechanism: in, Let be the growth direction vector of the b-th hyphae during the exploration phase; The growth direction of the b-th hyphae is directed towards a direction randomly selected from the population. r4 is a random number generated in a uniform distribution in [0,1]. r6 is a vector of random numbers generated in a uniform distribution in [0,1]; r6 is a random number generated in a uniform distribution in [0,1]; R is a predefined parameter in [0,1]; β takes the random value 1 or -1, and when β is 1, the search direction is moved away from the current optimal solution; Mycelial position update: in, This represents the position of the b-th hyphae in the c-th dimension in the current assessment. Candidate solutions generated for the global search phase; R c r3 is a random number generated in a uniform distribution in [0,1] for the c-th dimension; r3 is a global random threshold generated in a uniform distribution in [0,1]. Step S324: Correct the direction using the gradient direction and the population optimal solution; Gradient direction: Among them, g b For the overall gradient direction; r h The local optimal direction weight parameter; r g The globally optimal direction weight parameters; For individual gradient direction; d h,b d represents the local optimal direction correction amount. g,b This is the globally optimal direction correction amount; Population optimal solution: Egret A gradient estimation: Egret B random search: Egret C-Surrounding Mechanism: x C,b =(1-r h -r g )·x b +r h ·D h +r g ·D g ; Where, x A,b x represents the position of the new candidate solution generated by egret A at the b-th hyphal individual; B,b x represents the position of the new candidate solution generated by Egret B at the b-th hyphal individual; C,b x represents the position of the new candidate solution generated by egret C at the b-th hyphal individual; b The current individual position; step A The step size factor for the gradient search of Egret A; step B is the step size factor for the Egret B gradient search; hop is the jump coefficient; g b For the overall gradient direction; r B,b r is a random direction vector; h The local optimal direction weight parameter; r g The globally optimal direction weight parameter; D h D is the vector of differences between the individual and the local optimum. g This is the interpolation vector between the individual and the global optimal solution; Selection mechanism: The optimal solution among the three is retained, or a new solution is accepted with a probability r < 0.
3. Where, x d,b Let y be the order matrix of the b-th egret group; d,b c is an array of objective function values for candidate solutions. b The index of the optimal candidate solution; y b x represents the fitness value of the current individual. b is the current individual position; r is a random number generated in a uniform distribution in [0,1]. Step S325: Update the individual and global optimal solutions; Step S326: Repeat steps S322-S324 until the maximum number of evaluations is reached.
10. The greenhouse ventilation optimization control method based on meteorological data clustering and flow field analysis according to claim 7, characterized in that, Step S34 specifically includes the following steps: Step S341: Adjust the opening degree of any of the ventilation openings to o w A quadratic polynomial relationship is established with respect to wind speed v and indoor-outdoor temperature difference ΔF. The specific formula is as follows: in, Let w be the predicted opening of the w-th vent, where w = x1, x2, x3, x4; ΔF is the indoor-outdoor temperature difference; β wi These are the polynomial fitting coefficients; Step S342: Using a radial basis function interpolation model, based on known data points... The formula for outputting the opening of the unknown point (v, ΔF) is as follows: Where, λ k,l For the radial basis functions, Φ(||(v,ΔF)-(v) are the interpolation weighting coefficients; l ,ΔF l )||) are radial basis functions; Step S343, Opening physical constraints, the specific formula is as follows: