Crop nitrogen fertilizer management system and method based on multi-agent reinforcement learning
By combining multi-agent reinforcement learning and large language models, the decision-making on nitrogen fertilizer type, dosage, method and timing is optimized, which solves the complexity of multi-dimensional coupling relationships in nitrogen fertilizer management, generates scientific, safe and operable fertilization strategies, improves crop yield and nitrogen fertilizer utilization efficiency, and reduces costs and environmental risks.
Patent Information
- Application Number
- CN202511273032.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-08
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2045-09-08
AI Technical Summary
Existing technologies are insufficient to achieve multi-dimensional synergistic optimization of nitrogen fertilizer management, and cannot meet the dynamic nitrogen requirements of crops at different growth stages and under different environmental conditions, resulting in insufficient or excessive fertilization, leading to yield reduction and environmental pollution problems.
A multi-agent reinforcement learning approach is adopted, in which four dedicated agents optimize the decisions on nitrogen fertilizer type, dosage, method, and timing. The reward signal is dynamically corrected and agronomic constraints are applied by combining a large language model, generating high-yield, high-efficiency, low-cost, and environmentally friendly fertilization strategies. The transparency of decision-making is improved by using a natural language interpretation mechanism.
It achieves multi-dimensional synergistic optimization of nitrogen fertilizer management, generates scientific, safe, and operable fertilization plans, improves crop yield and nitrogen fertilizer utilization efficiency, reduces production costs and environmental risks, and enhances the credibility and explainability of decision-making.
Smart Images

