An intelligent water body antibacterial agent dispensing strategy generation system and method

By acquiring multimodal data sources and generating spatiotemporal unified feature vectors using dynamic time warping algorithms, a dynamic weight allocation model is constructed. Edge computing and reinforcement learning frameworks are used to generate intelligent antimicrobial agent delivery strategies, solving the static and lag problems of traditional antimicrobial agent delivery methods and achieving accurate, efficient, and safe antimicrobial agent delivery.

CN120746345BActive Publication Date: 2025-12-16NANJING INSTITUTE OF FISHERY SCIENCES (NANJING AQUATIC TECHNOLOGY PROMOTION STATION NANJING AQUATIC ANIMAL DISEASE PREVENTION & CONTROL CENTER)
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511249058.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-03
Publication Date
2025-12-16
Estimated Expiration
2045-09-03

AI Technical Summary

Technical Problem

Traditional methods of applying antimicrobial agents cannot dynamically respond to environmental changes, leading to excessive microbial levels or drug residues that can harm health. Furthermore, they lack multi-objective synergistic optimization, making it difficult to achieve precise, efficient, and safe application of antimicrobial agents.

Method used

Water quality, flow velocity, and meteorological data are acquired through multimodal data sources. A unified spatiotemporal feature vector is generated using a dynamic time warping algorithm and a sliding window mechanism. A dynamic weight allocation model is constructed, and an intelligent antibacterial agent delivery strategy is generated using edge computing and reinforcement learning frameworks. The Q-value network parameters are optimized by combining online incremental learning.

Benefits of technology

It enables real-time response to environmental changes, optimizes the trade-off between sterilization efficiency, drug residue, and operating costs, improves the accuracy and safety of antimicrobial agent application, and solves the static and lag problems of traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120746345B_ABST
    Figure CN120746345B_ABST
Patent Text Reader

Abstract

The application discloses an intelligent water body antibacterial agent putting strategy generation system and method, relates to the technical field of intelligent control, obtains water quality monitoring data, aquaculture water area flow rate data and meteorological forecast data from multiple modal data sources, forms a multi-source data set, performs time alignment on the multi-source data set based on a dynamic time warping algorithm, adopts a sliding window mechanism to eliminate sensor sampling frequency differences, generates a space-time unified feature vector, constructs a dynamic weight distribution model containing bactericidal efficiency, drug residue and operation cost based on the space-time unified feature vector, deploys a reinforcement learning framework based on the dynamic weight coefficient and the space-time unified feature vector, constructs an antibacterial agent putting model based on a double-delay deep deterministic policy gradient algorithm, dynamically updates network parameters of the reinforcement learning framework through an online incremental learning mechanism, and generates an antibacterial agent intelligent putting strategy; and solves the problems of staticity and hysteresis of a traditional putting method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent control technology, specifically to a system and method for generating intelligent dosing strategies for antibacterial agents in water. Background Technology

[0002] In aquaculture systems, precise application of antimicrobial agents is crucial for ensuring microbial safety. Traditional control methods typically rely on fixed thresholds or manual experience to set dosages, which are ill-suited to dynamically changing environmental conditions. Water quality parameters such as flow velocity, dissolved oxygen, and turbidity in aquaculture areas are affected by fluctuations in water usage and meteorological changes, such as rainfall and temperature fluctuations, exhibiting real-time dynamic characteristics. Insufficient dosage may lead to excessive microbial levels, while excessive dosage can result in pesticide residues that harm health. Furthermore, there is a complex trade-off between sterilization efficiency, pesticide residue levels, and operating costs. Traditional methods lack dynamic weighting mechanisms, making it difficult to achieve multi-objective synergistic optimization. Simultaneously, multi-source data such as water quality, flow velocity, and meteorological data often form data silos due to differences in sampling frequency and uneven spatiotemporal distribution, leading to delayed or biased decision-making. These problems urgently require an intelligent control strategy that can integrate multi-dimensional data and respond to environmental changes in real time to achieve precise, efficient, and safe antimicrobial agent application.

[0003] Therefore, this invention proposes a smart dispensing strategy generation system and method for antibacterial agents in water. Summary of the Invention

[0004] This invention aims to solve at least one of the technical problems existing in the prior art. To this end, this invention proposes a smart dosing strategy generation system and method for water antibacterial agents, which solves the problems of staticity and lag in traditional dosing methods.

[0005] To achieve the above objectives, a method for generating an intelligent water antibacterial agent delivery strategy is proposed, comprising the following steps:

[0006] Step 1: Obtain water quality monitoring data, aquaculture water flow velocity data, and meteorological forecast data from multimodal data sources to form a multi-source dataset. The multimodal data sources include dissolved oxygen sensor arrays, turbidity sensors, and distributed flow meters.

[0007] Step 2: Time alignment of multi-source datasets is performed based on the dynamic time warping algorithm, and a sliding window mechanism is used to eliminate differences in sensor sampling frequencies to generate a unified spatiotemporal feature vector;

[0008] Step 3: Based on the spatiotemporal unified feature vector, construct a dynamic weight allocation model that includes sterilization efficiency, drug residue, and operating cost. The dynamic weight allocation model calculates the dynamic weight coefficients in real time through a gated cyclic unit network.

[0009] Step 4: Based on the dynamic weight coefficients and spatiotemporal unified feature vectors, deploy a reinforcement learning framework on edge computing nodes and construct an antibacterial agent delivery model based on the dual-delay deep deterministic policy gradient algorithm;

[0010] Step 5: Dynamically update the Q-value network parameters of the reinforcement learning framework through an online incremental learning mechanism to generate an intelligent antibacterial agent delivery strategy.

[0011] The acquisition of water quality monitoring data, aquaculture water flow velocity data, and meteorological forecast data includes the following steps:

[0012] Step 11: Collect water quality monitoring data in real time using a dissolved oxygen sensor array;

[0013] Step 12: Collect water quality monitoring data in real time using a turbidity sensor array;

[0014] Step 13: Collect real-time flow velocity data of the aquaculture area using distributed flow meters;

[0015] Step 14: Obtain weather forecast data in real time through the weather forecast data interface;

