Greenhouse feedforward-feedback fusion control method and system based on attention prediction

By using a greenhouse feedforward-feedback fusion control method based on attention prediction, the weights of feedforward and feedback control are dynamically adjusted, which solves the instability problem of greenhouse environmental control under high uncertainty disturbances, achieves precise regulation and energy-saving operation, extends equipment life, and ensures crop safety.

CN122308057APending Publication Date: 2026-06-30NORTHWEST A & F UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NORTHWEST A & F UNIV
Filing Date
2026-05-19
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing technologies struggle to achieve an optimal balance between proactive adjustment and real-time correction when faced with highly uncertain disturbances, leading to instability in greenhouse environment control and resulting in energy waste and equipment wear and tear.

Method used

A greenhouse feedforward and feedback fusion control method based on attention prediction is adopted. By constructing a time series input matrix, key features are extracted using the attention mechanism. Combined with a deep reinforcement learning controller and physical constraints, the feedforward and feedback control weights are dynamically adjusted to generate the final control command, thereby achieving precise regulation of the greenhouse environment.

Benefits of technology

It improves the precision of greenhouse environmental control, reduces energy consumption throughout the entire life cycle, extends the service life of the equipment, and ensures the safety of crop growth.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122308057A_ABST
    Figure CN122308057A_ABST
Patent Text Reader

Abstract

This invention discloses a greenhouse feedforward-feedback fusion control method and system based on attention prediction, relating to the fields of smart agriculture and automatic control technology. The method includes: collecting greenhouse internal environmental parameters, outdoor meteorological parameters, and actuator status data; constructing a time-series input matrix after cleaning and standardization; inputting the time-series input matrix into a prediction model based on an attention mechanism; extracting key feature weights from historical moments; and outputting a predicted sequence of future greenhouse environmental states for multiple steps; identifying disturbances based on the predicted sequence; and if a drastic environmental change or a trend exceeding a safety threshold is detected in the future, using a greenhouse heat and humidity response model to back-calculate the feedforward compensation control amount required to offset the disturbance. This invention ultimately achieves multiple objectives: significantly improving greenhouse environmental control accuracy, drastically reducing total life-cycle energy consumption, extending the service life of actuators, and ensuring crop growth safety.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of smart agriculture and automatic control technology, and in particular to a greenhouse feedforward-feedback fusion control method and system based on attention prediction. Background Technology

[0002] Environmental control in facility agriculture is gradually evolving from traditional threshold control to data-driven intelligent predictive control. Existing technologies often employ recurrent neural networks (RNNs) such as Long Short-Term Memory (LSTM) or Gated Recurrent Units (GRUs) to construct predictive models, combined with Model Predictive Control (MPC) strategies. These methods predict greenhouse temperature and humidity trends by mining the time dependencies of historical environmental data and adjust actuators accordingly. Such methods perform well in handling conventional linear changes, significantly improving the stability of environmental control. However, greenhouse systems exhibit significant time lag and strong nonlinearity, and are susceptible to sudden changes in outdoor weather. Traditional RNNs have limitations in capturing long-distance key historical features, leading to large fluctuations in prediction accuracy under extreme weather or complex disturbances. More critically, existing technologies typically use fixed weights or simple linear superposition to handle feedforward prediction commands and feedback correction commands at the control strategy fusion level, lacking a dynamic response mechanism to the uncertainty (i.e., confidence level) of the prediction model itself.

