A rice-frog symbiotic automatic water quality monitoring and self-adaptive regulation method and system
Patent Information
- Application Number
- CN202611199313.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-09
- Publication Date
- 2026-11-03
AI Technical Summary
Existing rice-frog symbiotic systems suffer from problems such as high false alarm and false negative rates in water quality monitoring, failure to adapt to the needs of different growth stages, lack of multi-parameter coupling crisis mode identification, low prediction accuracy, and difficulty in regulating biological demand conflicts.
An automatic water quality monitoring and adaptive regulation method for rice-frog symbiosis was adopted, which integrates multi-source data fusion. The method uses an isolated forest model for multi-dimensional anomaly scoring, combines a multi-parameter linkage anomaly pattern library for nearest neighbor matching, and combines growth stage adaptive thresholds and LSTM prediction models to achieve dual-objective prediction. Finally, a knowledge graph is used for weighted correction of regulation commands.
It reduced the false alarm and false alarm rates, improved the accuracy of water quality prediction, resolved the conflict of biological needs during critical stages such as the application period and the juvenile frog stage, and achieved precise and coordinated control with unattended operation and low maintenance costs.
Smart Images

Figure CN123032491A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural intelligent management technology, specifically to an automatic water quality monitoring and adaptive control method and system for rice-frog symbiosis. Background Technology
[0002] Rice-frog symbiosis, as an ecological agricultural model, achieves a mutually beneficial symbiotic relationship by having frogs feed on rice paddy pests, fertilize the fields with their excrement, and purify the water with the rice roots. However, frogs are extremely sensitive to water quality parameters, especially to changes in dissolved oxygen (>3 mg / L), ammonia nitrogen (<0.5 mg / L), and nitrite (<0.1 mg / L).
[0003] Currently, some agricultural IoT systems have attempted to achieve automatic water quality monitoring. For example, Chinese invention application (title: "An Intelligent Management System for Rice-Aquaculture Based on the Internet of Things", publication number: CN119937693A, publication date: 20250506) discloses an intelligent management system for rice-aquaculture based on the Internet of Things, which monitors water quality parameters in real time by deploying a sensor network and achieves automatic adjustment through a feedback control mechanism. Chinese invention (title: "Water Quality Prediction Method Based on Improved Genetic Algorithm Optimized LSTM Neural Network", publication number: CN111915097B, announcement date: 20221111) discloses a water quality prediction method based on an improved genetic algorithm optimized LSTM neural network. This method collects three parameters—water temperature, dissolved oxygen, and pH—in the aquaculture pond using water quality sensors mounted on an unmanned patrol vessel, and uses an LSTM model to predict water quality data at a future point in time. Chinese invention application (title: "Water quality prediction method for rice-shrimp based on RS rough set and CPA algorithm", publication number: CN114611840A, publication date: 20220610) discloses a water quality prediction method for rice-shrimp based on RS rough set and CPA algorithm, which simplifies the input features by attribute reduction and uses RBF neural network to predict the water quality level.
[0004] However, existing technologies generally suffer from the following shortcomings: First, anomaly detection uses fixed thresholds and lacks the ability to adapt to different growth stages of rice-frogs, which can easily lead to false alarms or missed alarms. Second, it is based solely on single-parameter exceedance judgment and has not established a linkage identification mechanism for multi-parameter coupled crisis modes, resulting in a high false alarm rate and a coarse response. Third, the water quality prediction model has not been optimized for the rice-frog scenario through feature engineering, resulting in insufficient input dimensions and ignoring key exogenous variables such as meteorology and feeding and fertilization, leading to low prediction accuracy. Fourth, it lacks an intelligent coordination mechanism for the conflict of biological needs between rice and frogs (such as high water levels during the pesticide application period and low water levels during the juvenile frog period), making it difficult for regulatory decisions to take both objectives into account. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides an automatic water quality monitoring and adaptive control method and system for rice-frog symbiosis. This system achieves closed-loop intelligent management of the entire process—from water quality monitoring to crisis identification, demand conflict balancing, and automatic control—reducing false alarm and missed alarm rates, improving prediction accuracy, and effectively resolving biological demand conflicts during critical stages such as the application of pesticides and the juvenile frog stage. It also enables precise collaborative control with unattended operation and low maintenance costs.
[0006] To achieve the above objectives, the present invention provides the following technical solution: An automated water quality monitoring and adaptive control method for rice-frog symbiosis includes the following steps: Step S1: Real-time collection of paddy field water quality data, as well as meteorological data, feeding data, and rice farming operation data; among which, paddy field water quality data includes pH, dissolved oxygen, ammonia nitrogen, nitrite, water temperature, and turbidity; Step S2: Input paddy field water quality data into a pre-trained isolated forest model to perform multi-dimensional anomaly scoring, and map the scoring results to a multi-parameter linked anomaly pattern library for nearest neighbor matching. Based on the matching results, output crisis control instructions or normal control instructions. Step S3: When the ambient temperature is between 18℃ and 28℃, determine the current growth stage of the rice frog according to the real-time clock and the breeding calendar, and load the corresponding water quality monitoring sub-item abnormal detection threshold from the growth cycle threshold mapping table. Step S4: Input paddy field water quality data, meteorological data, feeding amount data, and rice farming operation data into the pre-trained LSTM prediction model, and output rice safety indicators and frog safety indicators through a dual-objective prediction head; rice safety indicators include pH, ammonia nitrogen, and water temperature, and frog safety indicators include dissolved oxygen, nitrite, turbidity, and ammonia nitrogen. Step S5: Dynamically compare the rice safety indicators with the corresponding abnormal detection thresholds for rice, and calculate the deviation degree of the rice monitoring indicators and the overall deviation degree of the rice monitoring indicators; at the same time, dynamically compare the frog safety indicators with the corresponding abnormal detection thresholds for frog, and calculate the deviation degree of the frog monitoring indicators and the overall deviation degree of the frog monitoring indicators. Step S6: When the deviation of the comprehensive rice monitoring index or the deviation of the comprehensive frog monitoring index exceeds the preset comprehensive deviation threshold, the knowledge graph is retrieved to obtain the rice safety weight and frog safety weight corresponding to the current growth stage. Based on the deviation of the comprehensive rice monitoring index, the deviation of the comprehensive frog monitoring index, the rice safety weight and the frog safety weight, the crisis control instruction suggestion or the normal control instruction suggestion is corrected and adjusted to generate an optimized control instruction suggestion. Step S7: Perform water quality control operations according to the optimized control instructions.
[0007] An automated water quality monitoring and adaptive control system for rice-frog symbiosis includes: The data acquisition module is used to collect real-time data on paddy field water quality, meteorological data, feeding amount data, and rice farming operations. Among them, the paddy field water quality data includes pH, dissolved oxygen, ammonia nitrogen, nitrite, water temperature, and turbidity. The anomaly identification module is used to input paddy field water quality data into a pre-trained isolated forest model, generate a multi-dimensional anomaly score, and map the score result to a multi-parameter linked anomaly pattern library for nearest neighbor matching. Based on the matching result, it outputs crisis control instructions or normal control instructions. The stage determination module is used to determine the current growth stage of rice frogs based on the real-time clock and the breeding calendar when the ambient temperature is between 18℃ and 28℃, and load the corresponding water quality monitoring sub-item anomaly detection threshold from the growth cycle threshold mapping table. The prediction module is used to input paddy field water quality data, meteorological data, feeding data, and rice farming operation data into a pre-trained LSTM prediction model. It outputs rice safety indicators and frog safety indicators through a dual-objective prediction head. The rice safety indicators include pH, ammonia nitrogen, and water temperature, while the frog safety indicators include dissolved oxygen, nitrite, turbidity, and ammonia nitrogen. The deviation calculation module is used to dynamically compare the rice safety indicators with the corresponding abnormal detection thresholds for rice, and calculate the deviation degree of the rice monitoring indicators and the overall deviation degree of the rice monitoring indicators; at the same time, it dynamically compares the frog safety indicators with the corresponding abnormal detection thresholds for frog, and calculates the deviation degree of the frog monitoring indicators and the overall deviation degree of the frog monitoring indicators. The deviation correction decision module is used to retrieve the rice safety weight and frog safety weight corresponding to the current growth stage when the deviation of the comprehensive rice monitoring index or the comprehensive frog monitoring index exceeds the preset comprehensive deviation threshold. Based on the deviation of the comprehensive rice monitoring index, the deviation of the comprehensive frog monitoring index, the rice safety weight and the frog safety weight, the module corrects and adjusts the crisis control instruction suggestions or normal control instruction suggestions to generate optimized control instruction suggestions. The execution control module is used to perform water quality control operations based on the optimization and control instructions.
[0008] Compared with the prior art, the beneficial effects of the present invention are: This invention integrates multi-source agricultural and meteorological data, constructs an adaptive threshold mechanism for growth stages, and achieves multi-parameter coupled anomaly identification and dual-objective water quality prediction. Based on a knowledge graph, it dynamically loads safety weights for rice and frogs to perform weighted correction of control commands. In the rice-frog symbiotic system, it realizes closed-loop intelligent management of the entire process of "water quality monitoring - crisis identification - demand conflict balancing - automatic control", reduces false alarm and missed alarm rates, improves prediction accuracy, effectively solves the problem of biological demand conflict during key stages such as the application period and the juvenile frog stage, and achieves precise collaborative control with unattended operation and low maintenance costs. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This is a flowchart illustrating the automatic water quality monitoring and adaptive control method for rice-frog symbiosis in an embodiment of the present invention. Detailed Implementation
[0011] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope of the invention. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.
[0012] The embodiments of the present invention / invention are described in detail below with reference to the accompanying drawings.
[0013] In one embodiment of the present invention, an automatic water quality monitoring and adaptive control method for rice-frog symbiosis is designed, the process of which is shown in the attached figure. Figure 1 As shown in the figure. The method includes the following steps: Step S1: Collect real-time data on paddy field water quality, as well as meteorological data, feeding data, and rice farming operation data.
[0014] In this embodiment, the "paddy field water quality data" includes pH, dissolved oxygen, ammonia nitrogen, nitrite, water temperature, and turbidity, which can be acquired by corresponding sensors. pH directly affects nutrient availability and microbial activity; excessive acidity or alkalinity inhibits rice root absorption and frog gill function. Dissolved oxygen is a direct limiting factor for frog respiratory metabolism; levels below 3 mg / L can cause stress or even suffocation. Ammonia nitrogen and nitrite are highly toxic metabolic waste products in frogs; levels exceeding 0.5 mg / L and 0.1 mg / L, respectively, can cause tissue damage and immunosuppression. Water temperature regulates frog development rate and rice tillering; deviations from the optimal range (e.g., 18–28℃) will delay growth or induce disease. Turbidity reflects suspended solids and organic load in the water; excessively high levels can block sunlight, reduce photosynthetic efficiency, and clog frog gills. These six core water quality parameters collectively constitute the core evaluation dimensions of water quality health in the rice-frog symbiotic system, and none can be omitted.
[0015] In this embodiment, "meteorological data" refers to meteorological data related to the paddy field environment that are collected simultaneously when collecting paddy field water quality data. This includes, but is not limited to, external climate information such as ambient temperature, rainfall, sunlight, and wind speed, in order to reflect the impact of external conditions on the water body.
[0016] In this embodiment, "feeding amount data" refers to the daily feeding mass per unit area, expressed in kg / acre·day. By recording the daily feeding quantity, the activity of frogs and the potential disturbance of water quality by the feed itself can be tracked.
[0017] In this embodiment, "rice farming operation data" includes (1) fertilizer application information: the single application amount and application timestamp of nitrogen, phosphorus and potassium fertilizers, in kg / mu; where nitrogen fertilizer is calculated as urea, phosphorus fertilizer as superphosphate, and potassium fertilizer as potassium chloride; (2) pesticide application information: the name, application amount and time of herbicides, fungicides, etc. By collecting rice farming operation data, the intensity and time of fertilizer and pesticide application in farming operations can be grasped, thereby capturing the direct effects of human intervention and fertilizers and pesticides on water components.
[0018] In this step of the embodiment, water quality data of the paddy field is acquired through data collection methods, while meteorological data, feeding amount data, and rice farming operation data related to the paddy field environment are collected simultaneously. This data collection directly enables a comprehensive understanding of the water quality status and its external influencing factors within the rice-frog symbiotic system. This ensures that the information sources relied upon by subsequent processing steps cover the water quality itself and the interacting farming operations and environmental variables, providing a complete and synchronous raw input foundation for subsequent anomaly identification and control decisions.
[0019] Step S2: Input paddy field water quality data into a pre-trained isolated forest model for multi-dimensional anomaly scoring, and map the scoring results to a multi-parameter linked anomaly pattern library for nearest neighbor matching. Based on the matching results, output crisis control instructions or normal control instructions.
[0020] In this embodiment, the training samples of the "Isolated Forest Model" are derived from the logs of abnormal events recorded in historical rice-frog fields. A sliding window method is used to extract the temporal variation sequence of rice paddy water quality data, and the coefficient of variation of each parameter within the window exceeding a preset threshold is used as the criterion for determining a mutation event. The samples are then labeled with tags indicating whether regulatory operations have been triggered, thereby constructing an abnormal sample set with realistic ecological disturbance characteristics. This abnormal sample set fully reflects the regulatory response behavior of the rice-frog symbiotic system caused by sudden changes in water quality during actual operation. This allows the Isolated Forest Model to effectively learn the distribution of abnormal patterns that match the physiological sensitivity of the rice-frog symbiotic system during training, thereby improving its accuracy and ecological adaptability in scoring multi-dimensional water quality parameters. This ensures that the nearest neighbor matching results when subsequently mapped to the multi-parameter linked abnormal pattern library are closer to real crisis scenarios, enhancing the reliability and accuracy of regulatory command suggestions, and ultimately achieving dynamic, adaptive identification and intelligent intervention of water quality risks in the rice-frog symbiotic system.
[0021] For example, historical water quality monitoring logs and human intervention records were collected from 12 standardized experimental plots covering three typical rice-frog co-cultivation areas in East China, South China, and Southwest China over nearly three rice-frog farming cycles (approximately 36 months). Each sample included: (1) six-dimensional water quality time-series data (pH, dissolved oxygen, ammonia nitrogen, nitrite, water temperature, turbidity) for 72 consecutive hours, with a sampling frequency of once every 10 minutes; (2) corresponding agricultural operation logs (feeding amount, fertilizer amount, herbicide / bactericide dosage, irrigation and drainage records); (3) a manually marked "whether regulation was triggered" label, which was confirmed by the field manager based on actual emergency response behavior (such as turning on the aerator, suspending feeding, changing water, etc.) and used as the gold standard after expert review. To construct a mutation event sample, the sliding window method was used to extract features from each six-dimensional water quality time-series data: the window size was set to 6 hours (i.e., 36 sampling points), and the step size was 1 hour (i.e., sliding once per hour), forming overlapping time segments. Calculate the coefficient of variation (CV) for each of the six water quality parameters within each window. i =(σ i / μ i )×100%; where CV i Let σ be the coefficient of variation of the i-th water quality parameter (i=1,2,…,6, corresponding to pH, dissolved oxygen, ammonia nitrogen, nitrite, water temperature, and turbidity, respectively). i The standard deviation of this water quality parameter within the window is μ. iThis is the arithmetic mean of the water quality parameter within the window. If the CV of any water quality parameter is... i A water quality parameter is considered to have undergone a sudden change if its percentage exceeds 15% and the duration is at least three consecutive windows (≥3 hours). If at least two water quality parameters simultaneously meet the sudden change criteria, and there are corresponding records of human intervention (such as starting an aerator, changing water, or stopping feeding) within one hour before or after the window, the window is marked as a "positive sample" (triggering intervention). If a water quality parameter undergoes a sudden change but there is no intervention response, or if it recovers spontaneously without reaching the threshold, it is marked as a "negative sample" (no intervention triggered). Finally, after data cleaning and deduplication, a training dataset containing 2178 positive samples and 5432 negative samples is constructed for unsupervised anomaly scoring learning in the isolated forest model. During the isolated forest model training, 100 isolated trees are used, with each tree sampling 256 samples. After path length normalization, the anomaly score for each sample is output and used as input to a multi-parameter linked anomaly pattern library for nearest neighbor matching.
[0022] In this embodiment, the input features of the "isolated forest model" include six water quality parameters: pH, dissolved oxygen, ammonia nitrogen, nitrite, water temperature, and turbidity. To improve the sensitivity of anomaly detection to the biological risks of the rice-frog symbiotic system, this application does not use equal weighting, but constructs differentiated weights based on the differences in the physiological tolerance thresholds and lethal risk gradients of rice and frogs to various water quality parameters. Specifically, the weight allocation is based on: Dissolved oxygen (e.g., weight 0.25) – Frogs (especially tadpoles) are cutaneous respiratory organisms and are extremely sensitive to dissolved oxygen; when DO < 3.0 mg / L, tadpole mortality increases exponentially; long-term levels below 2.5 mg / L can cause adult frogs to suffocate; its regulatory response speed is the fastest and its lethal risk is the highest, hence it is given the highest weight. Nitrite (e.g., weight 0.22) – Nitrite can combine with frog hemoglobin to form methemoglobin, leading to tissue hypoxia; its toxicity is much higher than that of ammonia nitrogen (LD50). 50 Nitrite accounts for approximately 1 / 5 of ammonia nitrogen; in enclosed water bodies like paddy fields, nitrite easily accumulates during the ammonia oxidation stage and lacks a natural rapid decomposition mechanism, hence it is given the second highest weight. Ammonia nitrogen (e.g., weight 0.18) – although a major toxic factor in frogs, its toxicity is affected by pH and water temperature (the NH3 ratio increases sharply with increasing pH and water temperature); through subsequent LSTM prediction models that have integrated pH, water temperature, and other coupled corrections, its weight in the isolated forest model is slightly lower than nitrite, but still higher than other parameters. pH (e.g., weight 0.15) – pH directly affects not only the toxic forms of ammonia nitrogen (NH3 / NH4) +pH balance), also regulates algal reproduction and microbial activity; pH < 6.0 or > 9.0 can cause skin corrosion in frogs and root absorption disorders in rice, and is considered a medium-risk factor. Water temperature (e.g., weight 0.10) – Water temperature mainly affects water quality indirectly by influencing metabolic rate and biochemical reaction rate (e.g., accelerating organic matter decomposition and reducing dissolved oxygen saturation), and it is not directly toxic, hence its low weight. Turbidity (e.g., weight 0.10) – Mainly reflects suspended solids and algal biomass, indirectly affecting photosynthesis and diurnal fluctuations in dissolved oxygen, it has no direct lethal effect on frogs, and mainly serves as an auxiliary disturbance factor, hence its lowest weight. The aforementioned weighting is based on data from the applicant's earlier field-based lethal concentration experiments, specifically as follows: A 72-hour acute toxicity exposure test was conducted on young black-spotted frogs (3–5 cm in length) using the static water method. Test parameters included: dissolved oxygen (1.0–8.0 mg / L), nitrite (0.01–1.5 mg / L), and ammonia nitrogen (0.1–5.0 mg / L). The results showed that when dissolved oxygen ≤ 3.0 mg / L, the cumulative mortality rate over 72 hours reached 52.3%; when nitrite ≥ 0.15 mg / L, the mortality rate increased to 41.7%, with typical poisoning symptoms such as gill congestion and lethargy appearing; and when ammonia nitrogen ≥ 1.2 mg / L (pH=8.2), the mortality rate increased (compared to 12% mortality at pH=7.0 with 1.2 mg / L ammonia nitrogen). The above data forms a "physiological risk level": dissolved oxygen (extremely sensitive) > nitrite (highly sensitive) > ammonia nitrogen (moderately sensitive) > pH > water temperature > turbidity, and corresponding weights are assigned accordingly (0.25, 0.22, 0.18, 0.15, 0.10, 0.10, with a total of 1).
[0023] In this embodiment, the isolated forest model assigns differentiated weights to the six-dimensional water quality parameters (pH, dissolved oxygen, ammonia nitrogen, nitrite, water temperature, and turbidity) based on their physiological sensitivity differences within the rice-frog symbiotic system. For example, dissolved oxygen is weighted at 0.25, nitrite at 0.22, and pH and ammonia nitrogen at 0.15 and 0.18 respectively, reflecting their dual effects on rice root absorption and frog neurotoxicity, due to their impact on frog respiratory metabolism and toxicity accumulation. Water temperature and turbidity are both weighted at 0.10, reflecting their relatively low sensitivity as environmental background factors. This weighting mechanism ensures that the generated multidimensional anomaly scores accurately focus on the parameter combinations that pose the greatest threat to rice-frog survival, improving the matching accuracy with the multi-parameter linkage anomaly pattern library. This ensures that the output regulatory instructions can prioritize responses to high-risk stress events and provide a high signal-to-noise ratio input for subsequent corrective adjustments based on growth stage thresholds and dual-objective prediction results. Ultimately, this achieves a dynamic balance and synergistic optimization of water quality regulation between rice growth safety and frog physiological needs.
[0024] It should be noted that, in addition to the specific weight values mentioned above, other verification methods can also be used to obtain the corresponding weight values, but the "physiological risk level" must be reflected in the weights, such as dissolved oxygen (extremely sensitive) > nitrite (highly sensitive) > ammonia nitrogen (medium sensitive) > pH ≥ water temperature ≥ turbidity.
[0025] In this embodiment, the preset coupled crisis modes in the "multi-parameter linkage abnormal mode library" can be set according to the classification and summary of historical crisis situations in the rice-frog symbiotic system. For example, the following five coupled crisis modes can be preset: low dissolved oxygen accompanied by high ammonia nitrogen and rising water temperature; high turbidity superimposed with low pH and high nitrite; a sharp rise in ammonia nitrogen while the feeding amount exceeds the threshold; a sudden increase in nitrite and water disturbance after a sudden rainstorm; and a sudden rise in water temperature superimposed with accelerated nitrogen conversion after fertilization. Each coupled crisis pattern is represented by a six-dimensional centroid vector (representing pH, dissolved oxygen, ammonia nitrogen, nitrite, water temperature, and turbidity, respectively, with measured values normalized to minimum and maximum values, ranging from [0,1], where "1" represents "extreme danger"). This six-dimensional centroid vector is generated by the K-means clustering algorithm from the multidimensional anomaly scores output by the isolated forest model in historical anomaly events. The number of clusters is fixed at 5, and Euclidean distance is used as the distance metric. This achieves high-precision clustering representation of the joint anomaly features of multi-source heterogeneous data such as water quality, meteorology, feeding, and fertilization. This ensures that each coupled crisis pattern in the multi-parameter linkage anomaly pattern library can stably reflect the typical state of coupling imbalance of typical parameters in the rice-frog symbiotic system. Thus, when performing nearest neighbor matching on the real-time generated multidimensional anomaly score results, the accuracy and anti-interference ability of pattern recognition are improved. This effectively overcomes the problems of insufficient pattern representativeness and matching fluctuation caused by a single distance metric or uncertain clustering parameters, and ultimately achieves accurate identification and reliable response to water quality crises.
[0026] It should be noted that the values of each dimension in the above six-dimensional centroid vector are the original anomaly scores of the corresponding water quality parameters output in the isolated forest model, normalized to the [0,1] interval. The normalization range is determined based on the extreme values of each parameter score of all positive samples (triggering regulatory events) in the training set. For example, if the minimum dissolved oxygen score is 0.12 and the maximum is 0.98, then the normalization formula is: (score-0.12) / (0.98-0.12).
[0027] In this embodiment, "nearest neighbor matching" refers to combining the multi-dimensional anomaly score results output by the isolated forest model (i.e., the anomaly scores of six water quality parameters, corresponding to pH, dissolved oxygen, ammonia nitrogen, nitrite, water temperature, and turbidity) into a comprehensive anomaly feature vector, and intelligently comparing it with preset coupled crisis modes, such as the aforementioned five coupled crisis modes, to achieve accurate identification of multi-parameter coordinated anomalies. Since each coupled crisis mode is based on a large number of historical field anomaly events, it represents a specific "abnormal state of water quality parameter combination". For example: Mode M1: low dissolved oxygen + high ammonia nitrogen + rising water temperature (easily causes suffocation and poisoning of tadpoles); Mode M2: sudden rise in nitrite + low pH (easily causes "brown blood disease"); Mode M3: high turbidity + decreased dissolved oxygen + inhibited photosynthesis (easily leads to diurnal hypoxia cycle); Mode M4: simultaneous exceedance of ammonia nitrogen and nitrite (signs of nitrification system collapse); Mode M5: sudden rise in temperature + insufficient dissolved oxygen + rapid evaporation of water level (easily causes dehydration of tadpoles). A weighted similarity matching mechanism automatically determines which of the five modes the current abnormal feature vector is "most similar" to. Matching does not simply consider whether a single parameter exceeds its limit, but rather comprehensively considers the intensity of the anomalies linked by multiple parameters, assigning higher matching weights to parameters with a greater impact on frog survival (such as dissolved oxygen and nitrite). When the current abnormal feature is determined to be highly similar to a certain crisis mode (reaching a preset matching threshold), the corresponding precise control suggestion is triggered. If multiple modes match simultaneously, the more harmful and widely impactful instructions are prioritized and automatically weighted and merged based on the degree of matching. If none of the modes match, it is judged as a "general fluctuation," and only routine control suggestions are output (such as increasing oxygenation, which can be preset according to routine control needs).
[0028] For example, the parameter linkage exception mode library has the following preset coupling crisis modes: Mode M1: Low dissolved oxygen + high ammonia nitrogen + elevated water temperature (easily leads to suffocation and poisoning in tadpoles), with a six-dimensional centroid vector of [0.35, 0.88, 0.90, 0.70, 0.82, 0.40]. Mode M2: Sudden rise in nitrite + low pH (prone to "leukemia"), with a six-dimensional centroid vector of [0.20, 0.65, 0.50, 0.95, 0.55, 0.45]. Mode M3: High turbidity + decreased dissolved oxygen + inhibited photosynthesis (easily leads to diurnal hypoxia cycle), with a six-dimensional centroid vector of [0.50, 0.60, 0.35, 0.40, 0.45, 0.92]. Model M4: Ammonia nitrogen and nitrite exceed the standard simultaneously (signs of nitrification system collapse), with the six-dimensional centroid vector as: [0.40, 0.55, 0.92, 0.90, 0.60, 0.30]; Model M5: Sudden rise in temperature + insufficient dissolved oxygen + rapid evaporation of water level (easily leading to dehydration of tadpoles), the six-dimensional centroid vector is: [0.55, 0.85, 0.70, 0.55, 0.95, 0.45].
[0029] At 13:30 on a certain day, water quality data from paddy fields was collected and processed using an isolated forest model for multidimensional anomaly scoring. The output scores were: [0.30, 0.92, 0.88, 0.91, 0.75, 0.45] (corresponding to pH, dissolved oxygen, ammonia nitrogen, nitrite, water temperature, and turbidity, respectively). The weights for pH, dissolved oxygen, ammonia nitrogen, nitrite, water temperature, and turbidity were set to 0.15, 0.30, 0.20, 0.25, 0.05, and 0.05, respectively.
[0030] Calculated: Distance to the six-dimensional centroid vector of pattern M1 [0.35, 0.88, 0.90, 0.70, 0.82, 0.40]: √[0.30×(0.92−0.88) 2 +0.20×(0.88−0.90) 2 +0.25×(0.91−0.70) 2 +0.15×(0.30−0.35) 2 +0.05×(0.75−0.82) 2 +0.05×(0.45−0.40) 2 ]≈0.1110; Distance to the six-dimensional centroid vector of pattern M2: 0.2338; Distance to the six-dimensional centroid vector of pattern M3: 0.4165; Distance to the six-dimensional centroid vector of pattern M4: 0.2125; Distance to the six-dimensional centroid vector of pattern M5: 0.2274.
[0031] The preset matching threshold is 0.20. Only when the distance to the six-dimensional centroid vector of mode M1 is less than the threshold is the current mode determined to be "early stage hypoxia poisoning precursor" mode, and the multi-mode fusion mechanism is not triggered. The final output control command is: "Immediately increase oxygenation at full power, stop feeding for 48 hours, and spray nitrifying bacteria simultaneously", so as to achieve precise intervention in potential ecological collapse and avoid excessive water change and disturbance of the juvenile frog habitat caused by misjudging M4.
[0032] In this embodiment, the multidimensional anomaly score output by the isolated forest model is mapped to a preset multi-parameter linked anomaly pattern library for nearest neighbor matching, realizing intelligent identification of multi-parameter collaborative anomaly patterns. Compared with existing technologies that generally rely on the judgment of a single water quality parameter exceeding the limit (such as alarming only when dissolved oxygen is below 3 mg / L), which is prone to high-frequency false alarms due to local fluctuations or missed alarms due to the neglect of synergistic deterioration between parameters, this application constructs a centroid vector library of various typical coupled crisis patterns, and performs a structured comparison between the multidimensional anomaly features identified by the isolated forest model and historically accumulated composite risk patterns, accurately identifying synergistic effects of biological toxicity such as "low dissolved oxygen accompanied by high ammonia nitrogen and water temperature rise" and "sudden rise in nitrite and low pH synergistic toxicity". This mechanism breaks through the limitation of the traditional threshold method of "single-point triggering", upgrades the anomaly judgment from "parameter exceeding the limit" to "pattern recognition", reduces the false alarm rate and missed alarm rate, and evolves the control response from "coarse alarm" to "targeted intervention", which greatly improves the diagnostic accuracy and decision-making pertinence of complex water quality crises in rice-frog symbiotic systems.
[0033] Step S3: Determine the current growth stage of the rice frog based on the real-time clock and the aquaculture calendar, and load the corresponding water quality monitoring sub-item anomaly detection threshold from the growth cycle threshold mapping table.
[0034] In this embodiment, the "Growth Cycle Threshold Mapping Table" includes four stages of the rice frog life cycle: tadpole stage, juvenile stage, sub-adult stage, and adult stage. Abnormal detection thresholds for pH, dissolved oxygen, ammonia nitrogen, nitrite, water temperature, and turbidity are independently set for each stage. For example, as shown in the table below: Note: The lower limit of all thresholds is the "lower warning limit", the upper limit is the "risk limit", and the bilateral interval is the safe operating range.
[0035] To ensure that water quality thresholds are accurately adapted to environmental conditions and the physiological state of organisms, this embodiment further establishes a dual-mode switching mechanism of "life cycle stage-driven + environmental stress emergency response". The life cycle stage-driven mechanism: Within the suitable growth range of 18℃ to 28℃, based on the pre-set developmental time windows in the aquaculture calendar, it automatically identifies the current life cycle stage of the rice frog (tadpole stage, tadpole stage, sub-adult stage, or adult stage) and loads the corresponding six water quality anomaly detection thresholds. The switching criteria for each stage are as follows: Tadpole stage → Tadpole stage: 18–24 days after hatching (typically 21 days); Tadpole stage → Sub-adult stage: 45–55 days; Sub-adult stage → Adult stage: 75–85 days. These time windows are calibrated using field-measured molting and body length change data to ensure that the stage division is synchronized with biological development. Environmental stress emergency response mechanism: When the ambient temperature deviates from the normal growth range, the system automatically activates an emergency protection strategy: If the ambient temperature is >28℃, it is determined to be a "high temperature stress state". Since the tadpole, juvenile, and subadult stages are already at their physiological limits or functional decline under high temperatures, their original water quality thresholds cannot provide effective protection. The original thresholds for these stages are not used. Instead, only for individuals currently in the adult stage, the conservative upper limit parameters of their original thresholds are applied, namely: the upper limit of ammonia nitrogen is reduced from 0.5mg / L to 0.4mg / L, the upper limit of turbidity is reduced from 20NTU to 18NTU, and dissolved oxygen is maintained at ≥3.0mg / L. However, the operating time of the aeration equipment is increased by 30% or the daily effective aeration time is increased by 30%. This adjustment strategy only applies to the adult stage. Its essence is "within the controllable range, for the highest value biological population..." Precise protection is implemented for the entire organism (frogs at other stages may not have a high chance of being saved); if the ambient temperature is <18℃, it is judged as "low temperature stress / wintering preparation state", exiting the life cycle stage judgment and switching to a unified "wintering protection threshold" mode. At this time, the water quality safety standard only has the sole goal of "maintaining life survival", and the threshold is set as follows: dissolved oxygen ≥3.5mg / L (preventing asphyxiation); ammonia nitrogen ≤0.6mg / L (preventing accumulation of metabolic waste); nitrite ≤0.12mg / L (preventing methemoglobinemia); pH 6.5~8.5 (preventing acid-base fluctuations); water temperature ≥10℃ (no active heating, but alarm prompts); turbidity ≤25NTU (preventing hypoxia caused by silt disturbance). In this mode, the stage switching logic based on the growth calendar is suspended, and only basic survival parameters are monitored until the water temperature rises back to above 18℃.
[0036] In this embodiment, compared to the existing technology that generally uses a fixed threshold (such as always using 3 mg / L as the warning line for dissolved oxygen), which is prone to underreporting of insufficient dissolved oxygen during the tadpole stage due to the threshold being too low, and causing false alarms of non-crisis fluctuations during the adult frog stage due to the threshold being too wide, this application automatically identifies the growth stage of the rice-frog symbiotic system based on a real-time clock and aquaculture calendar, and loads the corresponding water quality anomaly detection threshold from the preset growth cycle-threshold mapping table, thereby realizing dynamic adaptive control of key parameters such as dissolved oxygen and ammonia nitrogen. Furthermore, this application establishes a differentiated threshold system based on the frog's growth stages (tadpole stage, juvenile stage, sub-adult stage, and adult stage). For example, the lower limit of dissolved oxygen in the tadpole stage is set at 4.2 mg / L (40% higher than the 3.0 mg / L in the adult stage), the upper limit of ammonia nitrogen is 0.3 mg / L (40% lower than the 0.5 mg / L in the adult stage), and the upper limit of nitrite is 0.05 mg / L (only half of the adult stage). The pH and water temperature ranges are also tightened accordingly to fully match the extreme sensitivity of tadpole-stage organisms to water quality. Crucially, this application utilizes the highly synchronized ecological characteristics of the rice-frog growth cycle, using the frog's growth stage as a proxy variable for rice agricultural needs: the tadpole stage corresponds to the rice seedling stage (sensitive to pesticides, requires shallow water), and the adult frog stage corresponds to the rice maturity stage (strong pesticide resistance, can be deep-irrigated). Thus, without needing to independently model the rice growth stages, an implicit constraint and synergistic protection of rice safety thresholds is achieved using a single dimension (frog stage). This mechanism improves the stage adaptability of anomaly detection, effectively avoiding typical risks such as drowning in the tadpole stage, misadjustment in the adult frog stage, and water level conflict during the application period caused by rigid thresholds. It provides a precise, low-redundancy, and engineering-implementable adaptive control basis for the rice-frog dual-objective symbiosis.
[0037] Step S4: Input paddy field water quality data, meteorological data, feeding amount data, and rice farming operation data into the pre-trained LSTM prediction model, and output rice safety indicators and frog safety indicators through a dual-objective prediction head; rice safety indicators include pH, ammonia nitrogen, and water temperature, and frog safety indicators include dissolved oxygen, nitrite, turbidity, and ammonia nitrogen.
[0038] In this embodiment, the "LSTM prediction model" employs a dual-output LSTM model with a multi-task weighted mixed loss function, and is pre-trained offline based on historical data from a real rice-frog symbiotic system. The model input layer contains 12 features: paddy field water quality parameters (pH, dissolved oxygen, ammonia nitrogen, nitrite, water temperature, turbidity, sampling frequency 30 minutes / time) and exogenous variables (daily average temperature, daily precipitation, daily relative humidity, cumulative feeding amount in the past 24 hours, cumulative fertilizer / pesticide application amount in the past 24 hours, and water level change from the previous day), standardized using Z-scores. The model structure consists of a single 128-dimensional LSTM hidden layer (tanh activation, dropout=0.3) followed by two parallel fully connected output heads—a rice safety indicator prediction head (outputting pH, ammonia nitrogen, and water temperature) and a frog safety indicator prediction head (outputting dissolved oxygen, nitrite, turbidity, and ammonia nitrogen). The weighted mixed loss function is as follows: ;in, By assigning higher optimization weights to frog-related indicators, their prediction bias can be reduced first. The mean square error of rice indicators is used, and since its fluctuations are relatively mild, the standard MSE loss is adopted. The Huber loss for frog indicators, with an inflection point threshold parameter δ=0.5, effectively suppresses the interference of outliers caused by sudden extreme water quality fluctuations such as rainstorm erosion, overfeeding, and dead frog decay on model training, improving the model's robustness to non-normal, long-tailed error distributions. The hybrid loss design balances the stability (MSE) of rice indicators with the sensitivity and outlier robustness (Huber) of frog indicators, achieving intelligent preference optimization that prioritizes frogs over rice without altering the model's input-output structure. The pre-training dataset comes from continuous monitoring data from three rice-frog co-cultivation demonstration bases in a certain province (March 2022 to October 2024), collecting a total of 18,762 valid samples covering four frog growth stages (tadpole stage, juvenile stage, sub-adult stage, and adult stage). The data is divided into training, validation, and test sets in a 7:1.5:1.5 ratio, and a 24-step sliding window is used to construct the time-series samples. Training was performed using the Adam optimizer (initial learning rate 0.001, batch size 64) for 200 epochs with early stopping (patience=15). The model's final performance on the test set is as follows: Compared to the baseline model that only uses MSE loss (i.e., both rice and frog indices use standard MSE loss with a 1:1 weighting), this model reduces the MAE of dissolved oxygen and nitrite in frogs by 15.4% and 16.7%, respectively. Furthermore, in extreme weather samples (e.g., a sudden drop in dissolved oxygen >2 mg / L after heavy rain), the standard deviation of the prediction error decreases by 34.2%, validating the robustness gains of Huber loss and frog weight enhancement on survival-sensitive indicators. After pre-training, the model weights are fixed and deployed on edge nodes for subsequent real-time water quality prediction and deviation calculation, supporting the precise implementation of the subsequent "dual-objective correction and control" mechanism.
[0039] In this step of the embodiment, paddy field water quality data, meteorological data, feeding data, and rice farming operation data are used as inputs and simultaneously fed into a pre-trained LSTM prediction model. Based on the temporal correlation of these multi-source data, calculations are performed, and the model's internal dual-objective prediction head generates two sets of prediction outputs: one set for rice safety indicators, including future predicted values for pH, ammonia nitrogen, and water temperature; the other set for frog safety indicators, including future predicted values for dissolved oxygen, nitrite, turbidity, and ammonia nitrogen. This process directly incorporates biological aquaculture and farming operation variables affecting water quality, along with environmental meteorological factors, into the prediction framework. This allows the model to simultaneously output prediction results for two key indicators related to rice growth safety and frog survival safety without relying on a single water quality time-series data.
[0040] It should be noted that this application constructs "rice safety indicators" and "frog safety indicators" at the output of the dual-objective LSTM prediction model, both of which include predicted values for the future trend of ammonia nitrogen concentration. These predicted values are driven by the same set of historical ammonia nitrogen water quality time-series data and output separately through the dual-branch prediction heads in the same model architecture; they are not two independent measurements or inputs of ammonia nitrogen. This is because rice and frogs have fundamentally different mechanisms of action on ammonia nitrogen: rice uses ammonia nitrogen as a nitrogen nutrient source, and its safety threshold is relatively high (up to 2–5 mg / L, depending on the variety and growth stage); while frogs are extremely sensitive to the toxicity of ammonia nitrogen (especially non-ionic ammonia NH3), with a very low safety threshold (<0.5 mg / L), which dynamically changes with pH and water temperature. This application, through its dual-objective prediction structure, enables the model to learn the "rice nutrient response pattern" and the "frog toxicity response pattern" separately, based on shared underlying time-series features, thereby generating two ammonia nitrogen prediction curves with different physical meanings. At the regulatory decision-making level, the system compares these two predicted values with their respective dynamic thresholds (loaded according to the growth stage) to achieve a "dual safety assessment" of the same physical quantity—ammonia nitrogen concentration: on the one hand, it assesses whether it exceeds the upper limit of rice nutrient absorption (preventing fertilizer damage); on the other hand, it assesses whether it exceeds the lower limit of acute toxicity in frogs (preventing poisoning). This mechanism achieves the technical effect of "one measurement for two uses and coordinated prevention and control": relying on only one set of water quality sensors and one sensor data stream, through innovative model architecture, it completes differentiated responses to two types of biosafety needs, breaking through the limitations of traditional systems with "single threshold and single target," and significantly improving the coordinated regulation accuracy and biocompatibility of the rice-frog symbiotic system.
[0041] Step S5: Dynamically compare the rice safety indicators with the corresponding rice anomaly detection thresholds to calculate the deviation degree of the rice monitoring indicators and the comprehensive deviation degree of the rice monitoring indicators; simultaneously, dynamically compare the frog safety indicators with the corresponding frog anomaly detection thresholds to calculate the deviation degree of the frog monitoring indicators and the comprehensive deviation degree of the frog monitoring indicators; wherein, the comprehensive deviation degree of the rice monitoring indicators and the comprehensive deviation degree of the frog monitoring indicators are both the comprehensive deviation amount obtained by normalizing the deviation degree of the LSTM predicted values according to the current growth stage dynamic threshold range.
[0042] In this implementation, the "deviation degree of rice monitoring indicators" is calculated by quantifying the deviation of the predicted values of rice safety indicators within a preset future timeframe, based on the frog growth stage determined by the real-time clock and breeding calendar of the current rice-frog symbiosis system. This deviation is calculated by loading the corresponding dynamic threshold ranges of rice safety indicators from the growth cycle-threshold mapping table, and then performing a deviation quantification on the predicted values of rice safety indicators output by the LSTM prediction model. This deviation degree is calculated in the form of a deviation level, and each rice safety indicator (pH, ammonia nitrogen, water temperature) is evaluated separately. The calculation formula is as follows: In the formula, This indicates the degree of deviation of the i-th rice safety indicator (dimensionless, ranging from [0,1]). This represents the future prediction value of the indicator by the LSTM prediction model; This indicates the target threshold center value (or the median of the safe interval) for the current growth stage of this indicator. This represents the upper and lower limits of the safe threshold allowed for the indicator at the current growth stage, forming a dynamic range. For ease of unified system processing, the weighted average of the deviations of the three indicators is ultimately used as the comprehensive deviation of the rice monitoring indicator. In the formula, This indicates the degree of deviation of comprehensive rice monitoring indicators; This indicates the degree of deviation of the safety indicators for rice, including pH, ammonia nitrogen, and water temperature. The weights representing the deviations of pH, ammonia nitrogen, and water temperature among the rice safety indicators can be set according to the physiological sensitivity of rice, such as 0.3, 0.5, and 0.2 respectively, with a sum of 1. By dividing the difference between the predicted value of the rice safety indicator and the abnormal detection threshold of its corresponding growth stage by the threshold interval width of that indicator and taking the absolute value, and then assigning corresponding weights based on the influence coefficients of ammonia nitrogen, pH, and water temperature on rice growth inhibition, the deviation of rice monitoring indicators is standardized and quantitatively calculated. This method not only eliminates the comparison bias caused by different indicator dimensions and fluctuation ranges, but also incorporates the relative inhibitory influence intensity supported by biology into the calculation system, making the assessment of deviation comparable and physiologically based. This provides accurate, objective, and repeatable input for subsequent correction of control commands based on the deviations and safety weights of rice and frogs, improving the scientific validity and effectiveness of optimized control recommendations.
[0043] For example, assuming the current period is for pesticide application of rice (corresponding to the sub-adult frog stage or adult frog stage), the safety threshold for rice at the corresponding growth stage is: pH: 6.5±0.5→[6.0,7.0], with a center value of 6.5; Ammonia nitrogen: ≤1.2mg / L → Upper limit of safety 1.2mg / L, lower limit 0.3mg / L, center value 0.75mg / L; Water temperature: 28±3℃→[25℃,31℃], with a center value of 28℃; LSTM prediction model predicts the next 48 hours: pH=7.2 → Deviation from center value 0.7, interval width 1.0 → D pH =0.7; Ammonia nitrogen = 0.5 mg / L → Deviation from center value 0.25, interval width 0.9 → D NH3 =0.28; Water temperature = 30.5℃ → Deviation from center value 2.5, interval width 6 → D temp =0.42; Overall deviation of rice monitoring indicators (weighted): → This indicates that the overall deviation of the rice safety indicators is 43.4%, which is in a moderate warning state.
[0044] Similarly, in this embodiment, the "deviation degree of frog monitoring indicators" is determined based on the frog growth stage as determined by the real-time clock and breeding calendar of the current rice-frog symbiosis system. The corresponding dynamic threshold intervals for frog safety indicators are loaded from the growth cycle-threshold mapping table. For the predicted values of frog safety indicators (dissolved oxygen, nitrite, turbidity, and ammonia nitrogen) within a preset future time period predicted by the LSTM prediction model, the normalized deviation degree relative to the center value of the safety interval is calculated for each indicator. The overall deviation is obtained by weighting and fusing these deviations according to the frog's physiological sensitivity weights. This deviation degree is calculated in the form of a deviation degree, and each frog safety indicator (dissolved oxygen, nitrite, turbidity, and ammonia nitrogen) is evaluated separately. The calculation formula is as follows: In the formula, This indicates the degree of deviation of the i-th frog safety indicator (dimensionless, ranging from [0,1]). This represents the future prediction value of the indicator by the LSTM prediction model; This indicates the target threshold center value (or the median of the safe interval) for the current growth stage of this indicator. This represents the upper and lower limits of the safe threshold allowed for the indicator at the current growth stage, forming a dynamic range. For ease of unified system processing, the weighted average of the deviations of the three indicators is ultimately used as the comprehensive deviation of the frog monitoring indicator. In the formula, This indicates the degree of deviation of comprehensive frog monitoring indicators; This indicates the degree of deviation of the safety indicators for frogs, including dissolved oxygen, nitrite, turbidity, and ammonia nitrogen. The weights representing the deviations of the four safety indicators for frogs—dissolved oxygen, nitrite, turbidity, and ammonia nitrogen—are set based on the physiological sensitivity of frogs, such as 0.4, 0.35, 0.07, and 0.18 respectively, with a total of 1. By subtracting the predicted values of each of these four safety indicators from the corresponding abnormal detection thresholds for their respective growth stages, dividing by the threshold range width of each indicator, and taking the absolute value, and then weighting the sum according to their statistical impact on frog survival rate, the quantitative results of the deviation have a clear biological basis. When subsequently used in conjunction with the deviation of rice monitoring indicators to participate in the correction of control commands, this improves the system's response accuracy to the survival needs of frogs, effectively alleviating the decision-making bias problem caused by the conflicting needs of the two parties in water quality control in rice-frog symbiosis systems. Ultimately, it achieves precise and intelligent control that balances rice growth safety and frog survival rate.
[0045] In this embodiment, the comparison of rice safety indicators with corresponding anomaly detection thresholds is achieved by directly comparing them to preset threshold standards to determine whether the rice safety indicators exceed the allowable range, thereby quantifying the deviation of the rice growth environment. Simultaneously, the comparison of frog safety indicators with corresponding anomaly detection thresholds is performed to independently assess the safety of the frog's living environment and obtain the degree of deviation. These two comparison operations are conducted independently, targeting the safety indicator systems of rice and frogs respectively, without mixing or overlapping. Only a single-dimensional numerical comparison is performed based on their respective thresholds, ultimately yielding the deviation degrees of the rice monitoring indicators and the frog monitoring indicators, serving as a quantitative basis for subsequent regulation and correction.
[0046] Step S6: When the deviation of the comprehensive rice monitoring index or the deviation of the comprehensive frog monitoring index exceeds the preset comprehensive deviation threshold, the knowledge graph is retrieved to obtain the rice safety weight and frog safety weight corresponding to the current growth stage. Based on the deviation of the comprehensive rice monitoring index, the deviation of the comprehensive frog monitoring index, the rice safety weight, and the frog safety weight, the crisis control instruction suggestion or normal control instruction suggestion output in step S2 is corrected and adjusted to generate an optimized control instruction suggestion.
[0047] In this implementation, the "knowledge graph" is a structured rule database stored on local edge nodes. The nodes include: growth stage, agricultural operation records, rice safety weight, frog safety weight, instruction priority, etc. The rice safety weight and frog safety weight in the knowledge graph are dynamically assigned according to the following rules: (1) If herbicide, fungicide, or other pesticide application records are detected in the fertilizer application data and the timestamp is within the previous 24 hours, then the rice safety weight is ≥0.7 and the frog safety weight is ≤0.3, with the sum of the two being 1; (2) If the frog is currently in the juvenile stage and no water replenishment or water change operations have been detected in the past 72 hours, then even if there are no recent pesticide application records, the rice safety weight is still maintained at ≥0.7 and the frog safety weight is ≤0.3, with the sum of the two being 1; (3) If the frog is currently in the juvenile stage and there are no agricultural operation records (i.e., no fertilization, pesticide application, water change, etc.), then the frog safety weight is ≥0.7. 0.6, rice safety weight ≤ 0.4, the sum of the two is 1; (4) For other growth stages (including tadpole stage, sub-adult frog stage, adult frog stage and non-pesticide application period of rice), the system adopts preset default weights: rice safety weight 0.5, frog safety weight 0.5, in order to maintain regulatory balance.
[0048] In this embodiment, the "correction adjustment" includes: multiplying the deviation degree of the comprehensive rice monitoring index and the deviation degree of the comprehensive frog monitoring index by their corresponding rice safety weight and frog safety weight, respectively, to obtain a weighted deviation degree. After normalization, the weighted deviation degree ratio determines whether to adopt, correct, or reject the control instruction suggestion output in step S2. For example, when the ratio is greater than 1.5, the frog control suggestion is adopted first; when it is less than 0.67, the rice control suggestion is adopted first; and when it is between 0.67 and 1.5, the original suggestion is maintained. The above ratio threshold (1.5 and 0.67) is a symmetrical boundary of 1 / 1.5, which is derived from the statistical analysis of more than 2,000 historical control cases: when the frog weighted deviation degree is ≥ 1.5 times the rice weighted deviation degree, 92% of the field feedback shows that 'prioritizing frog protection' can improve the survival rate; conversely, when the rice weighted deviation degree is ≥ 1.5 times the frog deviation degree, the risk of rice yield loss increases by more than 30%. When the safety indicators of rice or frogs exceed the anomaly detection threshold for the corresponding growth stage, the system obtains the safety weights of rice and frogs at the current stage based on a knowledge graph. It then multiplies the deviation of the rice monitoring indicator by the rice safety weight to obtain the rice weighted deviation, and multiplies the deviation of the frog monitoring indicator by the frog safety weight to obtain the frog weighted deviation. Both are then normalized using MinMax to eliminate dimensional differences before calculating their ratio. Based on the preset range of this ratio—greater than 1.5, frog demand is considered higher priority, and frog control suggestions are automatically adopted; less than 0.67, rice demand is considered higher priority, and rice control suggestions are automatically adopted; between 0.67 and 1.5, the original instruction suggestions are maintained. This achieves dynamic correction of the output instructions of the isolated forest model, transforming the originally subjective weight application into a quantifiable, comparable, and reproducible numerical decision-making mechanism. This effectively resolves the dynamic conflict between rice and frogs in terms of water quality requirements, improving the accuracy, stability, and engineering feasibility of the control strategy.
[0049] For example, when the rice-frog symbiotic system is in the rice application period and the frogs are in the juvenile development stage, the system loads the corresponding growth stage anomaly detection thresholds according to the real-time clock and the aquaculture calendar. It calculates a multi-dimensional anomaly score through the isolated forest model and matches it to the multi-parameter linkage anomaly pattern library, outputting a "normal control instruction suggestion". Subsequently, the LSTM prediction model integrates meteorological data, feeding amount and rice farming operation data to generate rice safety indicators and frog safety indicators for the next 6 hours. It finds that the predicted value of rice ammonia nitrogen concentration slightly exceeds the threshold (deviation degree of 0.12), while the predicted value of frog dissolved oxygen is seriously low (deviation degree of 0.45). After calculating the weighted deviation, the frog safety weight is 0.7 and the rice safety weight is 0.3, resulting in a weighted deviation degree of 0.315 for frogs and 0.036 for rice. The normalized ratio is 8.75, which is far greater than 1.5. Based on this, the system rejects the original normal control suggestion, prioritizes the frog control instruction, automatically starts the oxygenation device and suspends the water level raising operation.
[0050] In this embodiment, when the deviation of the comprehensive rice monitoring index or the comprehensive frog monitoring index exceeds a preset comprehensive deviation threshold, a retrieval operation for the current growth stage is triggered. Based on the preset rice safety weight and frog safety weight in the knowledge graph for this stage, the previously generated crisis control instruction suggestions or normal control instruction suggestions are corrected and adjusted. This adjustment process is based on the numerical values of the deviation of the rice monitoring index and the frog monitoring index, combined with the quantitative relationship between the rice safety weight and the frog safety weight, to dynamically correct the tendency of the crisis control instruction suggestions or normal control instruction suggestions. This ensures that the crisis control instruction suggestions or normal control instruction suggestions are more aligned with the respective safety priority allocations of rice and frogs at the current growth stage without changing the original instruction structure. This process does not introduce external decision-making logic; it relies solely on the mathematical correlation between the recorded weight parameters and the deviation degree to directly correct the control suggestions. Furthermore, in this embodiment, the correction and adjustment mechanism does not depend on the output category (crisis or normal) of the isolated forest model, but is instead used as a standardized post-processing step after each LSTM prediction, uniformly applied to all control instruction suggestions. This process performs mathematical calculations based solely on the numerical relationship between pre-set weight parameters and the degree of deviation. It does not introduce external decision-making logic, nor does it change the original structure of the instructions. It only performs objective, quantifiable, and reproducible dynamic calibration of the instruction tendency through weighted ratios, thereby achieving real-time, intelligent, adaptive, and collaborative regulation of the biological demand conflict between rice and frogs without increasing the complexity of the system.
[0051] Step S7: Perform water quality control operations according to the optimized control instructions.
[0052] In this step of the embodiment, water quality control operations are performed according to the optimized control instructions. That is, based on the generated control instructions, physical or chemical parameters of the paddy field water are directly adjusted to ensure that the water quality state approaches the target state indicated by the instructions. This operation does not involve re-evaluating the source of the instructions or refining the selection of control methods; it uses the instructions as the sole basis for execution, completing a closed-loop response from the decision-making end to the execution end, and achieving real-time intervention in the water quality environment.
[0053] By applying the technical solution of this embodiment, multi-dimensional data such as paddy field water quality, weather, feeding amount, and fertilizer amount are collected in real time. Combined with an isolated forest model, multi-dimensional anomaly scores are generated and matched with a multi-parameter linked anomaly pattern library to achieve collaborative identification and accurate classification of water quality anomalies, avoiding misjudgments caused by single parameter exceeding limits. Simultaneously, water quality anomaly detection thresholds corresponding to the growth stage are dynamically loaded based on a real-time clock and aquaculture calendar, allowing water quality control standards to adaptively adjust with changes in the physiological needs of rice and frogs, overcoming biological demand conflicts caused by fixed thresholds. Furthermore, an LSTM prediction model synchronously outputs rice safety indicators and frog safety indicators, and combines meteorological and input variables to improve prediction accuracy. This system enables differentiated assessment of two types of biosafety states. When either indicator deviates from the threshold, it automatically retrieves the priority weights of rice and frogs at the current growth stage from the knowledge graph. Based on the degree of deviation and weight, it collaboratively corrects the original control suggestions and generates optimized instructions that take into account both agronomic production and biological survival, thereby achieving intelligent decision-making balance in complex symbiotic environments. Finally, it executes precise water quality control according to the optimized instructions, comprehensively solving the problem of inaccurate water quality control caused by rigid thresholds, isolated parameters, conflicting demands, and lack of coordination mechanisms in rice-frog symbiosis systems. This achieves the comprehensive effect of improving the accuracy of water quality control, reducing the risk of biological stress, and enhancing system stability and ecological synergy efficiency.
[0054] This application also provides an automatic water quality monitoring and adaptive control system for rice-frog symbiosis, including: a data acquisition module, an anomaly identification module, a stage determination module, a prediction module, a deviation calculation module, a correction decision module, and an execution control module. The data acquisition module is used to collect real-time data on paddy field water quality, meteorological data, feeding amount data, and rice farming operations. The paddy field water quality data includes pH, dissolved oxygen, ammonia nitrogen, nitrite, water temperature, and turbidity. The anomaly identification module inputs the paddy field water quality data into a pre-trained isolated forest model, generates a multi-dimensional anomaly score, and maps the score result to a multi-parameter linked anomaly pattern library for nearest neighbor matching. Based on the matching result, it outputs crisis control instructions or normal control instructions. The stage determination module determines the current growth stage of the rice-frogs based on a real-time clock and aquaculture calendar when the ambient temperature is between 18℃ and 28℃, and loads the corresponding water quality monitoring sub-item anomaly detection thresholds from the growth cycle threshold mapping table. The prediction module inputs paddy field water quality data, meteorological data, feeding data, and rice farming operation data into a pre-trained LSTM prediction model. It outputs rice safety indicators and frog safety indicators through a dual-objective prediction head. Rice safety indicators include pH, ammonia nitrogen, and water temperature, while frog safety indicators include dissolved oxygen, nitrite, turbidity, and ammonia nitrogen. The deviation calculation module dynamically compares the rice safety indicators with corresponding anomaly detection thresholds for rice, calculating the deviation degree of both the rice monitoring indicators and the overall rice monitoring indicator deviation. Simultaneously, it dynamically compares the frog safety indicators with corresponding anomaly detection thresholds for frogs, calculating the deviation degree of both the frog monitoring indicators and the overall frog monitoring indicator deviation. The deviation correction decision module is used to retrieve the rice safety weight and frog safety weight corresponding to the current growth stage from the knowledge graph when the deviation of the comprehensive rice monitoring index or the comprehensive frog monitoring index exceeds a preset comprehensive deviation threshold. Based on the deviation of the comprehensive rice monitoring index, the comprehensive frog monitoring index, the rice safety weight, and the frog safety weight, it adjusts the crisis control instruction suggestions or normal control instruction suggestions to generate optimized control instruction suggestions. The execution control module is used to execute water quality control operations according to the optimized control instruction suggestions.
[0055] The above embodiments are merely preferred embodiments of the present invention and are not intended to limit the technical solutions of the present invention. Any technical solution that can be implemented based on the above embodiments without creative effort should be considered to fall within the scope of protection of the patent of the present invention.
Claims
1. A method for automatic water quality monitoring and adaptive control in rice-frog symbiosis, characterized in that, Includes the following steps: Step S1: Real-time collection of paddy field water quality data, as well as meteorological data, feeding data, and rice farming operation data; among which, paddy field water quality data includes pH, dissolved oxygen, ammonia nitrogen, nitrite, water temperature, and turbidity; Step S2: Input paddy field water quality data into a pre-trained isolated forest model to perform multi-dimensional anomaly scoring, and map the scoring results to a multi-parameter linked anomaly pattern library for nearest neighbor matching. Based on the matching results, output crisis control instructions or normal control instructions. Step S3: When the ambient temperature is between 18℃ and 28℃, determine the current growth stage of the rice frog according to the real-time clock and the breeding calendar, and load the corresponding water quality monitoring sub-item abnormal detection threshold from the growth cycle threshold mapping table. Step S4: Input paddy field water quality data, meteorological data, feeding amount data, and rice farming operation data into the pre-trained LSTM prediction model, and output rice safety indicators and frog safety indicators through a dual-objective prediction head; rice safety indicators include pH, ammonia nitrogen, and water temperature, and frog safety indicators include dissolved oxygen, nitrite, turbidity, and ammonia nitrogen. Step S5: Dynamically compare the rice safety indicators with the corresponding abnormal detection thresholds for rice, and calculate the deviation degree of the rice monitoring indicators and the overall deviation degree of the rice monitoring indicators; at the same time, dynamically compare the frog safety indicators with the corresponding abnormal detection thresholds for frog, and calculate the deviation degree of the frog monitoring indicators and the overall deviation degree of the frog monitoring indicators. Step S6: When the deviation of the comprehensive rice monitoring index or the deviation of the comprehensive frog monitoring index exceeds the preset comprehensive deviation threshold, the knowledge graph is retrieved to obtain the rice safety weight and frog safety weight corresponding to the current growth stage. Based on the deviation of the comprehensive rice monitoring index, the deviation of the comprehensive frog monitoring index, the rice safety weight and the frog safety weight, the crisis control instruction suggestion or the normal control instruction suggestion is corrected and adjusted to generate an optimized control instruction suggestion. Step S7: Perform water quality control operations according to the optimized control instructions.
2. The automatic water quality monitoring and adaptive control method for rice-frog symbiosis according to claim 1, characterized in that, In step S2, when the isolated forest model is used to score the six-dimensional water quality parameters of pH, dissolved oxygen, ammonia nitrogen, nitrite, water temperature and turbidity, the weight relationship of each item is as follows: dissolved oxygen weight > nitrite weight > ammonia nitrogen weight > pH weight ≥ water temperature weight ≥ turbidity weight, and the sum of all weights is 1.
3. The automatic water quality monitoring and adaptive control method for rice-frog symbiosis according to claim 1 or 2, characterized in that, The multi-parameter linkage anomaly mode library in step S2 has a variety of coupled crisis modes preset. Each coupled crisis mode is represented by a six-dimensional centroid vector. The similarity between the current score result and the coupled crisis mode is judged by weighted similarity matching. When the preset matching threshold is reached, the corresponding crisis control instruction suggestion is output.
4. The automatic water quality monitoring and adaptive control method for rice-frog symbiosis according to claim 1, characterized in that, In step S3, when the ambient temperature is >28℃ or <18℃, the environmental stress emergency response mechanism is activated. Specifically, if the ambient temperature is >28℃, only individuals currently in the adult stage will have their original conservative upper limit parameters activated, and oxygenation will be increased. If the ambient temperature is <18℃, the thresholds are set as follows: dissolved oxygen ≥3.5mg / L, ammonia nitrogen ≤0.6mg / L, nitrite ≤0.12mg / L, pH 6.5~8.5, water temperature ≥10℃, and turbidity ≤25NTU.
5. The automatic water quality monitoring and adaptive control method for rice-frog symbiosis according to claim 1, characterized in that, In step S4, the LSTM prediction model employs a dual-output LSTM model that incorporates a multi-task weighted hybrid loss function; wherein the weighted hybrid loss function is expressed as follows: In the formula, Standard MSE loss for rice indicators; The Huber loss for frog metrics is set with an inflection point threshold parameter δ=0.
5. Let represent the weights of the rice index loss function and the frog index loss function, respectively.
6. The automatic water quality monitoring and adaptive control method for rice-frog symbiosis according to claim 5, characterized in that, 。 7. The automatic water quality monitoring and adaptive control method for rice-frog symbiosis according to claim 1, characterized in that, The degree of deviation of the rice monitoring indicators in step S5 is expressed as follows: In the formula, This represents the degree of deviation of the i-th rice safety indicator, is dimensionless, and ranges from [0,1]. This represents the future prediction value of the indicator by the LSTM prediction model; This indicates the target threshold center value or the median value of the safe range for the current growth stage. This indicates the upper and lower limits of the safe threshold allowed for this indicator at the current growth stage; Deviation of comprehensive rice monitoring indicators: In the formula, This indicates the degree of deviation of comprehensive rice monitoring indicators; This indicates the degree of deviation of the safety indicators for rice, including pH, ammonia nitrogen, and water temperature. The weights of the deviations of pH, ammonia nitrogen, and water temperature among the safety indicators for rice are represented, and the sum is 1. The degree of deviation of frog monitoring indicators is expressed as follows: In the formula, This represents the degree of deviation of the i-th frog safety index, is dimensionless, and ranges from [0,1]. This represents the future prediction value of the indicator by the LSTM prediction model; This indicates the target threshold center value or the median value of the safe range for the current growth stage. This indicates the upper and lower limits of the safe threshold allowed for this indicator at the current growth stage; Deviation of comprehensive frog monitoring indicators: In the formula, Indicates the degree of deviation of comprehensive frog monitoring indicators; This indicates the degree of deviation of the safety indicators for frogs, including dissolved oxygen, nitrite, turbidity, and ammonia nitrogen. The weights representing the deviations of the safety indicators for frogs, namely dissolved oxygen, nitrite, turbidity, and ammonia nitrogen, are summed to 1.
8. The automatic water quality monitoring and adaptive control method for rice-frog symbiosis according to claim 1, characterized in that, In step S6, the safety weights for rice and frogs in the knowledge graph are dynamically assigned according to the following rules: If pesticide application records are detected in the fertilizer application data and the timestamp is within the previous 24 hours, then the safety weight for rice is ≥0.7, the safety weight for frogs is ≤0.3, and the sum of the two is 1. If the frog is currently in the juvenile stage and no water replenishment or water change has been detected in the past 72 hours, then even if there is no recent pesticide application record, the safety weight for rice will still be maintained at ≥0.7 and the safety weight for frogs at ≤0.3, with the sum of the two being 1. If the frogs are currently in the juvenile stage and there are no records of any agricultural operations, the safety weight for frogs is ≥0.6, the safety weight for rice is ≤0.4, and the sum of the two is 1. For other growth stages, the safety weight is 0.5 for rice and 0.5 for frogs.
9. The automatic water quality monitoring and adaptive control method for rice-frog symbiosis according to claim 1 or 8, characterized in that, The correction adjustment in step S6 includes: multiplying the deviation degree of the comprehensive rice monitoring index and the deviation degree of the comprehensive frog monitoring index by their corresponding rice safety weight and frog safety weight, respectively, to obtain the weighted deviation degree. After normalization, the weighted deviation degree ratio is used to determine whether to adopt, correct, or reject the control instruction suggestion output in step S2.
10. An automatic water quality monitoring and adaptive control system for rice-frog symbiosis, characterized in that, include: The data acquisition module is used to collect real-time data on paddy field water quality, meteorological data, feeding amount data, and rice farming operations. Among them, the paddy field water quality data includes pH, dissolved oxygen, ammonia nitrogen, nitrite, water temperature, and turbidity. The anomaly identification module is used to input paddy field water quality data into a pre-trained isolated forest model, generate a multi-dimensional anomaly score, and map the score result to a multi-parameter linked anomaly pattern library for nearest neighbor matching. Based on the matching result, it outputs crisis control instructions or normal control instructions. The stage determination module is used to determine the current growth stage of rice frogs based on the real-time clock and the breeding calendar when the ambient temperature is between 18℃ and 28℃, and load the corresponding water quality monitoring sub-item anomaly detection threshold from the growth cycle threshold mapping table. The prediction module is used to input paddy field water quality data, meteorological data, feeding data, and rice farming operation data into a pre-trained LSTM prediction model. It outputs rice safety indicators and frog safety indicators through a dual-objective prediction head. The rice safety indicators include pH, ammonia nitrogen, and water temperature, while the frog safety indicators include dissolved oxygen, nitrite, turbidity, and ammonia nitrogen. The deviation calculation module is used to dynamically compare the rice safety indicators with the corresponding abnormal detection thresholds for rice, and calculate the deviation degree of the rice monitoring indicators and the overall deviation degree of the rice monitoring indicators; at the same time, it dynamically compares the frog safety indicators with the corresponding abnormal detection thresholds for frog, and calculates the deviation degree of the frog monitoring indicators and the overall deviation degree of the frog monitoring indicators. The deviation correction decision module is used to retrieve the rice safety weight and frog safety weight corresponding to the current growth stage when the deviation of the comprehensive rice monitoring index or the comprehensive frog monitoring index exceeds the preset comprehensive deviation threshold. Based on the deviation of the comprehensive rice monitoring index, the deviation of the comprehensive frog monitoring index, the rice safety weight and the frog safety weight, the module corrects and adjusts the crisis control instruction suggestions or normal control instruction suggestions to generate optimized control instruction suggestions. The execution control module is used to perform water quality control operations based on the optimization and control instructions.
Citation Information
Patent Citations
A Water Quality Prediction Method Based on Improved Genetic Algorithm and Optimized LSTM Neural Network
CN111915097B
Rice and shrimp water quality prediction method based on RS rough set and CPA algorithm
CN114611840A
Paddy field aquaculture intelligent management system based on Internet of Things
CN119937693A