[0016] Step 15: Preprocess the collected water quality monitoring data, aquaculture water flow velocity data and meteorological forecast data to generate a standardized multi-source dataset.

[0017] The generation of the spatiotemporal unified feature vector includes the following steps:

[0018] Step 21: Perform time series alignment processing on standardized multi-source data based on the dynamic time warping algorithm to eliminate time deviations between data sources and generate time-synchronized data sequences.

[0019] The generated time-synchronized data sequence includes:

[0020] First, the cost matrix of the dynamic time warping algorithm is constructed. Then, the cumulative cost matrix is ​​calculated by the dynamic programming recursive formula. After backtracking to obtain the tortuous path, the second-level sampling sequence of the aquaculture water flow velocity data and the ten-minute-level sampling sequence of the meteorological data are subjected to nonlinear time scaling. Finally, the three sets of data of dissolved oxygen, turbidity and flow velocity are synchronized to the meteorological data time axis to form a sequence with a unified time reference.

[0021] Step 22: Use a sliding window mechanism to unify the sampling frequency of the time-synchronized data sequence to generate a spatiotemporal data sequence with consistent frequency;

[0022] Step 23: Extract and combine features from spatiotemporal data sequences with consistent frequencies to generate a unified spatiotemporal feature vector.

[0023] The real-time calculation of dynamic weight coefficients through a gated recurrent unit network includes the following steps:

[0024] Step 31: Collect historical data on sterilization efficiency, pesticide residue, and operating costs. The historical data adopts the spatiotemporal unified feature vector. Through historical data recording and statistical analysis, a historical dataset required for dynamic weight allocation is generated.

[0025] Step 32: Design a dynamic weight allocation model. The dynamic weight allocation model takes historical datasets as input, constructs a time-dependent weight calculation framework through a gated recurrent unit network, and outputs a preliminary weight allocation model.

[0026] Step 33: Train and optimize the dynamic weight allocation model. The model takes the initial weight allocation model as input, trains it using historical datasets, optimizes the loss function and adjusts the model parameters, and outputs the trained dynamic weight allocation model for real-time calculation of dynamic weight coefficients.

[0027] The construction of the antimicrobial agent delivery model based on the dual-delay deep deterministic strategy gradient algorithm includes the following steps:

[0028] Step 41: Initialize the lightweight reinforcement learning framework on the edge computing node. The input data are the dynamic weight coefficients and the spatiotemporal unified feature vector. The framework initialization is completed by configuring computing resources and communication protocols, and the initialized lightweight reinforcement learning framework is output.

[0029] Step 42: Construct the action space of the antimicrobial agent delivery model based on the dual-delay deep deterministic policy gradient algorithm. The input data are dynamic weight coefficients and spatiotemporal unified feature vectors. By defining the state space, action space and reward function, design the policy network structure and initialize the network parameters, and output the initially constructed antimicrobial agent delivery action space.

[0030] Step 43: Train and optimize the initially constructed antimicrobial agent delivery action space. The input data are spatiotemporal unified feature vectors and dynamic weight coefficients. Optimize the policy network parameters through the dual-delay deep deterministic policy gradient algorithm, update the action space, and output the trained antimicrobial agent delivery action space.

[0031] The intelligent antimicrobial agent delivery strategy includes the following steps:

[0032] Step 51: Collect real-time environmental feedback data, including the effect of antibacterial agent application, the operational status of aquaculture waters, and meteorological change data, as input for online incremental learning.

[0033] Specifically, the effect of antibacterial agent administration is obtained in real time by a turbidity sensor. The data preprocessing adopts the sliding window averaging method, that is, the raw sensor data is processed by moving average using a fixed-length time window. The window length is dynamically adjusted according to the hydraulic residence time of the aquaculture area.

[0034] The operational status of the aquaculture area is acquired by distributed pressure sensors at a sampling frequency of twice per second, and outliers are removed by Hampel filtering.

[0035] Meteorological change data is obtained by calling the API interface to obtain forecast data for the next two hours, and the Kalman filter algorithm is used to fuse it with historical observation data to generate forecast correction values.

[0036] Step 52: Combine the antibacterial agent delivery action space and real-time environmental feedback data to calculate the value function of the state-action pair and update the Q-value network parameters.

[0037] Step 53: Optimize the Q-value network parameters through an online incremental learning algorithm to generate an intelligent antibacterial agent delivery strategy that meets real-time response requirements.

[0038] A smart application strategy generation system for antibacterial agents in water is proposed, comprising a multi-source data collection module, a feature vector generation module, a weight coefficient calculation module, and a smart application strategy generation module; wherein the modules are electrically connected to each other.

[0039] The multi-source data collection module acquires water quality monitoring data, aquaculture water flow velocity data, and meteorological forecast data from multimodal data sources, forms a multi-source dataset, and sends the multi-source dataset to the feature vector generation module.

[0040] The feature vector generation module aligns the multi-source datasets in time based on the dynamic time warping algorithm and uses a sliding window mechanism to eliminate differences in sensor sampling frequencies, generating a spatiotemporally unified feature vector. The spatiotemporally unified feature vector is then sent to the weight coefficient calculation module and the intelligent delivery strategy generation module.

[0041] The weight coefficient calculation module, based on the spatiotemporal unified feature vector, constructs a dynamic weight allocation model that includes sterilization efficiency, drug residue, and operating cost. The dynamic weight allocation model calculates the dynamic weight coefficient in real time through a gated cyclic unit network and sends the dynamic weight coefficient to the intelligent delivery strategy generation module.

[0042] The intelligent delivery strategy generation module deploys a reinforcement learning framework on edge computing nodes based on the dynamic weight coefficients and spatiotemporal unified feature vectors. It constructs an antibacterial agent delivery model based on a dual-delay deep deterministic policy gradient algorithm and dynamically updates the Q-value network parameters of the reinforcement learning framework through an online incremental learning mechanism to generate an intelligent antibacterial agent delivery strategy that meets real-time response requirements.

[0043] Compared with the prior art, the beneficial effects of the present invention are:

[0044] This invention first collects water quality and flow velocity data in real time using a dissolved oxygen sensor array, a turbidity sensor, and a distributed flow meter. Simultaneously, it accesses a weather forecast interface to obtain information such as temperature and rainfall. After normalization processing, a standardized multi-source dataset is generated, effectively eliminating sensor time bias and sampling frequency differences. Subsequently, a dynamic time warping algorithm is used to align the multi-source time series, and a sliding window mechanism is combined to extract multi-dimensional spatiotemporal features, constructing a unified feature vector. A dynamic weight allocation model analyzes historical data through a GRU network, outputting target weight coefficients in real time to guide the design of the reward function for the reinforcement learning model. In a lightweight reinforcement learning framework deployed at edge nodes, the policy network generates antibacterial agent dosing actions based on the current state and continuously optimizes the Q-value network parameters by fusing real-time feedback data through an online incremental learning mechanism, forming a closed-loop control. Through this closed-loop architecture of "data fusion, feature extraction, dynamic decision-making, and feedback optimization," the static and lagging problems of traditional dosing methods are solved. Attached Figure Description

[0045] Figure 1 This is a flowchart of a method for generating an intelligent water antibacterial agent delivery strategy according to Embodiment 1 of the present invention;

[0046] Figure 2 This is an example diagram of a sensor network in Embodiment 1 of the present invention;

[0047] Figure 3 This is a module connection diagram of an intelligent water antibacterial agent delivery strategy generation system in Embodiment 2 of the present invention. Detailed Implementation

[0048] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. 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.

[0049] Example 1

[0050] like Figure 1 As shown, a method for generating an intelligent water antibacterial agent delivery strategy includes the following steps:

[0051] Step 1: Obtain water quality monitoring data, aquaculture water flow velocity data, and meteorological forecast data from multimodal data sources to form a multi-source dataset. The multimodal data sources include dissolved oxygen sensor arrays, turbidity sensors, and distributed flow meters.

[0052] Step 2: Time alignment of multi-source datasets is performed based on the dynamic time warping algorithm, and a sliding window mechanism is used to eliminate differences in sensor sampling frequencies to generate a unified spatiotemporal feature vector;

[0053] Step 3: Based on the spatiotemporal unified feature vector, construct a dynamic weight allocation model that includes sterilization efficiency, drug residue, and operating cost. The dynamic weight allocation model calculates the dynamic weight coefficients in real time through a gated cyclic unit network.

[0054] Step 4: Based on the dynamic weight coefficients and spatiotemporal unified feature vectors, deploy a reinforcement learning framework on edge computing nodes and construct an antibacterial agent delivery model based on the dual-delay deep deterministic policy gradient algorithm;

[0055] Step 5: Dynamically update the Q-value network parameters of the reinforcement learning framework through an online incremental learning mechanism to generate an intelligent antibacterial agent delivery strategy.

[0056] In an embodiment of the present invention, the acquisition of water quality monitoring data, aquaculture water flow velocity data, and meteorological forecast data includes the following steps:

[0057] Step 11: Collect water quality monitoring data in real time through a dissolved oxygen sensor array, including parameters such as dissolved oxygen concentration, pH value and water temperature, to ensure the real-time nature and accuracy of the data.

[0058] Specifically, a dissolved oxygen sensor array is deployed at key nodes in fish farming waters. This array contains at least 12 dissolved oxygen sensors arranged in a distributed manner, with the distance between each sensor node not exceeding 200 meters. It is connected to an edge computing gateway via an RS-485 bus and collects dissolved oxygen concentration data every 5 seconds, with a measurement range of 0-20 mg / L and an accuracy of ±0.1 mg / L.

[0059] The pH value can be collected using a glass electrode sensor with a built-in temperature compensation module to correct for water temperature effects, with a measurement range of 0-14 pH. Water temperature monitoring can be performed using a platinum resistance thermometer, embedded in the top of the sensor probe to monitor water temperature changes in real time. During data preprocessing, a sliding window filtering algorithm is used, with the following formula: ,in This represents the current data value after filtering, where N=60 seconds, which is a 1-minute time window. The original sampled value is given, and t is the current time, to eliminate instantaneous interference. The index of the sliding window;

[0060] When three consecutive data points exceed the historical average ±3σ range, the sensor self-test program is triggered. The abnormality is eliminated by comparing redundant sensor data. σ is the preset range threshold.

[0061] Step 12: Collect water quality monitoring data in real time through a turbidity sensor array, including parameters such as turbidity, turbidity and total organic carbon, to ensure the real-time nature and accuracy of the data.

[0062] Specifically, the turbidity sensor array uses membrane electrode sensors, which are deployed at 50 meters, 500 meters, and 1000 meters downstream of the disinfectant dosing point along the water flow direction in the aquaculture area. The sensor is equipped with an automatic cleaning device that performs cleaning with a titanium alloy scraper every 6 hours to prevent biofilm adhesion from affecting the measurement accuracy.

[0063] Turbidity monitoring uses a 90° scattering light principle sensor with a range of 0-4000 NTU, while total organic matter detection uses the ultraviolet-persulfate oxidation method. Both are integrated into a multi-functional water quality probe.

[0064] Step 13: Collect real-time flow velocity data of the aquaculture water area using distributed flow meters, including parameters such as flow velocity, pressure, and flow rate, to ensure the real-time nature and accuracy of the data.

[0065] Specifically, the distributed flow meter uses the ultrasonic time-of-flight measurement principle, with different range sensors configured in different pipe sections. The flow velocity measurement range is 0.1-5 m / s, with an accuracy of ±0.5% of the reading. Pressure monitoring uses a ceramic capacitive sensor, acquiring pressure waveform data every 2 seconds.

[0066] In a further embodiment of the invention, the dominant frequency component can be analyzed using Fast Fourier Transform. When a characteristic frequency of 10-15 Hz is detected, it is determined to be a water hammer effect, and a slow-closing valve control command is automatically triggered. The flow data correction uses the Darcy-Weisbach equation to compensate for the impact of head loss along the flow path on velocity measurement.

