Greenhouse environment modeling and simulation method based on DEVS and agricultural knowledge graph

By constructing a greenhouse environment model based on DEVS and agricultural knowledge graphs, and combining historical data and knowledge graphs to optimize control strategies, the problem of poor adaptability of control strategies in traditional greenhouse environment control methods is solved, and precise environmental control and intelligent decision-making are achieved.

CN122284286APending Publication Date: 2026-06-26HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES
Filing Date
2026-03-04
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Traditional greenhouse environment control methods are unable to accurately characterize the complex dynamic coupling relationships between multiple environmental factors, resulting in poor adaptability of control strategies and an inability to achieve refined and optimal control of crop growth environment. Furthermore, the DEVS framework is difficult to integrate expert experience and heterogeneous knowledge from multiple sources in the agricultural field, and lacks intelligent decision-making capabilities.

Method used

By constructing a greenhouse environment model based on DEVS and an agricultural knowledge graph, historical planting data is obtained to identify correlations, an agricultural knowledge graph is constructed, and the DEVS atomic model and Cadmium framework are coupled together. Real-time simulation is performed, and the control strategy is corrected based on the knowledge graph to optimize environmental control.

Benefits of technology

It has achieved precise digital twinning of the greenhouse environment and dynamic optimization of strategies, improved the intelligence level and decision-making accuracy of environmental regulation, and enhanced the system's adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122284286A_ABST
    Figure CN122284286A_ABST
Patent Text Reader

Abstract

This invention discloses a greenhouse environment modeling and simulation method based on DEVS and an agricultural knowledge graph. First, an agricultural knowledge graph is constructed based on historical data to represent the association rules between crops, the environment, and equipment. Second, based on the greenhouse control system, a DEVS-style atomic model of sensors, inference engine, controller, and actuators is constructed, and these are coupled into a top-level model using the Cadmium framework, defining interaction and synchronization mechanisms. During simulation, real-time environmental data is input, and the proportion of time that environmental parameters are within the optimal range for crops is evaluated. If the proportion is below a threshold, the inference rules are dynamically corrected based on the knowledge graph to generate an optimized environmental control strategy. This invention achieves formal modeling and intelligent simulation optimization of the greenhouse system, improving the accuracy of control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of greenhouse planting and environmental simulation technology, and in particular to a greenhouse environment modeling and simulation method based on DEVS and agricultural knowledge graph. Background Technology

[0002] With the deepening development of modern agriculture, greenhouse planting technology is becoming increasingly popular, and intelligent environmental control systems have become a key means to improve crop yield and quality. However, traditional greenhouse environmental control methods mostly rely on preset rules or simplified mathematical models, which make it difficult to accurately depict the complex dynamic coupling relationship between multiple environmental factors such as temperature, humidity, CO2 concentration, and soil parameters in the greenhouse. This results in poor adaptability and delayed response of control strategies, making it impossible to achieve refined and optimized control of the crop growth environment.

[0003] In system modeling and simulation, the Discrete Event Systems Specification (DEVS), with its "event-driven, state-discrete" modeling characteristics, provides an effective way to formally describe and simulate complex systems like greenhouses that operate asynchronously and have multiple components. Modern DEVS simulation frameworks such as Cadmium further support modular modeling and component reuse, which is beneficial for building greenhouse control system models with clear structures. However, relying solely on the DEVS framework still has limitations. It is difficult to effectively integrate and utilize the vast amount of expert experience, crop growth rules, and heterogeneous knowledge accumulated in the agricultural field, resulting in insufficient decision-making intelligence in the model.

[0004] In recent years, knowledge graph technology has shown potential in the field of agricultural knowledge management due to its powerful knowledge structure representation and semantic reasoning capabilities, providing semantic and relational decision support for environmental regulation. However, current technologies have not yet achieved deep integration of knowledge graphs and the DEVS simulation framework at the greenhouse environment modeling level. The lack of effective connection between the dynamics of knowledge reasoning and the continuity of simulation model behavior restricts the construction of a greenhouse environment digital twin system that combines accurate simulation and intelligent decision-making capabilities.

[0005] Therefore, how to organically embed agricultural knowledge graphs into the DEVS formal modeling framework and construct a greenhouse environment model that not only has high-fidelity dynamic simulation capabilities but also supports knowledge-based intelligent decision-making and rule self-optimization has become a pressing technical problem in the field of smart agriculture. Summary of the Invention

[0006] To address at least one of the aforementioned technical problems, this invention proposes a greenhouse environment modeling and simulation method based on DEVS and agricultural knowledge graphs.

[0007] The first aspect of this invention provides a greenhouse environment modeling and simulation method based on DEVS and agricultural knowledge graphs, comprising: Obtain historical planting data of the target greenhouse, identify the relationship between the planted crops, greenhouse environment, and greenhouse environment control equipment based on the historical planting data, and construct an agricultural knowledge graph of the target planted crops based on the relationship; Obtain the configuration information of the environmental control system of the target greenhouse, and construct a set of atomic models in the form of DEVS based on the configuration information of the environmental control system. The set of atomic models includes sensor atomic models, inference engine atomic models, controller atomic models and actuator atomic models. Based on the Cadmium DEVS framework, the atomic models are coupled to construct a top-level coupled model, defining the information interaction path and synchronization mechanism between models, and connecting each sub-model through external input coupling, external output coupling and internal coupling. The real-time greenhouse environment data is input into the top-level coupled model for simulation. The proportion of time that the environmental parameters are in the optimal growth range of crops is evaluated based on the simulation results. If the proportion of time is lower than a preset threshold, the reasoning rules are corrected based on the agricultural knowledge graph to obtain an optimized greenhouse environment control strategy.

[0008] In this solution, the acquisition of historical planting data of the target greenhouse, and the identification of the correlation between the planted crops, the greenhouse environment, and the greenhouse environment control equipment based on the historical planting data, specifically includes: Acquire historical planting data of the target crop in the target greenhouse over multiple planting cycles. The historical planting data includes crop growth stage data, time-series data of greenhouse environmental parameters, operation record data of environmental control equipment, and final crop yield and quality assessment data. Based on the crop growth stage data, each planting cycle is divided into sowing period, seedling period, growth period, flowering period and fruiting period, and a subset of environmental parameter data and a subset of control equipment operation data corresponding to each growth stage are extracted. Statistical characteristic values ​​of key environmental parameters within each growth stage are calculated based on the aforementioned subset of environmental parameter data. The key environmental parameters include air temperature, air humidity, carbon dioxide concentration, soil temperature, humidity, and pH value. The statistical characteristic values ​​include average value, maximum value, minimum value, and the proportion of time within the preset optimal growth range. Based on the operation record data of the control equipment, the environmental control equipment activated in each growth stage is identified and associated. The environmental control equipment includes ventilation equipment, shading equipment, heating equipment, humidification equipment, supplemental lighting equipment, and irrigation equipment. The control parameters of the environmental control equipment are extracted. The control parameters include the threshold conditions for equipment activation, the target parameter values ​​for equipment operation, and the duration of continuous equipment operation. The association data between the planted crops, the greenhouse environment, and the greenhouse environmental control equipment are obtained.

