Intelligent control method and system for fish-maize symbiosis based on fuzzy control algorithm
By introducing an instruction buffer queue with environmental disturbance urgency coefficient modulation into the aquaponics system, the problem of frequent instruction switching in fuzzy controllers when parameters fluctuate is solved, the continuity and stability of control instructions are realized, and the stability and safety of the system are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CANGZHOU NORMAL UNIV
- Filing Date
- 2026-04-10
- Publication Date
- 2026-06-30
AI Technical Summary
Existing fuzzy controllers in aquaponics systems cause frequent switching of control commands due to sensor measurement noise or parameter fluctuations, leading to frequent equipment start-ups and shutdowns, increased energy consumption, disruption of water flow patterns, and impact on system stability and mechanical lifespan.
An instruction buffer queue with dynamic modulation of environmental disturbance urgency coefficient is introduced. The disturbance urgency is calculated through real-time change rate. Combined with fuzzy inference and smooth control, the final execution instruction is generated to achieve the continuity and stability of control instructions.
It effectively suppresses high-frequency command oscillations, reduces mechanical wear and energy consumption, improves system stability and safety, ensures rapid response in emergencies, and enhances system control quality and intelligence.
Smart Images

Figure CN122308222A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automation control technology, and in particular to an intelligent control method and system for aquaponics based on fuzzy control algorithms. Background Technology
[0002] Aquaponics is an integrated ecological symbiotic model combining aquaculture and hydroponics. Its stable operation highly depends on the dynamic balance of several key parameters in the aquatic environment, including but not limited to pH, dissolved oxygen, ammonia nitrogen concentration, and temperature. To achieve automated management of these nonlinear and strongly coupled parameters, fuzzy control algorithms have become the mainstream intelligent control strategy in this field. The core of this method lies in converting continuous and precise numerical values collected by sensors into discrete fuzzy linguistic variables through a predefined membership function. Subsequently, reasoning is performed based on an expert experience rule base, and finally, the fuzzy reasoning results are defuzzified into specific execution instructions, such as adjusting the on / off duration of acid / alkali dripping pumps.
[0003] While fuzzy control significantly enhances the management capabilities of complex systems in existing technologies, its performance in practical engineering applications relies on discretizing a continuous space into a finite number of fuzzy sets. When the measured value of an environmental parameter (e.g., dissolved oxygen) falls within the intersection or transition region of the membership functions of two adjacent fuzzy sets (e.g., moderate and low), its classification becomes extremely fragile. In this case, even minute sensor noise or normal fluctuations (e.g., ±0.05 mg / L) can cause the parameter to repeatedly switch between belonging to set A and set B. Such abrupt shifts in classification activate drastically different control rules, resulting in discontinuous, step-like changes in the controller's output commands. This output oscillation is directly transmitted to the actuators, causing frequent start-ups or significant adjustments to equipment such as pumps and valves. This not only accelerates mechanical wear and increases energy consumption but also continuously disturbs the water flow, disrupting the system's inherent hydraulic and ecological balance. Summary of the Invention
[0004] To address the technical problems existing in the background art, this invention proposes an intelligent control method and system for aquaponics based on fuzzy control algorithms, the specific solution of which is as follows: The intelligent control method for aquaponics based on fuzzy control algorithm includes the following steps: S1. Acquire multiple environmental parameters of the aquaponics system in real time, and calculate the real-time change rate of each environmental parameter at the current sampling time; S2. Input the environmental parameters as input variables into the preset fuzzy control rule base, and generate a real-time pass-through control command for the current sampling time through fuzzy inference and defuzzification processing. S3. Based on the real-time rate of change, calculate the environmental disturbance urgency coefficient at the current sampling time; S4. Pre-construct an instruction buffer queue with a preset maximum storage depth, and sequentially write the real-time pass-through control instructions to the tail of the instruction buffer queue; determine the current read depth of the instruction buffer queue based on the environmental disturbance urgency coefficient, and read historical instruction data of the corresponding depth from the instruction buffer queue to generate a delay smoothing control instruction. S5. Using the environmental disturbance urgency coefficient as a weighting factor, perform complementary weighted summation calculation on the real-time direct control command and the time delay smoothing control command to generate the final execution command.
[0005] Furthermore, in S1, the real-time rate of change of each of the environmental parameters at the current sampling time is calculated as follows: Obtain the measured value of the environmental parameter at the current sampling time, and the historical measured value of the environmental parameter at the previous sampling time; Calculate the difference between the measured value and the historical measured value; Divide the absolute value of the difference by the sampling time interval to generate the real-time rate of change of the environmental parameter at the current sampling moment.
[0006] Furthermore, in S2, the environmental parameters are input as input variables into a preset fuzzy control rule base. After fuzzy inference and defuzzification processing, a real-time pass-through control command for the current sampling time is generated, as follows: Set a target value for the environmental parameter, and calculate the deviation between the current measured value of the environmental parameter and the target value; Based on the real-time rate of change, it is set as the rate of change of the deviation; Using a preset membership function, the deviation and the rate of change of the deviation are converted into fuzzy linguistic variables; Based on a preset fuzzy control rule table, fuzzy logic reasoning is performed on the fuzzy linguistic variables to output fuzzy control quantities; the fuzzy control rule table contains several control rules based on conditional statements. The fuzzy control quantity is defuzzified using the maximum membership method to generate a numerical signal, which serves as the real-time pass-through control command for the current sampling time.
[0007] Furthermore, in S3, based on the real-time rate of change, the environmental disturbance urgency coefficient at the current sampling moment is calculated as follows: A preset noise threshold and a mutation threshold are defined, wherein the mutation threshold is greater than the noise threshold. The real-time rate of change is numerically compared with the noise threshold and the mutation threshold, respectively: If the real-time rate of change is less than or equal to the noise threshold, then the environmental disturbance urgency coefficient is set to 0. If the real-time rate of change is greater than or equal to the mutation threshold, then the environmental disturbance urgency coefficient is set to 1. If the real-time rate of change is between the noise threshold and the mutation threshold, an environmental disturbance urgency coefficient is generated based on the real-time rate of change using a linear interpolation algorithm, such that the environmental disturbance urgency coefficient monotonically increases between 0 and 1 with the real-time rate of change.
[0008] Furthermore, in S4, the current read depth of the instruction buffer queue is determined based on the environmental disturbance urgency coefficient, as follows: Specifically, the following calculation formula is used: , in, This represents the current read latency. K is the maximum hysteresis time constant corresponding to the preset maximum storage depth, and K is the environmental disturbance urgency coefficient. The current read depth is determined based on the ratio of the current read lag time to the system sampling period.
[0009] Furthermore, in S4, delay smoothing control instructions are generated as follows: Based on each sampling moment, the real-time pass-through control instruction is written to the current write position of the instruction buffer queue; Based on the current read depth, locate the starting read position in the instruction buffer queue; Based on the instruction buffer queue, a historical instruction sequence is generated from the starting read position to the current write position; The arithmetic mean of the historical instruction sequence is calculated, and the result is used as the delay smoothing control instruction.
[0010] Furthermore, in S4, an instruction buffer queue with a preset maximum storage depth is pre-built, as follows: A fixed-length storage space is set as the instruction buffer queue, the length of which is determined by the preset maximum storage depth; Set a write position identifier to indicate the position where the next real-time pass-through control command will be stored, and set its initial value to 0; Set a read position identifier to indicate the starting position of the next read of historical command data, and set its initial value to 0.
[0011] Furthermore, in S5, using the environmental disturbance urgency coefficient as a weighting factor, the real-time pass-through control command and the time-delay smoothing control command are subjected to complementary weighted summation calculation to generate the final execution command, as follows: Let the final execution instruction be ; Let the urgency coefficient of the environmental disturbance be K; Let the time delay smoothing control command be ; Let the real-time through control command be ; The following complementary weighted summation formula is used for calculation: , Wherein, K is used as the weighting coefficient of the real-time pass-through control command, and (1-K) is used as the complementary weighting coefficient of the time delay smoothing control command.
[0012] The aquaponics intelligent control system based on fuzzy control algorithm includes: The acquisition and analysis module is used to acquire multiple environmental parameters of the aquaponics system in real time and calculate the real-time change rate of each environmental parameter at the current sampling time. The baseline instruction generation module is used to input the environmental parameters as input variables into a preset fuzzy control rule base, and generate real-time pass-through control instructions at the current sampling time through fuzzy inference and defuzzification processing. The urgency assessment module is used to calculate the environmental disturbance urgency coefficient at the current sampling time based on the real-time rate of change. The dynamic smoothing module is used to pre-build an instruction buffer queue with a preset maximum storage depth, and sequentially write the real-time pass-through control instructions to the tail of the instruction buffer queue; determine the current read depth of the instruction buffer queue based on the environmental disturbance urgency coefficient, and read historical instruction data of the corresponding depth from the instruction buffer queue to generate a delay smoothing control instruction. The fusion output module is used to perform complementary weighted summation calculation on the real-time direct control command and the time-delay smoothing control command, using the environmental disturbance urgency coefficient as a weighting factor, to generate the final execution command.
[0013] Compared with the prior art, the present invention can achieve at least the following beneficial effects: This invention solves the grid line oscillation problem near the parameter critical point in traditional fuzzy control by introducing an instruction buffer queue dynamically modulated by the urgency coefficient of environmental disturbance. When in steady state, the queue works at maximum depth to perform deep smoothing filtering on historical control instructions. This process effectively filters out high-frequency instruction jumps caused by small sensor noise or slight fluctuations in parameters at the fuzzy set boundary, making the final instructions output to actuators such as water pumps and valves continuous and stable. This avoids frequent start-stop and large-scale adjustment of actuators, significantly reduces mechanical wear, saves energy, and maintains the long-term stability of water flow, thereby extending the overall service life of the system. By constructing a real-time direct control channel parallel to the smoothing channel and intelligently integrating it through the urgency coefficient, when parameters change drastically, such as a sudden drop in dissolved oxygen, the urgency coefficient K quickly approaches 1. At this time, the depth of the instruction buffer queue is dynamically compressed to almost zero, the smoothing link is instantaneously short-circuited, and the weight of the final execution instruction is almost entirely assigned to the real-time direct control instruction. This allows the full force of the correction instruction to be quickly sent to the actuator within the same control cycle when the danger is detected, ensuring that the control system can intervene immediately in emergency situations such as pipeline rupture and equipment failure, thus buying precious time to save biological lives and greatly improving the safety and reliability of the system. By using the continuous quantity of environmental disturbance urgency coefficient, the control strategy achieves a continuous and smooth transition. It can automatically and intelligently adjust its control behavior based on the real-time perceived urgency of the system dynamics. In all intermediate states from steady state to sudden change, the control commands are optimized by real-time response and historical smoothness. This makes the system more compliant and robust in adapting to external disturbances. This adaptive mechanism significantly improves the overall control quality and intelligence level of the aquaponics system, a complex ecological engineering project, when facing changing environments and internal disturbances. Attached Figure Description
[0014] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein: Figure 1 This is a flowchart of the method of the present invention.
[0015] Figure 2 This is a system principle block diagram of the present invention. Detailed Implementation
[0016] Embodiments of the present invention are described in detail below. Examples of these embodiments are illustrated in the accompanying drawings, wherein the same or similar symbols denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0017] Please refer to Figure 1 This invention provides an intelligent control method for aquaponics based on fuzzy control algorithm, comprising the following steps: S1. Acquire multiple environmental parameters of the aquaponics system in real time, and calculate the real-time change rate of each environmental parameter at the current sampling time.
[0018] It should be noted that real-time acquisition of various environmental parameters of the aquaponics system is achieved through sensor arrays deployed at key nodes of the system. These sensor arrays include at least dissolved oxygen sensors, pH sensors, ammonia nitrogen sensors, temperature sensors, and water level sensors. These sensors acquire data synchronously or asynchronously at a constant system sampling period (e.g., 1 second, 5 seconds, or 1 minute) and transmit the measured values to the central processing unit. These various environmental parameters typically refer to critical water quality and physical parameters essential for the growth of fish and vegetables, with core parameters including dissolved oxygen concentration (DO), pH value, ammonia nitrogen concentration (NH3-N), water temperature, and system water level. Real-time, synchronous acquisition of these multi-dimensional parameters forms the basis for subsequent precise and coordinated control.
[0019] In an optional embodiment, in S1, the real-time rate of change of each of the environmental parameters at the current sampling time is calculated as follows: Obtain the measured value of the environmental parameter at the current sampling time, and the historical measured value of the environmental parameter at the previous sampling time; Calculate the difference between the measured value and the historical measured value; Divide the absolute value of the difference by the sampling time interval to generate the real-time rate of change of the environmental parameter at the current sampling moment.
[0020] It should be noted that calculating the real-time rate of change of each environmental parameter at the current sampling moment is a crucial step in quantifying the dynamic behavior of the system. In a discrete sampling system, this real-time rate of change is essentially the first-order approximate derivative of the parameter at the current sampling moment. It reflects the speed and direction of the environmental parameter's change, indicated by the sign of the difference. However, to assess the severity of the change, the absolute or squared value is often used in subsequent calculations. Specifically, the system caches the historical measurement values of each parameter from the previous sampling moment. The sampling time interval is the fixed sampling period set by the system. Taking dissolved oxygen as an example, if the measured value at the current time t is... The previous moment The measured value is Then its instantaneous rate of change This calculation method is simple and effective, and can capture sudden trends in parameters (such as a sudden drop in dissolved oxygen) or steady-state fluctuations (such as small fluctuations in pH) in real time, providing direct quantitative basis for subsequent judgment of system state (steady-state or acute state).
[0021] It should be noted that using absolute values to calculate the rate of change is primarily to focus on the magnitude rather than the direction of environmental parameter changes. This is because drastic changes, whether positive or negative, can indicate system imbalance or sudden emergencies, requiring a rapid response from the control system. For example, a sharp rise or fall in dissolved oxygen can be caused by different faults, but both require immediate attention. Of course, in some implementations, symbolic information can be retained for more refined rule-based judgments.
[0022] It should be noted that the system sampling period The selection of a sampling period requires a trade-off between response speed and noise immunity. Shorter periods (e.g., 1 second) can capture sudden changes more quickly, but small fluctuations in the sensor readings and measurement noise will be amplified, potentially leading to an overestimation of the calculated rate of change and falsely triggering an emergency response. Longer periods (e.g., 1 minute) can effectively smooth out daily fluctuations, but introduce a larger detection delay. In practical applications, an optimal sampling period is usually determined experimentally based on the specific scale of the aquaponics system, the inertial time constant, and the accuracy of the sensors used.
[0023] S2. The environmental parameters are input as input variables into a preset fuzzy control rule base. After fuzzy inference and defuzzification processing, a real-time pass-through control command for the current sampling time is generated.
[0024] In an optional embodiment, in S2, the environmental parameters are input as input variables into a preset fuzzy control rule base. After fuzzy inference and defuzzification processing, a real-time pass-through control command for the current sampling time is generated, as follows: Set a target value for the environmental parameter, and calculate the deviation between the current measured value of the environmental parameter and the target value; It should be noted that the target setpoints are the optimal environmental ranges predetermined based on the optimal growth models for fish and vegetables. For example, the target setpoint for dissolved oxygen might be set at 5.0 mg / L, the target setpoint for pH might be set at 6.8, and the target setpoint for ammonia nitrogen concentration might be set at less than 0.5 mg / L. The deviation is the difference between the current sensor measurement and these target setpoints (e = measured value - setpoint), which quantifies the distance and direction (positive or negative deviation) of the current environmental state from the ideal state.
[0025] Based on the real-time rate of change, it is set as the rate of change of the deviation; It should be noted that setting the real-time rate of change directly as the rate of change of the deviation is a key design feature. In traditional fuzzy control, the rate of change of the deviation is usually obtained by calculating the difference in the deviation. This invention cleverly reuses the pre-calculated real-time rate of change, which characterizes the drastic change of the parameter itself, to replace it. This not only simplifies the calculation, but more importantly, it allows the controller to perceive the sudden dynamic changes in the environment more directly, rather than just the rate of deviation from the target value. For example, when dissolved oxygen drops sharply due to a power outage, its real-time rate of change is extremely high. Even if the deviation itself may not have reached its maximum value at this time, the controller can detect the emergency situation in advance.
[0026] Using a preset membership function, the deviation and the rate of change of the deviation are converted into fuzzy linguistic variables; It should be noted that converting the deviation and its rate of change into fuzzy linguistic variables using a preset membership function is a key step in realizing fuzzy inference. The membership function defines the degree to which a precise value belongs to a certain fuzzy linguistic set, such as negative large (NB), negative small (NS), zero (ZO), positive small (PS), and positive large (PB). Taking dissolved oxygen deviation as an example, a triangular or Gaussian membership function might be used. For instance, when the deviation e = -0.3 mg / L, it might simultaneously belong to both negative small (NS) and zero (ZO) linguistic variables, but with different membership degrees, such as... , μ_ZO(e)=0.3) This fuzzification process effectively overcomes the rigid boundary problem in traditional threshold control.
[0027] Based on a preset fuzzy control rule table, fuzzy logic reasoning is performed on the fuzzy linguistic variables to output fuzzy control quantities; the fuzzy control rule table contains several control rules based on conditional statements. The fuzzy control quantity is defuzzified using the maximum membership method to generate a numerical signal, which serves as the real-time pass-through control command for the current sampling time.
[0028] It should be noted that the pre-defined fuzzy control rule table encapsulates the logical core of domain expert knowledge and system operation experience. Rules typically use the "If...Then..." format. For example, for the control of a variable frequency oxygen pump, a typical rule might be: if the dissolved oxygen deviation is negatively small (NS) and its rate of change is positively large (PB), then the output control quantity is positively large (PB). This means that if the dissolved oxygen is slightly below the target value but is rising rapidly, a larger oxygenation command should still be output to prevent it from falling back due to insufficient upward momentum. The rule base needs to cover typical scenarios of all combinations of input linguistic variables, and the fuzzy set of output quantities is calculated through fuzzy logic reasoning (commonly using the Mamdani fuzzy system or the TS fuzzy model).
[0029] It should be noted that defuzzifying the fuzzy control quantity using the maximum membership method is a crucial step in transforming the inferred fuzzy output set into a precise value that can be used to drive the actuator. The maximum membership method is a commonly used defuzzification method that selects the precise value corresponding to the output linguistic variable with the highest membership degree as the final output. For example, if the inferred fuzzy control quantity has membership degrees on both the medium-speed and high-speed sets, but the high-speed set has the highest membership degree, then the specific frequency value corresponding to the high-speed set (e.g., 45Hz) is output. This method is simple to calculate and has a fast response, meeting the speed requirements of a real-time through-channel. However, its drawback is that the output command may experience step fluctuations near the quantization boundary due to jumps in membership degrees, which is precisely the problem that subsequent steps in this invention need to address.
[0030] S3. Based on the real-time rate of change, calculate the environmental disturbance urgency coefficient at the current sampling time; the environmental disturbance urgency coefficient is a value between 0 and 1.
[0031] It should be noted that the environmental disturbance urgency coefficient, as a continuous scalar between 0 and 1, is essentially a dynamic quantitative assessment of the urgency of the disturbance currently affecting the system due to abrupt changes in environmental parameters. A coefficient of 0 represents that the system is in an ideal stable state with negligible disturbances, while a coefficient of 1 represents that the system is experiencing a drastic change that threatens the survival of organisms.
[0032] In an optional embodiment, in S3, based on the real-time rate of change, the environmental disturbance urgency coefficient at the current sampling time is calculated as follows: A preset noise threshold and a mutation threshold are defined, wherein the mutation threshold is greater than the noise threshold. It should be noted that the noise threshold setting is primarily based on sensor measurement noise, normal physiological fluctuations in environmental parameters, and the acceptable fluctuation range caused by the system's minute inertia. For example, for a high-precision dissolved oxygen sensor, its measurement noise may be ±0.05 mg / L. Considering the normal minute fluctuations caused by fish respiration, the noise threshold can be set to a rate of change of 0.1 mg / L / min. Fluctuations below this threshold are considered background noise and should be filtered out by the system. In this case, the stress coefficient is set to 0, and the system enters a deep smoothing mode.
[0033] It should be noted that the mutation threshold is set based on the critical rate of change of a parameter that may cause acute stress or damage to fish or plants. This threshold needs to be determined in conjunction with biological tolerance data and historical incident analysis. For example, studies have shown that a drop in dissolved oxygen exceeding 2.0 mg / L within 1 minute can easily lead to fish suffocation; therefore, the mutation threshold for dissolved oxygen can be set at 2.0 mg / L / min. When the rate of change exceeds this threshold, it means that a major emergency has occurred in the system (such as equipment failure or pipeline rupture), and the urgency coefficient should be immediately set to 1 to trigger a zero-delay emergency response.
[0034] The real-time rate of change is numerically compared with the noise threshold and the mutation threshold, respectively: If the real-time rate of change is less than or equal to the noise threshold, then the environmental disturbance urgency coefficient is set to 0. If the real-time rate of change is greater than or equal to the mutation threshold, then the environmental disturbance urgency coefficient is set to 1. If the real-time rate of change is between the noise threshold and the mutation threshold, an environmental disturbance urgency coefficient is generated based on the real-time rate of change using a linear interpolation algorithm.
[0035] It should be noted that if the real-time rate of change is between the noise threshold and the mutation threshold, an environmental disturbance urgency coefficient is generated based on the real-time rate of change using a linear interpolation algorithm. This is crucial for handling moderate disturbances. The linear interpolation formula can be expressed as: Where K is the urgency coefficient, The current real-time rate of change. Noise threshold The threshold value is set at the mutation threshold. This design allows the response stiffness of the control system to change continuously and smoothly with the severity of the disturbance, avoiding the secondary oscillations that may occur with traditional on / off switching. For example, if the dissolved oxygen change rate is 1.0 mg / L / min (between the noise threshold of 0.1 and the mutation threshold of 2.0), the calculated urgency coefficient K is approximately 0.47. The system will correspondingly shorten the buffer queue and moderately tilt the final command towards the real-time command.
[0036] For different environmental parameters, separate noise thresholds and mutation thresholds are set respectively: For the dissolved oxygen concentration parameter, a first mutation threshold is set; for the pH parameter, a second mutation threshold is set; wherein, the first mutation threshold is less than the second mutation threshold.
[0037] It should be noted that setting independent noise and mutation thresholds for different environmental parameters is a refined design based on the varying biological importance, dynamic characteristics, and sensor accuracy of each parameter in the aquaponics system. Specifically: For the dissolved oxygen concentration parameter, a low mutation threshold (first mutation threshold) is set: this is because dissolved oxygen is a critical instantaneous parameter for fish survival, and its acute deficiency can lead to mass mortality within minutes, so the system must be extremely sensitive to its decline and respond quickly.
[0038] For the pH parameter, a higher mutation threshold (second mutation threshold) is set: Although pH is important, its changes are usually relatively slow, and organisms are quite tolerant of its short-term fluctuations. A higher mutation threshold can prevent the frequent triggering of emergency modes due to normal, slow fluctuations in pH (such as diurnal variations caused by algal photosynthesis), thereby improving the overall stability of the system.
[0039] This differentiated threshold management demonstrates the advanced nature of the invention in intelligent collaborative control of multi-parameter coupled systems, enabling the system to maintain the highest vigilance against fatal mutations while avoiding overreacting to non-critical fluctuations.
[0040] S4. Pre-construct an instruction buffer queue with a preset maximum storage depth, and sequentially write the real-time pass-through control instructions to the tail of the instruction buffer queue; determine the current read depth of the instruction buffer queue based on the environmental disturbance urgency coefficient, and read historical instruction data of the corresponding depth from the instruction buffer queue to generate a delay smoothing control instruction.
[0041] It should be noted that the core of the dynamic delay smoothing channel is a dynamically adjustable instruction buffer queue and a corresponding smoothing algorithm. The function of the dynamic delay smoothing channel is twofold: in steady state, it utilizes a longer historical data window for smoothing filtering to eliminate instruction oscillations caused by fuzzy control quantization boundary issues in the real-time pass-through channel of S2; in rapid changes, it can short-circuit itself almost in real time to avoid introducing harmful delays. It is the key technological carrier for achieving the paradoxical unity of high smoothness in steady state and fast response in rapid state.
[0042] In an optional embodiment, in S4, the current read depth of the instruction buffer queue is determined based on the environmental disturbance urgency coefficient, as follows: specifically, the following calculation formula is used: , in, This represents the current read latency. K is the maximum hysteresis time constant corresponding to the preset maximum storage depth, and K is the environmental disturbance urgency coefficient. The current read depth is determined based on the ratio of the current read lag time to the system sampling period, and rounded down.
[0043] It should be noted that determining the current read depth of the instruction buffer queue based on the environmental disturbance urgency coefficient is the core logic for implementing dynamic adjustment in this step. The calculation formula establishes a clear mathematical relationship: When K = 0 (steady state): . Read historical data with the maximum lag time constant, perform the deepest smoothing, and completely filter out boundary oscillations.
[0044] When K = 1 (emergency state): . The read lag time is zero, which means directly reading the latest written instruction, and the smoothing channel is completely bypassed.
[0045] When 0 < K < 1 (transition state): Linearly vary between 0 and . The smoothing intensity continuously weakens as the disturbance urgency increases, achieving a smooth transition of the control behavior and avoiding jitter during mode switching.[[ID=X]] [[ID=Y]]
[0046] It should be noted that the maximum lag time constant determines the maximum smoothing intensity in the steady state, and its typical value range can be from 3 seconds to 30 seconds, preferably 5 seconds to 15 seconds. should not be less than the main inertia time of the controlled object (such as water body). For example, for a medium-sized aquaculture pond, the global response time of dissolved oxygen to the aeration instruction is about 10 seconds, then can be set to 10 seconds.
[0047] To effectively smooth the high-frequency instruction oscillations caused by the quantization boundary of fuzzy control, whose period may be close to the sampling period, usually takes a value that is several times the control period or the expected oscillation period.
[0048] The current read depth is obtained by dividing by the sampling period and rounding down. Rounding down ensures that the depth value is an integer number of sampling points, facilitating accurate index positioning in the discrete queue, which is a necessary operation for engineering implementation.
[0049] In an optional embodiment, in S4, generate a time-delay smoothing control instruction as follows: Based on each sampling moment, write the real-time direct control instruction to the current write position of the instruction buffer queue; Based on the current read depth, locate the starting read position in the instruction buffer queue; Based on the instruction buffer queue, generate a historical instruction sequence between the starting read position and the current write position; Calculate the arithmetic mean of the historical instruction sequence, and use the calculation result as the time-delay smoothing control instruction.
[0050] It should be noted that generating delay-smoothing control commands is a periodic data access and processing process. At each sampling moment, the latest real-time pass-through control command is first written to the tail of the queue, ensuring continuous data updates. Then, based on the current read depth D, the starting historical position for data reading is calculated. The data segment between this starting read position and the current write position constitutes the historical command sequence. Finally, the arithmetic mean of this sequence is calculated. This is a simple and effective low-pass filtering method that can significantly smooth out high-frequency jump components (i.e., fuzzy control boundary oscillations) in the sequence, and its output... It has smooth and hysteretic characteristics, making it very suitable for fine-tuning in steady state. For example, if D=5, the average of the last 5 command values is taken, which can eliminate the jump from 30Hz to 35Hz in a single command and stabilize it around 32.5Hz.
[0051] In an optional embodiment, in S4, an instruction buffer queue with a preset maximum storage depth is pre-constructed as follows: A fixed-length storage space is set as the instruction buffer queue, the length of which is determined by the preset maximum storage depth; Set a write position identifier to indicate the position where the next real-time pass-through control command will be stored, and set its initial value to 0; Set a read position identifier to indicate the starting position of the next read of historical command data, and set its initial value to 0.
[0052] It should be noted that pre-constructing an instruction buffer queue with a preset maximum storage depth allocates storage resources and sets an upper limit for smoothing capabilities. The preset maximum storage depth determines the maximum smoothing strength the system can achieve in a fully steady state (K=0), and is typically determined by the system's maximum inertia time constant and the desired noise frequency to be filtered out. For example, if the mechanical inertia of an actuator such as a water pump makes it insensitive to frequency fluctuations of instructions shorter than 5 seconds, the maximum storage depth can be set to the corresponding 5-second duration (e.g., if the sampling period is 1 second, the depth is 5). This queue is typically implemented in software as a first-in, first-out (FIFO) circular buffer. During initialization, setting a fixed-length storage space allocates the buffer; setting write and read position identifiers initializes the two pointers (or indices) managing the buffer, which is the basic data structure for achieving efficient circular overlay access.
[0053] The smoothing of historical instruction sequences described in S4 is achieved through a circular overwrite storage and addressing mechanism, specifically including: When the instruction buffer queue is initialized, a fixed storage length N is set, and a current write index value and a current start read index value are initialized. At each sampling time t, perform the following operations sequentially: (a) Store the real-time pass-through control command in a storage area at the location identified by the current write index value; (b) Update the current write index value: Increment the current write index value by 1. If the result of the addition is equal to the storage length N, then reset the current write index value to 0. (c) Calculate the target read index value based on the current read depth D: subtract D from the current write index value; (d) Correcting the target read index value: If the target read index value calculated in step (c) is less than 0, add the storage length N to it to obtain the corrected target read index value; if the target read index value is greater than or equal to 0, use the value directly. (e) Set the current starting read index value to the corrected or directly used target read index value obtained in step (d); (f) The position identified by the current starting read index value is used as the starting read position to perform the operation of extracting the historical instruction sequence.
[0054] It should be noted that the described circular overlay storage and addressing mechanism is a specific software implementation scheme for the above-mentioned variable-depth buffer queue, which is efficient and reliable. Its core advantage lies in using a fixed-size storage space (length N) to simulate a theoretically infinitely long FIFO queue, and avoiding costly data movement through pointer (index) wraparound operations.
[0055] Operations (a) and (b) complete the writing of data and the updating and wrapping of the write pointer. When the pointer reaches the end of the array (index N-1), the next write will return to the beginning (index 0), overwriting the oldest data, thus achieving circular overwriting.
[0056] Operations (c), (d), and (e) are crucial for dynamically determining the read position. Based on the current read depth D, the system backtracks D positions from the write position. Due to the circular structure, this backtracking calculation may result in a negative number (indicating that it has wrapped around to the previous data area). The correction step in operation (d) (adding N) is precisely to handle this wraparound situation and obtain the correct physical storage index. Finally, the corrected index is assigned to the read pointer.
[0057] Operation (f) clarifies that this mechanism serves the purpose of extracting historical instruction sequences.
[0058] S5. Using the environmental disturbance urgency coefficient as a weighting factor, perform complementary weighted summation calculation on the real-time direct control command and the time delay smoothing control command to generate the final execution command.
[0059] In an optional embodiment, in S5, using the environmental disturbance urgency coefficient as a weighting factor, the real-time pass-through control command and the time-delay smoothing control command are subjected to complementary weighted summation calculation to generate the final execution command, as follows: Let the final execution instruction be ; Let the urgency coefficient of the environmental disturbance be K; Let the time delay smoothing control command be ; Let the real-time through control command be ; The following complementary weighted summation formula is used for calculation: , Wherein, K is used as the weighting coefficient of the real-time pass-through control command, and (1-K) is used as the complementary weighting coefficient of the time delay smoothing control command.
[0060] It should be noted that the complementary weighted summation formula... This is the mathematical core of this step. Its design philosophy is as follows: Weight normalization: The sum of the weight coefficient K and (1-K) is 1, which guarantees the fused output. Always and This is a convex combination of the two instruction values. Mathematically, this ensures that the output instruction will not exceed the range of the two input instruction values, avoiding additional amplitude overshoot or distortion introduced during the fusion process and ensuring system stability.
[0061] Urgency-driven control transfer: The urgency coefficient K of the environmental disturbance acts as a scheduler for the dynamic allocation of control between the two channels. The value of K directly determines which channel's command dominates the final output. This design directly and linearly links the system's state assessment (S3) with control decisions (S5), resulting in clear logic and computational efficiency.
[0062] It should be noted that the complementary relationship between K and (1-K) in the formula is key to achieving a continuous and smooth transition in control characteristics. It ensures that when the system state changes from a steady state (K≈0) to a rapid state (K≈1), the output characteristics of the final command do not jump, but rather smoothly transition from a completely smooth, slightly lagging characteristic to a completely real-time, lag-free characteristic as K continuously changes. This smooth transition avoids secondary disturbances or actuator jitter that may be caused by traditional switching strategies.
[0063] The complementary weighted summation calculation has the following dynamic convergence characteristics: When the aquaponics system is in a steady state, causing the environmental disturbance urgency coefficient to approach 0, the weight of the real-time direct control command approaches 0, and the final execution command numerically converges to the time-delay smoothing control command, thereby suppressing the oscillation of the control signal. When a sudden change occurs in the aquaponics system, causing the environmental disturbance urgency coefficient to approach 1, the weight of the time delay smoothing control command approaches 0, and the final execution command numerically converges to the real-time pass-through control command, thereby eliminating the phase lag introduced by the smoothing process.
[0064] It should be noted that the dynamic convergence characteristic accurately describes the ideal behavior of the method of the present invention under two extreme conditions, and is a direct manifestation of its solution to the contradictions mentioned in the background art: Steady-state convergence to a smoothing command: When the system is running steadily, the rate of change of each parameter is extremely small, and the value of K approaches 0. At this time, (1-K)≈1, K≈0, and the formula simplifies to... ≈ This means that the final output is almost entirely composed of the deeply smoothed filter. The high-frequency oscillation noise from the real-time direct channel (such as the 30Hz / 35Hz jump caused by quantization boundary) is effectively suppressed, and the variable frequency water pump will obtain a stable and smooth frequency command (such as 32.5Hz), thereby completely eliminating the frequent start-stop or large adjustment of the actuator, solving the critical oscillation problem, and protecting the equipment.
[0065] Acute convergence to real-time command: When a sudden change occurs in the system (such as a sharp drop in dissolved oxygen), the rate of change of relevant parameters is extremely high, and the value of K rapidly approaches 1. At this time, (1-K)≈0, K≈1, and the formula simplifies to... ≈ Within the same sampling cycle when a hazard is detected, control commands reflecting the highest level of emergency (such as full-speed oxygenation - 50Hz) can be directly output to the actuator, achieving millisecond-level emergency response. This fundamentally solves the problem of response lag and ensures biosafety.
[0066] Please refer to Figure 2 This invention provides an intelligent control system for aquaponics based on fuzzy control algorithms, comprising: The acquisition and analysis module is used to acquire multiple environmental parameters of the aquaponics system in real time and calculate the real-time change rate of each environmental parameter at the current sampling time. The baseline instruction generation module is used to input the environmental parameters as input variables into a preset fuzzy control rule base, and generate real-time pass-through control instructions at the current sampling time through fuzzy inference and defuzzification processing. The urgency assessment module is used to calculate the environmental disturbance urgency coefficient at the current sampling time based on the real-time rate of change. The dynamic smoothing module is used to pre-build an instruction buffer queue with a preset maximum storage depth, and sequentially write the real-time pass-through control instructions to the tail of the instruction buffer queue; determine the current read depth of the instruction buffer queue based on the environmental disturbance urgency coefficient, and read historical instruction data of the corresponding depth from the instruction buffer queue to generate a delay smoothing control instruction. The fusion output module is used to perform complementary weighted summation calculation on the real-time direct control command and the time-delay smoothing control command, using the environmental disturbance urgency coefficient as a weighting factor, to generate the final execution command.
[0067] In summary, this patent application introduces an environmental disturbance urgency coefficient to dynamically adjust the depth of the instruction buffer queue and adopts a dual-channel weighted fusion output. This enables the system to deeply smooth the boundary oscillations generated by fuzzy control in steady state to protect the equipment, and to achieve zero-delay emergency response by instantaneously bypassing the smoothing link when parameters change abruptly. This adaptively solves the problem of the incompatibility between smoothness and speed in traditional methods.
[0068] Furthermore, any content not described in detail in this specification is existing technology known to those skilled in the art.
[0069] In the embodiments provided by this invention, it should be understood that the disclosed system or method can be implemented in other ways. For example, the embodiments of the invention described above are merely illustrative; for instance, the division of modules is only a logical functional division, and there may be other division methods in actual implementation.
[0070] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0071] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated module can be implemented in hardware or in the form of hardware plus software functional modules.
[0072] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the basic characteristics of the present invention.
[0073] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. An intelligent control method for aquaponics based on fuzzy control algorithm, characterized in that, Includes the following steps: S1. Acquire multiple environmental parameters of the aquaponics system in real time, and calculate the real-time change rate of each environmental parameter at the current sampling time; S2. Input the environmental parameters as input variables into the preset fuzzy control rule base, and generate a real-time pass-through control command for the current sampling time through fuzzy inference and defuzzification processing. S3. Based on the real-time rate of change, calculate the environmental disturbance urgency coefficient at the current sampling time; S4. Pre-construct an instruction buffer queue with a preset maximum storage depth, and sequentially write the real-time pass-through control instructions to the tail of the instruction buffer queue. The current read depth of the instruction buffer queue is determined based on the environmental disturbance urgency coefficient, and historical instruction data at the corresponding depth is read from the instruction buffer queue to generate a delay smoothing control instruction. S5. Using the environmental disturbance urgency coefficient as a weighting factor, perform complementary weighted summation calculation on the real-time direct control command and the time delay smoothing control command to generate the final execution command.
2. The intelligent control method for aquaponics based on fuzzy control algorithm as described in claim 1, characterized in that: In S1, the real-time rate of change of each of the environmental parameters at the current sampling time is calculated as follows: Obtain the measured value of the environmental parameter at the current sampling time, and the historical measured value of the environmental parameter at the previous sampling time; Calculate the difference between the measured value and the historical measured value; Divide the absolute value of the difference by the sampling time interval to generate the real-time rate of change of the environmental parameter at the current sampling moment.
3. The intelligent control method for aquaponics based on fuzzy control algorithm as described in claim 1, characterized in that: In S2, the environmental parameters are input as input variables into a preset fuzzy control rule base. After fuzzy inference and defuzzification processing, a real-time pass-through control command for the current sampling time is generated, as follows: Set a target value for the environmental parameter, and calculate the deviation between the current measured value of the environmental parameter and the target value; Based on the real-time rate of change, it is set as the rate of change of the deviation; Using a preset membership function, the deviation and the rate of change of the deviation are converted into fuzzy linguistic variables; Based on the preset fuzzy control rule table, fuzzy logic reasoning is performed on the fuzzy linguistic variables to output fuzzy control quantities; The fuzzy control rule table contains several control rules based on conditional statements; The fuzzy control quantity is defuzzified using the maximum membership method to generate a numerical signal, which serves as the real-time pass-through control command for the current sampling time.
4. The intelligent control method for aquaponics based on fuzzy control algorithm as described in claim 1, characterized in that: In S3, based on the real-time rate of change, the environmental disturbance urgency coefficient at the current sampling time is calculated as follows: A preset noise threshold and a mutation threshold are defined, wherein the mutation threshold is greater than the noise threshold. The real-time rate of change is numerically compared with the noise threshold and the mutation threshold, respectively: If the real-time rate of change is less than or equal to the noise threshold, then the environmental disturbance urgency coefficient is set to 0. If the real-time rate of change is greater than or equal to the mutation threshold, then the environmental disturbance urgency coefficient is set to 1. If the real-time rate of change is between the noise threshold and the mutation threshold, an environmental disturbance urgency coefficient is generated based on the real-time rate of change using a linear interpolation algorithm, such that the environmental disturbance urgency coefficient monotonically increases between 0 and 1 with the real-time rate of change.
5. The intelligent control method for aquaponics based on fuzzy control algorithm as described in claim 1, characterized in that: In S4, the current read depth of the instruction buffer queue is determined based on the environmental disturbance urgency coefficient, as follows: Specifically, the following calculation formula is used: , in, This represents the current read latency. K is the maximum hysteresis time constant corresponding to the preset maximum storage depth, and K is the environmental disturbance urgency coefficient. The current read depth is determined based on the ratio of the current read lag time to the system sampling period.
6. The intelligent control method for aquaponics based on fuzzy control algorithm as described in claim 5, characterized in that: In S4, the delay smoothing control instruction is generated as follows: Based on each sampling moment, the real-time pass-through control instruction is written to the current write position of the instruction buffer queue; Based on the current read depth, locate the starting read position in the instruction buffer queue; Based on the instruction buffer queue, a historical instruction sequence is generated from the starting read position to the current write position; The arithmetic mean of the historical instruction sequence is calculated, and the result is used as the delay smoothing control instruction.
7. The intelligent control method for aquaponics based on fuzzy control algorithm as described in claim 6, characterized in that: In S4, an instruction buffer queue with a preset maximum storage depth is pre-built, as follows: A fixed-length storage space is set as the instruction buffer queue, the length of which is determined by the preset maximum storage depth; Set a write position identifier to indicate the position where the next real-time pass-through control command will be stored, and set its initial value to 0; Set a read position identifier to indicate the starting position of the next read of historical command data, and set its initial value to 0.
8. The intelligent control method for aquaponics based on fuzzy control algorithm as described in claim 1, characterized in that: In S5, using the environmental disturbance urgency coefficient as a weighting factor, the real-time direct control command and the time-delay smoothing control command are subjected to complementary weighted summation to generate the final execution command, as follows: Let the final execution instruction be ; Let the urgency coefficient of the environmental disturbance be K; Let the time delay smoothing control command be ; Let the real-time through control command be ; The following complementary weighted summation formula is used for calculation: , Wherein, K is used as the weighting coefficient of the real-time pass-through control command, and (1-K) is used as the complementary weighting coefficient of the time delay smoothing control command.
9. An intelligent control system for aquaponics based on fuzzy control algorithm, employing the intelligent control method for aquaponics based on fuzzy control algorithm as described in any one of claims 1-8, characterized in that, include: The acquisition and analysis module is used to acquire multiple environmental parameters of the aquaponics system in real time and calculate the real-time change rate of each environmental parameter at the current sampling time. The baseline instruction generation module is used to input the environmental parameters as input variables into a preset fuzzy control rule base, and generate real-time pass-through control instructions at the current sampling time through fuzzy inference and defuzzification processing. The urgency assessment module is used to calculate the environmental disturbance urgency coefficient at the current sampling time based on the real-time rate of change. The dynamic smoothing module is used to pre-build an instruction buffer queue with a preset maximum storage depth, and sequentially write the real-time pass-through control instructions to the tail of the instruction buffer queue. The current read depth of the instruction buffer queue is determined based on the environmental disturbance urgency coefficient, and historical instruction data at the corresponding depth is read from the instruction buffer queue to generate a delay smoothing control instruction. The fusion output module is used to perform complementary weighted summation calculation on the real-time direct control command and the time-delay smoothing control command, using the environmental disturbance urgency coefficient as a weighting factor, to generate the final execution command.