[0067] like Figure 2 The diagram shown is an example of a sensor network, which includes the dissolved oxygen sensor, turbidity sensor and flow meter mentioned above. DO-1, DO-2 and DO-3 are dissolved oxygen sensors, CL-1 and CL-2 are turbidity sensors, FL-1 and FL-2 are flow meters, and P1 to P6 are the ends of each section of pipe in the aquaculture water area.

[0068] Step 14: Obtain real-time weather forecast data, including parameters such as temperature, humidity, wind speed and precipitation, through the weather forecast data interface to ensure the real-time nature and accuracy of the data.

[0069] Specifically, the meteorological data interface calls the meteorological bureau's satellite broadcast data and uses JSON format to parse the temperature, relative humidity, wind speed, and precipitation data.

[0070] In a further embodiment of the present invention, a meteorological-water quality correlation matrix can be established, and when the predicted precipitation exceeds 20 mm / h, the surface runoff pollution early warning mode is automatically activated, and the sampling frequency is increased to once per second.

[0071] Step 15: Preprocess the collected water quality monitoring data, aquaculture water flow velocity data and meteorological forecast data, including noise reduction, interpolation and normalization, to generate a standardized multi-source dataset;

[0072] Specifically, the multi-source data fusion employs a spatiotemporal alignment algorithm. First, the UTC timestamps of the sensor data are converted into hydraulic residence time in the aquaculture area. Then, a two-dimensional velocity field distribution map is obtained through computational fluid dynamics (CFD) simulation, and integration is performed along the pipeline length. In practical applications, a piecewise linear approximation method is used, dividing the pipe segment into 50-meter calculation units. The arithmetic mean of the velocity within each unit is used to obtain the hydraulic residence time.

[0073] The missing data is then supplemented using cubic spline interpolation, while the normalization process uses an improved Z-Score method.

[0074] Furthermore, the generation of the spatiotemporal unified feature vector includes the following steps:

[0075] Step 21: Perform time series alignment processing on standardized multi-source data based on the dynamic time warping algorithm to eliminate time deviations between data sources and generate time-synchronized data sequences.

[0076] It is understandable that, due to the time deviation limitations of the standardized multi-source data, time series alignment processing is required to obtain a time-synchronized data sequence.

[0077] Specifically, the cost matrix of the dynamic time warping algorithm is first constructed. ,in This represents the measurement value of the s-th sensor at time i. This represents the measurement value of the o-th sensor at time j;

[0078] The cumulative cost matrix is ​​calculated using a dynamic programming recursive formula. After backtracking to obtain the tortuous path, the second-level sampling sequence of flow velocity data in aquaculture waters and the ten-minute-level sampling sequence of meteorological data are nonlinearly scaled over time. Finally, the three sets of data, namely dissolved oxygen, turbidity, and flow velocity, are synchronized to the meteorological data time axis to form a sequence with a unified time reference.

[0079] Step 22: Use a sliding window mechanism to unify the sampling frequency of the time-synchronized data sequence to generate a spatiotemporal data sequence with consistent frequency.

[0080] It is understandable that, due to the limitation of inconsistent sampling frequencies in the time-synchronized data sequences, it is necessary to perform sampling frequency unification processing to obtain spatiotemporal data sequences with consistent frequencies.

[0081] Specifically, a sliding window mechanism is used to unify the sampling frequency of the time-synchronized data sequence, setting a fixed window length of 30 minutes and a sliding step size of 5 minutes to resample the time-synchronized data sequence.

[0082] Within each window, the window mean is calculated using cubic interpolation for the flow velocity data. n is the total number of time windows. Let be the flow rate in the k-th time window;

[0083] Take the 85th percentile of the turbidity data within the window to capture peak characteristics.

[0084] For dissolved oxygen data, the coefficient of variation is calculated. :

[0085] To characterize volatility, data with different sampling frequencies of 5 minutes, 10 minutes, and 60 minutes are unified into a spatiotemporal data cube with a 5-minute interval. The sample standard deviation of dissolved oxygen concentration within the sliding window. The coefficient of variation represents the arithmetic mean of dissolved oxygen concentration within the window. This coefficient of variation eliminates the influence of dimensions by using the ratio of the standard deviation to the mean, and can accurately reflect the relative fluctuation level of dissolved oxygen concentration.

[0086] Step 23: Extract and combine features from spatiotemporal data sequences with consistent frequencies to generate a unified spatiotemporal feature vector.

[0087] It is understandable that, due to the limitation of feature dispersion in the spatiotemporal data sequences with consistent frequencies, feature extraction and combination are required to obtain a unified spatiotemporal feature vector.

[0088] Specifically, the topological features of the aquaculture water area are first extracted, and the velocity gradient upstream and downstream of each monitoring point is calculated. : Where L is the length of the pipe segment; and The flow velocities downstream and upstream of the monitoring point are respectively identified; secondly, the spatiotemporal correlation characteristics of water quality are extracted to construct a joint distribution matrix of turbidity and dissolved oxygen. ;in, Indicates turbidity Located in the a-th interval and the dissolved oxygen concentration The joint probability of being in the b-th interval.

[0089] In the specific calculations, the turbidity range was divided into 20 equal-width intervals, and the dissolved oxygen concentration range was divided into 15 equal-width intervals. The two-dimensional probability density distribution was calculated using the kernel density estimation method. Finally, meteorological influencing factors were integrated to establish the lag cross-correlation coefficient between rainfall R and flow velocity. ,in This represents the time lag between meteorological elements and aquaculture water parameters, i.e., the future... minute, Indicates in The flow rate of time, This represents the rainfall at time t. In calculating rainfall and future... When considering the correlation of flow rate after minutes, The value range is usually set to [0, 180] minutes, and the process is iterated in 6-minute increments. The lag that maximizes the correlation coefficient is selected as the effective impact delay.

[0090] In the actual implementation of this invention, the aforementioned features and standardized basic data are input into the feature selection module. The feature importance score is calculated using the random forest algorithm, and features with importance higher than the threshold θ=0.15 are selected to form a 768-dimensional spatiotemporal unified feature vector F, whose mathematical representation is as follows: ,in This represents the 768th eigenvalue at time t.

[0091] Furthermore, the real-time calculation of dynamic weight coefficients through the gated recurrent unit network includes the following steps:

[0092] Step 31: Collect historical data on sterilization efficiency, pesticide residue, and operating costs. The historical data uses the generated spatiotemporal unified feature vector. Through historical data recording and statistical analysis, a historical dataset required for dynamic weight allocation is generated.

[0093] It is understandable that, due to the dynamic nature of data such as sterilization efficiency, pesticide residue, and operating costs, it is necessary to collect and statistically analyze historical data to obtain a historical dataset for dynamic weight allocation.

[0094] Specifically, since the spatiotemporal unified feature vector contains multidimensional spatiotemporal water quality parameters, such as the time series of dissolved oxygen concentration and the flow velocity distribution matrix of aquaculture areas, the sterilization efficiency index can be segmented according to the feature dimensions. In the formula, K is the oxidation efficiency coefficient, with units of mg / (L·h), which is determined through laboratory batch tests. The specific determination method is as follows: under constant temperature conditions, different concentrations of disinfectant are added to standard water samples, and the time required to achieve a 99.9% sterilization rate is recorded. The fitting yielded The value range is usually 0.05-0.2; Dissolved oxygen concentration; The minimum sterilization threshold, expressed in mg / L, is determined based on microbiological index requirements and is obtained through dynamic sterilization simulation experiments. When the concentration is <2.0 mg / L, the kill rate of E. coli is less than 99.99%, therefore a minimum sterilization threshold is set. The value is 0.2; in practical applications, it is dynamically adjusted based on the detection results at the end point of the aquaculture area, with the minimum sterilization threshold being 0.2. The adjustment range shall not exceed ±0.3 mg / L.

[0095] Drug residue , Here, H is the weighting factor for the h-th pipe segment, where H is the number of pipe segments, and it is calculated as follows: ,in For the length of the pipe section, Let h be the diameter of the pipe segment. Let g be the diameter of the g-th pipe segment. This formula reflects the characteristic that long-distance, small-diameter pipes are more prone to chemical deposition. The weight value is limited to the range of 0.1-0.8. Real-time residual concentration;

[0096] Energy consumption cost , This is a real-time power function, in kW, expressed as follows: ,in For the pump station flow rate, For Yang Cheng, For the density of water, The acceleration due to gravity is calculated using a SCADA system that collects pump unit operating parameters in real time, with a sampling frequency of 1 minute per instance. Data preprocessing employs a sliding window statistical method, calculating the mean, variance, and extreme values ​​of each indicator over a 24-hour period. In practice, the sterilization efficiency within each window is calculated. Calculate: Mean ,variance ,extremum For the spatial dimension data of the aquaculture water area, the coefficient of variation of the flow velocity in each pipe segment is calculated for each time window. , It is the average value of the flow velocity v within the current time window. It is the standard deviation of the flow velocity v within the current time window, forming a spatiotemporal correlation feature matrix, and generating a dynamic weighted dataset containing spatiotemporal correlation features.

[0097] Step 32: Design a dynamic weight allocation model. The dynamic weight allocation model takes historical datasets as input, constructs a time-dependent weight calculation framework through a gated recurrent unit network, and outputs a preliminary weight allocation model.

[0098] Understandably, due to the time-dependent limitations of the historical dataset, it is necessary to design a dynamic weight allocation model to obtain a preliminary weight allocation model that can handle time dependencies.

[0099] Step 33: Train and optimize the dynamic weight allocation model. The model takes the initial weight allocation model as input, trains it using historical datasets, optimizes the loss function and adjusts the model parameters, and outputs the trained dynamic weight allocation model for real-time calculation of dynamic weight coefficients.

[0100] It is understandable that, due to the limitation of non-optimized parameters in the initial weight allocation model, the model needs to be trained and optimized to obtain a trained dynamic weight allocation model for real-time calculation of dynamic weight coefficients.

[0101] Furthermore, the construction of the antimicrobial agent delivery model based on the dual-delay deep deterministic strategy gradient algorithm includes the following steps:

[0102] Step 41: Initialize the lightweight reinforcement learning framework on the edge computing node. The input data are the dynamic weight coefficients and the spatiotemporal unified feature vector. The framework initialization is completed by configuring computing resources and communication protocols, and the initialized lightweight reinforcement learning framework is output.

[0103] Specifically, a containerized framework is deployed on the edge computing node, and computing resources of 2 CPU cores and 4GB of memory are allocated and managed through a Kubernetes cluster. The dynamic weight coefficients are encapsulated in JSON format, and the spatiotemporal unified feature vector is serialized and transmitted via the Protobuf protocol. The initialization process loads a pre-compiled TensorFlow Lite inference engine, establishes a Modbus-TCP communication link with the PLC control system of the aquaculture area, and sets the real-time sensor data refresh cycle to 500ms. The lightweight framework is reflected in the use of channel pruning technology to compress the number of parameters in the original DQN network, while retaining the Actor-Critic dual network structure of the dual-delay deep deterministic policy gradient (TD3) algorithm. The dynamic weight coefficients are encapsulated as key-value pairs, facilitating data parsing and exchange between different systems. The Protobuf protocol is used for efficient transmission of spatiotemporal unified feature vectors containing multi-dimensional floating-point features, which has a smaller data volume and faster parsing speed compared to JSON. TensorFlow Lite inference engine is a machine learning framework optimized for mobile and embedded devices. It supports INT8 quantization, compressing model size to 1 / 4 of its original size. Version 1.15 is used here, employing pre-compiled .so libraries for low-latency decision computation on edge devices. The Modbus-TCP communication link is a variant of the Modbus protocol implemented using TCP / IP, using port 502 for master-slave communication. This system is configured to send function code 03 every 500ms to read the holding register, with register addresses mapping from 40001 to 40012, corresponding to 12-dimensional sensor data. Channel pruning, as a neural network compression method, removes layers with contributions less than a threshold using the L1-norm criterion. The DQN network employs a dual-network architecture, where the online network periodically iterates and updates the target network, using the Huber loss function. Training is performed, where δ represents the TD error. The core mechanisms of the TD3 algorithm include: ① delayed policy network updates, with one Actor update performed every two Critic updates; ② smoothing and regularization of the target policy, adding Gaussian noise with a mean of 0 and a standard deviation of 0.2; ③ minimizing the value using a dual-Q learning architecture to suppress overestimation.