[0003] The shortcomings of static fusion mechanisms lie in their vulnerability to adverse effects. When drastic changes in external weather conditions lead to a decrease in prediction confidence, excessive reliance on feedforward commands can easily cause actuator malfunctions or over-adjustments, resulting in energy waste and environmental instability. Conversely, failure to dynamically increase the weight of feedback control results in a loss of robustness against sudden disturbances. Existing solutions struggle to achieve an adaptive balance between "advanced adjustment" and "real-time correction" based on prediction reliability, limiting the overall control performance of the system under complex and variable operating conditions. Therefore, a fusion control method is urgently needed that can quantify prediction uncertainty and dynamically adjust the weights of feedforward and feedback control accordingly to address control instability under high-uncertainty disturbances. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, this invention provides a greenhouse feedforward-feedback fusion control method based on attention prediction to solve the problem that existing technologies, when faced with high uncertainty disturbances, lack a dynamic adaptive mechanism based on prediction reliability, making it difficult to achieve the optimal balance between advance adjustment and real-time correction, thus leading to control instability.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: In a first aspect, the present invention provides a greenhouse feedforward feedback fusion control method based on attention prediction, which includes collecting greenhouse internal environmental parameters, outdoor meteorological parameters and actuator status data, and constructing a time series input matrix after cleaning and standardization. The time series input matrix is ​​input into a prediction model based on the Attention mechanism to extract key feature weights from historical moments and output a prediction sequence of future multi-step greenhouse environment status. Based on the predicted sequence, disturbance identification is performed. If a trend of drastic environmental change or exceeding the safety threshold is detected in the future, the feedforward compensation control amount required to offset the disturbance is calculated using the greenhouse heat and humidity response model. A comprehensive state vector containing the real-time state, the predicted sequence, and the disturbance identification result is constructed and input into a deep reinforcement learning controller to generate a feedback correction control quantity for eliminating real-time errors and unforeseen disturbances. The feedforward compensation control quantity and the feedback correction control quantity are weighted and fused to generate the final control command, which is then sent to the greenhouse actuator to drive the equipment to adjust the greenhouse environment.

[0007] As a preferred embodiment of the greenhouse feedforward-feedback fusion control method based on attention prediction described in this invention, the construction process of the prediction model based on the attention mechanism includes: The time series input matrix is ​​encoded using a bidirectional recurrent neural network encoder to obtain a hidden state vector containing forward and backward temporal dependencies; The attention mechanism layer reads the correlation scores between the current prediction time and all historical times, generates a dynamic attention weight distribution, and performs a weighted summation of the historical hidden states based on the weight distribution to construct a context vector focusing on key historical features. The decoder performs autoregressive inference based on the context vector to obtain the probability distribution predictions of greenhouse temperature, humidity, and light intensity for the next K time steps.

[0008] Furthermore, the standardized time-series input matrix is ​​fed into a bidirectional recurrent neural network in parallel. The (Bi-RNN) encoder uses two independent forward and backward hidden layers to capture bidirectional temporal dependencies in historical data, from the past to the present and from the future back to the present, respectively, and fuses them to generate a sequence of hidden state vectors containing complete contextual information. Subsequently, the attention mechanism layer uses the current prediction time as the query benchmark, calculates the dot product correlation score between the current prediction time and the hidden state vectors of all historical time points, and generates a dynamic attention weight distribution after normalization by the Softmax function. This distribution can adaptively focus on key historical nodes that have a decisive impact on the current environmental evolution (such as the moment of sudden weather change), and accordingly performs a weighted summation of historical hidden states to construct a context vector with highly condensed key feature information. Finally, the decoder receives this context vector as the initial state and iteratively extrapolates using an autoregressive inference mode. It not only outputs the mean prediction trajectory of greenhouse temperature, humidity, and light intensity for the next K time steps, but also simultaneously calculates the corresponding variance confidence interval based on the probability distribution assumption, thereby achieving a dual and accurate quantification of the future environmental state and its uncertainty.

[0009] As an excellent example of the attention-based greenhouse feedforward-feedback fusion control method described in this invention... The selected scheme, wherein the specific logic for disturbance identification is as follows: Iterate through the mean and variance of the predicted sequence to determine whether any of the following conditions are met: adjacent times If the absolute value of the predicted temperature difference is greater than the preset mutation threshold, the predicted value exceeds the safe range for crop growth, or the predicted variance exceeds the upper limit of confidence; If any of the conditions are met, it is determined to be a strong disturbance event, and the disturbance type, expected occurrence time and intensity level are marked. The formula for calculating the feedforward compensation control quantity is: ; in, This is the feedforward compensation control variable. This is the vector of deviations between the predicted sequence and the safety setpoint. This is an inverse response model constructed based on the greenhouse energy balance equation.