[0009] In this solution, the step of constructing an agricultural knowledge graph of the target crop based on the association relationship specifically involves: Construct an agricultural knowledge graph model layer with crop types as the core, define the entity types in the graph as crop type, growth stage, environmental parameters, control equipment, and control operation, and define the relationship types between entities as belonging to the growth stage, having the optimal parameter range, being controlled by equipment, triggering control operation, and operation duration. Based on the correlation data extracted from historical planting data, the agricultural knowledge graph is instantiated, and each growth stage is linked with the optimal statistical feature value range of the corresponding key environmental parameters to form an optimal parameter range relationship. Link each key environmental parameter to a control device that can regulate that parameter in a controlled-device relationship, and instantiate the control operation entity that each control device performs when triggered at different growth stages; By triggering the control operation relationship link, the control operation entity is associated with the control parameters and operation duration attributes extracted from the operation record. The instantiated agricultural knowledge graph is stored using a graph database to form a target crop agricultural knowledge graph that includes crops, environmental parameters, control equipment, and control operation relationships.

[0010] In this solution, the environmental control system configuration information of the target greenhouse is obtained, and a set of atomic models in DEVS form is constructed based on the environmental control system configuration information. This set of atomic models includes sensor atomic models, inference engine atomic models, controller atomic models, and actuator atomic models, specifically: Obtain the configuration information of the environmental control system of the target greenhouse, divide the control subsystems according to the configuration information of the environmental control system, and identify and separate the sensing, reasoning, control and execution subsystems. For the sensing subsystem, the physical configuration parameters of the air temperature sensor, air humidity sensor, carbon dioxide sensor, soil temperature sensor, soil humidity sensor, and soil pH sensor in the sensing subsystem are obtained, including measurement accuracy and acquisition frequency. A DEVS atomic model is constructed for each type of sensor. The sensor DEVS atomic model defines a state space that includes waiting, measurement, and transmission states, and sets the dwell time of the measurement state according to the acquisition frequency. The external transition function responds to external environmental data input events to trigger state transitions, and the acquired environmental parameter values ​​are issued as output events through the output function. For the reasoning subsystem, the agricultural knowledge graph is deployed in the reasoning subsystem. Based on the logical architecture of the agricultural knowledge graph and the SWI-Prolog inference engine, an atomic model of the reasoning engine is constructed. By mapping the received multi-source environmental data to entity attribute values ​​in the agricultural knowledge graph, and calling the Prolog rule base for logical reasoning, a device linkage strategy is generated as an output event. For the control subsystem, the instruction parsing and scheduling logic of the controller in the control subsystem is obtained, the controller atomic model is constructed, and specific control instructions are generated by parsing the policy events output by the inference engine and combining them with the current actuator state. The computation time for instruction execution is set according to the device type. For the execution subsystem, based on the physical response characteristics of the ventilation equipment, shading equipment, heating equipment, humidifying equipment, supplemental lighting equipment and irrigation equipment in the execution subsystem, atomic models of each actuator are constructed. By defining the shutdown, attempted opening, start-up and running states, the delay of equipment action and the running effect are simulated, and the actual impact on greenhouse environmental parameters is continuously output through the output function. The sensor atomic model, inference engine atomic model, controller atomic model, and actuator atomic model are constructed into a complete set of atomic models.

[0011] In this scheme, the atomic models are coupled based on the Cadmium DEVS framework to construct a top-level coupled model, defining the information interaction paths and synchronization mechanisms between models. The sub-models are connected through external input coupling, external output coupling, and internal coupling. Specifically: The sensor atomic model, inference engine atomic model, controller atomic model, and actuator atomic model are instantiated as sub-models to construct the top-level coupled model. The input event set of the top-level coupled model is defined as the external environment input, and the output event set is the control log output. The external environment input is the greenhouse environment data acquired by the sensor. Establish external input coupling relationships, mapping external environment input events to the input ports of each sensor atomic model and the input ports of the inference engine atomic model respectively; Establish internal coupling relationships by connecting the output ports of each sensor atomic model to the input ports of the inference engine atomic model to transmit real-time environmental data, connecting the output ports of the inference engine atomic model to the input ports of the controller atomic model to transmit device linkage strategies, connecting the output ports of the controller atomic model to the input ports of each actuator atomic model to send control commands, and connecting the output ports of each actuator atomic model to the input ports of the controller atomic model to provide feedback on device status. Build external output coupling relationships to map the output ports of the inference engine's atomic model to the output ports of the top-level coupled model in order to record control decision logs; Define a synchronization mechanism to ensure that the time advancement functions of all internal atomic models are executed synchronously as the top-level coupled model advances in time. By integrating all atomic models through the aforementioned external input coupling, internal coupling, and external output coupling relationships, a complete greenhouse environment control simulation system is formed.

[0012] In this scheme, the step of inputting the real-time collected greenhouse environment data into the top-level coupled model for simulation specifically involves: The real-time greenhouse environment data is input into the top-level coupled model as an external input event stream in the order of timestamps. The sensor atomic model receives the real-time greenhouse environment data and triggers the external transition function to perform state transition, enters the measurement state, and outputs the measurement value event with timestamp after the dwell time ends. The inference engine atomic model receives measurement value events from the atomic models of each sensor, maps them to the current attribute values ​​of the corresponding environmental parameter entities in the agricultural knowledge graph, and performs logical reasoning based on the optimal growth range of the crop associated with the current growth stage stored in the agricultural knowledge graph and the inference rules in the Prolog rule base to generate a device linkage strategy event containing the identifier of the control device to be triggered and the target control value. The controller atomic model receives and parses the device linkage strategy event, and combines it with the current device state fed back from the actuator atomic model to generate a control instruction event containing specific control instruction codes and execution time information; The actuator atomic model receives the control command event, updates its state according to its physical response characteristics, and calculates the actual impact on greenhouse environmental parameters. This impact is fed back to the input port of the sensor atomic model through internal coupling to influence the environmental data input of the next simulation step in a closed loop.

[0013] In this scheme, the proportion of time during which environmental parameters are within the optimal growth range of crops is evaluated based on simulation results. If this proportion is lower than a preset threshold, the inference rules are modified based on the agricultural knowledge graph to obtain an optimized greenhouse environment control strategy. The values ​​of key environmental parameters at each simulation moment are recorded synchronously and compared with the optimal growth range of the corresponding environmental parameters defined in the agricultural knowledge graph for the current crop growth stage. After the simulation is completed, the cumulative duration of each key environmental parameter in its corresponding optimal growth range during the entire simulation period is counted, and the proportion of time each environmental parameter is in the optimal growth range is calculated. The time proportions of all key environmental parameters are compared with preset global evaluation thresholds. If the time proportion of at least one environmental parameter is lower than its corresponding preset threshold, based on the historical correlation data stored in the agricultural knowledge graph, the specific numerical distribution characteristics of the greenhouse environmental data, the control devices triggered at the same time and their control parameters, and the actual impact of the corresponding actuator atomic model output are analyzed during the time period when the time proportion is lower than the preset threshold. Based on the analysis results, potential rule defects that cause environmental parameters to deviate from the optimal range were identified. These rule defects include unreasonable threshold conditions for triggering control devices, inaccurate target parameter values ​​for device operation, or timing conflicts between multiple devices. For the identified rule defects, the entity relationship attributes related to the defective rules are backtracked and adjusted in the agricultural knowledge graph, and the adjusted relationships and attributes are synchronously updated to the Prolog rule base; The inference engine atomic model is reconfigured using the revised rule base, and the simulation process is repeated until the time proportions of all key environmental parameters reach or exceed their corresponding preset thresholds. The inference rule set adopted by the revised inference engine atomic model is configured with the entity relationship of the agricultural knowledge graph and defined as the optimized greenhouse environment control strategy.