Figure CN121280165A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart agriculture technology, and more specifically, to a crop nitrogen fertilizer management system and method based on multi-agent reinforcement learning. Background Technology
[0002] Nitrogen, as a core nutrient element for crop growth and development, is directly related to the improvement of crop yield and quality through its rational supply. In traditional agricultural production, nitrogen fertilizer application often relies on experience or relatively fixed recommended values, making it difficult to match the dynamic nitrogen requirements of crops at different growth stages and under different environmental conditions. This can easily lead to yield reduction due to insufficient fertilization or environmental problems such as eutrophication of water bodies and soil compaction due to excessive fertilization. With the increasing demand for sustainable agricultural development, how to achieve efficient nitrogen fertilizer management through precise and intelligent means has become a key issue in balancing agricultural production efficiency and ecological environmental protection.
[0003] In existing technologies, fertilization recommendation methods based on soil testing and crop growth models have been gradually applied. For example, process models such as DSSAT and APSIM predict crop fertilizer requirements by simulating crop growth and nutrient cycling. These methods rely on extensive parameter calibration and have stringent requirements for the accuracy of input data such as soil moisture and temperature. They struggle to fully capture the complex dynamic changes in the field environment and the real-time feedback of crop growth, failing to meet the need for real-time response to dynamic fluctuations in the field environment. Some technologies attempt to integrate real-time monitoring data to optimize model output. For instance, patent CN119417135A proposes a method that combines an environmental volume model, canopy image estimation, and assimilation model to obtain crop growth status, and uses an intelligent agent model combined with precipitation information to generate fertilization decision time and values. However, its intelligent agent decision-making still cannot meet the comprehensive decision-making needs for fertilizer type, dosage, application timing, and method, and lacks the application of deep agronomic knowledge, making it difficult to support the comprehensive decision-making requirements in complex field scenarios.
[0004] In recent years, the application of IoT and sensor technologies has promoted the real-time collection of farmland environmental data, providing richer input information for agricultural management. In single-dimensional decision-making scenarios such as irrigation, attempts have been made to optimize management strategies through multi-source data fusion and intelligent algorithms. For example, patent CN119026082A uses deep reinforcement learning to achieve dynamic irrigation control, the core logic of which lies in optimizing a single action (water volume control) through environmental feedback. However, nitrogen fertilizer management involves multi-dimensional coupled decisions regarding fertilizer type, ratio, application time, and method, and the nonlinear relationships between these variables are significantly more complex than in irrigation scenarios. Existing intelligent decision-making methods in irrigation are also difficult to apply to nitrogen fertilizer management scenarios; therefore, a systematic solution is still lacking for the multi-dimensional decision-making characteristics of nitrogen fertilizer management. Summary of the Invention
[0005] To address the aforementioned problems in existing technologies, this invention provides a crop nitrogen fertilizer management system and method based on multi-agent reinforcement learning. This system enables multi-dimensional collaborative optimization of crop nitrogen fertilizer management and dynamic integration of agronomic knowledge. By deploying four dedicated agents to optimize decisions regarding nitrogen fertilizer type, dosage, application method, and timing, and by dynamically correcting reward signals and applying agronomic constraints using a large language model, a fertilization strategy that is high-yielding, efficient, low-cost, and environmentally friendly is generated. Furthermore, the system enhances decision transparency and credibility based on natural language interpretation mechanisms, ultimately achieving scientific rigor, safety, and field operability of the nitrogen fertilizer application plan.
[0006] The objective of this invention is achieved through the following technical solutions.
[0007] As a first aspect of this application, some embodiments of this application provide a crop nitrogen fertilizer management method based on multi-agent reinforcement learning, comprising the following steps: Step 1: Collect and preprocess multi-source data of the target area, including field test data, sensor data, remote sensing data and historical data; Step 2: Calibrate the crop growth-nitrogen cycle model based on multi-source data, and build a dynamic simulation environment based on the calibrated crop growth-nitrogen cycle model; Step 3: Construct a nitrogen fertilizer application strategy model and a multi-objective reward function; the nitrogen fertilizer application strategy model consists of a nitrogen fertilizer type decision agent, an application dosage decision agent, an application method decision agent, and an application time decision agent; Based on the constructed nitrogen fertilizer application strategy model and multi-objective reward function, a centralized training-decentralized execution architecture is adopted for agent reinforcement learning training. At the same time, a large language model is introduced to dynamically generate reward adjustment signals and decision constraints. During the agent reinforcement learning training process, the strategy network and / or value network of the nitrogen fertilizer type decision agent, application dosage decision agent, application method decision agent, and application time decision agent are updated according to the reward adjustment signals and decision constraints, so as to realize agronomic knowledge-guided strategy optimization. During the reinforcement learning training process of the agent, the nitrogen fertilizer application strategy model is evaluated. When the index volatility is less than the preset threshold within a continuous evaluation period, the nitrogen fertilizer application strategy model is determined to have converged, and the optimal nitrogen fertilizer application strategy model is obtained. Step 4: Based on the optimal nitrogen fertilizer application strategy model and combined with the real-time status data of the target area, generate a nitrogen fertilizer application plan, and at the same time generate a natural language interpretation and risk assessment report based on the big language model.
[0008] Furthermore, the crop growth-nitrogen cycle model is selected based on crop type and target region. The crop growth-nitrogen cycle model includes phenological development module, photosynthesis and biomass accumulation module, canopy development module, nitrogen cycle module and environmental response module, and has the ability to simulate key growth stages of crops, accumulation and distribution of photosynthetic products, dynamic development of canopy, nitrogen cycle of soil-crop system and response to environmental factors.
[0009] Furthermore, the steps of dynamically generating reward adjustment signals and decision constraints using a large language model include: A pre-trained large language model was selected, and retrieval-enhanced generation techniques were used to fine-tune the large language model using a comprehensive text corpus in the agricultural field. Based on the fine-tuning of the large language model, its knowledge guidance logic in the agent reinforcement learning training process is designed and configured to achieve joint strategy optimization for guiding agronomic knowledge; The knowledge-guided logic includes dynamic reward adjustment logic and decision constraint generation logic. The dynamic reward adjustment logic clarifies what type and intensity of reward adjustment signals the large language model should generate under what combination of situations. The decision constraint generation logic clarifies what hard and soft constraints the large language model should generate to limit the agent's action space under different environmental conditions. Hard constraints are used to filter out sets of actions that cannot be taken, while soft constraints are used to impose independent penalties.
[0010] Furthermore, the steps for training an agent through reinforcement learning include: Environment initialization and state observation: At the start of each crop growing season simulation, the reset() method is called to initialize the dynamic simulation environment to the set initial state and obtain the initial environmental state observation values. s t ; Multi-agent joint action selection and execution: Each agent selects and executes actions based on the current environmental state. s t The learning strategy is implemented in a distributed manner, with each action suggestion selected separately for the corresponding decision dimension and collectively constituting the time step. t Combined fertilization action a t And pass it to the step(action) method; Environmental Feedback and Basic Reward Acquisition: Executing Joint Actions in a Dynamic Simulation Environment a t It simulates the dynamic changes in crop growth and soil nitrogen, and returns the environmental state at the next time step. s t+1 The basic environmental reward value calculated based on a preset multi-objective reward function. r env and a flag indicating whether the current round has ended.done ; Application of reward adjustment and decision constraint guided by large language model knowledge: applying the current environmental state s t Joint actions performed by intelligent agents a t and basic environmental rewards r env The input is fed into a large language model, which performs inference based on the configured knowledge-guided logic and outputs a reward adjustment signal. r adj and dynamic decision constraints applied to the next decision step; basic environmental rewards r env With the current reward adjustment signal r adj Integrate to obtain the final reward value r final ; Updating agent policies and cooperative mechanisms: collecting experience samples ( s t , a t , s t+1 , r final , done In the framework of Centralized Training with Decentralized Execution (CTDE), multi-agent reinforcement learning algorithms are used to update the policy network and / or value network of each agent. Based on global state s t Dynamic weights for the contributions of each agent are generated and used for credit allocation and to guide the collaborative optimization of the agents' strategies. Repeat the above steps until the agent's reinforcement learning training converges.
[0011] Furthermore, the final reward value is used to quantify and balance key performance indicators in nitrogen fertilizer management, with the final reward value at each time step. t The calculation is expressed as: r final = w yield R Yield_t + w nue R NUE_t wcost C fert_t w loss L N_t + w LLM r adj ; In the formula, r final This represents the final reward value; R Yield_t This indicates a production-based bonus; R NUE_t Indicates a reward for nitrogen use efficiency; C fert_t This indicates a cost penalty; L N_t Indicates a penalty for nitrogen loss risk; r adj This indicates the adjustment items for the large language model; w yield , w nue , w cost , w loss , w LLM These are the weighting coefficients for each item.
[0012] Furthermore, the steps for determining the convergence of agent reinforcement learning training include: constructing an independent test dataset based on data from multi-source data that did not participate in agent reinforcement learning training; running the nitrogen fertilizer application strategy model on the independent test dataset and recording the data of each evaluation index; when the fluctuation of each evaluation index is less than the preset threshold within a continuous preset evaluation period, it is determined that the nitrogen fertilizer application strategy model has converged. The evaluation metrics include simulated average crop yield or yield gain, simulated average nitrogen fertilizer use efficiency, simulated average total fertilizer cost, and simulated average environmental impact metrics.
[0013] Furthermore, the intelligent agents include nitrogen fertilizer type decision-making agents, application dosage decision-making agents, application method decision-making agents, and application time decision-making agents.
[0014] Furthermore, the nitrogen fertilizer management plan includes machine-readable structured instructions to clearly indicate the type of nitrogen fertilizer, application dosage, application method, and application timing; natural language interpretation to explain the basis for recommendations and expected effects; and risk assessment to provide early warnings when extreme weather or abnormal soil conditions are predicted.
[0015] As a second aspect of this application, some embodiments of this application provide a crop nitrogen fertilizer management system based on multi-agent reinforcement learning, including a data acquisition module for acquiring multi-source data of a target area and performing preprocessing; The simulation environment module is used to receive multi-source data preprocessed by the data acquisition module and to build a dynamic simulation environment based on the calibrated crop growth-nitrogen cycle model. A multi-agent reinforcement learning decision-making module is used to train the nitrogen fertilizer application strategy model in the simulation environment module and output the optimal nitrogen fertilizer application strategy model. The large language model knowledge guidance module is used to generate reward adjustment signals and decision constraints during the reinforcement learning training of the agent, so as to guide the reinforcement learning training of the agent. The nitrogen fertilizer recommendation generation module is used to call the optimal nitrogen fertilizer application strategy model and generate an executable nitrogen fertilizer application plan based on the real-time status data of the target area.
[0016] Furthermore, the nitrogen fertilizer recommendation generation module is also used to transmit executable nitrogen fertilizer application plans and the real-time status of the target area to the large language model knowledge guidance module to generate natural language explanations and risk assessments of the nitrogen fertilizer application plans.
[0017] Compared with the prior art, the advantages of this invention are: (1) Multi-dimensional collaborative decision-making enhances the global optimality of the strategy. Most existing technologies optimize fertilization in a single dimension, which is difficult to cope with the complex coupling relationship between "type, dosage, method and time" in nitrogen fertilizer management. This invention adopts a multi-agent reinforcement learning (MARL) architecture to decouple this complex problem. Through the collaborative training and joint decision-making of four agents, a comprehensive fertilization strategy that is globally better under multiple objectives (yield, cost, efficiency and environmental protection) can be found, which breaks through the limitations of single-point optimization methods.
[0018] (2) Knowledge-guided mechanism to ensure scientific and safe decision-making. Addressing the drawbacks of traditional reinforcement learning, which often results in blind training and strategies that violate agronomic common sense, this invention introduces a Large Language Model (LLM) as a dynamic knowledge-guided source. By dynamically adjusting rewards and imposing constraints during training, domain expert knowledge is integrated into the model learning process in real time and flexibly, fundamentally ensuring the scientific validity, safety, and environmental friendliness of the final strategy, thus overcoming the "black box" problem of AI decision-making.
[0019] (3) Explainable fertilization plans enhance the credibility and practicality of the technology. This invention not only outputs machine-readable instructions, but also utilizes LLM to provide clear natural language explanations of the agronomic principles, expected effects, and potential risks of the recommended plans. This greatly enhances users' understanding and trust in intelligent decision-making, solves the "last mile" problem of promoting and applying intelligent agricultural technology, and makes complex models truly reliable tools for guiding production practices. Attached Figure Description
[0020] Figure 1 This is a schematic diagram of the structure of a crop nitrogen fertilizer management system based on multi-agent reinforcement learning in one embodiment of the present invention; Figure 2 This is a flowchart of a crop nitrogen fertilizer management method based on multi-agent reinforcement learning in one embodiment of the present invention; Figure 3 This is a flowchart of agent reinforcement learning training in one embodiment of the present invention. Detailed Implementation
[0021] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] like Figure 1 As shown, the crop nitrogen fertilizer management system of the present invention includes a data acquisition module 101, a simulation environment module 102, a large language model (LLM) knowledge guidance module 103, a multi-agent reinforcement learning decision-making module 104, and a nitrogen fertilizer recommendation generation module 105.
[0023] The data acquisition module 101 is used to acquire multi-source data and input it into the simulation environment module 102 after preprocessing. The data acquisition module 101 includes a data preprocessing unit, which is responsible for cleaning, transforming and spatiotemporally aligning the multi-source data.
[0024] The simulation environment module 102 calibrates the crop growth-nitrogen cycle model based on multi-source data and constructs a dynamic simulation environment based on the calibrated crop growth-nitrogen cycle model. The simulation environment module 102 includes the crop growth-nitrogen cycle model and an API interface that conforms to standard reinforcement learning environment specifications (such as OpenAI Gym).
[0025] Specifically, the simulation environment module 102 uses multi-source data provided by the data acquisition module 101 to calibrate the varietal genetic parameters, soil parameters, and initial environmental conditions in the crop growth-nitrogen cycle model through metaheuristic optimization algorithms or dynamic parameter adjustment techniques. This minimizes the error between the simulated output of the crop growth-nitrogen cycle model (such as leaf area index LAI, biomass, plant nitrogen concentration PNC, etc.) and field test data, achieving accurate simulation of the crop growth-nitrogen cycle dynamics. The metaheuristic optimization algorithm can employ particle swarm optimization (PSO) or genetic algorithm (GA), while the dynamic parameter adjustment technique can utilize data assimilation.
[0026] As shown in Table 1, the simulation environment module 102 provides state feedback information to the multi-agent reinforcement learning decision module 104 at each simulation time step. The simulation time step refers to the basic time granularity of model operation in the dynamic simulation environment, dynamically aligned with the frequency of multi-source data acquisition to ensure the timeliness of state feedback. The simulation time step is typically set to a daily scale or a critical reproductive period node.
[0027] Table 1 Simulation Environment Status Feedback Information
[0028] After executing the joint fertilization action output by the multi-agent reinforcement learning decision-making module 104, the simulation environment module 102 calculates the basic environment reward value according to the preset multi-objective reward function. r env This reward value quantifies the comprehensive effects of the current fertilization action on yield gain, nitrogen fertilizer utilization efficiency, fertilization cost control, and reduction of nitrogen loss risk. It is then returned to the decision-making module as a core feedback signal along with other status information.
[0029] The API interface includes the `reset()` method, the `step(action)` method, and the `render()` method. The `reset()` method initializes the dynamic simulation environment, loading initial conditions such as crop variety, soil type, and meteorological data, and begins the simulation for the new growing season. The `step(action)` method receives the joint fertilization action suggestions output by the multi-agent reinforcement learning decision module 104, drives the crop growth-nitrogen cycle model simulation to the next time step, and returns the next environmental state observation and the basic environmental reward value. r env The `render()` method is responsible for visualizing the simulation process, dynamically displaying key growth indicators (such as the leaf area index (LAI) time-series curve) and nitrogen distribution heatmap.
[0030] The multi-agent reinforcement learning decision-making module 104 is trained in a dynamic simulation environment constructed by the simulation environment module 102. The MARL training process adopts a centralized training-distributed execution (CTDE) architecture, deploying four agents responsible for nitrogen fertilizer type, application dosage, application method, and application time, respectively, to collaboratively learn and optimize nitrogen fertilizer management decisions. During the MARL training process, the simulation environment module 102 simulates crop growth dynamics and soil nitrogen cycle response under different nitrogen fertilizer management decisions based on a calibrated crop growth-nitrogen cycle model, and provides the multi-agent reinforcement learning decision-making module 104 with environmental state observations including leaf area index (LAI), plant nitrogen concentration (PNC), soil available nitrogen content, and meteorological factors, as well as multi-objective basic environmental reward values that quantify yield gain, nitrogen fertilizer use efficiency, fertilization cost, and nitrogen loss risk.
[0031] During MARL training, the large language model knowledge guidance module 103 receives real-time environmental state observations and joint fertilization action suggestions from the multi-agent reinforcement learning decision module 104. Based on retrieval-enhanced generation (RAG) technology, it dynamically generates reward adjustment signals and decision constraints incorporating agronomic knowledge and transmits them back to the multi-agent reinforcement learning decision module 104. The multi-agent reinforcement learning decision module 104 updates the agent's policy network and / or value network according to the reward adjustment signals and decision constraints. Through iterative optimization, after MARL training converges, the multi-agent reinforcement learning decision module 104 finally outputs the optimal nitrogen fertilizer application strategy model.
[0032] like Figure 3 As shown, the nitrogen fertilizer application strategy model adopts a centralized training-decentralized execution (CTDE) architecture, where each agent consists of a policy network and / or a value network. The policy networks and / or value networks of the four agents together constitute the complete nitrogen fertilizer application strategy model, achieving collaborative optimization through iterative training. In reinforcement learning, the policy network is responsible for directly outputting the agent's action distribution (such as a probability distribution or deterministic actions) based on the current environmental state. In this scheme, each agent is equipped with a policy network to generate specific decisions. The value network is used to estimate the long-term value of the current state or state-action pairs, providing gradient signals for policy optimization. During the centralized training phase, the value network evaluates the merits of the collaborative strategy using global information (such as the states and actions of all agents). The optimal nitrogen fertilizer application strategy model is a complete decision-making system containing the policy networks and value networks of the four agents, and is a parameterized function obtained through iterative optimization during training.
[0033] Specifically, to overcome the problems of low sample efficiency, blind exploration, and potential policy violations of domain common sense in traditional reinforcement learning methods, this solution dynamically integrates agronomical knowledge into the MARL training process through a large language model knowledge guidance module 103. This module generates reward adjustment signals and decision constraints in real time, guiding the multi-agent reinforcement learning decision module 104 to generate a nitrogen fertilizer application strategy that is scientific, safe, and practical. The large language model knowledge guidance module 103 uses a pre-trained large language model fine-tuned with a comprehensive agricultural text corpus and integrates Retrieval Augmentation (RAG) technology to ensure accurate agronomical knowledge understanding and reasoning capabilities. The core function of this module is to generate reward adjustment signals and decision constraints to optimize the policy network and / or value network of the agents in the multi-agent reinforcement learning decision module 104, thereby improving the quality of the final output optimal nitrogen fertilizer application strategy model.
[0034] Regarding reward adjustments: upon receiving the environmental status... s t Intelligent agent actions a t and basic environment reward value r env Subsequently, LLM generates a reward adjustment signal. r adj ,and r env Integrated into the final reward value r final ,Should r final It is used to update the policy network and / or value network of the agent.
[0035] Regarding decision constraints: LLM is based on the current environmental state. s t Dynamic decision constraints are generated, including hard constraints and soft constraints. Hard constraints are implemented by removing inactive actions directly from the agent's action space before the decision is made; soft constraints are implemented by applying an independent negative reward or penalty to actions marked by LLM as violating the constraints, in order to guide the agent to avoid choosing such actions.
[0036] The multi-agent reinforcement learning decision-making module 104 deploys agents including a nitrogen fertilizer type decision agent, an application dosage decision agent, an application method decision agent, and an application time decision agent. The training convergence of this module is determined by monitoring whether the evaluation indicators (such as average crop yield, average nitrogen fertilizer use efficiency, etc.) fluctuate less than a preset threshold over a continuous period on an independent test dataset.
[0037] Finally, the nitrogen fertilizer recommendation generation module 105 calls the optimal nitrogen fertilizer application strategy model and inputs multi-source data of the target area provided by the data acquisition module 101 to generate an executable nitrogen fertilizer application plan. At the same time, the nitrogen fertilizer application plan is transmitted to the large language model knowledge guidance module 103 to generate a natural language explanation and risk assessment of the plan.
[0038] The nitrogen fertilizer recommendation generation module 105 supports flexible deployment and can adapt to various operating environments such as cloud platforms, edge computing devices, or local servers. It is also equipped with the ability to load and execute the converged optimal nitrogen fertilizer application strategy model from the multi-agent reinforcement learning decision module 104. This module receives real-time dynamic information of the target field as model input, generates a structured (e.g., JSON format) nitrogen fertilizer application plan through model inference, and calls the large language model knowledge guidance module 103 to obtain the natural language interpretation and risk assessment of the plan. Finally, it outputs the integrated complete information to the user or downstream automated agricultural equipment.
[0039] This invention provides a crop nitrogen fertilizer management method based on multi-agent reinforcement learning, using field crop cultivation as an application scenario. Through real-time multi-source data acquisition, crop growth simulation, agronomic knowledge guidance, and multi-agent collaborative decision-making, it ultimately generates an executable and interpretable nitrogen fertilizer application plan. This method decomposes the complex nitrogen fertilizer management problem into four decision dimensions: nitrogen fertilizer type, application dosage, application method, and application time. Collaborative optimization is achieved through a multi-agent reinforcement learning (MARL) framework. Simultaneously, a large language model (LLM) is introduced as a dynamic knowledge guidance source, dynamically integrating domain knowledge into the training process to ensure the scientific validity and operability of the final nitrogen fertilizer application strategy model. The aim is to improve crop yield and nitrogen fertilizer use efficiency (NUE) while reducing production costs and environmental risks. Figure 2 As shown, the crop nitrogen fertilizer management method based on multi-agent reinforcement learning specifically includes the following steps: S1. Data Acquisition and Preprocessing Acquire and preprocess multi-source data for the target area. The multi-source data includes field trial data, sensor data, remote sensing data, and historical data containing historical meteorological data, farm management data, and regional yield data.
[0040] Specifically, field trial data is collected by designing field trials with different nitrogen fertilizer treatment combinations, including nitrogen fertilizer type, application method, application dosage, and application time. The field trial process includes: destructive sampling during key growth stages to measure plant height, leaf area index (LAI), biomass, plant nitrogen concentration (PNC), leaf SPAD value, and soil organic matter and nitrogen, phosphorus, and potassium content, which are used as field trial data. Among them, the key growth stages refer to the stages in crop growth and development that are sensitive to nitrogen demand and significantly affect fertilization decisions.
[0041] The sensor data is collected by deploying soil temperature and humidity sensors and meteorological sensors. Soil data such as soil moisture content, pH value, temperature, and electrical conductivity are collected in real time, as well as meteorological data such as daily maximum temperature, daily minimum temperature, daily average temperature, precipitation, sunshine hours, total solar radiation, air temperature and humidity, and wind speed, which are used as sensor data.
[0042] Remote sensing data acquisition utilizes drones equipped with RGB, multispectral, hyperspectral, thermal infrared, or lidar devices to collect image data during key growth periods, including crop vegetation indices, canopy structure parameters, and stress indicators, as remote sensing data.
[0043] Specifically, vegetation indices (VIs) include the Normalized Difference Vegetation Index (NDVI), the Normalized Red Edge Vegetation Index (NDRE), the Ratio Vegetation Index (RVI), and the Soil-Regulated Vegetation Index (SAVI), etc.; canopy structure parameters can be crop structure indicators such as leaf area index (LAI) and leaf tilt angle; stress indicators can be water stress index based on canopy thermal infrared data or nitrogen stress index based on canopy spectral data.
[0044] Historical data collection is achieved by integrating historical documents on crops in the target area, agricultural databases, farm management records, and farmer survey data.
[0045] Specifically, the collected multi-source data is preprocessed to improve data quality, ensure data consistency, and extract key information. The preprocessing process is as follows: (1) Cleaning and conversion: The multi-source data is cleaned to remove outliers and fill missing values in the time series data using linear interpolation. Then, the multi-source data is spatiotemporally aligned to ensure consistency of multi-source data from different sources on the spatiotemporal baseline. Finally, all multi-source data is converted to standard formats such as CSV or NetCDF.
[0046] (2) Point-area data fusion: Spatial fusion techniques (such as interpolation-based or machine learning methods) are employed to fuse sensor data as point data and remote sensing data as area data to generate a spatial distribution map. Simultaneously, time-series multi-source data from different acquisition frequencies are aligned and scaled to obtain multi-source data with continuous or consistent temporal intervals.
[0047] (3) Remote sensing data processing: Radiometric calibration and geometric correction are performed on remote sensing data to eliminate systematic errors and geometric distortions; and inversion models (such as statistical models or machine learning models) are constructed and applied in combination with ground-measured data to extract physiological and biochemical parameters of crop canopy.
[0048] The preprocessed multi-source data is stored in an agricultural database in a unified format and with spatiotemporal reference, and is used for subsequent model calibration and dynamic simulation environment construction.
[0049] S2. Model Calibration and Dynamic Simulation Environment Construction The crop growth-nitrogen cycle model is calibrated based on multi-source data from step S1, and a dynamic simulation environment for the crop growth-nitrogen cycle is constructed based on the calibrated model, providing a simulation interaction platform for subsequent reinforcement learning training.
[0050] First, select a crop growth-nitrogen cycle model based on crop type and target area. The crop growth-nitrogen cycle model should include phenological development module, photosynthesis and biomass accumulation module, canopy development module, nitrogen cycle module and environmental response module, and have the ability to simulate key growth stages of crops, accumulation and distribution of photosynthetic products, dynamic development of canopy, nitrogen cycle of soil-crop system and response to environmental factors.
[0051] Key growth stages include tillering, jointing, heading, and maturity. Photosynthesis and biomass accumulation are measured using net photosynthetic rate. Canopy dynamics are assessed using leaf area index (LAI) changes. Soil-crop nitrogen cycling includes soil nitrogen supply, crop nitrogen uptake and distribution, nitrogen stress effects, and major nitrogen loss pathways. Environmental factors include meteorological, soil, and field management factors.
[0052] The phenological development module simulates the various growth stages of crops from sowing to maturity, such as tillering, jointing, panicle differentiation, heading, flowering, and grain filling in rice. The photosynthesis and biomass accumulation module simulates canopy photosynthesis, dry matter production, and its distribution among leaves, stems, roots, and panicles. The canopy development module simulates the dynamic changes in leaf area index (LAI). The nitrogen cycle module simulates soil nitrogen supply (mineralized and fertilizer nitrogen), crop nitrogen uptake, nitrogen distribution within the plant (e.g., calculating plant nitrogen concentration (PNC)), the effects of nitrogen stress on growth, and potential nitrogen loss processes. The environmental response module simulates the crop's response to meteorological factors such as temperature, light, and precipitation, as well as management practices such as fertilization and irrigation.
[0053] In a specific embodiment, the ORYZA model is used when the target crop is rice, the DSSAT-CERES module can be selected when the target crop is dryland crops such as wheat or corn, and the WOFOST model can be adapted for general scenarios.
[0054] The crop growth-nitrogen cycle model was calibrated based on the multi-source data collected and preprocessed in step S1, enabling it to accurately simulate the growth and development process (such as key phenological stages, LAI dynamics, and aboveground biomass accumulation) and nitrogen nutrient status (such as plant nitrogen concentration (PNC) and total nitrogen uptake) of the target crop under specific environmental and field management conditions in the target area. Key parameters for model calibration included varietal genetic parameters, soil parameters, and initial environmental conditions.
[0055] Variety genetic parameters reflect the unique attributes of the target crop variety, including parameters related to phenological development rate, photosynthetic efficiency, the distribution ratio of dry matter among different organs (leaves, stems, roots, and ears), and parameters related to efficient nitrogen use such as nitrogen uptake kinetics, critical nitrogen concentration curves, and nitrogen reuse efficiency. Soil parameters affect soil moisture balance and nutrient dynamics, including physical properties of soil layers (such as field capacity, wilting point water content, and saturated hydraulic conductivity) and chemical and biochemical parameters closely related to soil nitrogen cycling (such as soil organic matter content and its decomposition rate, nitrogen mineralization potential, nitrification rate, denitrification rate, ammonia volatilization potential, and nitrogen leaching characteristics). Initial environmental conditions simulate the field environment at the start date, including the initial water content of soil profiles divided by layers and the initial concentrations or reserves of available nitrogen such as nitrate nitrogen and ammonium nitrogen.
[0056] Specifically, model calibration employs a parameter optimization algorithm to minimize the error between the crop growth-nitrogen cycle model simulation output and the field trial data obtained in step S1 by continuously adjusting key parameters. Statistical indicators typically include minimizing the root mean square error (RMSE) or maximizing the coefficient of determination (R²). The crop growth-nitrogen cycle model simulation output includes time series or key node values of LAI, biomass, PNC, and soil available nitrogen content.
[0057] Parameter optimization algorithms can employ particle swarm optimization (PSO), genetic algorithm (GA), or data assimilation techniques (such as ensemble Kalman filter (EnKF) or Markov chain Monte Carlo (MCMC)). Key parameters are adjusted by minimizing the root mean square error (RMSE) or maximizing the coefficient of determination (R²).
[0058] Specifically, multi-source data not involved in model calibration, such as multi-source data from different years, different fields, or different field management practices, are used to construct an independent test dataset to evaluate the predictive performance of the crop growth-nitrogen cycle model after calibration. Predictive performance includes the simulation accuracy and generalization ability of the crop growth-nitrogen cycle model for key growth indicators and nitrogen-related indicators. Model calibration ends when the evaluation results meet preset standards, and a dynamic simulation environment is constructed based on the crop growth-nitrogen cycle model. Preset standards refer to a series of statistical indicators that must be reached to measure the consistency between model-simulated values and actual observed values. These thresholds are typically determined based on academic consensus in the field of crop models, authoritative literature, or the accuracy requirements of specific application scenarios. In one specific embodiment of this invention, the standard may include one or more of the following: The coefficient of determination (R²) reflects the model's ability to explain the variability in real data. The closer the value is to 1, the better the fit. A value greater than 0.75 is generally required.
[0059] Normalized root mean square error (nRMSE): This is a key relative accuracy metric, representing the percentage of the model's average prediction error relative to the average of the observed values. It is unaffected by the dimensions of the variable itself, and a lower value is better. Typically, for key growth indicators (such as biomass and LAI), this value is required to be less than 15%-20%.
[0060] Percentage Bias (PBIAS): Measures the average systematic bias (over- or under-biased) of the model's predictions; the closer the absolute value is to 0, the better. Typically, an absolute value of less than 10%-15% is required.
[0061] Key growth indicators include leaf area index (LAI), biomass, and yield components. Nitrogen-related indicators include plant nitrogen concentration (PNC), plant nitrogen uptake (PNU), and nitrogen nutrient index (NNI).
[0062] Specifically, the dynamic simulation environment is encapsulated into an API interface conforming to standard reinforcement learning environment specifications (such as OpenAI Gym), including the `reset()` method, the `step(action)` method, and the `render()` method. The `reset()` method is used to initialize or reset the dynamic simulation environment. When called, it sets the dynamic simulation environment to the starting point of a new growing season or scenario based on preset initial conditions such as crop variety, soil type, and meteorological data, and returns the initial environmental state observations. The `step(action)` method receives action suggestions from the agent, including nitrogen fertilizer type, dosage, application method, and application time, executes the model simulation to the next time step, and returns the next state and the basic environmental reward value. r envThe `render()` method is used to visualize key state variables (such as LAI dynamic curves and soil nitrogen spatial distribution maps) during the simulation process, facilitating debugging and understanding.
[0063] The dynamic simulation environment constructed in this step can simulate the dynamic response of crop growth and nitrogen cycle in real time according to the input nitrogen fertilizer management strategy, and provide the necessary state feedback and reward signals for the reinforcement learning agent, thereby driving the agent to learn and obtain the optimal nitrogen fertilizer application strategy model.
[0064] S3, Collaborative Reinforcement Learning Training Based on the dynamic simulation environment constructed in step S2, the core of this step is to train a collaborative decision-making nitrogen fertilizer application strategy model using the Multi-Agent Reinforcement Learning (MARL) method. This model consists of four independent agents, each responsible for different aspects of nitrogen fertilizer application: type, dosage, method, and timing. The training process follows a Centralized Training with Decentralized Execution (CTDE) paradigm to achieve collaborative optimization of the global policy. Unlike traditional reinforcement learning, this training process introduces a Large Language Model (LLM) for real-time knowledge guidance. By dynamically adjusting rewards and decision constraints, it ensures that the final policy model, composed of parameterized policy networks and / or value networks for each agent, possesses scientific validity, safety, and practicality.
[0065] The nitrogen fertilizer type decision-making agent is responsible for optimizing the specific type of nitrogen fertilizer. Its action space is a set of predefined discrete options, such as urea, ammonium sulfate, slow-release / controlled-release urea (e.g., coated urea), and granular urea. The agent's decision-making comprehensively considers factors such as the crop's current growth stage (e.g., the tillering stage may require more readily available nitrogen), the agronomic characteristics of different fertilizers (e.g., nitrogen release rate, nutrient content, cost), the matching degree between fertilizer and crop nitrogen requirements, and current environmental conditions (e.g., soil type, temperature, humidity may affect the efficiency and loss risk of specific fertilizers).
[0066] The application dosage decision-making agent is responsible for determining the amount of nitrogen fertilizer to be applied. Its action space can be a discrete set of dosages (e.g., gradient nitrogen application rates such as 0 kg N / ha, 15 kg N / ha, 30 kg N / ha, 45 kg N / ha, 60 kg N / ha, 100 kg N / ha, 150 kg N / ha) or continuous values within a preset range. The agent's decisions are mainly based on the crop's current nitrogen nutrient status and demand forecast, soil nitrogen supply capacity assessment, preset target yield levels, and cost-benefit analysis of fertilization.
[0067] The application method decision-making agent is responsible for selecting the most suitable nitrogen fertilizer application method. Its action space is a set of discrete operation methods, such as surface application, deep furrow application, surface application followed by tilling into the soil, and drip irrigation through an irrigation system. The agent's decision-making needs to consider the type of fertilizer selected (e.g., granular or liquid), the distribution characteristics of the crop root system, the need to reduce nitrogen volatilization or leaching losses, and the availability and cost of field operation equipment.
[0068] The application timing decision agent is responsible for determining the optimal time to apply nitrogen fertilizer. Its action space typically determines whether to perform the fertilization action at each decision time step (e.g., each day in a simulated environment or a specific crop growth stage transition point), i.e., "apply fertilizer immediately" or "do not fertilize / wait for the next opportunity." The agent's decision is based on the precise growth stage of the crop, predictions of the peak nitrogen demand period of the crop, short-term weather condition forecasts (e.g., avoiding pre-rain application), and coordination with other management measures.
[0069] LLM uses a pre-trained large language model with general capabilities, such as the Llama series or DeepSeek series models. Specifically, the process of configuring an LLM is as follows: The LLM was fine-tuned using a comprehensive text corpus in the agricultural field to enhance its understanding and reasoning capabilities regarding agricultural terminology, crop growth patterns, nitrogen cycle mechanisms in the soil-plant system, field management practices, and related risks.
[0070] Specifically, the system employs Retrieval Enhanced Generation (RAG) technology, which connects to a real-time updated external agricultural knowledge base specifically built for this system, enabling the LLM to access the latest domain knowledge as a decision-making reference during runtime.
[0071] The agricultural knowledge base is a well-organized, processed, and indexed document-based database whose content sources may include one or more of the following: Basic agronomic knowledge: including but not limited to authoritative textbooks, research papers, and officially published technical manuals and fertilization guidelines in the fields of crop physiology, soil science, and plant nutrition.
[0072] Dynamic and timely information: including the latest agricultural research progress, descriptions of new fertilizer products, early warning information on pests and diseases in specific regions, real-time fluctuations in fertilizer market prices, and the latest national or local policies and regulations on environmental protection and fertilizer use.
[0073] Regional localization knowledge includes official planting recommendations for specific geographical areas, detailed descriptions of the characteristics of main crop varieties (such as the fertilizer requirements of different varieties), and more detailed local soil survey reports.
[0074] Historical feedback data from the system includes assessment reports on the actual implementation effects, yields, costs, and environmental impacts of nitrogen fertilizer management schemes generated by the system in past application cycles, which are used to form a data-driven self-optimization and iterative closed loop.
[0075] In building this knowledge base, the documents from the aforementioned sources are processed into structured text fragments and indexed using vectorization techniques, thereby supporting efficient semantic retrieval and ensuring that the RAG system can provide the most relevant and accurate decision-making references for LLM.
[0076] More specifically, based on agronomic principles, sustainable agricultural practices, and anticipated nitrogen fertilizer management goals (such as high yield, high efficiency, and low environmental risk), the knowledge guidance logic for LLM during MARL training is designed and configured, including dynamic reward adjustment logic and decision constraint generation logic. The dynamic reward adjustment logic clarifies the environmental conditions under which LLM is trained (…). s t What actions does the agent attempt or perform? a t And what kind of basic environmental rewards were received () r env In a combined situation, what type (positive incentive or negative punishment) and intensity of reward adjustment signal should be generated? r adj For example, positive reward adjustments are given to actions that apply appropriate amounts of nitrogen fertilizer in a timely manner during the critical nitrogen-demanding period of crops; negative reward adjustments are given to fertilization behaviors that may lead to significant nitrogen loss (such as large-scale application before rain). The decision constraint generation logic clearly defines which hard constraints and soft constraints should be generated by the LLM under different environmental conditions to limit the agent's action space, ensuring that the optimal nitrogen fertilizer application strategy model formed by the agent's policy network and / or value network is always within the range of agronomic rationality, production safety (such as the total amount limit to avoid fertilizer burn), and environmental regulations. For example, it stipulates that certain fertilization operations are prohibited under specific soil moisture or rainfall warning conditions, or sets a dynamic upper limit on the amount of fertilizer applied at one time.
[0077] MARL leverages dynamic rewards and decision constraints to guide and optimize multi-agent collaborative reinforcement learning training in real time. Dynamic rewards are awarded at specified nodes during each iteration of MARL training or after several iterations, based on the actions performed by the agents in the previous time step, returning the base environment reward value. r env )back, r env Together with the current environmental conditions ( s t ) and the actions that the agent actually adopts or proposes (a t This, along with other contextual information, is input into the LLM. Based on its internally stored and reasoned agronomical knowledge (e.g., determining whether the current action conforms to fertilization principles for a specific growth stage, and whether it may lead to nutrient loss risk), the LLM generates reward adjustment signals. r adj (This can be a positive incentive or a negative punishment). Then... r adj and r env The final, knowledge-adjusted reward value is then formed through integration. r final For example, by weighted summation: r final = w 1 r env + w 2 r adj ,in w 1, w 2 represents the weighting coefficient, or they can be directly added together: r final = r env + r adj Using MARL algorithms (such as Q-learning's update rules or Actor-Critic's advantage function) r final Update the agent's policy network and / or value network to guide the agent to learn decisions that conform to agronomic knowledge.
[0078] LLM is based on the current environmental state ( s t The LLM generates dynamic decision constraints, limiting the action space (the set of all possible actions an agent can choose in a given state) for each agent. The generation of decision constraints is based on the LLM's agronomic risk assessment and opportunity identification of the current situation (e.g., before rainfall or when soil moisture is saturated, the LLM generates constraints to prohibit the application of fast-acting nitrogen fertilizer to prevent leaching losses; during specific sensitive periods of the crop, the LLM generates constraints to restrict the use of unsuitable fertilizer types).
[0079] Decision constraints include hard constraints and soft constraints. Hard constraints directly modify or filter the agent's available actions. Before the agent makes a decision, inactive actions are removed from the agent's action space based on the list of inactive actions generated by LLM, ensuring that the agent can only choose from a subset of actions that conform to agronomic norms. Soft constraints are implemented by imposing an independent negative reward penalty on actions that violate the constraints. If the agent chooses an action marked as violating the constraint by LLM, the reward it ultimately learns will be significantly reduced due to an independent negative penalty, thus guiding the agent to avoid choosing such actions. Decision constraints ensure that the agent always adheres to agronomic principles, safe production standards, and environmentally friendly requirements.
[0080] In each (or every N) training step, relevant contextual information (such as the current environment state) s t Actions chosen by the agent a t Basic rewards obtained from the parametric dynamic simulation environment module 102 r env Inputs (such as natural language prompts) are encoded into an LLM-understandable input format. After processing these inputs, the LLM outputs a corresponding reward adjustment signal. r adj And / or updated action constraint rules. This dynamic, context-aware knowledge guidance mechanism overcomes the limitations of traditional static rule bases and the drawbacks of blind exploration in purely data-driven methods.
[0081] Specifically, the agent is trained through collaborative reinforcement learning in a dynamic simulation environment using a pre-configured LLM. The training process follows the centralized training-distributed execution (CTDE) paradigm and employs a MARL algorithm suitable for CTDE (such as QMIX, QPLEX, etc., based on value function decomposition). The MARL training process is as follows: (1) Environment initialization and state observation: At the beginning of each crop growing season simulation, the reset() method is called to initialize the dynamic simulation environment to the set initial state and obtain the initial environmental state observation values. s t .
[0082] (2) Multi-agent joint action selection and execution: Each agent selects and executes actions based on the current environmental state. s t The learned strategy is implemented in a decentralized manner, with each agent selecting action suggestions for the corresponding decision dimension. The action suggestions from each agent collectively constitute the decision at that time step. t Combined fertilization action a t =(Action type, action dosage, action method, action timing decision). Subsequently, combined fertilization actions.a t Pass it to the step(action) method.
[0083] (3) Environmental feedback and basic reward acquisition: The dynamic simulation environment performs joint actions. a t It simulates the dynamic changes in crop growth and soil nitrogen, and returns the environmental state at the next time step. s t+1 The basic environmental reward value calculated based on a preset multi-objective reward function. r env and a flag indicating whether the current round has ended. done .
[0084] Among them, the basic environment reward value r env It includes multiple components such as yield, nitrogen utilization efficiency, cost, and nitrogen loss risk.
[0085] (4) Application of reward adjustment and decision constraint guided by large language model knowledge: the current environmental state s t Joint actions performed by intelligent agents a t and the basic environmental rewards obtained r env Contextual information is input into the LLM, which then performs reasoning based on the configured knowledge-guided logic and outputs a reward adjustment signal. r adj And dynamic decision constraints applied to the next decision step.
[0086] Subsequently, the basic environmental rewards obtained in step (3) will be used to... r env Adjustment signal for rewards obtained in the current step r adj Integrate to obtain the final reward value r final .
[0087] (5) Updating agent strategies and cooperative mechanisms: collecting experience samples ( s t , a t , s t+1 , r final , done Within the CTDE framework, the selected MARL algorithm is used to update the policy network (e.g., Actor network) and / or value network (e.g., Critic network) of each agent.
[0088] Utilizing the collected global information (including observations, actions, and final reward values of all agents) r final This is used to train centralized components (such as centralized Critic or hybrid networks of value function decomposition). During this process, a learned collaborative weighting mechanism is used by the auxiliary neural network based on the global state. s t Dynamic weights for each agent's contribution are generated and used for credit allocation and to guide the collaborative optimization of each agent's strategy.
[0089] Specifically, hard constraints are used directly to filter or modify the available action set of each agent before the action selection in the next time step, while soft constraints indirectly guide agents by influencing reward signals or exploration strategies.
[0090] (6) Cyclic and convergence: Repeat steps (2) to (5) to perform a large number of simulated growing season interaction learning until the collaborative strategy model of all agents reaches the convergence standard on the preset evaluation index.
[0091] Specifically, the final reward value r final The aim is to quantify and balance multiple key performance indicators in nitrogen fertilizer management, guiding the agent to learn sustainable fertilization strategies. Final reward value. r final At each time step t calculate: r final = w yield R Yield_t + w nue R NUE_t w cost C fert_t w loss L N_t + w LLM r adj In the formula, R Yield_tThis represents a yield benefit reward designed to maximize crop yield, and can be calculated based on the yield increment (ΔYield) of the current simulated yield relative to a baseline scenario (e.g., no fertilization or conventional fertilization). t It can be calculated using a sigmoid or tanh function (e.g., tanh(Yield)). t / TargetYield) is used to measure how close the current output is to the preset target output; R NUE_t This indicates a nitrogen use efficiency bonus, aimed at improving the absorption and utilization efficiency of nitrogen fertilizer. It can be implemented using nitrogen fertilizer partial factor productivity (PFP_N). t =Yield t / Applied_N_Dose t As a direct reward, or as a reward for the portion exceeding a certain target nitrogen use efficiency (e.g., max(0, PFP_N)). t -TargetPFP_N t )); C fert_t This represents a cost penalty, designed to minimize fertilization costs, typically based on the amount of nitrogen fertilizer applied (Applied_N_Dose). t The negative reward is calculated by multiplying the price per kg of the selected nitrogen fertilizer type (Price_per_kg_N(Selected_Type)) by the price per kg of the selected nitrogen fertilizer type. L N_t This represents the nitrogen loss risk penalty, designed to minimize nitrogen loss to the environment (such as leaching, volatilization, denitrification, etc.). This penalty is calculated by multiplying the nitrogen application rate (Applied_N_Dose) by a predefined risk assessment function or model (Penalty_Factor(Type, Method, Timing, Weather, Soil)). t This risk assessment function can be constructed based on agronomic mechanism models or expert knowledge. r adj This represents the adjustment term of the large language model, which is dynamically generated based on the current specific context (environmental state, current action of the agent, etc.) and is used to make real-time corrections to the above-calculated rewards at the agronomic knowledge level (which may be positive or negative). w yield , w nue , w cost , wloss , w LLM These are the weighting coefficients for each item. These weighting coefficients are usually important hyperparameters, depending on the priority objectives of agricultural production (e.g., in some regions, environmental protection may be more emphasized). w loss (The weight will be higher) Pre-set and debug to balance the contributions of different objectives.
[0092] The four agents output action suggestions in their respective decision dimensions, namely nitrogen fertilizer type, application dosage, application method and application time, which together constitute the nitrogen fertilizer application strategy.
[0093] In summary, a centralized learning approach is adopted during the multi-agent training phase to collaboratively regulate the learning direction and progress of each agent's output strategy. This enables joint optimization of all agents' strategies within a unified framework, allowing each agent to access global information, including the simulation environment state, the combined actions chosen by all agents, observation data from other agents, and a joint reward function for evaluating collective performance. This sharing of global information allows agents to learn the complex dependencies between their decisions and effective collaborative strategies, thereby maximizing the team's overall long-term returns. During the multi-agent execution and deployment phase, a decentralized strategy is employed, with each agent independently outputting decisions. Fully trained agents are deployed to real-world application scenarios or for independent simulation evaluation. At this stage, each agent independently executes its learned optimization strategy based on its own local observation information (e.g., species agents focus on fertilizer inventory and costs, while time agents focus on weather forecasts and crop stages) and limited collaborative information received from other agents via a pre-defined lightweight communication protocol (e.g., other agents' decision intentions or key state summaries).
[0094] To ensure that the action suggestions output by the four agents in their respective decision dimensions can effectively coordinate to achieve overall optimization, this scheme introduces a learning-based collaborative weight mechanism. The collaborative weights are learned during the MARL centralized training phase through an independent auxiliary neural network (e.g., a fully connected network), which is trained based on the current global environment state. s t As input, the output is a set of normalized weights (e.g., processed using a Softmax function to ensure the sum of the weights is 1), corresponding to the relative importance or expected contribution of the four decision dimensions (or four agents) in the current state. By dynamically learning and adjusting the optimal trade-offs for each decision dimension under different crop growth stages and environmental conditions, the system promotes the generation of more coordinated and efficient nitrogen fertilizer application strategies by the four agents. The parameters of this auxiliary neural network are optimized synchronously with the agents' own policy networks (Actors) and / or value networks (Critics).
[0095] S4. Convergence Verification of Nitrogen Fertilizer Application Strategy Model The nitrogen fertilizer application strategy model during MARL training is periodically evaluated to determine whether the MARL training has converged and achieved the expected results. The optimal nitrogen fertilizer application strategy model is obtained once the MARL training converges. The strategy convergence verification process ensures that the optimal nitrogen fertilizer application strategy model meets the requirements of agronomic feasibility and technical stability. The implementation process is as follows: Design evaluation metrics: Using meteorological data that was not used in the training, dynamic simulation environments for various typical soil types (such as clay and sandy loam) were constructed, and the soil nitrogen content was randomly initialized to form an independent test dataset.
[0096] The evaluation metrics include simulated average crop yield or yield gain, simulated average nitrogen fertilizer use efficiency, simulated average total fertilization cost, and simulated average environmental impact metrics. Environmental impact metrics include, for example, simulated nitrogen leaching or runoff loss.
[0097] Set a baseline strategy for comparison, such as an expert-recommended fertilization strategy or a farmer-experienced fertilization strategy.
[0098] Evaluation and convergence analysis: After the preset training period ends, the nitrogen fertilizer application strategy model trained is run on an independent test dataset, and its performance on various evaluation indicators is recorded.
[0099] Set convergence criteria for the nitrogen fertilizer application strategy model. For example, the model can be considered converged when one or more of the following conditions are met: Specifically, when the fluctuations of various evaluation indicators are less than a preset threshold within a consecutive preset evaluation period, the nitrogen fertilizer application strategy model is judged to be of stable performance. In this embodiment, when the average crop yield variation coefficient of 10 consecutive evaluations is less than 5%, the nitrogen fertilizer application strategy model is judged to be of stable performance.
[0100] When the overall performance of the nitrogen fertilizer application strategy model on the independent test dataset improves below a preset threshold after continuous training, it is judged that the performance no longer improves significantly.
[0101] Overall performance is obtained by weighting the total score of evaluation metrics or by using the Pareto front of a specific evaluation metric.
[0102] When a nitrogen fertilizer application strategy model outperforms the baseline strategy on a certain evaluation metric, it is judged that the nitrogen fertilizer application strategy model performs better than the baseline.
[0103] If the nitrogen fertilizer application strategy model fails to converge, return to step S3 to continue training. If the nitrogen fertilizer application strategy model converges, output it as the optimal nitrogen fertilizer application strategy model. Quantify the improvement of the optimal nitrogen fertilizer application strategy model compared to the baseline strategy in various evaluation indicators. For example, calculate the percentage increase in yield, the improvement in nitrogen use efficiency, the percentage reduction in cost, and the degree of reduction in nitrogen loss risk.
[0104] S5. Generation of Nitrogen Fertilizer Management Plan The converged optimal nitrogen fertilizer application strategy model is transformed into an executable nitrogen fertilizer application scheme. The implementation process is as follows: First, real-time data on the current crop growth status, soil physicochemical properties, and immediate and short-term weather forecasts of the target area are acquired and used as state inputs to provide the loaded optimal nitrogen fertilizer application strategy model.
[0105] The policy network of each agent in the optimal nitrogen fertilizer application strategy model reasones based on the current state, makes parallel decisions on nitrogen fertilizer type, application dosage, application method and application timing and outputs action suggestions to form a complete structured nitrogen fertilizer application plan, which is encapsulated in JSON format.
[0106] The nitrogen fertilizer application plan and the real-time status of the target area are transmitted to the LLM (Limited Learning Model), generating a natural language explanation of the plan. This explanation elucidates the underlying agronomic principles, expected effects, and why the plan is considered appropriate under the current conditions. Simultaneously, based on the LLM knowledge base and a risk assessment of the current situation, the potential agronomic risks (such as the adaptability of specific fertilizers to specific varieties) or environmental risks (such as nutrient loss risks under extreme weather conditions) that may accompany the implementation of the nitrogen fertilizer application plan are identified, and corresponding management recommendations or precautions are provided.
[0107] By integrating nitrogen fertilizer application plans, natural language interpretation, and risk assessment, a comprehensive nitrogen fertilizer management plan is formed. This plan is provided to farm managers and agricultural technicians or transmitted to automated fertilization equipment through a user interface or API to guide or execute actual field nitrogen fertilizer application operations.
[0108] In one specific embodiment, the nitrogen fertilizer management plan comprises three parts: first, machine-readable structured instructions (JSON format) that clearly indicate the type of nitrogen fertilizer, application dosage, application method, and application timing; second, natural language explanations that describe the basis for the recommendations and expected effects, such as "The rice is currently in the early jointing stage, with moderate soil nitrogen content; it is recommended to apply 35 kg / ha of urea via drip irrigation to promote panicle differentiation"; and third, risk assessments that provide early warnings when extreme weather or abnormal soil conditions are predicted, such as suggesting adjustments to fertilization time during periods of high temperatures. For fields equipped with smart agricultural machinery, the nitrogen fertilizer management plan is distributed to variable-rate fertilization equipment for precise operation; for manually operated fields, a spatial distribution map containing fertilizer application amounts can be generated for farmers to view.
[0109] To enable continuous learning and iterative optimization of the system, this method also includes a tracking and feedback process for application effects. At the end of a growing season, the actual fertilizer efficiency data (such as final yield and nitrogen nutrient index) collected through continuous tracking can be used to evaluate the actual effectiveness of the nitrogen fertilizer management scheme adopted during that season. This validated measured data will then be added to the multi-source database of step S1 as new historical data or field trial data. In future optimization cycles, this new data can be used to recalibrate the crop growth-nitrogen cycle model of step S2, or to initiate a new MARL training based on richer data (step S3), thereby continuously improving the accuracy and adaptability of the nitrogen fertilizer application strategy model and forming a complete, self-optimizing smart agriculture management closed loop.
[0110] Through the above steps, this solution transforms complex, model-based intelligent decision-making into concrete, understandable, and risk-aware field management action guidelines. First, it enables collaborative decision-making based on real-time field data and predictive weather information. Second, it provides multimodal outputs that simultaneously meet the needs of automated machine execution and farmer comprehension. Finally, continuous data feedback ensures ongoing optimization of decisions, guaranteeing both the scientific nature of nitrogen fertilizer management and the applicability of the technical solution in actual agricultural production.
[0111] Example 1 In one specific embodiment, a three-year field trial (2020-2022) was conducted in the main rice-producing area of the lower Yangtze River. This region has a high degree of intensive rice production and faces the problem of excessive nitrogen fertilizer input and low utilization rate. This embodiment aims to achieve precise, efficient, and environmentally friendly management of nitrogen fertilizer for rice in this region by applying the crop nitrogen fertilizer management system and method of this invention. The specific process is as follows: Collect and preprocess data from multiple sources: (1) Field trial data: Nitrogen fertilizers include fast-acting nitrogen fertilizer urea (containing 46% N) and polymer-coated urea (release period of 60-90 days).
[0112] The application dosage included five nitrogen level gradients: 0 kg N / ha (N0, for control), 120 kg N / ha (N120), 180 kg N / ha (N180), 240 kg N / ha (N240) and 300 kg N / ha (N300, which is the overdose).
[0113] Application methods include: (a) surface application without covering with soil; (b) surface application followed by shallow mixing in conjunction with field management (leveling the field surface before transplanting); and (c) deep side application (applied 5-8 cm near the root layer).
[0114] The application timing is as follows: apply basal fertilizer one day before rice transplanting; apply tillering fertilizer about 10-12 days after transplanting; and apply panicle fertilizer at the early booting stage about 50-55 days after transplanting. The ratio of basal fertilizer to tillering fertilizer to panicle fertilizer is 4:3:3, 3:3:4, or 3:2:5.
[0115] The combination of nitrogen fertilizer type, dosage, application method and timing constituted 30 nitrogen fertilizer treatments, with the experimental area of each nitrogen fertilizer treatment ranging from 0.5 to 1 mu.
[0116] Phosphorus and potassium fertilizers for each treatment were applied as base fertilizers once before transplanting, with a concentration of 60 kg / ha for P2O5 and 90 kg / ha for K2O. The rice variety used was Nanjing 46, and the transplanting density was 20cm×20cm.
[0117] Plant height, tiller number, leaf area index (LAI), and biomass were measured every 7-15 days. Leaf samples were collected during tillering / jointing / heading stages, and plant nitrogen concentration (PNC) was determined by the Kjeldahl method, while the SPAD value of the leaves was measured simultaneously.
[0118] Specifically, throughout the rice growth period, destructive sampling and non-destructive observation were conducted every 7-15 days to measure and record plant height, as well as the number of tillers per unit area (within 60 days after transplanting) or the number of effective panicles. Aboveground plant samples were collected, and leaves, stems, and panicles were dried and weighed. The total aboveground biomass and its distribution in each organ were calculated, and the leaf area index (LAI) was measured using a leaf area meter. Key phenological stages for each treatment were recorded, including transplanting, greening-up, critical leaf age for effective tillering, jointing, booting, heading, flowering, grain-filling, and maturity stages. Developmental stages (DVS) were used for standardized quantification (transplanting was defined as 0, heading as 1.0, and physiological maturity as approximately 2.0). Plant (organ) and leaf samples were collected at the tillering, jointing, booting, heading, and maturity stages. Nitrogen concentration was determined using the Kjeldahl method, and plant nitrogen accumulation (PNA) was calculated based on the biomass. Meanwhile, during the corresponding period, the newly fully expanded leaves were measured using a handheld SPAD-502 chlorophyll meter, and the SPAD readings were recorded as a rapid and non-destructive estimation indicator of leaf chlorophyll content.
[0119] (2) Sensor data: Before the experiment and after rice harvest, soil samples were collected from the main root layer of rice at depths of 0cm-20cm and 20cm-40cm in the target area. Soil type (grandiose paddy soil), texture (ratio of silt, sand, and clay particles), and mineral nitrogen (ammonium nitrogen NH4) were analyzed. + -N and nitrate nitrogen NO3 -The study measured the content of nitrogen (N-N), organic matter (18.5 g / kg), pH (6.2), and basic nutrients such as total nitrogen, available phosphorus, and available potassium. Experimental areas with nitrogen application rates of 0 kg N / ha, 180 kg N / ha, and 300 kg N / ha were selected, and soil moisture sensors (TDR probes) were deployed to continuously monitor soil moisture content and temperature at different depths.
[0120] Set up small automatic weather stations within the target area or within 1 km of the target area, or obtain meteorological data from local standard weather stations, including daily maximum temperature, daily minimum temperature, daily average temperature, precipitation, sunshine hours (or total solar radiation), air temperature and humidity, and wind speed.
[0121] (3) Remote sensing data: During the peak tillering stage, jointing and booting stage, heading and flowering stage, and early grain-filling stage, select clear, cloudless weather with stable lighting conditions. Use a multi-rotor UAV equipped with a multispectral camera (including blue, green, red, red-edge, and near-infrared bands) and a high-resolution visible light (RGB) camera, flying at a constant speed at an altitude of 30-50 meters to collect field images. Radiometric calibration boards and ground control points (GCPs) are pre-deployed on the ground. Perform radiometric calibration (converting DN values to reflectance), atmospheric correction, geometric correction (based on GCPs), and image stitching on the acquired multispectral images to obtain processed remote sensing data.
[0122] Calculate various vegetation indices (VIs), such as the Normalized Difference Vegetation Index (NDVI) and the Normalized Red Edge Vegetation Index (NDRE). NDVI = (NIR – Red) / (NIR + Red), and NDRE = (NIR – RedEdge) / (NIR + RedEdge); NIR, Red, and RedEdge represent the reflectance of the near-infrared, red, and red-edge bands, respectively. Combine ground-based measured data (LAI, PNC, PNA, aboveground biomass, SPAD) collected synchronously during UAV flight, and use statistical regression models (such as Partial Least Squares Regression (PLSR) and Support Vector Regression (SVR)) or machine learning models (such as Random Forest (RF) and Gradient Boosting Machine (GBM)) to screen for vegetation index combinations sensitive to target parameters. Construct inversion models for key crop growth and nitrogen nutrition parameters such as LAI, PNC, PNA, canopy nitrogen concentration (CCC), and nitrogen nutrient index (NNI). Ensure that the coefficient of determination (R²) of the inversion model is greater than 0.75 and the root mean square error (RMSE) is within an acceptable range. Using the validated inversion model, a spatial distribution map of the target region is generated.
[0123] (4) Historical data: For surrounding promotion areas where no field trials have been conducted, relevant published scientific literature (including rice field trial data under similar ecological conditions in the area), historical meteorological records databases of local agricultural departments, soil survey databases (such as obtaining spatial distribution maps of soil type, texture, organic matter, etc.), and characteristic descriptions of local main rice varieties (such as growth period length, yield potential, etc.) are collected for model calibration of crop growth-nitrogen cycle models.
[0124] The collected multi-source data is preprocessed and stored in an agricultural database with a unified format and spatiotemporal reference.
[0125] Model calibration and dynamic simulation environment construction: The ORYZA (v3) model was selected as the crop growth-nitrogen cycle model for this embodiment. Multi-source data from the 2020 and 2021 growing seasons were used for model calibration, and multi-source data from the 2022 growing season were used for model evaluation.
[0126] Based on soil data, the key parameters most sensitive to rice growth, yield, and nitrogen response in the ORYZA model were identified, including: Variety genetic parameters: effective accumulated temperature required from transplanting to flowering (TSUM1), effective accumulated temperature required from flowering to maturity (TSUM2), photoperiod sensitivity coefficient (basic vegetative growth period), maximum specific leaf area, leaf area index decay coefficient, initial light energy utilization efficiency, parameters on the effect of CO2 concentration on photosynthesis, maintenance respiration coefficient, maximum nitrogen concentration in leaves, stems, and ears of grain, minimum nitrogen concentration, nitrogen redistribution efficiency coefficient from vegetative organs to grains, and maximum nitrogen absorption rate in roots. Soil parameters: field water holding capacity of 0cm-5cm soil layer, field water holding capacity of 5cm-15cm soil layer, field water holding capacity of 15cm-30cm soil layer, wilting point water content, saturated hydraulic conductivity, size of soil organic nitrogen pool and mineralization rate constant of each pool, nitrification rate constant, soil pH affecting ammonia volatilization, and soil texture affecting leaching.
[0127] In this embodiment, the organic matter content of the topsoil was 18.5 g / kg, and the initial rate constant of mineralizable nitrogen was calibrated to 0.005 d. -1 .
[0128] The dynamic simulation environment was set to simulate the initial water content and mineral nitrogen (NH4) of each soil layer on the starting day (transplanting day). + -N and NO3 -The content of nitrogen (LAI, aboveground biomass, organ nitrogen concentration, final yield, total nitrogen uptake, etc.) was determined, and the model was calibrated. Parameters were initially screened using the parameter sensitivity analysis tool built into the ORYZA model, and iterative optimization was performed using automated parameter optimization algorithms (such as Sequential Least Squares QP or Differential Evolutionary Algorithm (DE) implemented in the scipy.optimize library in Python). The objective function was to minimize the weighted root mean square error (RMSE) between the model's simulated values (LAI, aboveground biomass, organ nitrogen concentration, final yield, total nitrogen uptake, etc.) and the corresponding field measured values in the calibration set. Simultaneously, during key growth stages (tillering, jointing, and heading), the average values of the spatial distribution maps of LAI and PNC obtained from UAV inversion were used, and data assimilation methods such as ensemble Kalman filtering (EnKF) were employed to dynamically adjust the model's state variables and some sensitive parameters.
[0129] Using multi-source data acquired during the 2022 growing season, the ORYZA model after calibration was evaluated. The ORYZA model achieved a simulation R² of 0.88 and an nRMSE of 12.5% for the LAI (Lead Intake) of rice during the key growth period; a simulation R² of 0.91 and an nRMSE of 10.8% for aboveground biomass; a simulation R² of 0.85 and an nRMSE of 8.5% for final yield; and a simulation R² of 0.82 and an nRMSE of 11.2% for total nitrogen uptake per plant. As shown in Table 2, the evaluation indicators demonstrate that the model has high predictive accuracy and good generalization ability.
[0130] Table 2 Key parameters of the calibrated ORYZA model
[0131] A dynamic simulation environment is built based on the ORYZA model. It simulates the growth and development of rice from transplanting to maturity, carbon and nitrogen accumulation and distribution, and dynamic changes in soil nitrogen, according to the initial conditions of a specific field (including calibrated variety parameters, soil parameters, soil moisture and nitrogen status on the simulation start date, and planting information such as transplanting date and density) and the nitrogen fertilizer management decisions (fertilizer type, dosage, application method, and application time) output by the MARL agent during the simulation. This dynamic simulation environment is packaged according to the OpenAI Gym environment specification and provides standard API interfaces, including: `reset()`: Initializes a new simulated growing season. It accepts optional scene parameters (such as weather data for a specific year and initial soil conditions) and returns the initial state observation vector for that growing season. s 0; `step(action)`: Receives the joint fertilization action output by the MARL agent decision module 104, driving the ORYZA model to simulate for one time step (one day or until the next preset decision point, such as a critical growth period node). After simulation, it returns: the state observation vector for the next time step. s t+1 The base environment reward value calculated based on the current action effect. r env A Boolean value done It indicates whether the current growing season has ended, and provides optional additional debugging information. This dynamic simulation environment provides a core interactive platform for subsequent MARL training, enabling real-time feedback on the dynamic responses of crop and soil systems to different nitrogen fertilizer management strategies.
[0132] Collaborative reinforcement learning training: The state vector observed by the MARL agent at each decision time step (every 7 days after transplanting or at key decision nodes such as tillering stage, jointing stage, and booting stage). s t Includes the following information: Current number of days after transplanting (DAT), for example, 35 (days); Crop development stage (DVS), for example, 0.45 (peak tillering stage); Key weather forecast summary for the next 7 days: average temperature (e.g., 25°C), total rainfall (e.g., 10 mm), total effective radiation (e.g., 150 MJ / m²). Current average moisture content of the topsoil (0-20cm): for example, 0.30 (volume water content, m³ / m³). The current average mineral nitrogen content in the soil root layer (0-40cm) is, for example, 18 (kgN / ha). The current LAI simulated by the ORYZA model: for example, 3.2 (m² / m²); Current PNC or NNI simulated by the ORYZA model: for example, PNC=3.2% or NNI=0.9; Current total aboveground biomass simulated by the ORYZA model: for example, 3500 (kg / ha); Total pure nitrogen applied during this growing season: for example, 60 (kgN / ha); Specifically, the four agents make decisions separately: Nitrogen fertilizer type decision-making agent, TypeAgent: The action space is a discrete set {urea, polymer-coated urea}; Dosage decision intelligence, DoseAgent: Action space is a discrete set {0, 15, 30, 45, 60} kgN / ha; The application method decision-making agent, MethodAgent, has an action space of a discrete set {surface application, application followed by mixing, and deep application in the root zone}. The application time decision-making agent, TimeAgent, is defined in this embodiment by setting the decision point at key growth stages (such as the tillering fertilizer decision point or the heading fertilizer decision point). The action of the application time decision-making agent is simplified to a binary choice: {Immediately apply the planned fertilizer, or skip this fertilization opportunity}.
[0133] In this embodiment, the calculation of the reward value follows the two-step integration logic defined in the claims.
[0134] The dynamic simulation environment is based on the current state s t and joint actions a t Simulate the next state s t+1 Execute the action at each time step t. a t And transition to state s t+1 Subsequently, the basic environmental reward value calculated in the dynamic simulation environment. r env The following diagram reflects the direct agronomic and economic effects of fertilization in the simulated world. Its calculation formula is a multi-objective weighted function: r env =w yield ×R yield (s t ,a t ,s t+1 )+w NUE ×R NUE (s t ,a t ,s t+1 )–w cost ×C fert (a t )–w loss ×L N (s t ,a t ,st+1 ) ; Subsequently, in the knowledge-guided step, LLM will generate reward adjustment signals based on the current context. r adj . r env and r adj The final reward value is obtained by integrating the results and used for agent learning. r final The calculation formula is as follows: r final = r env +w LLM ×r adj ; in, R yield This is the yield benefit item, representing the difference between the final yield or current biomass increment and the zero-nitrogen control; R NUE This is the nitrogen use efficiency term, representing the difference between the crop nitrogen uptake in the current treatment and the control, divided by the nitrogen application rate in the current treatment. C fert The item for fertilizer cost indicates that the cost is calculated based on the type and dosage of nitrogen fertilizer applied. In this example, the price of urea is 2.5 yuan / kgN, and the price of coated urea is 4.0 yuan / kgN. L N The nitrogen loss risk term represents the penalty calculated based on the amount of ammonia volatilization and nitrate leaching simulated by the model. w yield , w NUE , w cost , w loss and w LLM These are configurable weights that reflect the relative importance of different objectives. In this embodiment, the weights are set... w yield =0.4, w NUE =0.25, w cost =0.15, w loss =0.1, w LLM =0.1.
[0135] A pre-trained large language model (LLM) fine-tuned using a comprehensive agricultural text corpus, such as DeepSeek-16B, was selected. Considering the specialized and regional characteristics of agricultural production, professional literature, technical manuals, research reports, and expert Q&A pairs related to high-yield and efficient rice cultivation, nitrogen management, soil and fertilizer, and plant nutrition in the lower Yangtze River region were used to perform parameter-efficient fine-tuning (PEFT) on the basic LLM. The goal of this fine-tuning was to enable the LLM to accurately understand the agronomical principles of rice growth, identify fertilization risks and opportunities in different situations, and generate guidance information that conforms to local agricultural practices. Simultaneously, a vector database containing localized agricultural technical knowledge was constructed and integrated with RAG technology, allowing the LLM to retrieve the latest or most relevant knowledge during runtime, enhancing the accuracy and timeliness of its guidance.
[0136] Specifically, knowledge guidance rules are set, and LLM is defined based on ( s t , a t , r env Generate reward adjustment signal r adj The rules are ultimately used to update the final reward value of the agent's policy network and / or value network. r final .
[0137] In a specific embodiment, the positive adjustment is as follows: If s t The data indicates that the rice is in its peak tillering stage (DVS approximately 0.35-0.5), the soil available nitrogen content is below 20 kg N / ha, the PNC is below 3.0%, and the weather forecast predicts sunny conditions for the next 3-5 days. At this time, if the intelligent agent... a t If the decision is to apply readily available nitrogen (urea) at 20-30 kg N / ha, then LLM determines that this action conforms to the agronomic principle of "promoting tillering during the critical period" and has low environmental risk, and outputs a positive reward adjustment value. r adj =+5. Negative adjustments such as: If s t The data indicates that the rice has entered the late milk stage (DVS>1.8), with less than 15 days until the predicted harvest. At this point, if the agent... a t If the decision is still made to apply any nitrogen fertilizer, the LLM will determine that this is ineffective or even harmful fertilization (prolonging maturity, increasing residue risk) and output a negative reward adjustment value. r adj = 10.
[0138] Define LLM according tos t Rules for generating hard or soft constraints include hard constraints (total control), such as: LLM real-time tracking of the total pure nitrogen applied during the current growing season. If the cumulative nitrogen application has reached 240 kg N / ha, and the local recommended upper limit for total nitrogen in rice is 270 kg N / ha, if the dosing agent proposes a nitrogen application exceeding 30 kg N / ha, LLM will generate a hard constraint to prevent this action and prompt the agent to reselect the dosage. Soft constraints (environmental risk avoidance), such as: if... s t If a heavy rain warning (>20mm) is issued within the next 24 hours, LLM will generate a strong negative preference for "surface application of quick-acting nitrogen fertilizer" (by applying an independent negative reward penalty to reduce the probability of this action being selected), guiding the agent to choose other application methods or postpone fertilization.
[0139] Specifically, in the constructed dynamic simulation environment, four decision-making agents are initialized. The policy network (Actor) and value network (Critic) of each agent are constructed using a multilayer perceptron (MLP) with two hidden layers and 128 neurons per layer, and the activation function is ReLU. The MAPPO (Multi-Agent Proximal Policy Optimization) algorithm is used for training, and the process is as follows: (1) Environment reset and initial state: At the beginning of each training round (episode, representing a complete rice growing season), env.reset() is called to obtain the initial state. s 0.
[0140] (2) Action selection and execution: at each decision time step t Each intelligent agent, according to its Actor network π i ( a i | o i () o i For intelligent agents i Local observations originate from the global state. s t The current valid action space (with hard constraints applied) provided by the LLM (based on the output of the previous time step) selects its respective action. a it These actions ( a type , a dose , a method , atime Together they constitute a joint action a t This joint action a t Input the dynamic simulation environment's env.step ( a t ).
[0141] (3) Environmental feedback: The environment returns to the next state. s t+1 Basic environment rewards r env and the end-of-round marker done .
[0142] (4) LLM bootstrapping: ( s t , a t , r env Input the configured LLM module to obtain the reward adjustment signal. r adj And dynamic decision constraints for use in the next time step.
[0143] (5) Calculation of final reward value: Based on the reward calculation logic defined above, the basic environment reward obtained in step (3) is calculated. r env The reward adjustment signal obtained in step (4) r adj Integrate to obtain the final reward value r final .
[0144] (6) Strategy Update: Update the experience tuple ( s t , a t , s t+1 , r final , done (or the local experience of each agent) o it , a it , r final , o i,t+1 , done The data is stored in the experience replay pool. Data is sampled from the pool, and the MAPPO algorithm is used to update the policy network (Actor) and value network (Critic) of all agents.
[0145] Learning-based collaborative weighting mechanism assists neural networks in adjusting to the global state. s t The dynamic weights of each agent's contribution are output. These weights are used by the value network to weight and aggregate the expected returns or advantage functions of each agent, thereby achieving effective credit allocation.
[0146] (7) Loop: Repeat steps 2-6 until the preset number of training rounds is reached or the performance of the nitrogen fertilizer application strategy model converges.
[0147] In one specific implementation, the learning rates for both the Actor and the Critic are set to 5 × 10⁻⁶. -5 Discount factor γ = 0.99, PPO cutting factor =0.2, GAE parameter λ=0.95.
[0148] The convergence determination of the nitrogen fertilizer application strategy model follows the principles described in S4 (Strategy Convergence Verification). Specifically, during training, the performance of the current nitrogen fertilizer application strategy model is periodically evaluated on an independent test dataset (e.g., every 1000 training rounds). The nitrogen fertilizer application strategy model is considered to have converged when the fluctuation of each evaluation metric or its weighted total score is less than a preset threshold over multiple consecutive evaluation periods (e.g., 10 consecutive evaluations), or when the improvement in its performance is less than another preset threshold.
[0149] Table 3 shows the definition of the intelligent agent in this embodiment.
[0150] Table 3 Definition of MARL Agent
[0151] Table 4 shows the MARL training convergence process in this embodiment.
[0152] Table 4 MARL Training Convergence Process
[0153] Policy convergence verification: After MARL training converged, the optimal nitrogen fertilizer application strategy model was obtained. To verify the final performance and generalization ability of the model, the nitrogen fertilizer application strategy model (i.e., the Actor network of four agents) was loaded into a dynamic simulation environment, and simulations were performed using three independent meteorological year data sets that were not involved in the training, with each year's simulation run 100 times.
[0154] The evaluation indicators include final grain yield (t / ha), nitrogen fertilizer partial productivity (PFPN, kg / kg), nitrogen fertilizer agronomic efficiency (AEN, kg / kg), nitrogen fertilizer recovery efficiency (REN, %), simulated nitrogen leaching (kgN / ha), simulated ammonia volatilization (kgN / ha), total nitrogen application (kgN / ha), nitrogen fertilizer cost (yuan / ha), and final net profit (yuan / ha, with the rice price set at 2.6 yuan / kg).
[0155] Set the baseline strategy for comparison as follows: (1) Zero nitrogen control (N0): No nitrogen fertilizer was applied throughout the entire growth period; (2) Farmers’ conventional practice (FP): Total nitrogen application rate is 280 kgN / ha, base fertilizer: tillering fertilizer: panicle fertilizer = 4:3:3, all of which is urea surface-spreading; (3) Optimized agricultural technology recommendation (OPT): Total nitrogen application rate 260 kg N / ha, base fertilizer (coated urea): tillering fertilizer (urea): panicle fertilizer (urea) = 4:2:4, combined with the principle of deep application and topdressing based on seedling condition.
[0156] Table 5 shows a performance comparison of different nitrogen fertilizer management strategies. Compared to conventional farmer practices, the optimal nitrogen fertilizer application strategy model in this embodiment significantly improved PFPN and REN, substantially reduced nitrogen leaching and ammonia volatilization, and decreased total nitrogen application by approximately 18% while slightly reducing yield, ultimately increasing net income by approximately 3.9%. Compared to optimized agricultural technology recommendations, the optimal nitrogen fertilizer application strategy model in this embodiment achieves a better balance in terms of yield, nitrogen use efficiency, environmental performance, and economic benefits. This indicates that the nitrogen fertilizer application strategy model trained by this invention has successfully learned a multi-objective optimized fertilization scheme.
[0157] Table 5 Performance of different nitrogen fertilizer management strategies
[0158] As shown in Table 6, the MARL strategy in this embodiment, compared with conventional farmer practices, significantly increased PFPN and REN while substantially reducing nitrogen leaching and ammonia volatilization, resulting in a total nitrogen application rate reduction of approximately 18% and a final net benefit increase of approximately 3.9%, despite a slight decrease in yield. Compared to optimized agronomic recommendations, the MARL strategy achieves a better balance in terms of yield, nitrogen use efficiency, environmental performance, and economic benefits. This indicates that the MARL strategy has successfully learned a multi-objective optimized fertilization program.
[0159] Nitrogen fertilizer management plan generation: In this embodiment, decision support for the next fertilization application needs to be provided for a rice paddy in the lower reaches of the Yangtze River. The current date is July 10, 2024, and the rice is in the transition stage from the late tillering stage to the jointing stage.
[0160] The validated nitrogen fertilizer application strategy model was deployed to the nitrogen fertilizer recommendation generation module running on the local farm management computer. The current status information of the field was obtained through the data acquisition module 101 and input into the deployed nitrogen fertilizer application strategy model: Days after transplanting (DAT) was 25 days; Crop development stage (DVS) was 0.55 (peak tillering stage); The average temperature of the past 5 days was 24.2°C; The weather forecast for the next 3 days was cloudy turning to light rain; The soil surface layer (0-20cm) water content was 85% field capacity (suitable); The ammonium nitrogen content in the soil root layer (0-20cm) was 8.5 mg / kg, and the nitrate nitrogen content was 4.2 mg / kg; The LAI estimated by UAV remote sensing was 1.8; The PNC was 3.0% (normal to low); The amount of nitrogen applied this season was 45 kg N / ha (all as basal fertilizer, coated urea).
[0161] The agent outputs the following decisions: nitrogen fertilizer type is urea, application rate is 20 kg N / ha, application method is surface application, and application timing is immediate (determining the current tillering fertilizer application window). These decisions collectively constitute a combined fertilization action. a t = (Type=Urea, Dose=20 kg N / ha, Method=Surface application, Time=Immediate application). The nitrogen fertilizer recommendation generation module 105 converts this scheme into JSON format, as shown in Table 6.
[0162] Table 6. Output of Simulated Nitrogen Fertilizer Recommendation Scheme
[0163] The recommended nitrogen fertilizer application plan and the real-time status of the target area are transmitted to the LLM (Liquid Management Model), generating a natural language explanation of the nitrogen fertilizer application plan. Based on the LLM knowledge base and a risk assessment of the current situation, the potential agronomic or environmental risks associated with implementing the plan are identified, and corresponding management recommendations or precautions are provided. The specific LLM output is as follows: Fertilization recommendations: (1) Timing of application: Rice is currently in the peak tillering stage, which is a critical period for building an effective number of tillers and achieving a sufficient number of panicles. It is relatively sensitive to nitrogen. Field monitoring data show that the available nitrogen in the soil is low and the nitrogen concentration in the crop leaves is at the lower limit of the normal range, indicating that nitrogen fertilizer needs to be supplemented in time to meet the growth needs during the tillering stage.
[0164] (2) Types and dosage of nitrogen fertilizer: It is recommended to apply 20 kg N / ha of pure nitrogen, with urea as the readily available nitrogen source, which can be quickly absorbed and utilized by crops to promote tillering. This dosage is an optimized result that balances the needs of crops, improves nitrogen use efficiency and controls environmental risks.
[0165] (3) Application method: Given that light rain is forecast for the future and the current soil moisture is suitable, it is recommended to use the surface application method, as rainwater helps the fertilizer to dissolve and infiltrate.
[0166] Risk assessment and recommendations: (1) Low to medium risk of ammonia volatilization. There is a certain risk of ammonia volatilization when urea is applied to the surface, but the expected rainfall and light rainfall will help carry the fertilizer into the soil and reduce this risk. If the rainfall does not arrive as expected or the rainfall is too light, it is recommended to keep a shallow water layer of 2-3 cm on the field surface for 3-5 days after fertilization.
[0167] (2) Low risk of leaching / runoff. The recommended dose is not large and the forecast is for light rain, so the risk of large-scale leaching or runoff is low.
[0168] (3) Recommendation: Ensure even application. If high temperatures (>32°C) persist for the next few days without effective rainfall, consider artificially adding a shallow water layer to reduce volatilization loss. Closely monitor weather changes; if the forecast rainfall increases (>25mm), consider delaying fertilization by 1-2 days.
[0169] Overall Recommendation: This nitrogen fertilizer management plan aims to precisely meet the nitrogen requirements of rice during the tillering stage to promote healthy growth. Under current conditions, environmental risks are manageable; therefore, it is recommended to implement the plan in conjunction with weather forecasts and actual field conditions. The invention and its embodiments have been described above illustratively. This description is not restrictive, and the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. The accompanying drawings are only one embodiment of the invention, and the actual structure is not limited thereto. No reference numerals in the claims should limit the scope of the claims. Therefore, if a person skilled in the art is inspired by this description and designs a similar structure and embodiment without departing from the spirit of the invention, such design should fall within the scope of protection of this patent. Furthermore, the word "comprising" does not exclude other elements or steps, and the word "a" preceding an element does not exclude the inclusion of "a plurality" of that element. Multiple elements stated in the product claims may also be implemented by a single element through software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any specific order.
Claims
1. A crop nitrogen management method based on multi-agent reinforcement learning, comprising the following steps: Step 1: Collect and pre-process multi-source data of the target area, including field test data, sensor data, remote sensing data and historical data; Step 2: Calibrate the crop growth-nitrogen cycle model based on the multi-source data, and build a dynamic simulation environment based on the calibrated crop growth-nitrogen cycle model; Step 3: Build a nitrogen application strategy model and a multi-objective reward function; the nitrogen application strategy model is composed of a nitrogen type decision-making agent, an application dose decision-making agent, an application method decision-making agent and an application time decision-making agent; Based on the constructed nitrogen application strategy model and multi-objective reward function, use the centralized training-decentralized execution architecture for agent reinforcement learning training; At the same time, introduce a large language model to dynamically generate reward adjustment signals and decision constraints, and update the policy network and / or value network of the nitrogen type decision-making agent, the application dose decision-making agent, the application method decision-making agent and the application time decision-making agent according to the reward adjustment signals and the decision constraints during the agent reinforcement learning training process, to realize the optimization of the strategy guided by agronomic knowledge; During the agent reinforcement learning training process, the nitrogen application strategy model is evaluated, and when the index fluctuation rate in the continuous evaluation period is less than the preset threshold, it is determined that the nitrogen application strategy model has converged, and the optimal nitrogen application strategy model is obtained; Step 4: Based on the optimal nitrogen application strategy model and combined with the real-time state data of the target area, generate a nitrogen application scheme, and at the same time generate a natural language explanation and a risk assessment report based on the large language model.
2. The crop nitrogen management method based on multi-agent reinforcement learning according to claim 1, wherein: The crop growth-nitrogen cycle model is selected according to the crop type and the target area, and contains a phenology development module, a photosynthesis and biomass accumulation module, a canopy development module, a nitrogen cycle module and an environmental response module, and has the ability to simulate the key growth stages of crops, photosynthetic product accumulation and distribution, canopy dynamic development, soil-crop system nitrogen cycle and response to environmental factors.
3. The crop nitrogen management method based on multi-agent reinforcement learning according to claim 1, wherein: The step of introducing a large language model to dynamically generate reward adjustment signals and decision constraints includes: Select a pre-trained large language model, and use retrieval enhancement generation technology to fine-tune the large language model using comprehensive text corpus in the agricultural field; Based on the fine-tuned large language model, design and configure its knowledge guidance logic in the agent reinforcement learning training process to realize the joint strategy optimization guided by agronomic knowledge; The knowledge guidance logic includes dynamic reward adjustment logic and decision constraint generation logic; the dynamic reward adjustment logic specifies that the large language model should generate what type and strength of reward adjustment signal under what combination of circumstances; the decision constraint generation logic specifies that the large language model should generate which hard constraints and soft constraints to limit the action space of the agent under different environmental conditions; The hard constraints are used to filter the inactionable set, and the soft constraints are used to impose independent penalty terms.
4. The crop nitrogen management method based on multi-agent reinforcement learning according to claim 1, wherein: The agent reinforcement learning training step comprises: Environment initialization and state observation: At the beginning of each crop growing season simulation, the reset() method is called to initialize the dynamic simulation environment to the set starting state and to obtain the initial environment state observation s t ; Multi-agent joint action selection and execution: each agent selects an action suggestion according to the current environment state s t Dispersed execution of learning strategies, respectively selecting action suggestions on corresponding decision dimensions and jointly constituting the joint fertilization action a of this time step t t and passed to the step(action) method; environment feedback and base reward acquisition: the dynamic simulation environment executes joint action a t , simulates the growth of crops and the dynamic change of soil nitrogen, and returns the environment state s of the next moment t+1 , the base environment reward value r calculated based on the preset multi-objective reward function env And the flag done indicating whether the current round is over; The reward adjustment and decision constraint application under the guidance of large language model knowledge: input the current environment state s t , the joint action a t executed by the agent and the basic environment reward r env to the large language model, perform reasoning according to the configured knowledge guidance logic and output the reward adjustment signal r adj and the dynamic decision constraint applied to the next decision step; integrate the basic environment reward r env and the current reward adjustment signal r adj to obtain the final reward value r final ; updating of agent policy and coordination mechanism: collecting experience samples (s t , a t , s t+1 , r final , done), under the CTDE framework, using multi-agent reinforcement learning algorithm to update the policy network and / or value network of each agent; According to the global state s t A dynamic weight of each agent contribution is generated for credit allocation and guiding the collaborative optimization of each agent strategy. Repeat the above steps until the agent reinforcement learning training converges.
5. The crop nitrogen management method based on multi-agent reinforcement learning according to claim 4, wherein: The final reward value is used to quantify and balance the key performance indicators in nitrogen management, and the final reward value is calculated at each time step t, denoted as: r final = w yield • R Yield_t + w nue • R NUE_t - w cost • C fert_t - w loss • L N_t + w LLM • r adj ; wherein r final represents the final reward value; R Yield_t represents the yield benefit reward; R NUE_t represents the nitrogen use efficiency reward; C fert_t represents the cost penalty; L N_t represents a nitrogen loss risk penalty; r adj represents a large language model adjustment term; w yield , w nue , w cost , w loss , w LLM are weight coefficients for each term.
6. The crop nitrogen management method based on multi-agent reinforcement learning according to claim 5, wherein: The step of judging whether the agent reinforcement learning training has converged comprises: constructing an independent test data set based on the data in the multi-source data that does not participate in the agent reinforcement learning training; running the nitrogen application strategy model on the independent test data set and recording the evaluation index data; when the evaluation indexes fluctuate less than a preset threshold in a continuous preset evaluation period, it is judged that the nitrogen application strategy model has converged; The evaluation indexes include simulated average crop yield or yield gain, simulated average nitrogen use efficiency, simulated average total cost of fertilization, and simulated average environmental impact indicators.
7. The crop nitrogen management method based on multi-agent reinforcement learning according to claim 1, wherein: The agent includes a nitrogen type decision agent, a dosage decision agent, an application method decision agent, and a time decision agent.
8. The crop nitrogen management method based on multi-agent reinforcement learning according to claim 1, wherein: The nitrogen management scheme includes machine-readable structured instructions for explicitly labeling nitrogen type, application dosage, application method, and application timing; natural language explanations for explaining the basis for the recommendation and the expected effect; and risk assessment for providing early warning when extreme weather or abnormal soil conditions are predicted.
9. A crop nitrogen management system based on multi-agent reinforcement learning, characterized in that, Comprise: A data acquisition module for acquiring multi-source data of a target area and preprocessing; A simulation environment module for receiving multi-source data preprocessed by the data acquisition module, and constructing a dynamic simulation environment based on a calibrated crop growth-nitrogen cycle model; A multi-agent reinforcement learning decision module for agent reinforcement learning training of a nitrogen application strategy model in the simulation environment module and outputting an optimal nitrogen application strategy model; A large language model knowledge guiding module for generating reward adjustment signals and decision constraints during agent reinforcement learning training to guide agent reinforcement learning training; A nitrogen recommendation generation module for calling the optimal nitrogen application strategy model and generating an executable nitrogen application scheme according to real-time state data of the target area.
10. The multi-agent reinforcement learning based crop nitrogen management system of claim 9, wherein, The nitrogen recommendation generation module is also used to transmit the executable nitrogen application scheme and the real-time state of the target area to the large language model knowledge guiding module to generate a natural language explanation and risk assessment of the nitrogen application scheme.
Citation Information
Patent Citations
Dynamic decision-making method and device for field irrigation and fertilization system
CN114662742A
Training method and device for water and fertilizer decision model of greenhouse
CN118586432A
Nitrogen fertilizer decision-making method and device for crops, electronic equipment and storage medium
CN119417135A
Agricultural planting decision-making method and system
CN119494746A
Crop planting management method and device, electronic equipment and storage medium
CN119784527A
Cited By
Insect situation monitoring method and device
CN121724223A
Rice fertilization decision-making method based on standard ratio vegetation index
CN121866954A
Intelligent optimization method for vegetative propagation of roots and stems of bluegrass based on big data
CN121980973A
A big data-based intelligent optimization method for asexual propagation of carex rhizomes
CN121980973B