[0010] Furthermore, specifically, the disturbance identification and feedforward compensation process first traverses the mean trajectory and variance uncertainty envelope of the prediction sequence in real time, and performs triple criterion detection: First, it calculates the absolute value of the predicted temperature difference between adjacent time steps; if it exceeds the preset mutation threshold, it is judged as a severe meteorological fluctuation. Second, it compares the predicted mean with the upper and lower limits of the crop growth safety range; if it exceeds the limits, it is judged as a survival stress risk. Third, it monitors whether the predicted variance exceeds the confidence limit; if it does, it is judged as a high uncertainty state of the model. Once any criterion is met, the system immediately triggers a strong disturbance event marker, accurately records the disturbance type, the expected time of occurrence, and the intensity level. Then, it calls the inverse response model constructed based on the first law of greenhouse thermodynamics and the mass conservation equation, takes the deviation vector between the predicted sequence and the safety setpoint as input, and solves the minimum energy input required to offset the prediction deviation through numerical iteration, thereby accurately calculating the feedforward compensation control quantity to achieve proactive compensation of known disturbances.

[0011] As a preferred embodiment of the attention-based greenhouse feedforward-feedback fusion control method of the present invention, wherein: the comprehensive state vector The construction formula is: ]; in, This provides the current real-time sensor readings and actuator status. For the future Multi-step prediction of mean sequence, For the corresponding predicted variance sequence, Encode the disturbance event; The deep reinforcement learning controller adopts an Actor-Critic architecture, and its reward function is designed to be multi-objective. The weighted form includes environmental control accuracy error, energy consumption cost, actuator motion smoothness penalty, and dynamic weighting coefficients for crop growth stages.

[0012] Furthermore, specifically, the construction process of the comprehensive state vector first deeply integrates multi-dimensional spatiotemporal information. It concatenates and splices the current high-dimensional real-time sensor readings and actuator feedback states, the mean trajectory of future multi-step environmental parameters output by the attention prediction model, the variance sequence representing prediction uncertainty, and the disturbance event tags processed by one-hot encoding to form an enhanced state space that can comprehensively represent the system's instantaneous state, future trends, and risk level. On this basis, a deep reinforcement learning controller based on the Actor-Critic architecture is deployed. Its reward function is carefully designed as a multi-objective weighted optimization form to ensure that the control strategy can adaptively balance control accuracy, energy efficiency ratio, and equipment life throughout the entire crop life cycle.

[0013] As a preferred embodiment of the greenhouse feedforward-feedback fusion control method based on attention prediction described in this invention, the training process of the deep reinforcement learning controller incorporates a physical information constraint loss function, specifically including: A physical residual term is added to the value estimation loss of the commentator network. The physical residual term is constructed based on the first law of greenhouse thermodynamics. The mean square error between the next time-instance state predicted by the neural network and the value obtained from the differential equation of greenhouse heat and moisture balance is read. By minimizing the total loss function to update the network parameters, the control strategy is forced to conform to the physical thermodynamics of greenhouse.