[0014] This invention discloses a greenhouse environment modeling and simulation method based on DEVS and an agricultural knowledge graph. First, an agricultural knowledge graph is constructed based on historical data to represent the association rules between crops, the environment, and equipment. Second, based on the greenhouse control system, a DEVS-style atomic model of sensors, inference engine, controller, and actuators is constructed, and these are coupled into a top-level model using the Cadmium framework, defining interaction and synchronization mechanisms. During simulation, real-time environmental data is input, and the proportion of time that environmental parameters are within the optimal range for crops is evaluated. If the proportion is below a threshold, the inference rules are dynamically corrected based on the knowledge graph to generate an optimized environmental control strategy. This invention achieves formal modeling and intelligent simulation optimization of the greenhouse system, improving the accuracy of control. Attached Figure Description

[0015] Figure 1 The flowchart of a greenhouse environment modeling and simulation method based on DEVS and agricultural knowledge graph of the present invention is shown; Figure 2 An example diagram of the sensor atomic model of the present invention is shown; Figure 3 An example diagram of the atomic model of the inference engine of the present invention is shown; Figure 4 An example diagram of the atomic model of the controller of the present invention is shown; Figure 5An example diagram of the actuator atomic model of the present invention is shown. Detailed Implementation

[0016] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0017] 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 therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.

[0018] Figure 1 The flowchart of a greenhouse environment modeling and simulation method based on DEVS and agricultural knowledge graph is shown.

[0019] like Figure 1 As shown, the first aspect of this invention provides a greenhouse environment modeling and simulation method based on DEVS and agricultural knowledge graphs, comprising: Obtain historical planting data of the target greenhouse, identify the relationship between the planted crops, greenhouse environment, and greenhouse environment control equipment based on the historical planting data, and construct an agricultural knowledge graph of the target planted crops based on the relationship; Obtain the configuration information of the environmental control system of the target greenhouse, and construct a set of atomic models in the form of DEVS based on the configuration information of the environmental control system. The set of atomic models includes sensor atomic models, inference engine atomic models, controller atomic models and actuator atomic models. Based on the Cadmium DEVS framework, the atomic models are coupled to construct a top-level coupled model, defining the information interaction path and synchronization mechanism between models, and connecting each sub-model through external input coupling, external output coupling and internal coupling. The real-time greenhouse environment data is input into the top-level coupled model for simulation. The proportion of time that the environmental parameters are in the optimal growth range of crops is evaluated based on the simulation results. If the proportion of time is lower than a preset threshold, the reasoning rules are corrected based on the agricultural knowledge graph to obtain an optimized greenhouse environment control strategy.

[0020] It should be noted that an agricultural knowledge graph is constructed using historical data, transforming the complex relationships between crop growth patterns, environmental parameter thresholds, and control equipment operation into a structured, reasonable knowledge network. Secondly, the greenhouse physical system is functionally decoupled into DEVS atomic models such as sensors, inference engines, controllers, and actuators, and rigorously coupled using the Cadmium framework. This creates a simulation environment that accurately characterizes the discrete event interactions and dynamic behaviors of the system. During runtime, real-time environmental data drives this coupled model in closed-loop simulation, and the knowledge graph empowers the inference engine to make real-time decisions and generate control commands. Subsequently, the system evaluates the effectiveness of the current control strategy by statistically analyzing the simulation results. If the proportion of time when environmental parameters deviate from the optimal range is too high, a rule correction mechanism based on the knowledge graph is triggered to dynamically adjust the inference logic and control parameters, ultimately iteratively generating an optimized control strategy. This method creatively combines DEVS's rigorous system modeling capabilities with the semantic reasoning and adaptive learning capabilities of knowledge graphs, overcoming the shortcomings of traditional models in integrating domain knowledge and adaptive adjustment. It achieves accurate digital twins and dynamic strategy optimization for complex greenhouse environmental systems, significantly improving the intelligence level, decision accuracy, and system adaptability of environmental regulation.

[0021] According to an embodiment of the present invention, the step of acquiring historical planting data of the target greenhouse and identifying the correlation between the planted crops, the greenhouse environment, and the greenhouse environment control equipment based on the historical planting data specifically includes: Acquire historical planting data of the target crop in the target greenhouse over multiple planting cycles. The historical planting data includes crop growth stage data, time-series data of greenhouse environmental parameters, operation record data of environmental control equipment, and final crop yield and quality assessment data. Based on the crop growth stage data, each planting cycle is divided into sowing period, seedling period, growth period, flowering period and fruiting period, and a subset of environmental parameter data and a subset of control equipment operation data corresponding to each growth stage are extracted. Statistical characteristic values ​​of key environmental parameters within each growth stage are calculated based on the aforementioned subset of environmental parameter data. The key environmental parameters include air temperature, air humidity, light intensity, carbon dioxide concentration, and soil moisture. The statistical characteristic values ​​include average value, maximum value, minimum value, and the proportion of time spent within the preset optimal growth range. Based on the operation record data of the control equipment, the environmental control equipment activated in each growth stage is identified and associated. The environmental control equipment includes ventilation equipment, shading equipment, heating equipment, humidification equipment, supplemental lighting equipment, and irrigation equipment. The control parameters of the environmental control equipment are extracted. The control parameters include the threshold conditions for equipment activation, the target parameter values ​​for equipment operation, and the duration of continuous equipment operation. The association data between the planted crops, the greenhouse environment, and the greenhouse environmental control equipment are obtained.

[0022] It is important to note that by systematically mining and quantifying the specific environmental requirements of crops at different growth stages from historical planting data, and the operational patterns of various control devices in achieving these requirements, and by extracting statistical feature values ​​of key environmental parameters at each growth stage and associating them with the corresponding activated control devices and their control parameters, previously scattered and isolated planting experiences can be transformed into a structured and quantifiable knowledge system. This correlation not only reveals the causal logic between environmental parameters and equipment operation but also provides an instantiation basis for entity links and semantic relationships for subsequent construction of an agricultural knowledge graph. This ensures that the simulation model can make inferences and decisions that more closely resemble the real production environment, based on actual historical data rather than subjective assumptions.

[0023] According to an embodiment of the present invention, the step of constructing an agricultural knowledge graph of the target crop based on the association relationship specifically includes: Construct an agricultural knowledge graph model layer with crop types as the core, define the entity types in the graph as crop type, growth stage, environmental parameters, control equipment, and control operation, and define the relationship types between entities as belonging to the growth stage, having the optimal parameter range, being controlled by equipment, triggering control operation, and operation duration. Based on the correlation data extracted from historical planting data, the agricultural knowledge graph is instantiated, and each growth stage is linked with the optimal statistical feature value range of the corresponding key environmental parameters to form an optimal parameter range relationship. Link each key environmental parameter to a control device that can regulate that parameter in a controlled-device relationship, and instantiate the control operation entity that each control device performs when triggered at different growth stages; By triggering the control operation relationship link, the control operation entity is associated with the control parameters and operation duration attributes extracted from the operation record. The instantiated agricultural knowledge graph is stored using a graph database to form a target crop agricultural knowledge graph that includes crops, environmental parameters, control equipment, and control operation relationships.