[0104] Step 42: Construct the action space of the antimicrobial agent delivery model based on the dual-delay deep deterministic policy gradient algorithm. The input data are dynamic weight coefficients and spatiotemporal unified feature vectors. By defining the state space, action space and reward function, design the policy network structure and initialize the network parameters, and output the initially constructed antimicrobial agent delivery action space.

[0105] Traditional single-delay policy gradient algorithms may suffer from policy oscillations and instability when dealing with complex dynamic environments. In contrast, dual-delay algorithms, by introducing a target network and a delayed update mechanism, can effectively improve the stability and convergence of the policy, thus better adapting to the dynamic needs of antimicrobial agent delivery.

[0106] Specifically, the state space consists of 12-dimensional data from a spatiotemporally unified feature vector, including parameters such as dissolved oxygen concentration, turbidity, and flow velocity. The action space is defined as a 3-dimensional vector. , representing the dosage of sodium hypochlorite, hydrogen peroxide, and ozone (unit: mg / L), respectively. Reward function Designed as follows:

[0107] ;

[0108] in, For dynamic weighting coefficients, The readings are from the sterilization efficiency tester. For turbidity sensor readings, Energy consumption calculation formula for dosing pump The policy network adopts a three-layer fully connected structure. The 12 nodes in the input layer correspond to the state dimension, the 256 nodes in the hidden layer use ReLU activation, and the 3 nodes in the output layer use the Sigmoid function to constrain the action range. The Sigmoid function compresses the output to the (0,1) interval. Applying the function to the 3 nodes in the output layer respectively, the action values ​​are constrained to the physical feasible region of sodium hypochlorite [0,5] mg / L, hydrogen peroxide [0,3] mg / L, and ozone [0,0.5] mg / L.

[0109] Step 43: Train and optimize the initially constructed antimicrobial agent delivery action space. The input data are spatiotemporal unified feature vectors and dynamic weight coefficients. Optimize the policy network parameters through the dual-delay deep deterministic policy gradient algorithm, update the action space, and output the trained antimicrobial agent delivery action space.

[0110] Since the initially constructed action space may not fully cover all possible deployment scenarios, the action space can be continuously adjusted and updated through the continuous optimization of the dual-delay deep deterministic strategy gradient algorithm, making it more adaptable to the actual dynamic environment, thereby improving the accuracy and effectiveness of antibacterial agent deployment.

[0111] Specifically, a delayed update mechanism is introduced during the training phase, with the Critic network synchronizing parameters every two training epochs. An experience replay pool stores 10,000 sets of transfer samples. , This indicates the state at the empirical index d. Indicates the state The following actions were taken. The reward corresponding to step d, Indicates the execution of an action The next state after the environment transitions is sampled with a batch size of 128. Target network soft update coefficients. The learning rate of the strategy network is set to The learning rate of the Q network is set to Exploring noise Using truncated normal distribution , This represents a normal distribution with a mean of 0 and a standard deviation of 0.1. A truncated normal distribution indicates that... The values ​​are clipped to upper and lower bounds to prevent motion noise from exceeding the limits; For the indicator function, when the action amplitude satisfies The value is set to 1 if the dosage exceeds the safety threshold or triggers constraints otherwise, effectively preventing sudden changes in sodium hypochlorite dosage beyond the safety threshold. After every 200 iterations, the strategy improvement is calculated using the Wasserstein distance. ,in, For parameters The policy network in state The output action, These are older parameters used for comparison. This indicates that a Q-network with parameter θ is used to process the state. The following strategy The selected actions are then evaluated for value. Indicates the use of the old strategy The selected action Calculate the expected value when The early stop mechanism is triggered at the right time. This measures the magnitude of policy improvement. Specifically, the delayed update mechanism requires the Critic network to update at twice the frequency of the Actor network, and the target network has a soft update coefficient. The hyperparameter controlling the migration rate of online network parameters to the target network is updated using the following formula: , This represents the Q-network parameters during the current training. The target Q network parameters are set here. =0.005 means that the target network parameters retain 99.5% of their original values ​​during each update, and only absorb 0.5% of the online network parameters.

[0112] Wasserstein distance, a metric for measuring the difference between two probability distributions, is used in this step to calculate the improvement of the old and new strategies. The experience replay pool stores state transition tuples. Set priority for the circular buffer. ,in For TD error, To prevent zero priority. The truncated normal distribution is a conditional normal distribution defined in the interval [-0.5, 0.5].

[0113] Furthermore, the intelligent antibacterial agent delivery strategy includes the following steps:

[0114] Step 51: Collect real-time environmental feedback data, including the effect of antibacterial agent application, the operational status of aquaculture waters, and meteorological change data, as input for online incremental learning.

[0115] Specifically, the effectiveness of the antibacterial agent application is acquired in real time by a turbidity sensor. Data preprocessing employs a sliding window averaging method, where a fixed-length time window is used to perform a moving average on the raw sensor data. The window length is dynamically adjusted based on the hydraulic residence time in the aquaculture area. The arithmetic mean of the most recent 30 sampling points is used to eliminate instantaneous fluctuations caused by equipment noise. The operational status of the aquaculture area is acquired via distributed pressure sensors at a sampling frequency of twice per second. Outliers are removed using Hampel filtering, an outlier detection method based on the absolute deviation of the median. The calculation process involves first determining a 7-point sliding window centered on the current data point, and then calculating the median of the data within the window. and median of absolute deviation When data points and The difference exceeds Outliers are identified and replaced with the median, resulting in a continuous time series. Meteorological change data is obtained by calling the meteorological bureau's API to obtain two-hour forecast data. A Kalman filter algorithm is used to fuse this data with historical observation data to generate a revised forecast value. The application of the Kalman filter algorithm here includes two stages: prediction and update. In the prediction stage, a state transition model is established based on historical observation data. In the update stage, the meteorological forecast data and measured data are weighted and fused using the covariance matrix to ultimately generate an estimate with the minimum mean square error. This step uses a spatiotemporal compensation algorithm to address the feedback delay problem caused by the sparseness of end-point monitoring points in aquaculture areas. The spatiotemporal compensation algorithm specifically refers to an interpolation algorithm designed to solve the monitoring delay problem caused by the excessively large spacing (average 800 meters) between end-point monitoring points in aquaculture areas.