[0014] Furthermore, during the training phase of the deep reinforcement learning controller, to overcome the potential flaw of purely data-driven models violating physical common sense, a physical residual term based on the first law of greenhouse thermodynamics is explicitly embedded in the value estimation loss function of the Critic Network. This residual term quantifies the degree of deviation of the policy output from the laws of energy conservation and mass conservation by calculating the mean square error between the next-moment environmental state (temperature and humidity) predicted by the neural network in real time and the theoretical state derived from the differential equation of greenhouse heat and humidity balance by substituting the current control action into it. Then, a total loss function containing the weighted sum of temporal difference error and physical residual is constructed. The network parameters are iteratively updated by minimizing this total loss through the backpropagation algorithm, thereby imposing hard physical constraints during the policy optimization process. This forces the control policy generated by the agent to not only pursue reward maximization but also strictly follow the laws of heat and humidity transfer and energy balance inside the greenhouse, significantly improving the model's generalization ability, interpretability, and system safety under extreme conditions or few-sample scenarios.

[0015] As a preferred embodiment of the greenhouse feedforward feedback fusion control method based on attention prediction described in this invention, the weighted fusion adopts an adaptive dynamic gain strategy based on prediction uncertainty, and the final control command is calculated using the following formula:

[0016] in, For control commands, To maintain the current state of the actuator, To provide feedback and correct the control quantity; The adaptive fusion coefficient is determined by the variance of the predicted sequence and automatically switches to feedback control as the primary method.

[0017] Furthermore, specifically, the weighted fusion mechanism adopts an adaptive dynamic gain strategy based on prediction uncertainty, aiming to achieve seamless coordination between feedforward prediction and feedback correction: the final control command is linearly superimposed by the current hold state of the actuator, the feedforward compensation calculated based on the prediction deviation, and the feedback correction modulated by dynamic coefficients; among which, the core adaptive fusion coefficient is constructed as a nonlinear monotonically decreasing function of the prediction sequence variance (such as an inverse proportional relationship or an S-shaped decay curve). When the environment is stable and the prediction variance is low, it maintains a high level to fully release the advanced adjustment advantage of the feedforward control. When a strong disturbance is detected that causes a surge in prediction uncertainty (variance exceeds the threshold), it automatically and rapidly decays to a low value, thereby suppressing unreliable feedforward components and forcing the system to switch to the feedback control mode driven by real-time error as the main mode, ensuring that the greenhouse environment can still be kept stable and controlled by the high robustness of the feedback loop even when the model confidence is insufficient.

[0018] As a preferred embodiment of the greenhouse feedforward feedback fusion control method based on attention prediction described in this invention, the method further includes a safety constraint verification and logic interlocking step after generating the final control command. Check whether each actuator instruction in the control command exceeds the physical limit range; if it does, truncate it to the boundary value. The logic interlock judgment is executed. If the heating command and the strong ventilation command exist at the same time and the temperature difference is less than the preset dead zone, the heating command is retained first and the ventilation opening is limited, or the ventilation command is retained first and the heating equipment is turned off to prevent energy waste and equipment damage. The verified final control command is converted into a pulse width modulation (PWM) signal or a relay switching signal to drive the motors, frequency converters and valves in the greenhouse to perform corresponding actions.

[0019] Furthermore, after generating the final control command, the system immediately executes a strict safety constraint verification and logic interlock mechanism: First, a physical limit check is performed, forcibly truncating values ​​in each actuator command that exceed the hardware's rated range (such as valve opening 0-100%, motor frequency upper limit) to a safe boundary to prevent equipment overload damage; then, a logic interlock judgment based on energy efficiency and equipment protection is initiated, focusing on monitoring the concurrent state of heating and strong ventilation commands. If both are activated simultaneously and the indoor-outdoor temperature difference is less than the preset dead zone (indicating that there is no need for heat dissipation through vigorous ventilation), a dynamic decision is made based on the "energy saving priority" or "temperature priority" strategy. Either the heating command is retained and the ventilation opening is significantly limited to maintain thermal efficiency, or the ventilation command is executed first and the heating equipment is forcibly shut down to eliminate the energy waste of "heating and dissipating heat simultaneously"; finally, the commands that have undergone dual verification and optimization are mapped to a high-precision pulse width modulation (PWM) duty cycle signal or relay switching level to precisely drive the variable frequency fans, electric valves, and heating units in the greenhouse to perform corresponding actions, ensuring that the control strategy is implemented efficiently under the premise of physical safety and logical rationality.

