Real-time interpretation system for farmland soil parameters integrating edge computing and lightweight models
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-26
- Publication Date
- 2026-08-14
AI Technical Summary
[0004]本发明的目的在于提供融合边缘计算与轻量化模型的农田土壤参数实时解译系统,以解决上述背景中问题
(1)降低了边缘计算节点在田间部署环境下的长期运行功耗,增强了无日照条件下的持续监测能力。本发明通过将长短期记忆网络转换为仅在信号变化超过预设阈值时触发稀疏脉冲计算的轻量化模型,避免了传统时序模型在每个时间步均进行完整前向计算所带来的高能耗。结合强化学习决策输出的推理频率档位和休眠计数器唤醒机制,可根据气象预报和蓄电状态动态调整模型推理间隔,并在节能模式下采用基于历史数据的数值积分外推替代部分高功耗推理。上述手段共同作用,使得边缘设备在梅雨季等连续阴雨条件下仍能维持基础土壤参数监测功能,有效避免了因供电中断而错失晒田、追肥等关键农事决策窗口期。
Smart Images

Figure CN122259677B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural information technology, specifically to a real-time interpretation system for farmland soil parameters that integrates edge computing and lightweight models. Background Technology
[0002] In precision agriculture, real-time acquisition of key parameters such as soil moisture content and ammonium nitrogen concentration is crucial for guiding water-saving irrigation and variable-rate fertilization. Traditional soil parameter detection methods primarily rely on manual field sampling followed by laboratory chemical analysis. While this method offers high accuracy, it suffers from drawbacks such as long sampling cycles, poor timeliness, and high labor costs, making it unsuitable for large-scale real-time monitoring of farmland. In recent years, with the development of IoT and sensor technologies, some solutions have attempted to deploy in-situ soil sensors in the field and upload data to cloud servers via wireless communication. Identification and resolution technology is used to uniformly identify and label sensor nodes scattered across different fields and depths, thereby achieving effective collection and traceability of massive amounts of heterogeneous data. The identified and resolved data is then centrally processed and used for model inversion.
[0003] In extreme conditions where edge computing devices experience intermittent power outages due to continuous rain during the plum rain season, resulting in intermittent solar power supply interruptions, how can continuous parameter estimation of soil moisture content and ammonium nitrogen concentration in farmland be achieved under discontinuous power supply conditions? Specifically, existing technologies employ fixed-frequency wake-up inference or simply reduce the sampling rate. Once the battery is depleted, interpretation completely stops, leading to irreversible loss of soil parameter sequences during critical window periods such as field drying. This invention, however, transforms a long short-term memory network into a lightweight pulse model that triggers sparse computation only when the signal changes. Combined with reinforcement learning, it dynamically outputs inference frequency levels and energy-saving mode flags based on weather forecasts and battery status. In energy-saving mode, it uses numerical integral extrapolation based on historical data to replace some high-power inference. Simultaneously, it performs weighted fusion of preliminary and continued estimates based on the fusion weights mapped by the pulse trigger frequency. Thus, even during power outages, it can still output continuous, smooth, and reliable time-series interpretation sequences, fundamentally solving the technical problem of "high-precision inference when there is power, and complete disconnection when there is no power," which restricts the practical deployment of edge computing in rice-growing areas of southern China. Summary of the Invention
[0004] The purpose of this invention is to provide a real-time interpretation system for farmland soil parameters that integrates edge computing and lightweight models, in order to solve the problems mentioned above.
[0005] The objective of this invention can be achieved through the following technical solutions: A real-time interpretation system for farmland soil parameters integrating edge computing and lightweight models includes: The data acquisition module is used to collect the capacitance, dielectric constant and ion-selective electrode potential of farmland soil, and construct a time-series signal sequence containing multiple consecutive sampling times; The lightweight inference module inputs the time-series signal sequence into the lightweight model obtained by pulse conversion from the time-series memory structure. The lightweight model only triggers sparse calculation when the signal change exceeds a preset threshold, and outputs preliminary estimates of soil volumetric water content and ammonium nitrogen concentration, as well as the pulse trigger frequency. The decision-making and scheduling module, based on the pulse triggering frequency, future meteorological numerical forecasts, current energy storage status, and agricultural window options, uses reinforcement learning to output inference frequency levels and energy-saving mode indicators, and transmits preliminary estimates. The energy-saving inference module wakes up the lightweight model for inference according to the inference frequency level. When the energy-saving mode flag is valid, it uses numerical integration extrapolation based on historical time series data to replace part of the lightweight model inference and outputs the continuous estimates of water content and ammonium nitrogen concentration. The fusion output module merges the incoming preliminary and extended estimates in chronological order to obtain the final interpreted soil moisture content and ammonium nitrogen concentration. It then determines when the moisture content is below the field capacity threshold and the ammonium nitrogen concentration is above the fertilization threshold and outputs an irrigation command.
[0006] As a further aspect of the present invention: the lightweight model obtained by pulse transformation from the temporal memory structure specifically includes: The timing signal sequence is input sequentially in time steps. If the difference between the dielectric constant of the current capacitance and the average value of the previous five times exceeds a preset threshold, a pulse is generated and the membrane potential is updated; otherwise, it remains silent. The pulse counts at each time step are accumulated, and after linear decoding, preliminary estimates of soil volumetric water content and ammonium nitrogen concentration are output. At the same time, the number of pulses per unit time is output as the pulse trigger frequency.
[0007] As a further aspect of the present invention: the preliminary estimates of the output soil volumetric water content and ammonium nitrogen concentration specifically include: The pulse counts of ten consecutive time steps are arranged in reverse chronological order to form a counting sequence; The counting sequence is multiplied element-by-element by the first set of pre-stored decoding coefficients and then summed to obtain the cumulative sum; The cumulative sum and saturated function are restricted to the range between field capacity and wilting coefficient to provide a preliminary estimate of soil volumetric water content. At the same time, the second set of decoding coefficients is used to calculate a preliminary estimate of ammonium nitrogen concentration.
[0008] As a further aspect of the present invention: the step of outputting the inference frequency level and energy-saving mode flag through reinforcement learning decision, and transmitting preliminary estimates, specifically includes: The pulse trigger frequency, the cumulative photovoltaic power calculated from the hourly cloud cover forecast for the next 72 hours, the percentage of the current energy storage status relative to the rated capacity, and the agricultural window option weight are combined to form a four-dimensional state description. The four-dimensional state description is input into a pre-trained dual-hidden-layer fully connected network. The output of the dual-hidden-layer fully connected network corresponds to the action value of four inference frequency levels and the action value of two energy-saving mode flags, respectively. The inference frequency setting with the highest action value is selected as the output, and the energy-saving mode flag is turned on or off based on whether the action value of the energy-saving mode flag exceeds the preset balance point. At the same time, the received preliminary estimate is directly passed to the next step.
[0009] As a further aspect of the present invention: the step of waking up the lightweight model for inference according to the inference frequency level specifically includes: Convert the inference frequency level into the target threshold of the sleep counter; the higher the level, the smaller the corresponding threshold. After each lightweight model completes inference, the sleep counter starts accumulating real-time clock pulses from zero, and a wake-up signal is generated when the accumulated value reaches the target threshold. In response to the wake-up signal, power is restored to the computing unit where the lightweight model is located and its parameters are loaded. After performing a complete forward calculation, it re-enters sleep mode.
[0010] As a further aspect of the present invention: the output of the continuous estimate of water content and ammonium nitrogen concentration specifically includes: The water content and ammonium nitrogen concentration from the most recent output of the lightweight model are used as initial values, and another historical value before the output is used to calculate the rate of change per unit time. Multiply the elapsed time after the energy-saving mode is activated by the rate of change to obtain the increment of change. The initial value is added to the increment of change to obtain the sustained estimates of water content and ammonium nitrogen concentration, respectively. When the elapsed time exceeds the preset maximum extrapolation span, the extrapolation is stopped and the sustained estimate is marked as invalid.
[0011] As a further aspect of the present invention: obtaining the final interpreted soil moisture content and ammonium nitrogen concentration specifically includes: Align the preliminary and extended estimates according to their respective time labels; For cases where two estimates exist for the same time tag, the pulse trigger frequency is mapped to the fusion weight of the preliminary estimate, and 1 is subtracted from the corresponding weight as the fusion weight of the continuation estimate. The weighted sum is then calculated. For time tags with only a single estimated value, the corresponding estimated value is directly used as the final interpretation value, and the complete interpretation sequence is output in chronological order.
[0012] As a further aspect of the present invention: the step of determining when the water content is lower than the field capacity threshold and the ammonium nitrogen concentration is higher than the fertilization threshold and outputting an irrigation command specifically includes: The final interpreted water content is compared with the pre-stored field capacity threshold. If the water content at three consecutive time points is lower than the field capacity threshold, the water condition flag is set. The final interpreted ammonium nitrogen concentration is compared with the fertilization threshold. If the concentration at the current time point is higher than the fertilization threshold and the concentration at the previous time point is not higher than the fertilization threshold, then the nitrogen condition flag is set. When both the moisture condition flag and the nitrogen condition flag are set, an irrigation start command is output, and both flags are reset simultaneously after the output.
[0013] The beneficial effects of this invention are: (1) This invention reduces the long-term operating power consumption of edge computing nodes in field deployment environments and enhances the continuous monitoring capability under conditions without sunlight. By converting the Long Short-Term Memory network into a lightweight model that triggers sparse pulse computation only when the signal change exceeds a preset threshold, this invention avoids the high energy consumption caused by the traditional time-series model performing complete forward computation at every time step. Combining the inference frequency level of the reinforcement learning decision output and the sleep counter wake-up mechanism, the model inference interval can be dynamically adjusted according to weather forecasts and battery status, and in energy-saving mode, numerical integral extrapolation based on historical data can replace some high-power inference. The above measures work together to enable edge devices to maintain basic soil parameter monitoring functions even under continuous rainy conditions such as the plum rain season, effectively avoiding missing key agricultural decision-making windows such as field drying and topdressing due to power outages.
[0014] (2) Improved the temporal integrity of soil moisture content and ammonium nitrogen concentration interpretation results and the reliability of irrigation decisions. This invention maps the pulse trigger frequency to a fusion weight, and performs a weighted summation of the preliminary estimate and the continued estimate. This ensures that when soil parameters change drastically, the interpretation value is biased towards the high-confidence model inference result, and when the change is gradual, the low-power extrapolation value is reasonably adopted to fill the time gap, thereby ensuring the continuity and smooth transition of the output sequence. In addition, the irrigation conditions are jointly judged by the rising edge trigger logic of the soil moisture content being lower than the field water holding capacity threshold at three consecutive time points and the ammonium nitrogen concentration crossing the fertilization threshold from low to high. This effectively suppresses false triggering caused by sensor instantaneous noise or single-point anomalies, ensuring that irrigation commands are output only when the dual conditions of real water shortage and sufficient nitrogen are met, thus improving the accuracy and safety of automated irrigation. Attached Figure Description
[0015] The invention will now be further described with reference to the accompanying drawings.
[0016] Figure 1 This is a system block diagram of the present invention; Figure 2 This is a flowchart illustrating the process of generating preliminary estimates in this invention. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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.
[0018] Please see Figure 1 As shown, this invention is a real-time interpretation system for farmland soil parameters that integrates edge computing and lightweight models, comprising: The data acquisition module is used to collect the capacitance, dielectric constant and ion-selective electrode potential of farmland soil, and construct a time-series signal sequence containing multiple consecutive sampling times; The lightweight inference module inputs the time-series signal sequence into the lightweight model obtained by pulse conversion from the time-series memory structure. The lightweight model only triggers sparse calculation when the signal change exceeds a preset threshold, and outputs preliminary estimates of soil volumetric water content and ammonium nitrogen concentration, as well as the pulse trigger frequency. The decision-making and scheduling module, based on the pulse triggering frequency, future meteorological numerical forecasts, current energy storage status, and agricultural window options, uses reinforcement learning to output inference frequency levels and energy-saving mode indicators, and transmits preliminary estimates. The energy-saving inference module wakes up the lightweight model for inference according to the inference frequency level. When the energy-saving mode flag is valid, it uses numerical integration extrapolation based on historical time series data to replace part of the lightweight model inference and outputs the continuous estimates of water content and ammonium nitrogen concentration. The fusion output module merges the incoming preliminary and extended estimates in chronological order to obtain the final interpreted soil moisture content and ammonium nitrogen concentration. It then determines when the moisture content is below the field capacity threshold and the ammonium nitrogen concentration is above the fertilization threshold and outputs an irrigation command.
[0019] In the data acquisition module, the capacitance, dielectric constant, and ion-selective electrode potential of farmland soil are collected to construct a time-series signal sequence containing multiple consecutive sampling times, specifically including: Capacitive moisture sensors and ammonium nitrogen ion selective electrodes are embedded at the target locations in the farmland. Both sensors are connected to the signal input terminal of the edge computing unit. The capacitive moisture sensor applies a 70 MHz alternating electric field to the soil, measures the returned capacitance value, and converts it into a dielectric constant, which is positively correlated with the soil volumetric water content. The ammonium nitrogen ion selective electrode contacts the soil solution through its sensitive membrane, generating a potential difference linearly related to the logarithm of ammonium ion activity. The analog-to-digital converter within the edge computing unit reads the capacitance dielectric constant and the voltage values of the ion selective electrode potential at a fixed sampling interval of 6 minutes, and marks the absolute time of each sampling moment. The capacitance dielectric constant values obtained from five consecutive sampling moments are arranged in chronological order to form a dielectric constant time series; simultaneously, the electrode potential values at the same sampling moment are arranged in the same order to form a potential time series. The two sequences together constitute a time-series signal sequence containing multiple consecutive sampling moments, which serves as input data for subsequent processing. During the sampling process, the capacitive moisture sensor probe is buried at a depth of 0 to 20 cm in the topsoil to maintain close contact with the soil. Before each sampling, the edge computing unit provides a stable excitation voltage to the capacitive moisture sensor, and the reading is completed after 10 milliseconds.
[0020] Please see Figure 2 As shown, in the lightweight inference module, the time-series signal sequence is input into the lightweight model obtained by pulse transformation from the time-series memory structure. The lightweight model triggers sparse computation only when the signal change exceeds a preset threshold, outputting preliminary estimates of soil volumetric water content and ammonium nitrogen concentration, as well as the pulse trigger frequency, specifically including: The lightweight model is constructed as follows: First, a pre-trained Long Short-Term Memory (LSTM) network is obtained. This network contains three gate structures: a forget gate, an input gate, and an output gate. Each gate uses the hyperbolic tangent function as its activation function. The activation functions of the forget gate, input gate, and output gate are then replaced with a leak integral ignition function. This function is defined as follows: when the accumulated membrane potential of the input signal exceeds the ignition threshold, a pulse is output, and the membrane potential is reset to the resting potential. Furthermore, the membrane potential decays exponentially with a fixed time constant when there is no input. Subsequently, layer-by-layer normalization is performed on the weight matrix of each layer in the replaced network. The normalization method involves dividing all elements in each weight matrix by the maximum absolute value of the matrix, ensuring that all weight values fall within the range of -1 to +1.
[0021] The constructed time-series signal sequence is sequentially input into the lightweight model, with each time step corresponding to the capacitance-dielectric constant and ion-selective electrode potential at a sampling time. At each time step, the model first calculates the arithmetic mean of the capacitance-dielectric constant at the current time and the capacitance-dielectric constant at the previous five times, and then calculates the difference between the two. A preset threshold is used as the criterion for judging this difference, which is obtained as follows: During the calibration phase before model deployment, capacitance-dielectric constant data are continuously collected over 24 hours, the difference between every six adjacent sampling points is calculated, and the standard deviation of these differences is multiplied by a coefficient of 1.5 to obtain the preset threshold.
[0022] If the difference calculated at the current moment exceeds a preset threshold, the model generates a pulse and updates the membrane potential according to the rules of the leakage integral ignition function. Specifically, the current membrane potential is added to the input signal, and then a fixed leakage amount is subtracted. The leakage amount is equal to the current membrane potential multiplied by the ratio of the time step to the decay time constant. If the updated membrane potential reaches the ignition threshold, a pulse with an amplitude of 1.0 is output, and the membrane potential is reset to a resting potential of 0.5 millivolts. If the ignition threshold is not reached, no pulse is output. If the difference at the current moment does not exceed the preset threshold, the model remains silent, neither generating a pulse nor updating the membrane potential, and the membrane potential decays naturally according to the leakage amount.
[0023] At the end of each time step, the model records the number of pulses generated within that time step. Since at most one pulse is generated per time step, the pulse count is either 0 or 1. The pulse counts for ten consecutive time steps are summed to obtain the pulse count value. Simultaneously, the model outputs the pulse trigger frequency, which is calculated as follows: the total number of pulses generated in the sixty time steps prior to the current moment is counted, divided by 60, and then multiplied by the duration of each time step to obtain the number of pulses per unit time, expressed in Hertz (Hz).
[0024] For the initial estimate of soil volumetric water content, the model first arranges the pulse counts of ten consecutive time steps in reverse chronological order, with the most recent time step at number one and the earliest at number ten, forming a counting sequence. The first set of pre-stored decoding coefficients contains ten values, each corresponding to an element at the same position in the counting sequence. This set of decoding coefficients is obtained as follows: In the laboratory, standard soil samples from the target farmland are taken, and soil samples with ten gradient water contents ranging from the wilting coefficient to field capacity are prepared. The lightweight model is then deployed in each soil sample, and its pulse count sequence is recorded. Ridge regression is then used to solve for the ten coefficient values that minimize the error between the model output and the actual water content.
[0025] Each pulse count value in the counting sequence is multiplied by the first set of decoding coefficients at its corresponding position, resulting in ten products. These ten products are then summed to obtain a cumulative sum. This cumulative sum is input into a saturation function, defined as follows: if the cumulative sum is less than the wilting coefficient, the wilting coefficient is output; if the cumulative sum is greater than the field capacity, the field capacity is output; otherwise, the cumulative sum itself is output. The value output by the saturation function is a preliminary estimate of the soil volumetric water content, expressed as a volume percentage. For the preliminary estimate of ammonium nitrogen concentration, the same process is used, except that a second set of decoding coefficients is used instead of the first set. The second set of decoding coefficients is obtained by preparing ten gradients of ammonium nitrogen concentration on standard soil samples and applying the same ridge regression method.
[0026] In the decision-making and scheduling module, based on the pulse trigger frequency, future meteorological numerical forecasts, current energy storage status, and agricultural window options, reinforcement learning is used to output the inference frequency level and energy-saving mode flag, and to transmit preliminary estimates, specifically including: The specific method for constructing the four-dimensional state description is as follows: First, obtain the pulse trigger frequency, expressed in Hertz; second, obtain the meteorological numerical forecast for the next 72 hours, which includes the cloud cover percentage for each hour. Convert the hourly cloud cover percentage into the cumulative photovoltaic power value for that hour. The conversion method is as follows: set the baseline photovoltaic power to 100 watts. When the cloud cover percentage is 0, the cumulative photovoltaic power value is 100 watts multiplied by 1 hour. When the cloud cover percentage is 100%, the cumulative value is zero. Intermediate values are calculated by linear interpolation. Add the cumulative values of each hour for 72 hours to obtain the total cumulative photovoltaic power value, expressed in watt-hours; then, obtain the current energy storage status, expressed as the percentage of the battery's current stored energy relative to its rated capacity, obtained by looking up a table using voltage and discharge curves; finally, obtain the agricultural window option weight value. This weight value is determined based on the degree of overlap between the current date and the preset critical agricultural window period. The weight value is set to 1.0 during the critical window period and 0.3 during non-critical window periods. The four values—pulse trigger frequency, total photovoltaic power accumulation, state of energy storage percentage, and agricultural window option weight—are arranged in a fixed order to form a four-dimensional state description.
[0027] The four-dimensional state description is input into a pre-trained dual-hidden-layer fully connected network. The network structure is as follows: the input layer contains 4 nodes, each receiving one of the four values from the four-dimensional state description; the first hidden layer contains 32 nodes, each fully connected to the four nodes in the input layer, using a linear rectified function as the activation function; the second hidden layer contains 16 nodes, each fully connected to the 32 nodes in the first hidden layer, also activated using a linear rectified function; the output layer contains 6 nodes, where the first four nodes correspond to the action values at four inference frequency levels, and the last two nodes correspond to the action values for turning the energy-saving mode flag off and on. The network is trained as follows: before deployment, 10,000 sets of random four-dimensional state descriptions and corresponding optimal action labels are generated using a simulation environment. The network weights are updated using a mean squared error loss function and gradient descent, with a learning rate of 0.001, iterating for 2,000 iterations until the loss value converges.
[0028] After the network performs forward computation, the values of the first four output nodes are compared. The inference frequency level corresponding to the node with the largest value is selected as the output. The four inference frequency levels correspond to one wake-up inference every 0.5 hours, 1.0 hour, 2.0 hours, and 4.0 hours, respectively. The values of the last two output nodes are compared. If the difference between the value of the node representing the power-saving mode on and the value of the node representing the power-saving mode off is greater than a preset equilibrium point, then the power-saving mode flag is output as on; otherwise, it is output as off. The preset equilibrium point is obtained statistically from the validation set after training. Specifically, it is calculated by averaging the differences between the outputs of the two nodes of all samples in the validation set, and this average value is used as the equilibrium point. Simultaneously, the preliminary estimated output values are directly passed to subsequent steps without any processing.
[0029] In the energy-saving inference module, the lightweight model is activated according to the inference frequency level for inference. When the energy-saving mode flag is valid, numerical integration extrapolation based on historical time-series data is used to replace part of the lightweight model inference, outputting continuous estimates of water content and ammonium nitrogen concentration, specifically including: The specific method for converting the inference frequency levels into target thresholds for the sleep counter is as follows: Four inference frequency levels are pre-defined, each corresponding to a target threshold. Level 1 corresponds to waking up once every 0.5 hours, Level 2 to waking up once every 1 hour, Level 3 to waking up once every 2 hours, and Level 4 to waking up once every 4 hours. The sleep counter uses a 16-bit binary counter, with its clock source being the second pulse output from the real-time clock. Each second pulse increments the counter value by 1. The wake-up interval corresponding to each level is converted into seconds and used as the target threshold. The target threshold for Level 1 is 1800, for Level 2 it is 3600, for Level 3 it is 7200, and for Level 4 it is 14400. The larger the level value, the smaller the corresponding target threshold.
[0030] After each complete forward computation of the lightweight model, the edge computing unit forces the current value of the sleep counter to 0, then puts the computing unit containing the lightweight model into a power-off sleep state. Simultaneously, the sleep counter begins accumulating the second pulses output by the real-time clock from 0. For each received second pulse, the sleep counter value increases by 1, and the increased value is compared with the target threshold corresponding to the current inference frequency level. When the accumulated value reaches or exceeds the target threshold, the sleep counter generates a high-level wake-up signal.
[0031] In response to the wake-up signal, the power management circuit in the edge computing unit first restores the power supply to the computing unit where the lightweight model resides, stabilizing the supply voltage at 3.3 volts. Then, it reads all parameters of the lightweight model from non-volatile memory, including the weight matrices and bias values of each layer, and loads them into the computing unit's random access memory. After the parameters are loaded, a complete forward computation is performed, that is, the time-series signal sequence acquired at the current moment is sequentially input into the lightweight model, and pulse calculation and linear decoding are performed according to the method described in step two, outputting preliminary estimates of soil volumetric water content and ammonium nitrogen concentration. After the calculation is completed, the computing unit enters sleep mode again and repeats the above process.
[0032] When the energy-saving mode is enabled, numerical integral extrapolation based on historical time-series data replaces part of the lightweight model inference. Specifically, the edge computing unit first reads the water content and ammonium nitrogen concentration from the most recent output by the lightweight model, using this set of values as initial values. Simultaneously, it reads another historical output value prior to this output, and the difference between the time corresponding to this historical output value and the time of the most recent output is recorded as the time interval. The rate of change per unit time is calculated as follows: subtract the historical water content value from the most recent output water content value, then divide by the time interval to obtain the rate of change of water content, expressed as a percentage per hour; the rate of change of ammonium nitrogen concentration is calculated in the same way, expressed as milligrams per kilogram per hour.
[0033] The elapsed time after the energy-saving mode activation flag is set as the elapsed duration. This duration is accumulated using a real-time clock, starting from the moment the energy-saving mode is activated, and is measured in hours. The elapsed duration is multiplied by the rate of change in water content and the rate of change in ammonium nitrogen concentration, respectively, to obtain the increments in water content and ammonium nitrogen concentration. The initial value of water content is added to the increments in water content to obtain the estimated water content value; similarly, the initial value of ammonium nitrogen concentration is added to the increments in ammonium nitrogen concentration to obtain the estimated ammonium nitrogen concentration value. In these addition operations, if the increment is negative, the estimated value for the continued operation is less than the initial value.
[0034] The maximum extrapolation span is preset to 48 hours. This span is determined as follows: In the verification test before model deployment, the soil moisture content decay curve under 72 hours of no irrigation is continuously recorded. The time corresponding to when the extrapolation error exceeds 10% is calculated, and half of this time is taken as the maximum extrapolation span. When the elapsed time after the energy-saving mode is activated exceeds 48 hours, the above numerical integration extrapolation calculation is stopped, and no new continuation estimate is output. At the same time, the last output continuation estimate is marked as invalid. When subsequent steps receive this invalid mark, this estimate will not be used for fusion judgment.
[0035] In the fusion output module, the received preliminary and sustained estimates are fused in chronological order to obtain the final interpreted soil moisture content and ammonium nitrogen concentration. It then determines whether to output an irrigation command when the moisture content is below the field capacity threshold and the ammonium nitrogen concentration is above the fertilization threshold. Specifically, this includes: The incoming preliminary and continuation estimates are aligned according to their respective time labels. Each estimate is marked with an absolute timestamp at the time of its generation, provided by a real-time clock and accurate to the second. The timestamp for the preliminary estimate is the moment when the lightweight model completes its forward computation, while the timestamp for the continuation estimate is the target moment corresponding to the numerical integration extrapolation. The alignment operation is as follows: using a one-minute time grid, each estimate is assigned to the grid to which its timestamp belongs; if multiple estimates exist within the same grid, the latest generated one is taken as the representative value for that grid, and the others are discarded. After alignment, a mixed estimate sequence is obtained, arranged in ascending order of time. Each element in the sequence contains a timestamp, an estimate type flag (preliminary or continuation), and specific water content and ammonium nitrogen concentration values.
[0036] For cases where both preliminary and extended estimates exist under the same time label, a fusion weight for the preliminary estimate needs to be determined. This weight is obtained by mapping the pulse trigger frequency, as follows: A minimum and maximum reference value for the pulse trigger frequency are pre-defined, with the minimum reference value set to 0.2 Hz and the maximum reference value to 5.0 Hz. When the actual pulse trigger frequency is less than or equal to the minimum reference value, the fusion weight is set to 0.1; when the actual pulse trigger frequency is greater than or equal to the maximum reference value, the fusion weight is set to 0.9; when the actual pulse trigger frequency is between the two, the fusion weight is determined according to the following mathematical formula: ; in, The fusion weight represents the preliminary estimate; it is dimensionless and ranges from 0.1 to 0.9. This indicates the pulse trigger frequency, measured in Hertz (Hz). This represents the minimum reference frequency, with a value of 0.2 Hz. This represents the maximum reference frequency, which is 5.0 Hz. The physical meaning of this formula is: the higher the pulse trigger frequency, the more drastic the change in soil parameters, and the higher the reliability of the lightweight model inference, thus giving greater weight to the initial estimate; conversely, when the change is gradual, the reliability of the continuation estimate increases relatively, and the weight is tilted towards the continuation estimate.
[0037] Determining the fusion weights of the preliminary estimates Then, the fusion weights of the continued estimates are automatically taken as... For the moisture content estimates under the same time label, the preliminary estimated moisture content value is multiplied by... Multiply the estimated water content value by Then, the two products are added together to obtain the final interpreted water content value. The same method is used for ammonium nitrogen concentration, employing the same fusion weights. The preliminary estimated ammonium nitrogen concentration value is weighted and summed with the subsequent estimated ammonium nitrogen concentration values to obtain the final interpreted ammonium nitrogen concentration value. The above weighted summation process can be expressed by the following mathematical formula: ; in, This indicates the final interpreted soil parameter value (which can be water content or ammonium nitrogen concentration). This indicates a preliminary estimate; Indicates the continuing estimate; The fusion weights were determined in the previous section. This formula ensures that the two estimates are mixed according to their confidence levels, and that the sum of the weights is always 1.
[0038] For time tags with only preliminary estimates and no continuation estimates, or only continuation estimates and no preliminary estimates, the estimated value is directly used as the final interpreted value without weighted fusion. Specifically, if the time tag corresponds to the lightweight model wake-up time, only a preliminary estimate is available, and no continuation estimate exists; the final interpreted value is directly equal to the preliminary estimate. If the time tag corresponds to the extrapolation time under energy-saving mode, and the lightweight model is not awake at that time, only a continuation estimate is available, and the final interpreted value is directly equal to this continuation estimate. All the final interpreted values processed above are arranged in chronological order according to the time tags to form a complete interpreted sequence. Each element in the sequence contains a time tag, the final interpreted water content value, and the final interpreted ammonium nitrogen concentration value. This sequence is refreshed every five minutes and stored in the circular buffer of the edge computing unit.
[0039] The edge computing unit sequentially reads the final interpreted water content value from the interpretation sequence and compares it with a pre-stored field capacity threshold. The field capacity threshold is obtained as follows: three representative points are selected in the target field, and the field capacity of the 0-20 cm topsoil layer is measured using a ring cutter method. The arithmetic mean of the three measurements is taken as the threshold, expressed as a volume percentage. In this embodiment, the threshold is 32%. The comparison operation is as follows: starting from the current time point, the water content values of three consecutive time points are traced back, with each time point spaced 30 minutes apart. If all three values are lower than the field capacity threshold, a binary flag named "Moisture Condition Flag" is set to 1; otherwise, the flag is set to 0. This flag is stored in the edge computing unit's register, initially in a state of 0, and is recalculated and updated each time a new interpreted value is added to the sequence.
[0040] The edge computing unit reads the final interpreted ammonium nitrogen concentration value at the current time point and the ammonium nitrogen concentration value at the previous time point from the interpretation sequence, and compares it with a pre-stored fertilization threshold. The fertilization threshold is obtained as follows: In the target field, 20 representative soil samples are collected during the rice booting stage, and the ammonium nitrogen concentration is determined using flow injection analysis. The critical concentration that maximizes rice yield is taken as the fertilization threshold; in this embodiment, the threshold is 30 mg / kg. The judgment logic is as follows: if the ammonium nitrogen concentration value at the current time point is higher than the fertilization threshold, and the ammonium nitrogen concentration value at the previous time point is not higher than the fertilization threshold, then a binary flag named "Nitrogen Condition Flag" is set to 1; otherwise, the flag is set to 0. This flag is also stored in a register and updated each time a new interpreted value arrives. This judgment method implements rising edge triggering, that is, a valid flag is output only when the ammonium nitrogen concentration changes from below the threshold to above the threshold, avoiding repeated triggering when it remains above the threshold.
[0041] When both the moisture and nitrogen condition flags are set (i.e., both flags are 1), the edge computing unit outputs a high-level pulse signal lasting 500 milliseconds through its general-purpose input / output interface. This signal, amplified by the driver circuit, triggers the irrigation solenoid valve to open, executing a shallow irrigation operation. After the irrigation command is output, the edge computing unit resets both the moisture and nitrogen condition flags to 0 at the start of the next computing cycle to prevent the same irrigation event from being triggered repeatedly. If the two flags are not set simultaneously, no irrigation command is output, and the flags remain in their current state awaiting the next interpreted value update. This judgment and output process is repeated after each new final interpreted value is generated, ensuring the real-time nature and accuracy of irrigation decisions.
[0042] The working principle of this invention is as follows: First, in a farmland setting, the capacitance, dielectric constant, and electrode potential of the soil are collected using a capacitive moisture sensor and an ammonium nitrogen ion selective electrode. A time-series signal sequence of five consecutive sampling times is constructed at 6-minute intervals. This time-series signal sequence is then input into a lightweight pulse model obtained by transforming a long short-term memory network through a leakage integral ignition function and performing layer-by-layer normalization. This model triggers sparse pulse calculation only when the difference between the current dielectric constant and the average of the previous five times exceeds a preset threshold. By weighting and accumulating the pulse counts of ten consecutive time steps with pre-calibrated decoding coefficients and applying saturation constraints, preliminary estimates of soil volumetric water content and ammonium nitrogen concentration, as well as the pulse triggering frequency, are output. Then, based on the pulse triggering frequency, the cumulative photovoltaic power calculated from cloud cover over the next 72 hours, and the current energy storage status... The state percentage and agricultural window option are used to reconstruct a four-dimensional state description, which is then input into a dual-hidden-layer fully connected reinforcement learning network. The network outputs an inference frequency level (corresponding to a wake-up time of 0.5 to 4 hours) and an energy-saving mode flag. Subsequently, the lightweight model is woken up by a sleep counter according to the inference frequency level to perform forward computation. When the energy-saving mode flag is valid, the rate of change is calculated using historical data from the two most recent model outputs, and continuous estimates of water content and ammonium nitrogen concentration are generated through linear extrapolation (maximum span of 48 hours). Finally, the preliminary estimate and the continuous estimate are aligned by time label, and a weighted sum is obtained based on the fusion weight of the pulse trigger frequency mapping to obtain the final interpretation value. When the water content at three consecutive time points is lower than the field capacity threshold and the ammonium nitrogen concentration shows an upward edge from lower to higher than the fertilization threshold, an irrigation start command is output.
[0043] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.
Claims
1. A real-time interpretation system for farmland soil parameters integrating edge computing and lightweight models, characterized in that, include: The data acquisition module is used to collect the capacitance, dielectric constant and ion-selective electrode potential of farmland soil, and construct a time-series signal sequence containing multiple consecutive sampling times; The lightweight inference module inputs the time-series signal sequence into the lightweight model obtained by pulse conversion from the time-series memory structure. The lightweight model only triggers sparse calculation when the signal change exceeds a preset threshold, and outputs preliminary estimates of soil volumetric water content and ammonium nitrogen concentration, as well as the pulse trigger frequency. The decision-making and scheduling module, based on the pulse triggering frequency, future meteorological numerical forecasts, current energy storage status, and agricultural window options, uses reinforcement learning to output inference frequency levels and energy-saving mode indicators, and transmits preliminary estimates. The energy-saving inference module wakes up the lightweight model for inference according to the inference frequency level. When the energy-saving mode flag is valid, it uses numerical integration extrapolation based on historical time series data to replace part of the lightweight model inference and outputs the continuous estimates of water content and ammonium nitrogen concentration. The fusion output module merges the incoming preliminary and extended estimates in chronological order to obtain the final interpreted soil moisture content and ammonium nitrogen concentration. It then determines when the moisture content is below the field capacity threshold and the ammonium nitrogen concentration is above the fertilization threshold and outputs an irrigation command.
2. The real-time interpretation system for farmland soil parameters integrating edge computing and lightweight models according to claim 1, characterized in that, The lightweight model obtained by pulse transformation from the temporal memory structure specifically includes: The timing signal sequence is input sequentially in time steps. If the difference between the dielectric constant of the current capacitance and the average value of the previous five times exceeds a preset threshold, a pulse is generated and the membrane potential is updated; otherwise, it remains silent. The pulse counts at each time step are accumulated, and after linear decoding, preliminary estimates of soil volumetric water content and ammonium nitrogen concentration are output. At the same time, the number of pulses per unit time is output as the pulse trigger frequency.
3. The real-time interpretation system for farmland soil parameters integrating edge computing and lightweight models according to claim 2, characterized in that, The preliminary estimates of the output soil volumetric water content and ammonium nitrogen concentration specifically include: The pulse counts of ten consecutive time steps are arranged in reverse chronological order to form a counting sequence; The counting sequence is multiplied element-by-element by the first set of pre-stored decoding coefficients and then summed to obtain the cumulative sum; The cumulative sum and saturated function are restricted to the range between field capacity and wilting coefficient to provide a preliminary estimate of soil volumetric water content. At the same time, the second set of decoding coefficients is used to calculate a preliminary estimate of ammonium nitrogen concentration.
4. The real-time interpretation system for farmland soil parameters integrating edge computing and lightweight models according to claim 1, characterized in that, The process of using reinforcement learning to output inference frequency levels and energy-saving mode flags, and transmitting preliminary estimates, specifically includes: The pulse trigger frequency, the cumulative photovoltaic power calculated from the hourly cloud cover forecast for the next 72 hours, the percentage of the current energy storage status relative to the rated capacity, and the agricultural window option weight are combined to form a four-dimensional state description. The four-dimensional state description is input into a pre-trained dual-hidden-layer fully connected network. The output of the dual-hidden-layer fully connected network corresponds to the action value of four inference frequency levels and the action value of two energy-saving mode flags, respectively. The inference frequency setting with the highest action value is selected as the output, and the energy-saving mode flag is turned on or off based on whether the action value of the energy-saving mode flag exceeds the preset balance point. At the same time, the received preliminary estimate is directly passed to the next step.
5. The real-time interpretation system for farmland soil parameters integrating edge computing and lightweight models according to claim 1, characterized in that, The step of waking up the lightweight model for inference according to the inference frequency level specifically includes: Convert the inference frequency level into the target threshold of the sleep counter; the higher the level, the smaller the corresponding threshold. After each lightweight model completes inference, the sleep counter starts accumulating real-time clock pulses from zero, and a wake-up signal is generated when the accumulated value reaches the target threshold. In response to the wake-up signal, power is restored to the computing unit where the lightweight model is located and its parameters are loaded. After performing a complete forward calculation, it re-enters sleep mode.
6. The real-time interpretation system for farmland soil parameters integrating edge computing and lightweight models according to claim 1, characterized in that, The output estimates of water content and ammonium nitrogen concentration specifically include: The water content and ammonium nitrogen concentration from the most recent output of the lightweight model are used as initial values, and another historical value before the output is used to calculate the rate of change per unit time. Multiply the elapsed time after the energy-saving mode is activated by the rate of change to obtain the increment of change. The initial value is added to the increment of change to obtain the sustained estimates of water content and ammonium nitrogen concentration, respectively. When the elapsed time exceeds the preset maximum extrapolation span, the extrapolation is stopped and the sustained estimate is marked as invalid.
7. The real-time interpretation system for farmland soil parameters integrating edge computing and lightweight models according to claim 1, characterized in that, The final interpreted soil moisture content and ammonium nitrogen concentration specifically include: Align the preliminary and extended estimates according to their respective time labels; For cases where two estimates exist for the same time tag, the pulse trigger frequency is mapped to the fusion weight of the preliminary estimate, and 1 is subtracted from the corresponding weight as the fusion weight of the continuation estimate. The weighted sum is then calculated. For time tags with only a single estimated value, the corresponding estimated value is directly used as the final interpretation value, and the complete interpretation sequence is output in chronological order.
8. The real-time interpretation system for farmland soil parameters integrating edge computing and lightweight models according to claim 1, characterized in that, The determination that an irrigation command is output when the water content is below the field capacity threshold and the ammonium nitrogen concentration is above the fertilization threshold specifically includes: The final interpreted water content is compared with the pre-stored field capacity threshold. If the water content at three consecutive time points is lower than the field capacity threshold, the water condition flag is set. The final interpreted ammonium nitrogen concentration is compared with the fertilization threshold. If the concentration at the current time point is higher than the fertilization threshold and the concentration at the previous time point is not higher than the fertilization threshold, then the nitrogen condition flag is set. When both the moisture condition flag and the nitrogen condition flag are set, an irrigation start command is output, and both flags are reset simultaneously after the output.
Citation Information
Patent Citations
Water and fertilizer zoning management method and system in zoning composite planting mode
CN120182027A
Hydrological information forecast data collection automatic processing method
CN121705733A