[0024] It's important to note that by constructing a model layer centered on crop types, a rigorous semantic framework is established for the knowledge graph. This framework clearly defines five entity types: crop type, growth stage, environmental parameters, control equipment, and control operations, as well as key relationship types such as "belongs to a growth stage" and "has an optimal parameter range." This ensures the structured and standardized nature of the knowledge. Next, based on specific relationships extracted from historical data, the graph is instantiated. The core operation is to precisely link each crop's growth stage with the optimal range of its required key environmental parameters (such as temperature and humidity), thereby transforming abstract agronomic knowledge into machine-understandable quantitative rules. Then, a control link is established between environmental parameters and control equipment, associating each environmental parameter with specific equipment that can affect it (e.g., temperature associated with a heater). Furthermore, specific control operations for these devices at different growth stages (e.g., "low-power activation") are defined as entities. Finally, by associating specific parameters (such as target temperature value) and duration of the control operation, the knowledge graph is made capable of driving the generation of actual control instructions. It is then efficiently stored and queried using a graph database, ultimately forming a target crop agricultural knowledge graph that can dynamically reflect the crop growth needs and environmental regulation logic.

[0025] To construct a knowledge graph, we first need to abstract the necessary classes based on the application scenarios of the knowledge graph, and then use a top-down approach to divide the graph hierarchy. Define the following basic classes: `EnvironmentParameter`, with subclasses including `Temperature`, `Humidity`, `CO2Concentration`, `SoilMoisture`, `SoilTemperature`, and `SoilPH`; `ControlDevice`, with subclasses including `Shutter`, `WaterFertilizerMachine`, `Fan`, `Sprayer`, and `Heater`; `TimePeriod`; and `Crop`.

[0026] Secondly, attributes and relationships need to be defined. This includes data attributes describing the inherent properties of a class, setting environmental parameters, parameter types for control devices, and the expression of thresholds, including `hasValue` (representing the actual value of an environmental parameter), `hasThreshold` (defining thresholds in various rules), and `hasTime` (describing the time attribute of monitoring data); object attributes connecting two entities, and constraints for different attributes, including `hasControlDevice` (connecting environmental state to operable control devices), `triggersOperation` (connecting a state or environmental condition to agricultural operations), `hasGrowthStage` (associating crops with their growth stages), `controls` (describing the impact of control devices on certain environmental parameters), and `appliesToCrop` (connecting a specific crop to a rule). In practical scenarios, the necessary entities to form the knowledge graph are extracted and categorized. Among the identified entities, their semantic relationships are determined and classified, and relationships are extracted and stored.

[0027] In terms of inference mechanism, the model embeds an external knowledge graph engine, specifically SWI-Prolog as the underlying inference engine. SWI-Prolog supports the parsing and processing of semantic data formats such as OWL and RDF, allowing the system to call Prolog rule files (.pl) through an embedded interface to perform fact- and rule-based logical reasoning. Input data is dynamically injected into the Prolog workspace through fact declarations, triggering pattern matching and condition verification for specific control rules.

[0028] According to an embodiment of the present invention, the step of obtaining the environmental control system configuration information of the target greenhouse and constructing a set of atomic models in the form of DEVS based on the environmental control system configuration information, wherein the set of atomic models includes sensor atomic models, inference engine atomic models, controller atomic models, and actuator atomic models, specifically: Obtain the configuration information of the environmental control system of the target greenhouse, divide the control subsystems according to the configuration information of the environmental control system, and identify and separate the sensing, reasoning, control and execution subsystems. It should be noted that, based on the principle of functional modularity, the greenhouse environmental control system can be divided into four collaborative subsystems. The sensing subsystem is responsible for real-time collection and uploading of physical quantities of various environmental factors inside and outside the greenhouse. The environmental factors that have a significant impact on crops inside the greenhouse are temperature, humidity, CO2 concentration, soil temperature, soil moisture, and soil pH. Therefore, six different environmental sensors are used to establish sensor models for these six environmental factors. The acquisition frequency is set to the minimum time period of DEVS, once per minute. The set acquisition precision is 0.01℃ for temperature, 0.01% for humidity, 1ppm for CO2 concentration, 0.01℃ for soil temperature, 0.01% for soil moisture, and 0.01% for soil pH.

[0029] like Figure 2 As shown, for the sensing subsystem, the physical configuration parameters of the air temperature sensor, air humidity sensor, carbon dioxide sensor, soil temperature sensor, soil humidity sensor, and soil pH sensor in the sensing subsystem are obtained, including measurement accuracy and acquisition frequency. A DEVS atomic model is constructed for each type of sensor. The sensor DEVS atomic model defines a state space containing waiting, measurement, and transmission states, and sets the dwell time of the measurement state according to the acquisition frequency. The external transition function responds to external environmental data input events to trigger state transitions, and the output function sends out the acquired environmental parameter values ​​as output events. like Figure 3 As shown, for the reasoning subsystem, the agricultural knowledge graph is deployed in the reasoning subsystem. Based on the logical architecture of the agricultural knowledge graph and the SWI-Prolog inference engine, an atomic model of the reasoning engine is constructed. By mapping the received multi-source environmental data to entity attribute values ​​in the agricultural knowledge graph, and calling the Prolog rule base for logical reasoning, a device linkage strategy is generated as an output event. like Figure 4 As shown, for the control subsystem, the instruction parsing and scheduling logic of the controller in the control subsystem is obtained, the controller atomic model is constructed, and the specific control instructions are generated by parsing the policy events output by the inference engine and combining them with the current actuator state. The computation time for instruction execution is set according to the device type. like Figure 5 As shown, for the execution subsystem, based on the physical response characteristics of the ventilation equipment, shading equipment, heating equipment, humidifying equipment, supplemental lighting equipment and irrigation equipment in the execution subsystem, atomic models of each actuator are constructed. By defining the closed, attempted open, start-up and running states, the device action delay and operation effect are simulated, and the actual impact on greenhouse environmental parameters is continuously output through the output function. The sensor atomic model, inference engine atomic model, controller atomic model, and actuator atomic model are constructed into a complete set of atomic models.

[0030] It should be noted that different atomic models are designed for each subsystem to create the foundation for the simulation model. Within the Cadmium DEVS modeling framework, the modules in the greenhouse environment are formally modeled as atomic models. Atomic models are designed for each entity in the sensor subsystem, inference subsystem, and facility subsystem. Specifically, the sensor subsystem includes air temperature sensor, air humidity sensor, CO2 sensor, soil temperature sensor, soil humidity sensor, and soil pH sensor; the inference subsystem includes the inference engine and controller; and the facility subsystem includes heaters, roller shutters, sprayers, fertigation systems, and fans. A specific seven-tuple implementation is defined for each atomic model.