[0020] Secondly, the present invention provides a greenhouse feedforward feedback fusion control system based on Attention prediction, including a data processing module that collects greenhouse internal environmental parameters, outdoor meteorological parameters and actuator status data, and constructs a time series input matrix after cleaning and standardization. The prediction module inputs the time series input matrix into the prediction model based on the Attention mechanism, extracts the key feature weights of historical moments, and outputs a prediction sequence of the greenhouse environment state in the future. The detection module identifies disturbances based on the predicted sequence. If it detects a trend of drastic environmental changes or exceeding a safety threshold in the future, it uses the greenhouse heat and humidity response model to back-calculate the feedforward compensation control amount required to offset the disturbance. The control module constructs a comprehensive state vector containing the real-time state, the predicted sequence, and the disturbance identification result, and inputs it to the deep reinforcement learning controller to generate a feedback correction control quantity for eliminating real-time errors and unforeseen disturbances. The fusion module weights and fuses the feedforward compensation control quantity and the feedback correction control quantity to generate a final control command and sends it to the greenhouse actuator to drive the equipment to adjust the greenhouse environment.

[0021] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, it implements any step of the greenhouse feedforward feedback fusion control method based on attention prediction as described in the first aspect of the present invention.

[0022] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the greenhouse feedforward feedback fusion control method based on attention prediction as described in the first aspect of the present invention.

[0023] The beneficial effects of this invention are as follows: By constructing a comprehensive state vector that integrates real-time state, multi-step prediction mean and variance, and disturbance labels, and combining it with a deep reinforcement learning training mechanism that introduces physical thermodynamic residual constraints, a deep balance between data-driven optimization and adherence to physical laws in the control strategy is achieved. This effectively solves the problems of poor generalization ability and violation of energy conservation in traditional black-box models under extreme conditions. Furthermore, by using an adaptive dynamic gain strategy based on the variance of prediction uncertainty to weight and fuse the feedforward compensation and feedback correction, and supplemented by actuator physical limit truncation and interlock verification of heating and ventilation logic, the invention achieves the advantage of feedforward control in advance adjustment when the environment is stable, and automatically and smoothly switches to a highly robust feedback-dominated mode when the prediction confidence is low or strong disturbances occur. At the same time, it eliminates the energy waste of equipment overload and "heating and dissipating heat simultaneously". Ultimately, it achieves multiple goals, including significantly improving the accuracy of greenhouse environmental control, greatly reducing the energy consumption throughout the entire life cycle, extending the service life of the actuators, and ensuring the safety of crop growth. Attached Figure Description

[0024] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 This is a flowchart of a greenhouse feedforward-feedback fusion control method based on attention prediction.

[0026] Figure 2 This is a schematic diagram of a greenhouse feedforward-feedback fusion control system based on attention prediction. Detailed Implementation

[0027] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0028] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0029] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0030] Example 1, Reference Figures 1-2 This is the first embodiment of the present invention, which provides a greenhouse feedforward fusion control method based on attention prediction, including the following steps: This embodiment provides a greenhouse feedforward-feedback fusion control method based on attention prediction, aiming to solve the problems of slow response, high energy consumption, and strategies violating physical laws in traditional greenhouse control when facing complex weather changes. The method first uses multi-source data acquisition and preprocessing to collect real-time environmental parameters such as temperature, humidity, and light intensity inside the greenhouse, outdoor weather forecast data, and the current operating status of actuators. After cleaning, denoising, and standardization, a high-dimensional time series input matrix is ​​constructed, laying the data foundation for subsequent intelligent decision-making. Subsequently, a deep prediction model based on an attention mechanism is used to encode and decode the input matrix. This model can automatically extract key feature weights from historical time series, ignore irrelevant noise, and accurately output the evolution trend and probability distribution of the greenhouse environmental state in future multiple steps.