[0116] Step 52: Combine the antibacterial agent delivery action space and real-time environmental feedback data to calculate the value function of the state-action pair and update the Q-value network parameters.

[0117] Specifically, it is implemented using a dual-delay depth deterministic strategy gradient algorithm, with the following formula:

[0118] ;

[0119] in, This indicates the current state of the Critic network. ,action The estimated value, This represents the feature vector of the aquaculture water state at time d. This represents the discrete action selection in the action space of the antibacterial agent delivery model. The parameters represent the target Critic network. This indicates that there are two target Q-networks. For the next state The corresponding action, For instant reward function, Indicates the weighting coefficient:

[0120] ;

[0121] In the formula, These are dynamic weighting coefficients; The normalized dissolved oxygen concentration is calculated as the ratio of the current measured value to the target control range:

[0122] ;

[0123] in, The dissolved oxygen value measured at time d; mg / L and mg / L represents the upper and lower limits specified in the water quality standards; The residue exceedance coefficient is defined as the squared deviation between the measured concentration and the safety threshold.

[0124] ;

[0125] in, This represents the residual concentration at time d. mg / L is the specified maximum allowable residue level; To determine the variance of pressure fluctuations in aquaculture waters, an immediate reward function is introduced. ,in This represents the seasonal influence coefficient. This is the current water temperature monitoring value. Using the reference temperature, this function is designed to accelerate the rate of decrease in the attenuation factor when the water temperature exceeds 25℃, thereby achieving quantitative compensation for the impact of water temperature T on sterilization efficiency in different seasons.

[0126] Step 53: Optimize the Q-value network parameters through an online incremental learning algorithm to generate an intelligent antibacterial agent delivery strategy that meets real-time response requirements.

[0127] Specifically, the online incremental learning employs a hybrid mechanism of parallel experience replay buffer and real-time data stream. A priority experience replay buffer with a capacity of 2000 samples is set up, and a pipeline-style parameter update architecture is proposed. The Q-value network is decomposed into a feature extraction layer (freezing parameters) and a policy decision layer (dynamic update). Gradient truncation technology is used to control the magnitude of parameter updates, ensuring the stability of model updates. During backpropagation, the gradient tensors of all parameters are normalized using the L2 norm, and the gradient vector is scaled proportionally by the norm value to ensure that the maximum change in a single parameter update does not exceed a set threshold.

[0128] Example 2

[0129] like Figure 3 As shown, a smart water antibacterial agent delivery strategy generation system includes a multi-source data collection module, a feature vector generation module, a weight coefficient calculation module, and a smart delivery strategy generation module; wherein, the modules are connected to each other electrically.

[0130] The multi-source data collection module acquires water quality monitoring data, aquaculture water flow velocity data, and meteorological forecast data from multimodal data sources, forms a multi-source dataset, and sends the multi-source dataset to the feature vector generation module.

[0131] The feature vector generation module aligns the multi-source datasets in time based on the dynamic time warping algorithm and uses a sliding window mechanism to eliminate differences in sensor sampling frequencies, generating a spatiotemporally unified feature vector. The spatiotemporally unified feature vector is then sent to the weight coefficient calculation module and the intelligent delivery strategy generation module.

[0132] The weight coefficient calculation module, based on the spatiotemporal unified feature vector, constructs a dynamic weight allocation model that includes sterilization efficiency, drug residue, and operating cost. The dynamic weight allocation model calculates the dynamic weight coefficient in real time through a gated cyclic unit network and sends the dynamic weight coefficient to the intelligent delivery strategy generation module.

[0133] The intelligent delivery strategy generation module deploys a reinforcement learning framework on edge computing nodes based on the dynamic weight coefficients and spatiotemporal unified feature vectors. It constructs an antibacterial agent delivery model based on a dual-delay deep deterministic policy gradient algorithm and dynamically updates the Q-value network parameters of the reinforcement learning framework through an online incremental learning mechanism to generate an intelligent antibacterial agent delivery strategy that meets real-time response requirements.

[0134] In addition, the parts of the technical solutions provided in the embodiments of this application that are consistent with the implementation principles of the corresponding technical solutions in the prior art have not been described in detail, so as to avoid excessive elaboration.

[0135] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the invention. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

[0136] The preset parameters or preset thresholds mentioned above are all set by those skilled in the art based on actual conditions or obtained through large-scale data simulation.

[0137] The above embodiments are only used to illustrate the technical methods of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of the present invention without departing from the spirit and scope of the technical methods of the present invention.

Claims