[0031] Each atomic model is defined in the DEVS formal semantics as a seven-tuple: AM= X,Y,S,δint,δext,λ,ta ,in: X represents the set of input events used to receive external data; Y represents the set of output events and the output data; S represents the state space, where a state can be a discrete symbol, a numerical vector, or a composite structure. δint is the internal transition function, which describes the state transition behavior of the atomic model according to a predetermined mechanism when there is no external input. It is automatically triggered after the time progresses to the time specified by ta(s). δext is the external transition function, which is the mechanism for adjusting the state in response to external events when receiving external input; The logic is: S×X×N→S; Where S represents the current state, X represents the external input, and ℕ represents the time elapsed in the current state. The input (current state, input event, and elapsed time) determines how the model transitions to a new internal state.

[0032] λ is the output function. Before the internal transition is executed (i.e., at the end of the state dwell time), the model generates an output event based on the current state. ta is the time advance function, which defines how long after a given state the model will trigger an internal transition.

[0033] The logic is ta:S→ ∪{0,∞}; Where S represents the current state. This indicates the duration of the state, where 0 indicates an immediate internal state transition and ∞ indicates that an external event must trigger the transition.

[0034] The final constructed atomic models are highly modular and reusable, and can be directly embedded into the coupled models of the greenhouse environment. Different atomic models play different roles within the coupled models.

[0035] According to an embodiment of the present invention, the top-level coupled model is constructed by coupling the atomic models based on the Cadmium DEVS framework, defining the information interaction paths and synchronization mechanisms between models, and connecting the sub-models through external input coupling, external output coupling, and internal coupling, specifically as follows: The sensor atomic model, inference engine atomic model, controller atomic model, and actuator atomic model are instantiated as sub-models to construct the top-level coupled model. The input event set of the top-level coupled model is defined as the external environment input, and the output event set is the control log output. The external environment input is the greenhouse environment data acquired by the sensor. Establish external input coupling relationships, mapping external environment input events to the input ports of each sensor atomic model and the input ports of the inference engine atomic model respectively; Establish internal coupling relationships by connecting the output ports of each sensor atomic model to the input ports of the inference engine atomic model to transmit real-time environmental data, connecting the output ports of the inference engine atomic model to the input ports of the controller atomic model to transmit device linkage strategies, connecting the output ports of the controller atomic model to the input ports of each actuator atomic model to send control commands, and connecting the output ports of each actuator atomic model to the input ports of the controller atomic model to provide feedback on device status. Build external output coupling relationships to map the output ports of the inference engine's atomic model to the output ports of the top-level coupled model in order to record control decision logs; Define a synchronization mechanism to ensure that the time advancement functions of all internal atomic models are executed synchronously as the top-level coupled model advances in time. By integrating all atomic models through the aforementioned external input coupling, internal coupling, and external output coupling relationships, a complete greenhouse environment control simulation system is formed.

[0036] It should be noted that, based on the completion of each atomic model, a top-level coupled model of the greenhouse environment is constructed using the Cadmium DEVS modeling framework. This top-level model acts as the overall coordinator of the system, integrating all sub-modules and forming a complete system for intelligent greenhouse environment control simulation by defining information interaction paths and synchronization mechanisms between modules. The information interaction path, or IC, defines the data flow and event transmission between functional modules in the system. In this invention, it specifically refers to the information transmission between atomic models within the coupled model, i.e., data is transmitted from the sensor model to the inference engine model, from the inference engine model to the controller model, and from the controller model to the actuator model. The synchronization mechanism is that the time progression function ta within each atomic model advances consistently under the control of the coupled model; that is, when the time of the coupled model advances by 00:00:01, the time of all atomic models within it advances by 00:00:01.

[0037] The top-level coupling model is formally defined as a nine-tuple: CM = X, Y, D, {Md}, EIC, EOC, IC, Select ,in: X represents the set of input events for the system, such as external weather forecasts, user manual intervention, and crop growth stage information. Y represents the system's set of output events, such as control command logs, environmental parameter trends, and actuator running status. D represents the set of all coupled sub-models, including sensor atomic models, inference engine atomic models, controller atomic models, and actuator atomic models (such as fans, sprayers, and roller shutters). {Md} represents the model definition corresponding to each element in sub-model D; EIC (External Input Coupling) is the connection mapping from external inputs to the input ports of sub-models, such as weather information being passed to relevant sensor models or inference modules; EOC (External Output Coupling) is a connection mapping from the sub-model output to the overall system output port, used to collect simulation output data; Internal Coupling (IC) refers to the internal connections between sub-models, defining the data flow and event transmission between functional modules in the system, such as: The sensor model provides real-time environmental awareness data to the inference engine and controller; The reasoning module transmits suggestions generated based on knowledge graph rules to the control unit; After processing the suggestion, the control unit issues specific control commands to the actuator; After the actuator model completes its action, it may send status information back to the control unit. Select is the event scheduling function, which ensures that when multiple sub-models trigger events simultaneously, the system can schedule them reasonably according to the preset priority order.

[0038] The input and output ports of the model are defined as follows: X={weather_input}; Y={control_log}; Through the design and implementation of this top-level coupling model, this system achieves powerful functional integration and behavioral simulation capabilities, providing a modeling platform with high operability, verifiability, and scalability.

[0039] According to an embodiment of the present invention, the step of inputting the real-time collected greenhouse environment data into the top-level coupled model for simulation specifically includes: The real-time greenhouse environment data is input into the top-level coupled model as an external input event stream in the order of timestamps. The sensor atomic model receives the real-time greenhouse environment data and triggers the external transition function to perform state transition, enters the measurement state, and outputs the measurement value event with timestamp after the dwell time ends. It should be noted that the greenhouse model includes sensors such as air temperature, air humidity, CO2, soil temperature, soil moisture, and soil pH sensors, and actuators such as fans, rolling shutters, sprayers, and fertigation units. A knowledge graph is constructed incorporating expert knowledge. By integrating the knowledge graph and a swi-prolog inference engine, appropriate equipment linkage control strategies are inferred to regulate the current environment based on the current multi-dimensional greenhouse environmental information and the required optimal environmental conditions. Based on the DEVS atomic modeling paradigm, the input data structure, internal state transitions, inference execution logic, and output behavior of the inference engine are formally defined, achieving the encapsulation and reuse of the Prolog inference engine within the DEVS framework. This model receives environmental parameter inputs from the sensor subsystem, internally calls the Prolog inference process, and ultimately outputs control command events as inputs to the facility control subsystem.

[0040] The inference engine atomic model receives measurement value events from the atomic models of each sensor, maps them to the current attribute values ​​of the corresponding environmental parameter entities in the agricultural knowledge graph, and performs logical reasoning based on the optimal growth range of the crop associated with the current growth stage stored in the agricultural knowledge graph and the inference rules in the Prolog rule base to generate a device linkage strategy event containing the identifier of the control device to be triggered and the target control value. It should be noted that the inference module, based on the constructed environmental control knowledge graph and SWI-Prolog inference engine, receives real-time environmental factor values ​​collected by various sensors in the greenhouse, as well as information on the growth stages of individual crops. Through a deep integration of SPARQL queries and the Prolog rule base, it quickly matches control strategies that are suitable for the current scenario. Specifically, the system first maps sensor data to attribute values ​​of "environmental factor" entities in the knowledge graph, associates the current crop (such as tomato) with its corresponding "periodic characteristic" entities such as "seedling stage / flowering stage / fruiting stage," and then calls a predefined set of rules in SWI-Prolog. These rules are based on "plant traits" (including leaf transpiration rate, growth rate, etc.) and "control strategies" (such as the opening ratio of the curtain machine, fan speed, water and fertilizer system ratio, and sprayer running time) as premises and conclusions, and generate the optimal operation plan through logical reasoning. Ultimately, the reasoning results are output in the form of structured decision instructions, which include not only the names and parameters of the equipment to be started or adjusted, but also the execution priority and suggested operation time window, so that downstream execution modules or maintenance personnel can perform real-time scheduling and closed-loop feedback to ensure a refined dynamic balance between the greenhouse environment and plant growth.