[0031] Based on this, the system performs intelligent disturbance identification and feedforward compensation: by traversing the statistical characteristics of the prediction sequence, it automatically determines whether there will be drastic environmental changes or trends exceeding crop safety thresholds in the future; once a strong disturbance event is identified, it immediately invokes the inverse response model built based on the greenhouse energy balance principle to calculate the feedforward compensation control amount required to offset the prediction deviation, achieving proactive adjustment. Simultaneously, a comprehensive state vector is constructed, integrating real-time state, future prediction mean, prediction uncertainty variance, and disturbance label, and input into a deep reinforcement learning controller trained with physical information constraints. During training, the controller incorporates the first law of thermodynamics as a physical residual constraint, ensuring that the generated feedback correction control amount not only pursues reward maximization but also strictly follows the physical laws of greenhouse heat and moisture transfer, thereby effectively eliminating real-time errors and responding to unforeseen random disturbances.

[0032] Ultimately, the system employs an adaptive dynamic gain strategy based on predictive uncertainty, intelligently weighting and fusing feedforward compensation and feedback correction: when the prediction confidence is high, the system primarily leverages the leading advantage of feedforward control; when the prediction variance increases, indicating high environmental uncertainty, the system automatically reduces the feedforward weight and switches to feedback control as the primary approach, ensuring system robustness. The final control command generated by the fusion also undergoes rigorous safety constraint verification and logic interlocking, including actuator physical limit truncation and anti-conflict logic judgment for heating and ventilation equipment (such as preventing simultaneous heating and strong ventilation), ultimately converting it into drive signals and sending them to the actuators to achieve precise, energy-saving, and safe closed-loop control of the greenhouse environment.

[0033] Example 2, Reference Figures 1-2 This is a second embodiment of the present invention, which provides a greenhouse feedforward fusion control method based on attention prediction, including the following steps: This embodiment provides a greenhouse feedforward-feedback fusion control system based on the above method. The system comprises a data processing module, a prediction module, a detection module, a control module, and a fusion module working collaboratively to form a complete intelligent control closed loop. The data processing module, as the system's sensing front end, is responsible for real-time acquisition of multi-dimensional heterogeneous data from inside and outside the greenhouse, performing cleaning and standardization operations, and constructing a unified time-series input matrix to ensure the quality and consistency of the input data. The prediction module incorporates a deep learning engine based on an attention mechanism, enabling in-depth time-series mining of historical data, dynamically focusing on key historical moment features, and outputting high-confidence prediction sequences containing multiple future steps of temperature, humidity, and light intensity, providing a forward-looking perspective in the time dimension for decision-making.

[0034] The detection module, acting as the trigger core for feedforward control, monitors the fluctuation characteristics of the predicted sequence in real time. Once it identifies an impending environmental change or risk of exceeding limits, it immediately marks the type and intensity of the disturbance and uses a greenhouse thermal and humidity response mechanism model to quickly calculate the feedforward compensation required to offset the disturbance, thus achieving proactive intervention. The control module acts as the system's "intelligent brain." Its internally integrated deep reinforcement learning controller has embedded physical thermodynamic constraints during the training phase. It can receive a comprehensive state vector containing real-time state, predicted trends, and disturbance information, and output feedback correction control quantities that conform to physical laws and optimize multi-objective rewards (such as accuracy, energy consumption, and equipment lifespan).

[0035] As the final gate for instruction generation, the fusion module employs an adaptive dynamic gain algorithm to intelligently adjust the fusion ratio of feedforward and feedback control quantities based on the magnitude of prediction uncertainty, enabling smooth switching of control strategies under different operating conditions. Simultaneously, this module embeds a safety verification and logic interlock unit to perform physical boundary checks and actuator action logic conflict investigations on all generated control instructions (such as the mutual exclusion logic between heating and ventilation), eliminating energy waste and equipment wear. Ultimately, the optimized instructions are converted into standard pulse width modulation signals or switching signals to precisely drive the actions of actuators such as fans, valves, and heaters within the greenhouse, comprehensively ensuring the efficient and stable operation of the greenhouse production environment.

