Artificial intelligence-based water and fertilizer integrated system future period water requirement prediction method
By using an AI-based integrated water and fertilizer system and employing event-driven decomposition and delayed memory branching prediction methods, the system addresses the issues of insufficient accuracy and lag in water demand prediction, thereby improving irrigation precision and water and fertilizer utilization efficiency and ensuring water supply security in high water demand scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WATER RESOURCES RES INST OF SHANDONG PROVINCE
- Filing Date
- 2026-05-07
- Publication Date
- 2026-06-05
AI Technical Summary
Existing methods for predicting water demand in integrated water and fertilizer systems struggle to distinguish between pulse-like abrupt changes caused by irrigation and fertilization events and background trends resulting from environmental factors. This makes it difficult for models to learn the true causal relationship between management behavior and water and salt status. Prediction results are easily affected by irrelevant fluctuations and lack explicit modeling of the continuous impact of irrigation events over time. Consequently, the prediction sensitivity is insufficient and cannot meet the asymmetric decision-making needs in actual production.
An AI-based approach is employed to decompose the causal response components and background fluctuation components of soil moisture, soil conductivity, and return fluid conductivity through event-driven decomposition. An improved gated cyclic unit prediction model is constructed by introducing a hydraulic delay buffer mechanism and an irrigation event delay memory branch. A risk bias loss function is designed to ensure water supply security in high water demand scenarios.
It has improved the accuracy of water demand forecasting and irrigation precision, enhanced water and fertilizer utilization efficiency, reduced the risk of yield reduction due to underestimation of water demand, and ensured water supply security during critical periods.
Smart Images