[0041] The controller atomic model receives and parses the device linkage strategy event, and combines it with the current device state fed back from the actuator atomic model to generate a control instruction event containing specific control instruction codes and execution time information; The actuator atomic model receives the control command event, updates its state according to its physical response characteristics, and calculates the actual impact on greenhouse environmental parameters. This impact is fed back to the input port of the sensor atomic model through internal coupling to influence the environmental data input of the next simulation step in a closed loop.

[0042] According to an embodiment of the present invention, the step of evaluating the proportion of time during which environmental parameters are within the optimal growth range of crops based on simulation results, and if the proportion of time is lower than a preset threshold, then the inference rules are modified based on the agricultural knowledge graph to obtain an optimized greenhouse environment control strategy. The values ​​of key environmental parameters at each simulation moment are recorded synchronously and compared with the optimal growth range of the corresponding environmental parameters defined in the agricultural knowledge graph for the current crop growth stage. After the simulation is completed, the cumulative duration of each key environmental parameter in its corresponding optimal growth range during the entire simulation period is counted, and the proportion of time each environmental parameter is in the optimal growth range is calculated. The time proportions of all key environmental parameters are compared with preset global evaluation thresholds. If the time proportion of at least one environmental parameter is lower than its corresponding preset threshold, based on the historical correlation data stored in the agricultural knowledge graph, the specific numerical distribution characteristics of the greenhouse environmental data, the control devices triggered at the same time and their control parameters, and the actual impact of the corresponding actuator atomic model output are analyzed during the time period when the time proportion is lower than the preset threshold. Based on the analysis results, potential rule defects that cause environmental parameters to deviate from the optimal range were identified. These rule defects include unreasonable threshold conditions for triggering control devices, inaccurate target parameter values ​​for device operation, or timing conflicts between multiple devices. For the identified rule defects, the entity relationship attributes related to the defective rules are backtracked and adjusted in the agricultural knowledge graph, and the adjusted relationships and attributes are synchronously updated to the Prolog rule base; It should be noted that the adjustment of entity relationship attributes related to defect rules includes modifying the threshold condition attribute values ​​stored in the control operation entities linked by the trigger control operation relationship, updating the optimal statistical feature value range linked by the optimal parameter range relationship, or adding timing constraint rules for coordinating device linkage.

[0043] The inference engine atomic model is reconfigured using the revised rule base, and the simulation process is repeated until the time proportions of all key environmental parameters reach or exceed their corresponding preset thresholds. The inference rule set adopted by the revised inference engine atomic model is configured with the entity relationship of the agricultural knowledge graph and defined as the optimized greenhouse environment control strategy.

[0044] It should be noted that during greenhouse environmental control, crop growth exhibits significant stage-specific differences, and internal greenhouse environmental parameters fluctuate continuously due to external climate changes, equipment response delays, and the interconnectedness of multiple devices. Simply relying on whether instantaneous environmental parameters meet threshold conditions is insufficient to accurately reflect the overall suitability of environmental control strategies for crop growth. In actual operation, even if environmental parameters meet crop growth requirements at certain moments, they may frequently deviate from the optimal growth range over longer timescales, leading to prolonged suboptimal growth conditions and impacting yield and quality. Furthermore, existing control rules are largely based on experience or historical static settings. When crop varieties, growth stages, or external environmental conditions change, these rules are difficult to adjust promptly, easily leading to problems such as unreasonable control trigger thresholds, deviations in target parameter settings, or imbalances in the synergistic effects of multiple control devices. Therefore, by retrospectively analyzing historical data on environmental characteristics, equipment actions, and their actual impacts, the system can accurately pinpoint specific areas of rule deficiencies, such as threshold setting deviations or equipment interconnection conflicts. Based on this, the system can dynamically adjust entity relationship attributes in the knowledge graph and synchronize the corrections to the Prolog rule base, enabling the inference engine to continuously learn and self-optimize. Through an iterative process of simulation and correction, an optimized control strategy that is highly adapted to the specific crop growth needs and can significantly improve environmental stability is finally generated. This realizes the leap from static rule execution to dynamic self-learning in greenhouse environmental control, greatly improving the accuracy and stability of the crop growth environment.

[0045] According to an embodiment of the present invention, it further includes: The historical operation log data of the target greenhouse environmental control system is obtained. Based on the historical operation log data, the delay probability distribution model of each link is statistically analyzed. Based on the delay probability distribution model, random delay parameters that conform to their statistical characteristics are injected into the sensor atomic model, inference engine atomic model, controller atomic model and actuator atomic model in the DEVS atomic model set, so that the state dwell time of each atomic model can fluctuate dynamically in the simulation process to simulate the time-varying delay effect of the real world. During the simulation of the top-level coupled model, the complete event chain timestamp sequence from the environmental measurement value event with timestamp output by the sensor atomic model to the device state event fed back by the actuator atomic model is recorded synchronously. The full-link simulation delay data from environmental perception to control execution completion is calculated based on the complete event chain timestamp sequence, and this simulation delay data is associated with the corresponding environmental measurement value event to generate an environmental state sequence with time delay label. The environmental state sequence with time delay labels is input into the inference engine atomic model. In addition to the optimal growth interval rule in the agricultural knowledge graph, the inference engine atomic model also introduces a time delay compensation inference rule. The time delay compensation inference rule predicts the trend of environmental parameter changes within the time window from decision generation to execution effectiveness based on the full-link simulation delay data associated with the current environmental state, and accordingly makes a forward-looking correction to the standard equipment control target value retrieved from the agricultural knowledge graph, generating anti-delay equipment linkage strategy events. The event-driven simulation system operates according to the anti-delay equipment linkage strategy, and the proportion of time when environmental parameters are in the optimal growth range of crops is re-evaluated based on the simulated environmental data. If the proportion of time is improved, the time delay compensation inference rules are integrated and updated into the inference rule base of the agricultural knowledge graph to form an optimized anti-delay greenhouse environment control strategy.