1. A method for generating an intelligent dispensing strategy of an antibacterial agent in a water body, characterized in that, Comprising the following steps: Step one: Obtain water quality monitoring data, aquaculture water flow data and weather forecast data from multi-modal data sources to form a multi-source data set; Step two: Time alignment of the multi-source data set based on dynamic time warping algorithm, and elimination of sensor sampling frequency difference by using sliding window mechanism to generate spatiotemporal unified feature vector; Step three: Based on the spatiotemporal unified feature vector, a dynamic weight distribution model containing sterilization efficiency, drug residue and running cost is constructed, and the dynamic weight distribution model calculates the dynamic weight coefficient in real time through the gated recurrent unit network; The dynamic weight coefficient calculated by the gated recurrent unit network includes the following steps: Step 31: Collect historical data of sterilization efficiency, drug residue and running cost; Step 32: Design a dynamic weight distribution model, which takes the historical data set as input, constructs a time-dependent weight calculation framework through the gated recurrent unit network, and outputs a preliminary weight distribution model; Step 33: Train and optimize the dynamic weight distribution model, which takes the preliminary weight distribution model as input, trains through the historical data set, optimizes the loss function and adjusts the model parameters, and outputs the trained dynamic weight distribution model for real-time calculation of dynamic weight coefficient; Step four: Based on the dynamic weight coefficient and the spatiotemporal unified feature vector, deploy a reinforcement learning framework on the edge computing node, and construct an antibacterial agent injection model based on the double-delay deep deterministic policy gradient algorithm; The antibacterial agent injection model constructed based on the double-delay deep deterministic policy gradient algorithm includes the following steps: Step 41: Initialize the lightweight reinforcement learning framework on the edge computing node; Step 42: Construct the action space of the antibacterial agent injection model based on the double-delay deep deterministic policy gradient algorithm, the input data is the dynamic weight coefficient and the spatiotemporal unified feature vector, define the state space, action space and reward function, design the policy network structure and initialize the network parameters, output the initially constructed antibacterial agent injection action space; Step 43: Train and optimize the initially constructed antibacterial agent injection action space, input data is the spatiotemporal unified feature vector and dynamic weight coefficient, optimize the policy network parameters through the double-delay deep deterministic policy gradient algorithm, update the action space, output the trained antibacterial agent injection action space; Step five: Dynamically update the Q-value network parameters of the reinforcement learning framework through online incremental learning mechanism to generate antibacterial agent intelligent injection strategy; The generation of antibacterial agent intelligent injection strategy includes the following steps: Step 51: Collect real-time environmental feedback data as input for online incremental learning; The real-time environmental feedback data includes antibacterial agent injection effect, aquaculture water running state and weather change data; Step 52: Calculate the value function of state-action pair by combining the antibacterial agent injection action space and real-time environmental feedback data, and update the Q-value network parameters; Step 53: Optimize the Q-value network parameters through online incremental learning algorithm to generate antibacterial agent intelligent injection strategy that meets real-time response requirements. 2.The method of claim 1, wherein, The acquisition of water quality monitoring data, aquaculture water flow data and weather forecast data includes the following steps: Step 11: Real-time acquisition of water quality monitoring data through a dissolved oxygen sensor array; Step 12: Real-time acquisition of water quality monitoring data through a turbidity sensor array; Step 13: Real-time acquisition of aquaculture water area flow rate data through a distributed flowmeter; Step 14: Real-time acquisition of weather forecast data through a weather forecast data interface; Step 15: Preprocessing of the above-mentioned water quality monitoring data, aquaculture water area flow rate data, and weather forecast data to generate a standardized multi-source data set. 3.The method of claim 2, wherein, The generation of the spatio-temporal unified feature vector includes the following steps: Step 21: Time series alignment processing of the standardized multi-source data based on the dynamic time warping algorithm to eliminate time deviations between data sources and generate time-synchronized data sequences; Step 22: Sampling frequency unification processing of the time-synchronized data sequences using a sliding window mechanism to generate frequency-consistent spatio-temporal data sequences; Step 23: Feature extraction and combination of the frequency-consistent spatio-temporal data sequences to generate spatio-temporal unified feature vectors.

4. The method of claim 3, wherein the method further comprises: The generation of the time-synchronized data sequences includes: First, a cost matrix of the dynamic time warping algorithm is constructed, and an accumulated cost matrix is calculated using a dynamic programming recursive formula. After obtaining the curved path through backtracking, the second-level sampling sequence of the aquaculture water area flow rate data and the ten-minute-level sampling sequence of the weather data are subjected to nonlinear time stretching. Finally, the dissolved oxygen, turbidity, and flow rate data are synchronized to the weather data time axis, forming a sequence with a unified time reference.

5. The method of claim 4, wherein the method further comprises: The construction of the lightweight reinforcement learning framework includes: The input data are the dynamic weight coefficients and the spatio-temporal unified feature vectors. The framework initialization is completed by configuring the computing resources and communication protocols, and the initialized lightweight reinforcement learning framework is output.

6. The method of claim 5, wherein the method further comprises: The antibacterial agent dispensing effect is obtained in real time by a turbidity sensor, and the data preprocessing uses a sliding window average method, i.e., a fixed-length time window is used to perform moving average processing on the original sensor data, and the window length is dynamically adjusted according to the hydraulic retention time of the aquaculture water area; The aquaculture water area operating state is obtained at a sampling frequency of two times per second by a distributed pressure sensor, and the abnormal values are removed through Hampel filtering; The weather change data are obtained by calling an API interface to obtain two-hour forecast data, and a Kalman filter algorithm is used to fuse with historical observation data to generate a forecast correction value.

7. A water body antibacterial agent intelligent delivery strategy generation system for implementing the water body antibacterial agent intelligent delivery strategy generation method of any one of claims 1-6, characterized in that, It includes a multi-source data collection module, a feature vector generation module, a weight coefficient calculation module, and an intelligent dispensing strategy generation module; wherein the modules are connected through electrical means; The multi-source data collection module obtains water quality monitoring data, aquaculture water area flow rate data, and weather forecast data from multi-modal data sources to form a multi-source data set, and sends the multi-source data set to the feature vector generation module; The feature vector generation module performs time alignment on the multi-source data set based on the dynamic time warping algorithm, eliminates the differences in sensor sampling frequencies using a sliding window mechanism, generates spatio-temporal unified feature vectors, and sends the spatio-temporal unified feature vectors to the weight coefficient calculation module and the intelligent dispensing strategy generation module; The weight coefficient calculation module is configured to construct a dynamic weight distribution model including sterilization efficiency, drug residue and operation cost based on the space-time unified feature vector, calculate the dynamic weight coefficient in real time through a gated recurrent unit network, and send the dynamic weight coefficient to the intelligent injection strategy generation module. The intelligent injection strategy generation module is configured to deploy a reinforcement learning framework based on the dynamic weight coefficient and the space-time unified feature vector at the edge computing node, construct an antibacterial agent injection model based on a double-delay deep deterministic policy gradient algorithm, dynamically update Q-value network parameters of the reinforcement learning framework through an online incremental learning mechanism, and generate an antibacterial agent intelligent injection strategy meeting real-time response requirements.

Citation Information

Patent Citations

  • Intelligent control method and system for sewage treatment

    CN119620623A

  • Intelligent breeding method for crayfish offspring seeds in winter fallow field

    CN120240370A

  • Thermal power plant circulating water intelligent dosing system and method based on multi-module cooperation

    CN120447343A