Figure CN122155041A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural water demand prediction technology, and in particular to a method for predicting the future water demand of an integrated water and fertilizer system based on artificial intelligence. Background Technology
[0002] Integrated water and fertilizer drip irrigation is a highly efficient agricultural technology that fully dissolves fertilizer and precisely mixes it with irrigation water, then delivers it directly to the crop root zone through drip irrigation. It can effectively save water resources and reduce fertilizer waste. In practice, the integrated water and fertilizer system needs to dynamically adjust irrigation and fertilization strategies according to the real-time water requirements of the crop. However, the crop water requirements are comprehensively affected by meteorological factors such as ambient temperature, humidity, and light intensity, as well as the water and salt status of the root zone, such as soil moisture, soil conductivity, and return liquid conductivity. Moreover, irrigation and fertilization events themselves have pulse characteristics, which can cause lag response and nonlinear changes in the root zone status.
[0003] The existing technology objectively has the following shortcomings: Existing methods typically input fertigation monitoring data directly into models as ordinary multivariate time series data, failing to distinguish between pulse-like abrupt changes caused by irrigation and fertilization events and background trends due to environmental factors. This makes it difficult for the models to learn the true causal relationship between management behavior and water and salt status, and the prediction results are easily affected by irrelevant fluctuations. Existing methods ignore the physical delay in the transport of return fluid conductivity values in the substrate, assuming that the return fluid collection points can respond instantly after fertilization or irrigation, causing a misalignment between the event time and the observation response time, weakening the indicative value of the return fluid signal for the water and salt transport status in the root zone. Existing prediction methods based on recurrent neural networks... Historical irrigation amounts are merely passed down point by point as ordinary input features over time, lacking explicit modeling of the sustained impact of a single irrigation event over time. The long-term promoting effect of irrigation is easily smoothed out or forgotten during the recursive process, resulting in insufficient sensitivity of water demand prediction to historical irrigation events. Existing methods generally use symmetric loss functions such as mean squared error for training, imposing the same penalty on underestimation predictions in high water demand scenarios and overestimation predictions in low water demand scenarios. This does not meet the asymmetric decision-making requirements in actual production where "the risk of water shortage is far greater than the risk of over-irrigation." In practical applications, the models tend to give conservative or even low water demand estimates.
[0004] Therefore, this invention proposes an artificial intelligence-based method for predicting the future water demand of an integrated water and fertilizer system to solve the above problems. Summary of the Invention
[0005] This invention addresses the shortcomings of existing technologies by proposing an artificial intelligence-based method for predicting future water demand in an integrated water and fertilizer system. This invention can solve the problems of insufficient accuracy and lag in water demand prediction under water and fertilizer coupling, thereby improving irrigation precision and water and fertilizer utilization efficiency.
[0006] The technical solution of this invention is a method for predicting the future water demand of an integrated water and fertilizer system based on artificial intelligence, comprising the following steps: S1. Read the original features from the water and fertilizer integration system at fixed sampling intervals to construct samples, and then process them to form the original monitoring feature tensor. Construct a corresponding supervision label for each sample, and save the crop growth stage sequence and sample time index corresponding to each sample. S2. Based on the original monitoring feature tensor, perform event-driven decomposition of the water and fertilizer coupled multidimensional feature vector, perform causal decomposition on the key state vectors corresponding to irrigation and fertilization events, and then perform robust normalization according to the crop growth stage to expand the dimension of the original monitoring feature tensor and obtain the preprocessed feature tensor. S3. Construct a prediction model. In addition to the gated recurrent unit, construct a delayed memory branch for irrigation events in parallel. Expand each irrigation event into a continuous contribution over multiple future time steps. Then, fuse it with the preprocessed feature vector to output the predicted water demand for the future target period and train the prediction model. S4. Deploy the trained model into the integrated water and fertilizer control system to predict the water demand for the target period in the future.
[0007] S1 is as follows: The original features used to construct the original monitoring feature tensor include ambient temperature, ambient humidity, light intensity, soil moisture, soil electrical conductivity, return liquid electrical conductivity, historical irrigation amount, historical fertilizer injection amount, and crop growth stage coding. Timestamp alignment and missing data repair are performed on the original sampled data. First, a timeline is established according to the unified sampling time. Then, the data from each sensor and the controller log are mapped to the same timeline. When the missing time of a certain feature does not exceed two consecutive time steps, linear interpolation is used to fill in the missing time. When the missing time of consecutive time steps exceeds two consecutive time steps, the corresponding time period is directly discarded and does not participate in the sample construction. Next, a sliding time window is used to construct the original monitoring feature tensor, assuming the total number of training samples is... The length of the historical time window is The target time period in the future is , for the Samples, take consecutive The original monitoring feature matrix is composed of the 9-dimensional original features of each time step. All samples are stacked according to the sample dimensions to obtain the original monitoring feature tensor. For each sample, a label representing the water demand for the future target period is constructed as the corresponding supervision label, indicating the future water demand after that historical time window. The actual total water demand within a given time step.
[0008] S2 is as follows: S2.1. Using non-zero moments in historical irrigation data, reconstruct the causal response component of soil moisture and the background fluctuation component of soil moisture. S2.2 Decompose the soil electrical conductivity value into the causal response component of the soil electrical conductivity value and the background fluctuation component of the soil electrical conductivity value; S2.3. Based on the causal decomposition of soil conductivity values, a fixed delay buffer mechanism is introduced to perform delayed two-event decomposition on the return liquid conductivity values to obtain the causal response component and the background fluctuation component of the return liquid conductivity values. S2.4. Statistically calculate robust centers and robust scales according to crop growth stages, and then perform growth stage adaptive robust normalization on continuous features to obtain preprocessed feature tensors.
[0009] S2.1 is as follows: All irrigation event times are extracted from the historical irrigation volume sequence of each sample. A minimum event threshold is set, and an irrigation event is recorded when the historical irrigation volume exceeds the minimum event threshold. Then, a soil moisture decay time constant and a soil moisture response gain are preset for each crop growth stage. The soil moisture decay time constant is the duration of the impact of irrigation events on soil moisture at different growth stages, and the soil moisture response gain is the contribution of a unit irrigation volume to the increase in soil moisture at different growth stages. Next, the causal response component of soil moisture is calculated recursively in chronological order, and then the causal response component of soil moisture is subtracted from the original soil moisture sequence to obtain the background fluctuation component of soil moisture.
[0010] S2.2 is as follows: A recursive sequence of soil electrical conductivity salinity input response components is established. The original features in the original monitoring feature tensor also include historical fertilizer injection amounts. The fertilizer decay time constant and fertilizer response gain are preset and recursively calculated in chronological order. The soil electrical conductivity salinity input response component at the current time step is equal to the sum of the residual response decayed at the previous time step and the newly added fertilizer input response at the current time step. The net salinity response formed by the combined effects of fertilization and irrigation leaching yields the causal response component of soil electrical conductivity. The causal response component of soil electrical conductivity is then subtracted from the original soil electrical conductivity sequence to obtain the background fluctuation component of soil electrical conductivity.
[0011] S2.3 is as follows: Preset hydraulic delay steps Preset hydraulic delay steps To determine the time step delay between the occurrence of an irrigation or fertilization event and the start of a clearly observable event response at the return liquid collection point, a length of [length missing] was established for the historical fertilizer injection volume sequence and the historical irrigation volume sequence, respectively. A first-in-first-out (FIFO) delayed buffer queue is used. For each sample at each time step, if a new historical fertilizer injection amount exists, it is written to the fertilizer delayed buffer queue first; if a new historical irrigation amount exists, it is written to the irrigation delayed buffer queue first. When the queue length reaches [a certain threshold], [the process continues]. Then, the earliest value that entered the queue is taken out as the delayed historical fertilizer injection amount and delayed historical irrigation amount after the actual arrival of the return liquid collection point at the current time step; The salinity input response component of the return liquid conductivity value was constructed using the delayed historical fertilizer injection volume, and the leaching and dilution response component of the return liquid conductivity value was constructed using the delayed historical irrigation volume. The causal response component and the background fluctuation component of the return liquid conductivity value were calculated. The causal response component of the return liquid conductivity value is the net salinity response formed by the combined effect of delayed fertilization salt increase and irrigation leaching, and the background fluctuation component of the return liquid conductivity value is the background fluctuation part of the return liquid conductivity value that cannot be explained by the causal component.
[0012] S2.4 is as follows: The augmented feature matrix is assembled for each sample in chronological order, expanding the dimension of the input sample data from 9 to 12. Soil moisture, soil electrical conductivity, and reflux conductivity are decomposed into soil moisture causal response component, soil moisture background fluctuation component, soil electrical conductivity causal response component, soil electrical conductivity background fluctuation component, reflux conductivity causal response component, and reflux conductivity background fluctuation component. Then, robust centers and robust scales of each continuous feature dimension are calculated according to the crop growth stage. Adaptive robust normalization of the growth stage is performed on the first 11 continuous features. The last dimension of discrete semantic information, crop growth stage encoding, is directly concatenated after the normalized first 11 continuous features. Finally, the normalization results of all samples are stacked according to the sample dimensions to form a preprocessed feature tensor.
[0013] S3 is as follows: S3.1 Extract the irrigation event context of each irrigation event that occurs within the historical time window, and then transform it into a set of time-shifted impulse response weight sequences that change over time. All irrigation event moments are extracted from the historical time window of each sample. A minimum event threshold for historical irrigation volume is set. If the historical irrigation volume at each time step is greater than the minimum event threshold, it is recorded as an irrigation event moment. Then, the irrigation event context input is extracted for each irrigation event moment. The ambient temperature, ambient humidity, light intensity, historical irrigation volume, and crop growth stage code at that moment are read. The crop growth stage code is mapped to a low-dimensional dense vector through a trainable crop growth stage embedding matrix. This vector is then concatenated with the ambient temperature, ambient humidity, light intensity, and historical irrigation volume to form the irrigation event context vector. The irrigation event context vector is then input into a small parameter generation network, which outputs the response amplitude, response start delay, and decay rate corresponding to the current irrigation event. The small parameter generation network adopts a 2-layer fully connected structure. Finally, a time-shifted impulse response weight sequence is constructed based on the response amplitude, response start delay, and decay rate. S3.2 Expand the time-shifted impulse response weight sequence of each irrigation event on the time axis and aggregate it into an irrigation event memory vector at each time step; Define a trainable irrigation quantity basis vector. For each irrigation event at each time step, multiply the historical irrigation quantity of the event with the trainable irrigation quantity basis vector to obtain the event embedding vector. Then, establish an event response cache. Then, directly sum the contribution vectors from all irrigation events at the same time step to obtain the total event response vector for that time step. Obtain the corresponding event response cache and then map it to the hidden state space of the gated recurrent unit through linear projection to obtain the irrigation event memory vector. S3.3. The preprocessed feature vector and the irrigation event memory vector are fused at each time step and input into the improved gated recurrent unit. The historical information is selectively retained and updated through the gating mechanism, and finally the hidden state of the last time step is mapped to the predicted value of future water demand. For each time step within the historical time window of each sample, the preprocessed feature vector and irrigation event memory vector are read. The preprocessed feature vector and irrigation event memory vector are input together into the improved gated recurrent unit. All time steps are traversed from front to back along the time axis to obtain the hidden state sequence corresponding to the entire historical time window. The initial hidden state is set as an all-zero vector or a trainable initial vector. The hidden state of the last time step is taken as the comprehensive representation of the entire historical time window and input into the regressor to output the predicted water demand value for the future target period.
[0014] S3.4. Based on the predicted future water demand and the supervision label, calculate the risk bias loss for each sample, and then use the Adam optimizer to perform end-to-end joint training on all trainable parameters, save the optimal model parameters, and obtain the trained model.
[0015] The effects described in the invention are merely those of the embodiments, and not all the effects of the invention. The above technical solutions have the following advantages or beneficial effects: This invention discloses an artificial intelligence-based method for predicting future water demand in an integrated water and fertilizer system. It proposes an event-driven causal decomposition method, which decomposes three key state sequences—soil moisture, soil conductivity, and return fluid conductivity—into causal response components and background fluctuation components. This isolates the direct impact of irrigation and fertilization events on water and salt conditions from natural fluctuations such as environmental evapotranspiration and substrate buffering, providing physically interpretable input features for the prediction model. Furthermore, a hydraulic delay buffering mechanism is introduced for the return fluid conductivity value. A first-in, first-out queue is used to simulate the transmission delay of nutrient solution migrating from the root zone to the return fluid collection point, ensuring accurate alignment of the return fluid signal with irrigation and fertilization events on the timeline. To avoid causal misalignment caused by response lag, a prediction architecture is constructed that integrates delayed memory branches for irrigation events with gated recurrent units. Each irrigation event generates an independent time-shifted impulse response weight sequence according to its context, encoding the differentiated impact of irrigation on future water demand throughout the entire process of delayed onset, continuous enhancement, and gradual decay. This addresses the problem of insufficient modeling capability of ordinary recurrent networks for long-range event dependencies. A risk-biased loss function is designed, applying graded weighted penalties to the squared error based on whether the sample belongs to a high water demand scenario and whether the prediction underestimates the demand. This ensures that the model prioritizes water supply security during critical stages such as high temperature and strong light or peak fruiting periods, reducing the risk of yield reduction due to underestimation of water demand. Attached Figure Description
[0016] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.
[0017] Figure 1 This is a schematic diagram of the method flow of the present invention.
[0018] Figure 2 The original monitoring characteristics time series diagrams are shown in Figure (a), which is the environmental temperature time series diagram, Figure (b) is the environmental humidity time series diagram, Figure (c) is the light intensity time series diagram, Figure (d) is the soil moisture time series diagram, Figure (e) is the soil EC time series diagram, and Figure (f) is the return liquid EC time series diagram.
[0019] Figure 3 Figure 1 shows the pulse sequence diagrams of irrigation and fertilization events. Figure 2 shows the pulse sequence diagram of historical irrigation events, and Figure 3 shows the pulse sequence diagram of historical fertilizer injection events.
[0020] Figure 4Figure 1 shows the results of the soil moisture event-driven decomposition. Figure 2 shows the original soil sequence, Figure 3 shows the soil moisture causal response component, and Figure 4 shows the soil moisture background fluctuation component.
[0021] Figure 5 To analyze the delayed decomposition results of the return liquid conductivity, Figure (a) shows the original return liquid conductivity value, Figure (b) shows the causal response component of the return liquid conductivity, and Figure (c) shows the background fluctuation component of the return liquid conductivity. Detailed Implementation
[0022] To clearly illustrate the technical features of this solution, the invention will be described in detail below through specific implementation methods and in conjunction with the accompanying drawings.
[0023] like Figure 1 As shown, a method for predicting the future water demand of an integrated water and fertilizer system based on artificial intelligence includes the following steps: S1. Read the original features from the water and fertilizer integration system at fixed sampling intervals to construct samples, and then process them to form the original monitoring feature tensor. Construct a corresponding supervision label for each sample, and save the crop growth stage sequence and sample time index corresponding to each sample. S2. Based on the original monitoring feature tensor, perform event-driven decomposition of the water and fertilizer coupled multidimensional feature vector, perform causal decomposition on the key state vectors corresponding to irrigation and fertilization events, and then perform robust normalization according to the crop growth stage to expand the dimension of the original monitoring feature tensor and obtain the preprocessed feature tensor. S3. Construct a prediction model. In addition to the gated recurrent unit, construct a delayed memory branch for irrigation events in parallel. Expand each irrigation event into a continuous contribution over multiple future time steps. Then, fuse it with the preprocessed feature vector to output the predicted water demand for the future target period and train the prediction model. S4. Deploy the trained model into the integrated water and fertilizer control system to predict the water demand for the target period in the future.
[0024] In a specific implementation, the process of collecting historical monitoring data and constructing regression samples for fertigation in step S1 is as follows: The monitoring data collected by the integrated water and fertilizer system includes environmental variables, root zone state variables, and human management event variables. Among them, historical irrigation volume and historical fertilizer injection volume exhibit obvious impulse characteristics, while soil moisture, soil conductivity, and return fluid conductivity values show delayed responses to impulse events. This step first constructs a unified format of the original monitoring feature tensor, and then constructs labels for the water demand in the future target time period, which serve as inputs for subsequent preprocessing and model training. The specific steps are as follows: 1) Nine types of original features were read from the water and fertilizer integration system at fixed sampling intervals. The nine types of original features are as follows: ambient temperature, ambient humidity, light intensity, soil moisture, soil electrical conductivity value, return liquid electrical conductivity value, historical irrigation amount, historical fertilizer solution injection amount, and crop growth stage code. The units for each feature are as follows: ambient temperature is in degrees Celsius (°C), ambient humidity is in relative humidity percentage (%RH), light intensity is in lux, soil moisture is in volumetric water content (%), soil electrical conductivity is in millisiemens per centimeter (mS / cm), return liquid electrical conductivity is in millisiemens per centimeter (mS / cm), historical irrigation volume is in liters (L), historical fertilizer injection volume is in liters (L), and the unit for crop growth stage coding is a dimensionless integer, with values of 1, 2, 3, etc.
[0025] The sampling interval is denoted as , This represents the time difference between two adjacent samples, in a convenient implementation manner. You can take 1 hour.
[0026] 2) Perform timestamp alignment and missing data repair on the original sampled data. Since short-term missing data is usually caused by communication jitter, linear interpolation can maintain temporal continuity; long-term missing data often means that the observations during that period are unreliable, and continuing to retain them would interfere with subsequent event decomposition. Therefore, In the specific implementation, a time axis is first established according to a unified sampling time, and then the data from each sensor and the controller log are mapped to the same time axis. When the missing time length of a certain feature does not exceed two consecutive time steps, linear interpolation is used to fill in the missing time. When the missing time length exceeds two consecutive time steps, the corresponding time period is directly discarded and does not participate in the sample construction.
[0027] Assuming sampling interval The original time series is shown in Table 1, with hours as shown. Table 1 Original Time Series Table At this point, the consecutive missing time steps are 3 (10:00, 11:00, 12:00), exceeding the 2-step threshold. Therefore, the entire 10:00–12:00 time period is discarded and not used to construct any samples. If only 10:00 is missing, it is filled in using linear interpolation of 09:00 and 11:00.
[0028] 3) Construct the original monitoring feature tensor using a sliding time window. Let the total number of training samples be... The length of the historical time window is The target time period in the future is For the first Samples, take consecutive The original monitoring feature matrix is composed of 9-dimensional original features at each time step. , dimension , Indicates the first The original input is the historical time window of each sample. All samples are stacked according to their sample dimensions to obtain the original monitoring feature tensor. , dimension .
[0029] 4) Construct a label for the water demand during the future target period. The water demand during the future target period is denoted as... , Indicates the first The supervision labels corresponding to each sample are used to characterize the future after this historical time window. The actual total water demand within a given time step.
[0030] In one implementation, Directly obtain the future The cumulative value of actual irrigation volume at each time step, i.e., taking the "total amount of actual water replenishment in the future period" as the prediction target; when there are manual correction rules in the system, the corrected executed irrigation volume can also be used as... This is to make the model output more closely match actual control requirements.
[0031] 5) Save the crop growth stage sequence and sample time index for each sample, which will be used for subsequent statistical normalization of parameters by crop growth stage. The total number of crop growth stages is denoted as... , This indicates the number of crop growth stage categories. In one implementation, Three can be chosen, with the three crop growth stages corresponding to the seedling stage, flowering and fruit setting stage, and peak fruiting stage, respectively. The crop growth stage codes can be 1, 2, and 3 respectively.
[0032] like Figure 2 As shown, the original multivariate time series (partial features) is analyzed, and the curves of the changes of six main original features collected from the water and fertilizer integration system at fixed sampling intervals (1 hour) over time are displayed. These features include ambient temperature (°C), ambient humidity (%RH), light intensity (lux), soil moisture (%), soil electrical conductivity (mS / cm), and return liquid electrical conductivity (mS / cm). Figure 2 The experiment revealed diurnal fluctuations, random disturbances, and local jumps caused by irrigation and fertilization events in the variables. The results showed that the original monitoring data exhibited a clear overlap of background trends and event-driven mutations, making it difficult for the model to distinguish between the causal effects of irrigation and fertilization and natural fluctuations simply by relying on the original sequence input. The horizontal axis represents the time step (hours), and the vertical axis represents the unit corresponding to each physical quantity.
[0033] In a specific implementation, the event-driven decomposition and growth stage adaptive normalization operation of the water-fertilizer coupled multidimensional feature vector in step S2 are as follows: The original time series data in the fertigation system simultaneously includes impulse events, delayed responses, and differences in growth stages. Directly normalizing the original monitoring feature tensors can easily mask the true causal effects of irrigation and fertilization within background fluctuations, and can also misjudge normal differences at different crop growth stages as abnormal changes. This step first performs causal decomposition on key state variables around irrigation and fertilization events, then performs robust normalization according to crop growth stages, and finally expands the original 9-dimensional input into a 12-dimensional preprocessed input. The specific steps are as follows: S2.1 Decomposition of Soil Moisture Causal Response Driven by Irrigation Pulse Soil moisture is influenced by both environmental evapotranspiration and directly driven by irrigation events. If only the raw soil moisture sequence is input, the model struggles to distinguish between "moisture increase caused by irrigation" and "background fluctuations caused by climate change." This step utilizes non-zero moments from historical irrigation data to reconstruct the causal response components and background fluctuation components of soil moisture. The specific steps are as follows: 1) From the first Extract all irrigation event times from the historical irrigation volume sequence of each sample.
[0034] No. The first sample The historical irrigation volume at each time step is recorded as follows: ,in, Indicates the first The sample at the th The irrigation amount recorded at each time step. When it is greater than 0, it is considered that the first... An irrigation event occurs at a specific time step.
[0035] In practical implementation, to avoid extremely small flow noise being misidentified as irrigation events, a minimum event threshold can also be set, for example, when... An irrigation event is only recorded when the water level rises.
[0036] 2) Preset the soil moisture decay time constant and soil moisture response gain for each crop growth stage.
[0037] The soil moisture decay time constant is denoted as , Indicates crop growth stage The duration of the impact of irrigation events on soil moisture; Soil moisture response gain is denoted as , Indicates crop growth stage The contribution of a unit irrigation volume to the increase in soil moisture.
[0038] In one implementation, when the crop growth stages are coded as 1, 2, and 3, , , 24, 16, and 8 time steps can be selected respectively. , , You can take values of 1.0, 0.8, and 0.6 respectively.
[0039] 3) Calculate the causal response components of soil moisture in chronological order.
[0040] No. The first sample The soil moisture causal response components at each time step are denoted as follows: , This indicates the net humidity increase effect that is continuously transmitted from historical irrigation events to the current time step.
[0041] The crop growth stage at the current time step is coded as follows: ,according to Read from the parameter table and Then, the soil moisture causal response component from the previous time step is attenuated by an attenuation coefficient and superimposed with the new response introduced by the current irrigation event, which is expressed as: ; in, Indicates the first The first sample The causal response components of soil moisture at each time step; Indicates crop growth stage The contribution of a unit irrigation volume to the increase in soil moisture; Indicates the first The first sample Soil moisture decay coefficient corresponding to each time step It can be calculated from the soil moisture decay time constant corresponding to the current crop growth stage, for example, it can be taken as... Initial moment The soil moisture causal response component can be directly initialized as It can also be initialized to 0.
[0042] If the crop growth stage at a certain time step is coded as 2, then by looking up the table... , If the soil moisture causal response component at the previous time step is 12, and the historical irrigation amount at the current time step is 5, then the attenuation coefficient is approximately... The soil moisture causal response component at the current time step is approximately .
[0043] 4) Subtract the causal response component of soil moisture from the original soil moisture sequence to obtain the background fluctuation component of soil moisture. The first sample The original soil moisture value at each time step is denoted as The background fluctuation component of soil moisture is denoted as Then there is .
[0044] In practice, if the subtraction result exceeds the reasonable range of the same crop growth stage in the training set, the result can be truncated at the quantile, for example, limited to between the 1st quantile and the 99th quantile, to improve the ability to resist extreme values.
[0045] It should be noted that in order to separate the "humidity changes directly caused by irrigation" from the "background fluctuations caused by environmental changes", this step is not a simple smoothing or filtering, but rather a reconstruction of the causal response components of soil moisture with irrigation events as the trigger point. Based on this, the subsequent model can more directly learn the real chain of interaction between irrigation events and future water demand.
[0046] S2.2, Causal Response Decomposition of Soil Conductivity Values Driven by Two Events Soil electrical conductivity is affected by two types of management events: salt input due to historical fertilizer injection and leaching dilution due to historical irrigation. If only the raw soil electrical conductivity value is directly input into the prediction model, the model cannot determine whether the current increase in conductivity is due to fertilization or insufficient irrigation. This step decomposes the soil electrical conductivity value into a causal response component and a background fluctuation component. The specific steps are as follows: 1) Establish a recursive sequence of soil electrical conductivity values and salinity input response components.
[0047] No. The first sample The historical fertilizer injection volume at each time step is recorded as follows: The soil electrical conductivity value and salinity input response component are denoted as... .
[0048] In the actual implementation, the fertilizer solution decay time constant is preset first. and fertilizer solution response gain ,in, This indicates the duration over which the salt content of the fertilizer solution gradually decreases in the root zone. This represents the coefficient that expresses the increase in soil electrical conductivity based on the unit amount of fertilizer solution injected. 48 time steps can be taken. We can take 0.3. Then, we recursively calculate the soil conductivity value and salinity input response component at the current time step. The salinity input response component at the current time step is equal to the sum of the decayed residual response at the previous time step and the newly added fertilizer solution input response at the current time step.
[0049] Let the fertilizer solution decay time constant be... Fertilizer solution response gain attenuation coefficient If the salt input response component of the previous time step... Current time step fertilizer injection volume The current salt input response component is .
[0050] 2) Establish a recursive sequence of the leaching and dilution response components of soil electrical conductivity values, denoted as [the recursive sequence is missing from the original text]. .
[0051] In the actual implementation, the rinsing decay time constant is preset first. and rinsing response gain ,in, This indicates the duration of the impact of irrigation leaching in the subsequent time period. This represents the coefficient indicating the decrease in soil electrical conductivity value per unit irrigation volume. Among them, You can take 12 time steps. We can take 0.05. Then, we recursively calculate the soil conductivity value at the current time step, where the leaching and dilution response component is equal to the sum of the decayed residual leaching response from the previous time step and the newly added irrigation leaching response at the current time step.
[0052] Let the rinsing decay time constant be defined. rinsing response gain attenuation coefficient If the previous time step rinsing response component Current irrigation amount at current time step The current rinsing response component is .
[0053] 3) Calculate the causal response components of soil electrical conductivity values.
[0054] In practical implementation, the causal response component of soil electrical conductivity is denoted as... ,in, Indicates the first The first sample The net salinity response at each time step, resulting from the combined effects of fertilization-induced salinization and irrigation-leaching, is calculated as follows: .
[0055] It should be noted that constructing the data separately and then performing the difference calculation, instead of directly writing the two types of events into a single mixed formula, makes the engineering implementation clearer and facilitates the separate analysis of the individual effects of fertilization and irrigation.
[0056] In one embodiment, following the previous example, , Then the causal response component of soil electrical conductivity is .
[0057] 4) Subtract the causal response component of the soil conductivity value from the original soil conductivity value sequence to obtain the background fluctuation component of the soil conductivity value.
[0058] In specific implementation, the first The first sample The original soil electrical conductivity value at each time step is denoted as The background fluctuation component of soil electrical conductivity is denoted as Then there is .
[0059] If the original soil electrical conductivity value causal response components Then the background fluctuation component of soil electrical conductivity is .
[0060] It should be noted that this step separates the two opposing driving factors, "fertilization and salt increase" and "irrigation and leaching," to prevent the model from conflating changes in conductivity values with those in opposite directions. This allows the prediction model to more accurately distinguish between the two scenarios: "water replenishment is still required after salt input" and "conductivity value increases but is mainly caused by insufficient leaching."
[0061] S2.3, Causal response decomposition of the return conductivity value of the delay buffer. The return fluid conductivity value does not change immediately after fertilization or irrigation; rather, it requires a transmission process of "nutrient solution passing through the substrate and reaching the return fluid collection point." If this transmission delay is ignored, the temporal correspondence between the return fluid conductivity value and historical irrigation and fertilization volumes will be misaligned. This step introduces a fixed-delay buffer mechanism based on the causal decomposition of soil conductivity values to perform a delayed two-event decomposition of the return fluid conductivity value. The specific steps are as follows: 1) Preset hydraulic delay steps , This indicates the time step delay between the occurrence of an irrigation or fertilization event and the point at which a noticeable event response is observed at the return liquid collection point.
[0062] In one implementation, if the sampling interval is 1 hour, then You can choose 3 or 4, which means that the impact of the corresponding event will begin to be reflected at the liquid collection point after about 3 or 4 hours.
[0063] 2) Establish a sequence with a length of [length missing] for the historical fertilizer injection volume sequence and the historical irrigation volume sequence, respectively. A first-in, first-out delayed buffer queue. Specifically, for the first... The first sample At this time step, if there is a new historical fertilizer injection volume If a new historical irrigation volume exists, it should first be written to the fertilizer solution delay buffer queue; otherwise, it should be written to the fertilizer solution delay buffer queue. If the value is not specified, it will be written to the irrigation delay buffer queue first. When the queue length reaches [a certain value], it will be written to the queue. Then, the earliest value that entered the queue is taken out as the delayed historical fertilizer injection amount and delayed historical irrigation amount after the actual arrival of the return liquid collection point at the current time step.
[0064] like If the fertilizer liquid event amount 2.0 is written in the 5th time step, then this 2.0 will not be used immediately for the calculation of the return liquid conductivity value, but will be output from the tail of the delay buffer queue in the 8th time step as the delayed historical fertilizer liquid injection amount in the 8th time step.
[0065] 3) Construct the return liquid conductivity value and salinity input response component using the delayed historical fertilizer injection volume, and construct the return liquid conductivity value and leaching / dilution response component using the delayed historical irrigation volume. Specifically, the return liquid conductivity value and salinity input response component are denoted as... The elution dilution response component of the return liquid conductivity value is denoted as... The recursive method is the same as step S202, but the parameters are set separately to adapt to the smoother and more delayed response characteristics of the return fluid collection point compared to the soil measurement point.
[0066] In one embodiment, the hydraulic delay steps are set as follows: If the first There are fertilization events. Write to the delayed queue; until the... This value is dequeued at the step and used as the delayed fertilizer injection amount to calculate the return liquid conductivity and salt input response components. The recursive calculation uses parameters specific to the liquid return process (such as the attenuation coefficient). The remaining calculation methods are the same as those in S202.
[0067] In one implementation, the decay time constant of the return liquid conductivity value for salt input can be 52 time steps, and the decay time constant of the return liquid conductivity value for rinsing and dilution can be 16 time steps.
[0068] 4) Calculate the causal response component and background fluctuation component of the return liquid conductivity value. The causal response component of the return liquid conductivity value is denoted as... The background fluctuation component of the return conductivity value is denoted as .in, Indicates the first The first sample At this time step, the net salinity response (reaching the return liquid collection point) is formed by the combined effects of delayed fertilization and salt increase and irrigation leaching. This indicates the background fluctuation portion of the return conductivity value that cannot be explained by the aforementioned causal components, including long-term changes such as the buffering properties of the matrix itself and residual salts from environmental evaporation.
[0069] In practical implementation, differential logic is used for computation, first calculating... , and then ,in, Indicates the first The first sample The original return conductivity value at each time step.
[0070] It should be noted that this step is not simply a matter of replicating soil conductivity values. Instead, a hydraulic delay buffering mechanism is added to align the event response time of the return fluid conductivity value with the actual water and salt migration process. This allows the characteristics of the return fluid conductivity value to more accurately reflect "which irrigation and fertilization events have reached the return fluid collection point in the past period".
[0071] S2.4, Adaptive Robust Normalization during Augmented Feature Assembly and Growth Stages After steps S2.1 to S2.3, the original state variables have been decomposed into causal response components and background fluctuation components. The normal ranges of each dimension of characteristics still differ significantly at different crop growth stages.
[0072] This step involves statistically analyzing robust centers and robust scales according to crop growth stages, and then performing growth stage-adaptive robust normalization on continuous features to obtain preprocessed feature tensors. The specific steps are as follows: 1) Assemble the first part in chronological order. Augmented feature matrix of each sample , dimension , Indicates the first The 12-dimensional augmented input for each sample. The 12-dimensional features at each time step include, in order: ambient temperature, ambient humidity, light intensity, soil moisture causal response component, soil moisture background fluctuation component, soil conductivity causal response component, soil conductivity background fluctuation component, return fluid conductivity causal response component, return fluid conductivity background fluctuation component, historical irrigation amount, historical fertilizer injection amount, and crop growth stage encoding.
[0073] The unit of the soil moisture causal response component is volumetric water content (%), the unit of the soil moisture background fluctuation component is volumetric water content (%), and the unit of the return liquid conductivity value causal response component is millisiemens per centimeter (mS / cm).
[0074] Optionally, the light intensity can be logarithmically compressed or scaled to make its numerical range similar to that of temperature, humidity, etc.
[0075] 2) Before model training, robust centers and robust scales for each continuous feature dimension are statistically analyzed using the training set according to crop growth stages. For each of the first 11 continuous features, all corresponding values from all training samples are collected for each crop growth stage (e.g., 1, 2, 3), and the median and interquartile range are calculated. Continuous characteristics in crop growth stages The median below is denoted as , This indicates that the feature dimension is in the stage. The robust center below; interquartile range is denoted as , This indicates that the feature dimension is in the stage. The robustness of dispersion.
[0076] 3) Perform adaptive robust normalization during the growth phase on the first 11 continuous features. The first sample The first time step The original value of a continuous feature is denoted as Read the crop growth stage code corresponding to this time step. Then, retrieve from the lookup table and Execute again: ; in, Indicates the first The first sample The time step, the first The result of adaptive robust normalization of continuous features after the growth stage; This represents a very small constant to prevent the denominator from being zero, for example, Can be taken .
[0077] If the first The first sample The crop growth stage at each time step is encoded as 2. The original value of the 5th continuous feature, "soil moisture background fluctuation component," is 3.2. The median of this feature for this stage in the training set is 2.0, and the interquartile range is 0.8. Therefore, the normalized result is... .
[0078] 4) The crop growth stage encoding itself is discrete semantic information, which is more suitable as input for category embedding rather than as continuous numerical values for scaling. Therefore, this invention retains the 12th dimension of crop growth stage encoding, does not normalize it as a continuous value, but directly concatenates it after the normalized first 11 dimensions of continuous features.
[0079] Furthermore, the normalized results of all samples are stacked according to the sample dimensions to form a preprocessed feature tensor. , dimension , This represents the input tensor after event-driven decomposition and adaptive robust normalization during the growth phase.
[0080] It should be noted that normal fluctuations at different crop growth stages are mapped to comparable relative scales, and the direct impact of irrigation and fertilization events on key state quantities is preserved. This step, "first performing event-driven decomposition, then performing robust normalization according to crop growth stages," separates the causal components from the background components in the original observation sequence and uses robust statistics within each stage to replace the global mean and standard deviation for scaling. This achieves the goal of eliminating the interference of normal differences between growth stages on model training while highlighting the real signal changes caused by irrigation and fertilization events.
[0081] like Figure 3 As shown, the pulse sequences of irrigation and fertilization events were analyzed, and stem-and-leaf plots were used to depict the timing and intensity of historical irrigation volume (L) and historical fertilizer injection volume (L) throughout the monitoring period. Irrigation pulses were concentrated in the period following changes in the growth stage, while fertilization pulses occurred either synchronously with or independently of irrigation events. The experimental results indicate that water and fertilizer management events have sparse and sudden pulse characteristics, which are the basic triggering conditions for subsequent causal decomposition and event-driven modeling. The horizontal axis represents the time step (hours), and the vertical axis represents the irrigation volume or fertilizer injection volume, both in liters (L).
[0082] In a specific implementation, step S3, the construction and training of the gated cyclic prediction model based on delayed memory of irrigation events, is as follows: The preprocessed feature tensor already includes the decomposable portion of the water-salt state caused by irrigation and fertilization events, but further modeling of the "delayed promoting effect of irrigation events on future water demand" is still needed. This promoting effect typically does not occur instantly, but rather has temporal characteristics of initial delay, continuous enhancement, and gradual decay. If only ordinary gated recurrent units are used, the long-term effects of irrigation events are easily smoothed out during the recursive process.
[0083] This step constructs a delayed memory branch for irrigation events in parallel outside the gated recurrent unit, expanding each irrigation event into a continuous contribution over multiple future time steps. This contribution is then fused with the preprocessed feature vector to output the predicted water demand for the future target time period. The specific steps are as follows: S3.1 Irrigation Event Context Encoding and Time-Shifted Impulse Response Weight Sequence Generation Each irrigation event occurring within a historical time window is transformed into a set of weighted sequences that vary over time. These weighted sequences encode the delayed promotion intensity, onset time, and decay rate of a single irrigation's impact on future water demand. By generating independent response curves for each irrigation, the model can distinguish the differences in irrigation impact under different environmental conditions and growth stages, providing a foundation for subsequently constructing an irrigation event memory vector. The specific steps are as follows: 1) From the first Extract all irrigation event moments from the historical time window of each sample.
[0084] If the first Historical irrigation volume at each time step If it exceeds the minimum event threshold, then Recorded as the number Each irrigation event occurs at a specific time. The total number of irrigation events is recorded as follows: , Indicates the first The number of irrigation events detected within a sample's historical time window.
[0085] 2) At each irrigation event time Extract the irrigation event context input. Specifically, read the ambient temperature, ambient humidity, light intensity, historical irrigation amount, and crop growth stage encoding at that moment. The crop growth stage encoding is mapped to a low-dimensional dense vector using a trainable crop growth stage embedding matrix. The crop growth stage embedding matrix is denoted as... , dimension , This represents the embedding dimension of the crop growth stage, for example, it can be 4. The crop growth stage embedding vector obtained after looking up the table is concatenated with ambient temperature, ambient humidity, light intensity, and historical irrigation amount to form an irrigation event context vector. .
[0086] It should be noted that "table lookup" refers to using crop growth stage codes (1, 2, 3, etc.) in a trainable embedding matrix. The corresponding row vector is found in the matrix, which maps the discrete stage code to a continuous low-dimensional dense representation.
[0087] In one embodiment, as an example, suppose Embedded Dimensions , for The trainable matrix. When the growth stage at the moment of an irrigation event is encoded as 2, then from... Extract the 4-dimensional vector from the second row, denoted as... Then Concatenating these values with ambient temperature (22.5), humidity (65.0), light intensity (8000), and irrigation amount (3.0) yields the context vector. (dimension) ).
[0088] 3) Transfer the irrigation event context vector Input a small parameter generator network and output the response amplitude, response start delay, and decay rate corresponding to the current irrigation event.
[0089] The response amplitude is denoted as , This indicates the overall strength of the impact of this irrigation event on future water demand; The response start delay is denoted as , This indicates at what number of time steps the irrigation event began to significantly affect water demand; The decay rate is denoted as , This indicates how quickly the promoting effect declines after reaching its peak.
[0090] In practical implementation, a small parameter generation network can adopt a two-layer fully connected structure. The first layer can have 16 or 32 hidden neurons, and the activation function can be ReLU; the second layer outputs three real numbers. To ensure clear physical meaning, and It can be made positive using the Softplus activation function. First, convert it to a non-negative real number using the Softplus activation function, then round it to a non-negative integer, and restrict it to... arrive between.
[0091] Suppose a small parameter generation network takes an 8-dimensional context vector as input, passes through two fully connected layers (16-neuron ReLU layer in the first layer, and 3-neuron layer in the second layer), and outputs three raw values: Processed by Softplus After being rounded and range-limited by Softplus, the result is... Processed by Softplus .
[0092] 4) Construction length is The time-shifted impulse response weighted sequence, This indicates the time step length corresponding to the maximum effective duration of a single irrigation event.
[0093] In one implementation, if the sampling interval is 1 hour and the maximum effective duration is 48 hours, then You can choose 48 or 49. The irrigation event was in a relatively lagging step The weights on are denoted as ,in, Values range from 0 to .when hour, Take 0; when hour, Constructed using a unimodal pattern of "first increasing then decreasing", it is represented as: ; in, Indicates irrigation event In the relatively lagging step Time-shifted impulse response weights.
[0094] Furthermore, in one embodiment, if the small parameter generation network outputs a certain irrigation event... , , Then in , When the weights are all 0, the weights are all 0. At that time, the weight was approximately 0.8; At that time, the weight is approximately ;exist At that time, the weight is approximately Therefore, it can be seen that the weight sequence will first increase after the delay, and then gradually decrease.
[0095] It should be noted that, in order to give irrigation events under high temperature and strong light, low temperature and low light and different crop growth stages different onset times and decay rhythms, this step generates time-shifted impulse response weight sequences separately according to the context of each irrigation event. This allows the model to express more precisely the rule that "the same irrigation will have different effects on future water demand under different conditions".
[0096] S3.2 Temporal Unfolding and Aggregation of Irrigation Event Memory Vectors The time-shifted impulse response weight sequence of each irrigation event is expanded on the time axis and aggregated into an irrigation event memory vector at each time step. The specific steps are as follows: 1) Define a trainable irrigation quantity basis vector, denoted as . , dimension , This indicates the embedding dimension of the irrigation event, for example, it can be 8.
[0097] For irrigation events Using the historical irrigation volume of this event and Multiply to obtain the event embedding vector. This expands a single scalar irrigation quantity into a multidimensional vector representation that can be utilized by subsequent networks.
[0098] 2) Establish a length of Event response caching.
[0099] In specific implementation, the first The event response cache for each time step is denoted as , dimension The initial value is set to a vector of all zeros. Then, for the first... An irrigation event, from a relatively lagging step Traversing to ;when At that time, Add to In the middle; when At that time, the portion that exceeds the end of the historical time window is directly discarded.
[0100] set up basis vectors It is an 8-dimensional trainable vector. A certain irrigation event occurs... Irrigation volume Then the event embedding vector If the weight sequence generated by this event exist They are respectively ,but: exist Time step, to cache Accumulation ; exist Time step, to cache Accumulation ; And so on, until it goes beyond the window. .
[0101] 3) The contribution vectors from all irrigation events at the same time step are directly summed to obtain the total event response vector for that time step. Then, the vector is mapped to the hidden state space of the gated cyclic unit through linear projection to obtain the irrigation event memory vector.
[0102] No. The memory vector of irrigation events at each time step is denoted as follows: , dimension , This represents the hidden state dimension of the gated recurrent unit, which can be, for example, 64. Let the memory projection matrix be... The memory bias vector is Then the irrigation event memory vector at the current time step can be obtained from... It is obtained through linear transformation.
[0103] Define the hidden state dimension Event caching It is an 8-dimensional vector, with a memory projection matrix. for Matrix, bias It is a 64-dimensional vector. If... Then the irrigation event memory vector is The result is a 64-dimensional vector.
[0104] It should be noted that short-interval irrigation is common in actual production, and the impact of multiple irrigation events on crop status is inherently cumulative. When multiple adjacent irrigation events exist within a historical time window, the contributions of multiple irrigation events at the same time step are allowed to be directly superimposed, rather than using the "new event overwrites old event" approach. It should also be noted that, to preserve the delay and persistence of irrigation events, this step does not simply concatenate historical irrigation amounts into the input of each time step. Instead, each irrigation event is first expanded into a continuous contribution spanning multiple time steps, and then the impact of all undecayed events is aggregated at each time step. Based on this, even if an irrigation occurred a long time ago, the model can still perceive its residual impact through the irrigation event memory vector.
[0105] In a specific implementation, the gated loop prediction in step S3.3, which fuses the preprocessed feature vector with the irrigation event memory vector, is as follows: The preprocessed feature vector and the irrigation event memory vector are fused at each time step and input into the improved gated recurrent unit. Through the gating mechanism, historical information is selectively retained and updated, and finally the hidden state of the last time step is mapped to the predicted value of future water demand. The specific steps are as follows: 1) Regarding the first Each time step within a sample's historical time window Read the preprocessed feature vector and irrigation event memory vector.
[0106] No. The preprocessed feature vectors at each time step are denoted as follows: The dimension is 12; the first The memory vector of irrigation events at each time step is denoted as follows: The hidden state of the previous time step of the gated loop unit is recorded as... , dimension .
[0107] 2) The preprocessed feature vector and the irrigation event memory vector are jointly input into the improved gated recurrent unit. The reset gate is denoted as... Update the door record as Candidate hidden states are denoted as The current time step is hidden state. .
[0108] In one implementation, the update relation can be represented as: ; ; ; ; in, This represents the Sigmoid activation function. This represents the hyperbolic tangent activation function. This indicates element-wise multiplication. , , , , , , , , , , , All represent trainable parameters. Let the input dimension be... Hidden state dimension (e.g., 64), memory vector dimension (Same as hidden state), then: The dimension is , The dimension is , The dimension is , The dimension is .
[0109] 3) Traverse all timelines from beginning to end. Each time step yields the hidden state sequence corresponding to the entire historical time window. Initial hidden state It can be set as an all-zero vector or as a trainable initial vector. For example, it can be initialized as an all-zero vector.
[0110] 4) Take the hidden state of the last time step as a comprehensive representation of the entire historical time window, and input it into the regressor to output the predicted water demand value for the future target period. The hidden state of the last time step is denoted as... The predicted water demand for the target period is denoted as . .
[0111] In one implementation, the regressor can employ a two-layer fully connected structure. The first layer can have 32 hidden neurons and use ReLU activation function; the second layer has only 1 output neuron and uses Softplus activation function to ensure... It is a non-negative value.
[0112] It should be noted that this step directly writes the irrigation event memory vector into the gating computation and candidate hidden state computation, avoiding the fact that irrigation event information can only be passively passed through the hidden state chain. This allows the model to directly access the residual effects of the irrigation events that are still in effect at each time step, thereby more accurately modeling long-range event dependencies.
[0113] like Figure 4 As shown, the analysis results of soil moisture event-driven decomposition are presented. Figure 4 From top to bottom, the three subplots represent the original soil moisture sequence, the causal response component of soil moisture reconstructed through recursion, and the background fluctuation component of soil moisture obtained by subtraction. The causal response component clearly captures the rise and exponential decay of moisture after each irrigation, while the background fluctuation component mainly reflects the slow fluctuations caused by environmental factors such as evapotranspiration and temperature changes. Experimental results show that causal modeling driven by irrigation events can separate the direct effects of management intervention from the environmental background, allowing subsequent models to learn the effects of irrigation and environmental changes on water demand separately. The horizontal axis of each subplot represents time steps (hours), and the vertical axis represents volumetric water content (%).
[0114] S3.4 Risk Bias Loss Calculation and End-to-End Training 1) Preprocess the feature tensor The water demand labels for the future target period are used as training inputs. For the first... Based on a sample, the model outputs a predicted water demand value for the future target period. The real label is .
[0115] 2) High water demand samples typically correspond to critical scenarios such as high temperature and strong light or peak fruiting periods. Underestimating these samples carries a greater risk. Therefore, the 80th percentile of the water demand label for the future target period is calculated on the training set and denoted as _____. When the true label of a sample is greater than At that time, the sample was considered a high water demand sample.
[0116] 3) Calculate the risk bias loss for each sample. The base error is the squared error, and additional weights are set based on whether the sample belongs to the high water demand category and whether the model underestimates the value.
[0117] In specific implementation, the first The loss for each sample is denoted as The calculation method is expressed as follows: ; in, Indicates high water demand weight, when hour, ,otherwise ; This indicates that the penalty weight is underestimated, when hour, ,otherwise Preferably, You can choose 1.0 or 2.0. You can take 0.5.
[0118] like If a sample's true label is 7 liters and its predicted value is 5.5 liters, then this sample belongs to both the high-water-demand sample and the underestimated sample. , The weight for high water demand is 2.0, the weight for low water demand penalty is 1.5, and the total amplification factor is 3.0.
[0119] 4) The Adam optimizer is used to perform end-to-end joint training on all trainable parameters. Trainable parameters include at least: crop growth stage embedding matrix, small parameter generation network parameters, trainable irrigation amount basis vectors, memory projection matrix and bias, gated recurrent unit parameters, and regressor parameters.
[0120] The initial learning rate can be set to... The batch size can be 32 or 64. During training, a validation set is set, and an early stopping strategy is employed. For example, when the validation set loss no longer decreases for 10 consecutive training epochs, training is stopped, and the model parameters corresponding to the lowest validation set loss are retained.
[0121] 5) After training is completed, save the optimal model parameters and the robust normalized statistical tables of each crop growth stage used in step S204 for direct use in the online prediction stage, thereby ensuring that the online stage and the training stage use the exact same preprocessing parameters and model parameters.
[0122] like Figure 5 As shown, the delayed decomposition results of the return liquid conductivity are analyzed. Figure 5 From top to bottom, the figures represent the original return fluid conductivity value, the causal response component after a 3-hour hydraulic delay buffer, and the background fluctuation component. The causal response component only begins to show significant changes approximately three time steps after the fertilization or irrigation event, reflecting the actual transport delay of the nutrient solution from the rhizosphere to the return fluid collection point. Experimental results show that introducing a fixed delay buffer mechanism can align the response time of the return fluid conductivity with the water-salt transport process, improving the accuracy of the causal correspondence between features and events. The horizontal axis of the three subplots represents time steps (hours), and the vertical axis unit is millisiemens per centimeter (mS / cm).
[0123] In a specific implementation, the online prediction and irrigation control application process in step S4 is as follows: After model training is complete, the optimal model is deployed to the integrated water and fertilizer control system. During online operation, the system continuously receives new data at the same sampling interval as during the training phase, and automatically performs preprocessing and prediction according to a sliding time window, outputting the predicted water demand for the future target period. The specific steps are as follows: 1) The system updates the historical time window each time it receives a new sampling time step. Specifically, it discards the oldest time step data and adds the latest time step data, forming a new window of length [length missing]. The original monitoring feature matrix. The data format of this original monitoring feature matrix is the same as that of the original monitoring feature matrix of the single sample in step S1. Totally consistent.
[0124] 2) Perform the same event-driven decomposition and adaptive robust normalization during the growth phase as during the training phase on the new original monitoring feature matrix. Specifically, execute steps S201, S202, S203, and S204 sequentially to obtain the online single-sample preprocessed feature matrix.
[0125] 3) Input the online single-sample preprocessed feature matrix into the trained prediction model. The model first generates a time-shifted impulse response weight sequence based on irrigation events in the historical time window, then constructs the irrigation event memory vector for each time step, and finally outputs the predicted water demand for the future target period through an improved gated recurrent unit.
[0126] 4) Output the predicted water demand for the future target period to the irrigation decision module. The irrigation decision module can directly use the predicted water demand for the future target period as the recommended irrigation amount, or it can combine the current planned irrigation amount, the maximum allowable single irrigation amount, and the safety threshold to generate the final control command. In one implementation, when the predicted water demand for the future target period is higher than the current planned irrigation amount and the difference exceeds a preset threshold, a supplementary irrigation suggestion or alarm is triggered.
[0127] 5) The system repeats the above process at each sampling interval to achieve continuous rolling prediction of the crop's water demand for the target period in the future.
[0128] Although the specific embodiments of the invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the invention. Based on the technical solutions of the invention, various modifications or variations that can be made by those skilled in the art without creative effort are still within the scope of protection of the invention.
Claims
1. A method for predicting the future water demand of an integrated water and fertilizer system based on artificial intelligence, characterized in that, Includes the following steps: S1. Read the original features from the water and fertilizer integration system at fixed sampling intervals to construct samples, and then process them to form the original monitoring feature tensor. Construct a corresponding supervision label for each sample, and save the crop growth stage sequence and sample time index corresponding to each sample. S2. Based on the original monitoring feature tensor, perform event-driven decomposition of the water and fertilizer coupled multidimensional feature vector, perform causal decomposition on the key state vectors corresponding to irrigation and fertilization events, and then perform robust normalization according to the crop growth stage to expand the dimension of the original monitoring feature tensor and obtain the preprocessed feature tensor. S3. Construct a prediction model. In addition to the gated recurrent unit, construct a delayed memory branch for irrigation events in parallel. Expand each irrigation event into a continuous contribution over multiple future time steps. Then, fuse it with the preprocessed feature vector to output the predicted water demand for the future target period and train the prediction model. S4. Deploy the trained model into the integrated water and fertilizer control system to predict the water demand for the target period in the future.
2. The method for predicting future water demand in an integrated water and fertilizer system based on artificial intelligence as described in claim 1, characterized in that, The original features used to construct the original monitoring feature tensor include ambient temperature, ambient humidity, light intensity, soil moisture, soil electrical conductivity, return fluid electrical conductivity, historical irrigation amount, historical fertilizer injection amount, and crop growth stage encoding. The original monitoring feature tensor is then preprocessed, as detailed in S2 below: S2.
1. Using non-zero moments in historical irrigation data, reconstruct the causal response component of soil moisture and the background fluctuation component of soil moisture. S2.2 Decompose the soil electrical conductivity value into the causal response component of the soil electrical conductivity value and the background fluctuation component of the soil electrical conductivity value; S2.
3. Based on the causal decomposition of soil conductivity values, a fixed delay buffer mechanism is introduced to perform delayed two-event decomposition on the return liquid conductivity values to obtain the causal response component and the background fluctuation component of the return liquid conductivity values. S2.
4. Statistically calculate robust centers and robust scales according to crop growth stages, and then perform growth stage adaptive robust normalization on continuous features to obtain preprocessed feature tensors.
3. The method for predicting future water demand in an integrated water and fertilizer system based on artificial intelligence as described in claim 2, characterized in that, S2.1 is as follows: All irrigation event times are extracted from the historical irrigation volume sequence of each sample. A minimum event threshold is set, and an irrigation event is recorded when the historical irrigation volume exceeds the minimum event threshold. Then, a soil moisture decay time constant and a soil moisture response gain are preset for each crop growth stage. The soil moisture decay time constant is the duration of the impact of irrigation events on soil moisture at different growth stages, and the soil moisture response gain is the contribution of a unit irrigation volume to the increase in soil moisture at different growth stages. Next, the causal response component of soil moisture is calculated recursively in chronological order, and then the causal response component of soil moisture is subtracted from the original soil moisture sequence to obtain the background fluctuation component of soil moisture.
4. The method for predicting future water demand in an integrated water and fertilizer system based on artificial intelligence as described in claim 3, characterized in that, S2.2 is as follows: A recursive sequence of soil electrical conductivity salinity input response components is established. The original features in the original monitoring feature tensor also include historical fertilizer injection amounts. The fertilizer decay time constant and fertilizer response gain are preset and recursively calculated in chronological order. The soil electrical conductivity salinity input response component at the current time step is equal to the sum of the residual response decayed at the previous time step and the newly added fertilizer input response at the current time step. The net salinity response formed by the combined effects of fertilization and irrigation leaching yields the causal response component of soil electrical conductivity. The causal response component of soil electrical conductivity is then subtracted from the original soil electrical conductivity sequence to obtain the background fluctuation component of soil electrical conductivity.
5. The method for predicting future water demand in an integrated water and fertilizer system based on artificial intelligence according to claim 4, characterized in that, S2.3 is as follows: Preset hydraulic delay steps Preset hydraulic delay steps To determine the time step delay between the occurrence of an irrigation or fertilization event and the start of a clearly observable event response at the return liquid collection point, a length of [length missing] was established for the historical fertilizer injection volume sequence and the historical irrigation volume sequence, respectively. A first-in-first-out (FIFO) delayed buffer queue is used. For each sample at each time step, if a new historical fertilizer injection amount exists, it is written to the fertilizer delayed buffer queue first; if a new historical irrigation amount exists, it is written to the irrigation delayed buffer queue first. When the queue length reaches [a certain threshold], [the process continues]. Then, the earliest value that entered the queue is taken out as the delayed historical fertilizer injection amount and delayed historical irrigation amount after the actual arrival of the return liquid collection point at the current time step; The salinity input response component of the return liquid conductivity value was constructed using the delayed historical fertilizer injection volume, and the leaching and dilution response component of the return liquid conductivity value was constructed using the delayed historical irrigation volume. The causal response component and the background fluctuation component of the return liquid conductivity value were calculated. The causal response component of the return liquid conductivity value is the net salinity response formed by the combined effect of delayed fertilization salt increase and irrigation leaching, and the background fluctuation component of the return liquid conductivity value is the background fluctuation part of the return liquid conductivity value that cannot be explained by the causal component.
6. The method for predicting future water demand in an integrated water and fertilizer system based on artificial intelligence according to claim 5, characterized in that, S2.4 is as follows: The augmented feature matrix is assembled for each sample in chronological order, expanding the dimension of the input sample data from 9 to 12. Soil moisture, soil electrical conductivity, and reflux conductivity are decomposed into soil moisture causal response component, soil moisture background fluctuation component, soil electrical conductivity causal response component, soil electrical conductivity background fluctuation component, reflux conductivity causal response component, and reflux conductivity background fluctuation component. Then, robust centers and robust scales of each continuous feature dimension are calculated according to the crop growth stage. Adaptive robust normalization of the growth stage is performed on the first 11 continuous features. The last dimension of discrete semantic information, crop growth stage encoding, is directly concatenated after the normalized first 11 continuous features. Finally, the normalization results of all samples are stacked according to the sample dimensions to form a preprocessed feature tensor.
7. The method for predicting future water demand in an integrated water and fertilizer system based on artificial intelligence according to claim 1, characterized in that, S3 is as follows: S3.1 Extract the irrigation event context of each irrigation event that occurs within the historical time window, and then transform it into a set of time-shifted impulse response weight sequences that change over time. S3.2 Expand the time-shifted impulse response weight sequence of each irrigation event on the time axis and aggregate it into an irrigation event memory vector at each time step; S3.
3. The preprocessed feature vector and the irrigation event memory vector are fused at each time step and input into the improved gated recurrent unit. The historical information is selectively retained and updated through the gating mechanism, and finally the hidden state of the last time step is mapped to the predicted value of future water demand. S3.
4. Based on the predicted future water demand and the supervision label, calculate the risk bias loss for each sample, and then use the Adam optimizer to perform end-to-end joint training on all trainable parameters, save the optimal model parameters, and obtain the trained model.
8. The method for predicting future water demand in an integrated water and fertilizer system based on artificial intelligence according to claim 7, characterized in that, The calculation process for the time-shifted impulse response weight sequence and the irrigation event memory vector is as follows: All irrigation event moments are extracted from the historical time window of each sample. A minimum event threshold for historical irrigation volume is set. If the historical irrigation volume at each time step is greater than the minimum event threshold, it is recorded as an irrigation event moment. Then, the irrigation event context input is extracted for each irrigation event moment. The ambient temperature, ambient humidity, light intensity, historical irrigation volume, and crop growth stage code at that moment are read. The crop growth stage code is mapped to a low-dimensional dense vector through a trainable crop growth stage embedding matrix. This vector is then concatenated with the ambient temperature, ambient humidity, light intensity, and historical irrigation volume to form the irrigation event context vector. The irrigation event context vector is then input into a small parameter generation network, which outputs the response amplitude, response start delay, and decay rate corresponding to the current irrigation event. The small parameter generation network adopts a 2-layer fully connected structure. Finally, a time-shifted impulse response weight sequence is constructed based on the response amplitude, response start delay, and decay rate. Define a trainable irrigation quantity basis vector. For each irrigation event at each time step, multiply the historical irrigation quantity of the event by the trainable irrigation quantity basis vector to obtain the event embedding vector. Then, establish an event response cache. Next, directly sum the contribution vectors from all irrigation events at the same time step to obtain the total event response vector for that time step. Obtain the corresponding event response cache and then map it to the hidden state space of the gated recurrent unit through linear projection to obtain the irrigation event memory vector.
9. The method for predicting future water demand in an integrated water and fertilizer system based on artificial intelligence as described in claim 8, characterized in that, The calculation process for the future water demand forecast is as follows: For each time step within the historical time window of each sample, the preprocessed feature vector and irrigation event memory vector are read. The preprocessed feature vector and irrigation event memory vector are input together into the improved gated recurrent unit. All time steps are traversed from front to back along the time axis to obtain the hidden state sequence corresponding to the entire historical time window. The initial hidden state is set as an all-zero vector or a trainable initial vector. The hidden state of the last time step is taken as the comprehensive representation of the entire historical time window and input into the regressor to output the predicted water demand value for the future target period.
10. The method for predicting future water demand in an integrated water and fertilizer system based on artificial intelligence according to claim 1, characterized in that, S1 is as follows: Timestamp alignment and missing data repair are performed on the original sampled data. First, a timeline is established according to the unified sampling time. Then, the data from each sensor and the controller log are mapped to the same timeline. When the missing time of a certain feature does not exceed two consecutive time steps, linear interpolation is used to fill in the missing time. When the missing time of consecutive time steps exceeds two consecutive time steps, the corresponding time period is directly discarded and does not participate in the sample construction. Next, a sliding time window is used to construct the original monitoring feature tensor, assuming the total number of training samples is... The length of the historical time window is The target time period in the future is , for the Samples, take consecutive The original monitoring feature matrix is composed of the 9-dimensional original features of each time step. All samples are stacked according to the sample dimensions to obtain the original monitoring feature tensor. For each sample, a label representing the water demand for the future target period is constructed as the corresponding supervision label, indicating the future water demand after that historical time window. The actual total water demand within a given time step.