[0046] According to an embodiment of the present invention, the introduced delay compensation inference rule predicts the trend of environmental parameter changes within the time window from decision generation to execution effectiveness based on the end-to-end simulation delay data associated with the current environmental state, specifically as follows: After receiving a new environmental measurement event, the atomic model of the inference engine first queries the recent historical full-link simulation delay data associated with the event to estimate the future time point when the current control decision may take effect. The inference engine atomic model extracts continuous external environment input data from the current moment to the future time point from the external input event stream of the top-level coupled model to obtain the trajectory of natural environment changes. Based on the continuous external environmental input data, a short-term trend prediction model for key environmental parameters is established using a time series prediction algorithm to obtain environmental prediction data. The inference engine atomic model compares the environmental prediction data with the optimal environmental parameter range for the current growth stage retrieved from the agricultural knowledge graph, and determines the direction and magnitude by which the future environment will deviate from the optimal range if no intervention is taken. Based on the direction and magnitude of the deviation from the optimal range, and combined with the controlled relationship between the control equipment and environmental parameters in the agricultural knowledge graph, the control parameters in the equipment linkage strategy event are dynamically adjusted. The adjustment includes triggering the control equipment in advance and setting a stricter control target value to offset the environmental deterioration during the delay period when the environmental parameters are predicted to change rapidly in an unfavorable direction, or appropriately relaxing the control threshold to avoid over-control when the predicted environmental change tends to be gradual. The device linkage strategy event containing dynamically adjusted control parameters will be output, and the prediction logic and adjustment range on which this decision is based will be recorded as the basis data for subsequent verification and optimization of the time delay compensation inference rule.

[0047] It should be noted that in the practical application of intelligent greenhouse environmental control, the control loop from environmental data perception and intelligent decision-making to equipment execution inherently has physical delays. Coupled with complex factors such as network fluctuations, computational load, and differences in equipment response, this delay exhibits significant time-varying characteristics. This uncertainty often leads to overly optimistic simulation results based on real-time, ideal data. The decision-making system may issue instructions based on outdated information, causing equipment actions to lag behind environmental changes in real-world scenarios, resulting in a series of problems such as energy waste, regulatory oscillations, and even crop growth stress. By analyzing historical operation logs to establish a delay probability model for each link and injecting it into the DEVS atomic model, the dynamic lag effect of the "sensor-control" link is realistically reproduced in simulation. During the simulation, the system accurately tracks and records the entire link's delay, forming an environmental state sequence with delay labels. The core innovation lies in the introduction of delay compensation rules into the inference engine. This not only relies on current environmental data and knowledge graphs but also combines the predicted environmental state at the time of decision execution to proactively correct the control objective. This enables the system to proactively predict the natural evolution of the environment within the delay window, thus making intelligent decisions on whether to trigger control earlier and with increased intensity to offset the lag effect, or to postpone actions to avoid excessive intervention. The technical effect is a significant improvement in the simulation system's accuracy in depicting the dynamics and uncertainties of the real world. The generated control strategies possess stronger robustness and practicality, effectively shortening the time it takes for environmental parameters to deviate from the optimal range. It proactively avoids the risk of decision mismatch caused by time-varying delays during the simulation verification stage, providing a more reliable foundation for strategy pre-simulation and optimization for the stable, efficient, and energy-saving operation of actual greenhouse systems.

[0048] This invention discloses a greenhouse environment modeling and simulation method based on DEVS and an agricultural knowledge graph. First, an agricultural knowledge graph is constructed based on historical data to represent the association rules between crops, the environment, and equipment. Second, based on the greenhouse control system, a DEVS-style atomic model of sensors, inference engine, controller, and actuators is constructed, and these are coupled into a top-level model using the Cadmium framework, defining interaction and synchronization mechanisms. During simulation, real-time environmental data is input, and the proportion of time that environmental parameters are within the optimal range for crops is evaluated. If the proportion is below a threshold, the inference rules are dynamically corrected based on the knowledge graph to generate an optimized environmental control strategy. This invention achieves formal modeling and intelligent simulation optimization of the greenhouse system, improving the accuracy of control.

[0049] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0050] Alternatively, if the integrated units of this invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0051] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A greenhouse environment modeling and simulation method based on DEVS and agricultural knowledge graph, characterized in that, Includes the following steps: Obtain historical planting data of the target greenhouse, identify the relationship between the planted crops, greenhouse environment, and greenhouse environment control equipment based on the historical planting data, and construct an agricultural knowledge graph of the target planted crops based on the relationship; Obtain the configuration information of the environmental control system of the target greenhouse, and construct a set of atomic models in the form of DEVS based on the configuration information of the environmental control system. The set of atomic models includes sensor atomic models, inference engine atomic models, controller atomic models and actuator atomic models. Based on the Cadmium DEVS framework, the atomic models are coupled to construct a top-level coupled model, defining the information interaction path and synchronization mechanism between models, and connecting each sub-model through external input coupling, external output coupling and internal coupling. The real-time greenhouse environment data is input into the top-level coupled model for simulation. The proportion of time that the environmental parameters are in the optimal growth range of crops is evaluated based on the simulation results. If the proportion of time is lower than a preset threshold, the reasoning rules are corrected based on the agricultural knowledge graph to obtain an optimized greenhouse environment control strategy.

2. The greenhouse environment modeling and simulation method based on DEVS and agricultural knowledge graph as described in claim 1, characterized in that, The process of acquiring historical planting data for the target greenhouse and identifying the relationships between crops, greenhouse environment, and greenhouse environment control equipment based on this historical planting data specifically involves: Acquire historical planting data of the target crop in the target greenhouse over multiple planting cycles. The historical planting data includes crop growth stage data, time-series data of greenhouse environmental parameters, operation record data of environmental control equipment, and final crop yield and quality assessment data. Based on the crop growth stage data, each planting cycle is divided into sowing period, seedling period, growth period, flowering period and fruiting period, and a subset of environmental parameter data and a subset of control equipment operation data corresponding to each growth stage are extracted. Statistical characteristic values ​​of key environmental parameters within each growth stage are calculated based on the aforementioned subset of environmental parameter data. The key environmental parameters include air temperature, air humidity, carbon dioxide concentration, soil temperature, humidity, and pH value. The statistical characteristic values ​​include average value, maximum value, minimum value, and the proportion of time within the preset optimal growth range. Based on the operation record data of the control equipment, the environmental control equipment activated in each growth stage is identified and associated. The environmental control equipment includes ventilation equipment, shading equipment, heating equipment, humidification equipment, supplemental lighting equipment, and irrigation equipment. The control parameters of the environmental control equipment are extracted. The control parameters include the threshold conditions for equipment activation, the target parameter values ​​for equipment operation, and the duration of continuous equipment operation. The association data between the planted crops, the greenhouse environment, and the greenhouse environmental control equipment are obtained.

3. The greenhouse environment modeling and simulation method based on DEVS and agricultural knowledge graph as described in claim 1, characterized in that, The construction of an agricultural knowledge graph for the target crop based on the aforementioned relationships specifically involves: Construct an agricultural knowledge graph model layer with crop types as the core, define the entity types in the graph as crop type, growth stage, environmental parameters, control equipment, and control operation, and define the relationship types between entities as belonging to the growth stage, having the optimal parameter range, being controlled by equipment, triggering control operation, and operation duration. Based on the correlation data extracted from historical planting data, the agricultural knowledge graph is instantiated, and each growth stage is linked with the optimal statistical feature value range of the corresponding key environmental parameters to form an optimal parameter range relationship. Link each key environmental parameter to a control device that can regulate that parameter in a controlled-device relationship, and instantiate the control operation entity that each control device performs when triggered at different growth stages; By triggering the control operation relationship link, the control operation entity is associated with the control parameters and operation duration attributes extracted from the operation record. The instantiated agricultural knowledge graph is stored using a graph database to form a target crop agricultural knowledge graph that includes crops, environmental parameters, control equipment, and control operation relationships.