[0036] This embodiment also provides a computer device applicable to the greenhouse feedforward feedback fusion control method based on attention prediction, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the greenhouse feedforward feedback fusion control method based on attention prediction as proposed in the above embodiment.

[0037] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0038] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the greenhouse feedforward fusion control method based on attention prediction as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0039] In summary, this invention constructs a comprehensive state vector that integrates real-time state, multi-step prediction mean and variance, and disturbance labels. Combined with a deep reinforcement learning training mechanism incorporating physical thermodynamic residual constraints, it achieves a deep balance between data-driven optimization and adherence to physical laws in the control strategy. This effectively solves the problems of poor generalization ability and violation of energy conservation in traditional black-box models under extreme conditions. Furthermore, it utilizes an adaptive dynamic gain strategy based on prediction uncertainty variance to weightedly fuse feedforward compensation and feedback correction, supplemented by actuator physical limit truncation and interlocking verification of heating and ventilation logic. This enables the proactive adjustment advantage of feedforward control when the environment is stable, and automatic smooth switching to a highly robust feedback-dominated mode when prediction confidence is low or strong disturbances occur. Simultaneously, it eliminates equipment overload and energy waste from "heating and dissipating heat simultaneously." Ultimately, this achieves multiple objectives: significantly improving greenhouse environmental control accuracy, drastically reducing total life-cycle energy consumption, extending the service life of actuators, and ensuring crop growth safety.

[0040] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A greenhouse feedforward-feedback fusion control method based on attention prediction, characterized in that: include, Collect greenhouse internal environmental parameters, outdoor meteorological parameters, and actuator status data, and construct a time series input matrix after cleaning and standardization. The time series input matrix is ​​input into a prediction model based on the Attention mechanism to extract key feature weights from historical moments and output a prediction sequence of future multi-step greenhouse environment status. Based on the predicted sequence, disturbance identification is performed. If a trend of drastic environmental change or exceeding the safety threshold is detected in the future, the feedforward compensation control amount required to offset the disturbance is calculated by using the greenhouse heat and humidity response model. A comprehensive state vector containing the real-time state, the predicted sequence, and the disturbance identification result is constructed and input into a deep reinforcement learning controller to generate a feedback correction control quantity for eliminating real-time errors and unforeseen disturbances. The feedforward compensation control quantity and the feedback correction control quantity are weighted and fused to generate the final control command, which is then sent to the greenhouse actuator to drive the equipment to adjust the greenhouse environment.

2. The greenhouse feedforward feedback fusion control method based on attention prediction as described in claim 1, characterized in that: The construction process of the prediction model based on the attention mechanism includes: The time series input matrix is ​​encoded using a bidirectional recurrent neural network encoder to obtain a hidden state vector containing forward and backward temporal dependencies; The attention mechanism layer reads the correlation scores between the current prediction time and all historical times, generates a dynamic attention weight distribution, and performs a weighted summation of the historical hidden states based on the weight distribution to construct a context vector focusing on key historical features. The decoder performs autoregressive inference based on the context vector to obtain the probability distribution predictions of greenhouse temperature, humidity, and light intensity for the next K time steps.

3. The greenhouse feedforward-feedback fusion control method based on attention prediction as described in claim 2, characterized in that: The specific logic for perturbation identification is as follows: Iterate through the mean and variance of the predicted sequence to determine whether any of the following conditions are met: adjacent times If the absolute value of the predicted temperature difference is greater than the preset mutation threshold, the predicted value exceeds the safe range for crop growth, or the predicted variance exceeds the upper limit of confidence; If any of the conditions are met, it is determined to be a strong disturbance event, and the disturbance type, expected occurrence time and intensity level are marked. The formula for calculating the feedforward compensation control quantity is: ; in, This is the feedforward compensation control variable. This is the vector of deviations between the predicted sequence and the safety setpoint. This is an inverse response model constructed based on the greenhouse energy balance equation.