4. The greenhouse environment modeling and simulation method based on DEVS and agricultural knowledge graph as described in claim 1, characterized in that, The process involves acquiring the environmental control system configuration information of the target greenhouse, and constructing a set of atomic models in DEVS form based on this information. This set of atomic models includes sensor atomic models, inference engine atomic models, controller atomic models, and actuator atomic models. Specifically: Obtain the configuration information of the environmental control system of the target greenhouse, divide the control subsystems according to the configuration information of the environmental control system, and identify and separate the sensing, reasoning, control and execution subsystems. For the sensing subsystem, the physical configuration parameters of the air temperature sensor, air humidity sensor, carbon dioxide sensor, soil temperature sensor, soil humidity sensor, and soil pH sensor in the sensing subsystem are obtained, including measurement accuracy and acquisition frequency. A DEVS atomic model is constructed for each type of sensor. The sensor DEVS atomic model defines a state space that includes waiting, measurement, and transmission states, and sets the dwell time of the measurement state according to the acquisition frequency. The external transition function responds to external environmental data input events to trigger state transitions, and the acquired environmental parameter values ​​are issued as output events through the output function. For the reasoning subsystem, the agricultural knowledge graph is deployed in the reasoning subsystem. Based on the logical architecture of the agricultural knowledge graph and the SWI-Prolog inference engine, an atomic model of the reasoning engine is constructed. By mapping the received multi-source environmental data to entity attribute values ​​in the agricultural knowledge graph, and calling the Prolog rule base for logical reasoning, a device linkage strategy is generated as an output event. For the control subsystem, the instruction parsing and scheduling logic of the controller in the control subsystem is obtained, the controller atomic model is constructed, and specific control instructions are generated by parsing the policy events output by the inference engine and combining them with the current actuator state. The computation time for instruction execution is set according to the device type. For the execution subsystem, based on the physical response characteristics of the ventilation equipment, shading equipment, heating equipment, humidifying equipment, supplemental lighting equipment and irrigation equipment in the execution subsystem, atomic models of each actuator are constructed. By defining the shutdown, attempted opening, start-up and running states, the delay of equipment action and the running effect are simulated, and the actual impact on greenhouse environmental parameters is continuously output through the output function. The sensor atomic model, inference engine atomic model, controller atomic model, and actuator atomic model are constructed into a complete set of atomic models.

5. The greenhouse environment modeling and simulation method based on DEVS and agricultural knowledge graph according to claim 1, characterized in that, The Cadmium DEVS framework is used to couple the atomic models to construct a top-level coupled model, defining information interaction paths and synchronization mechanisms between models. The sub-models are connected through external input coupling, external output coupling, and internal coupling. Specifically: The sensor atomic model, inference engine atomic model, controller atomic model, and actuator atomic model are instantiated as sub-models to construct the top-level coupled model. The input event set of the top-level coupled model is defined as the external environment input, and the output event set is the control log output. The external environment input is the greenhouse environment data acquired by the sensor. Establish external input coupling relationships, mapping external environment input events to the input ports of each sensor atomic model and the input ports of the inference engine atomic model respectively; Establish internal coupling relationships by connecting the output ports of each sensor atomic model to the input ports of the inference engine atomic model to transmit real-time environmental data, connecting the output ports of the inference engine atomic model to the input ports of the controller atomic model to transmit device linkage strategies, connecting the output ports of the controller atomic model to the input ports of each actuator atomic model to send control commands, and connecting the output ports of each actuator atomic model to the input ports of the controller atomic model to provide feedback on device status. Build external output coupling relationships to map the output ports of the inference engine's atomic model to the output ports of the top-level coupled model in order to record control decision logs; Define a synchronization mechanism to ensure that the time advancement functions of all internal atomic models are executed synchronously as the top-level coupled model advances in time. By integrating all atomic models through the aforementioned external input coupling, internal coupling, and external output coupling relationships, a complete greenhouse environment control simulation system is formed.

6. The greenhouse environment modeling and simulation method based on DEVS and agricultural knowledge graph according to claim 5, characterized in that, The process of inputting real-time collected greenhouse environment data into the top-level coupled model for simulation is as follows: The real-time greenhouse environment data is input into the top-level coupled model as an external input event stream in the order of timestamps. The sensor atomic model receives the real-time greenhouse environment data and triggers the external transition function to perform state transition, enters the measurement state, and outputs the measurement value event with timestamp after the dwell time ends. The inference engine atomic model receives measurement value events from the atomic models of each sensor, maps them to the current attribute values ​​of the corresponding environmental parameter entities in the agricultural knowledge graph, and performs logical reasoning based on the optimal growth range of the crop associated with the current growth stage stored in the agricultural knowledge graph and the inference rules in the Prolog rule base to generate a device linkage strategy event containing the identifier of the control device to be triggered and the target control value. The controller atomic model receives and parses the device linkage strategy event, and combines it with the current device state fed back from the actuator atomic model to generate a control instruction event containing specific control instruction codes and execution time information; The actuator atomic model receives the control command event, updates its state according to its physical response characteristics, and calculates the actual impact on greenhouse environmental parameters. This impact is fed back to the input port of the sensor atomic model through internal coupling to influence the environmental data input of the next simulation step in a closed loop.

7. The greenhouse environment modeling and simulation method based on DEVS and agricultural knowledge graph as described in claim 6, characterized in that, The process involves evaluating the proportion of time during which environmental parameters fall within the optimal growth range for crops based on simulation results. If this proportion is lower than a preset threshold, the inference rules are modified based on the agricultural knowledge graph to obtain an optimized greenhouse environment control strategy. The values ​​of key environmental parameters at each simulation moment are recorded synchronously and compared with the optimal growth range of the corresponding environmental parameters defined in the agricultural knowledge graph for the current crop growth stage. After the simulation is completed, the cumulative duration of each key environmental parameter in its corresponding optimal growth range during the entire simulation period is counted, and the proportion of time each environmental parameter is in the optimal growth range is calculated. The time proportions of all key environmental parameters are compared with preset global evaluation thresholds. If the time proportion of at least one environmental parameter is lower than its corresponding preset threshold, based on the historical correlation data stored in the agricultural knowledge graph, the specific numerical distribution characteristics of the greenhouse environmental data, the control devices triggered at the same time and their control parameters, and the actual impact of the corresponding actuator atomic model output are analyzed during the time period when the time proportion is lower than the preset threshold. Based on the analysis results, potential rule defects that cause environmental parameters to deviate from the optimal range were identified. These rule defects include unreasonable threshold conditions for triggering control devices, inaccurate target parameter values ​​for device operation, or timing conflicts between multiple devices. For the identified rule defects, the entity relationship attributes related to the defective rules are backtracked and adjusted in the agricultural knowledge graph, and the adjusted relationships and attributes are synchronously updated to the Prolog rule base; The inference engine atomic model is reconfigured using the revised rule base, and the simulation process is repeated until the time proportions of all key environmental parameters reach or exceed their corresponding preset thresholds. The inference rule set adopted by the revised inference engine atomic model is configured with the entity relationship of the agricultural knowledge graph and defined as the optimized greenhouse environment control strategy.