4. The greenhouse feedforward-feedback fusion control method based on attention prediction as described in claim 3, Its features are: The comprehensive state vector The construction formula is: ]; in, This provides the current real-time sensor readings and actuator status. For the future Step-by-step prediction of the mean sequence, For the corresponding predicted variance sequence, Encode the disturbance event; The deep reinforcement learning controller adopts an Actor-Critic architecture, and its reward function is designed to be multi-objective. The weighted form includes environmental control accuracy error, energy consumption cost, actuator motion smoothness penalty, and dynamic weighting coefficients for crop growth stages.

5. The greenhouse feedforward feedback fusion control method based on attention prediction as described in claim 4, characterized in that: The training process of the deep reinforcement learning controller incorporates a physically constrained loss function, specifically including: A physical residual term is added to the value estimation loss of the commentator network. The physical residual term is constructed based on the first law of greenhouse thermodynamics. The mean square error between the next time-instance state predicted by the neural network and the value obtained from the differential equation of greenhouse heat and moisture balance is read. By minimizing the total loss function to update the network parameters, the control strategy is forced to conform to the physical thermodynamics of greenhouse.

6. The greenhouse feedforward-feedback fusion control method based on attention prediction as described in claim 5, characterized in that: The weighted fusion adopts an adaptive dynamic gain strategy based on prediction uncertainty, and the final control command is calculated using the following formula: ;in, For control commands, To maintain the current state of the actuator, To provide feedback and correct the control quantity; The adaptive fusion coefficient is determined by the variance of the predicted sequence and automatically switches to feedback control as the primary method.

7. The greenhouse feedforward-feedback fusion control method based on attention prediction as described in claim 6, characterized in that: After generating the final control command, the process also includes safety constraint verification and logic interlocking steps: Check whether each actuator instruction in the control command exceeds the physical limit range; if it does, truncate it to the boundary value. The logic interlock judgment is executed. If the heating command and the strong ventilation command exist at the same time and the temperature difference is less than the preset dead zone, the heating command is retained first and the ventilation opening is limited, or the ventilation command is retained first and the heating equipment is turned off to prevent energy waste and equipment damage. The verified final control command is converted into a pulse width modulation (PWM) signal or a relay switching signal to drive the motors, frequency converters and valves in the greenhouse to perform corresponding actions.

8. A greenhouse feedforward-feedback fusion control system based on attention prediction, based on the greenhouse feedforward-feedback fusion control method based on any one of claims 1 to 7, characterized in that: include, The data processing module collects internal greenhouse environmental parameters, outdoor meteorological parameters, and actuator status data, and constructs a time series input matrix after cleaning and standardization. The prediction module inputs the time series input matrix into the prediction model based on the Attention mechanism, extracts the key feature weights of historical moments, and outputs a prediction sequence of the greenhouse environment state in the future. The detection module identifies disturbances based on the predicted sequence. If it detects a trend of drastic environmental changes or exceeding a safety threshold in the future, it uses the greenhouse heat and humidity response model to back-calculate the feedforward compensation control amount required to offset the disturbance. The control module constructs a comprehensive state vector containing the real-time state, the predicted sequence, and the disturbance identification result, and inputs it to the deep reinforcement learning controller to generate a feedback correction control quantity for eliminating real-time errors and unforeseen disturbances. The fusion module weights and fuses the feedforward compensation control quantity and the feedback correction control quantity to generate a final control command and sends it to the greenhouse actuator to drive the equipment to adjust the greenhouse environment.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the greenhouse feedforward feedback fusion control method based on attention prediction as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the greenhouse feedforward feedback fusion control method based on attention prediction as described in any one of claims 1 to 7.