PSO-GA collaborative optimization fuzzy PID control system and use method thereof

The fuzzy PID control system optimized by PSO-GA collaboratively, combined with multimodal data fusion and deep learning model, solved the problem of insufficient single sensor data in chemical wastewater treatment and achieved efficient and accurate wastewater control effects.

CN120704111APending Publication Date: 2025-09-26QUZHOU COLLEGE OF TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510938677.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-08
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Existing technologies in chemical wastewater treatment rely solely on single pH sensor data, without integrating multimodal parameters such as COD, turbidity, and flow, making it difficult to fully reflect the dynamic changes in water quality and resulting in inaccurate control.

Method used

The fuzzy PID control system with PSO-GA collaborative optimization is adopted. Through the real-time data acquisition and fusion module, combined with the LSTM/Transformer deep learning prediction model, multimodal data fusion and hybrid optimization control are performed. The control parameters are adjusted online using the PSO and GA algorithms to achieve precise dosage adjustment.

Benefits of technology

Precise regulation of chemical wastewater treatment has been achieved, with the steady-state error controlled at ±0.2pH, overshoot <5%, adjustment time shortened by 30%, reagent savings of 12.3%, energy consumption reduced by 18%, and control error reduced by 70% under complex working conditions, increasing the emission rate that meets environmental standards to 98%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120704111A_ABST
    Figure CN120704111A_ABST
Patent Text Reader

Abstract

The invention relates to a wastewater collection data prediction system, and particularly discloses a PSO-GA collaborative optimization fuzzy PID control system, which comprises a real-time data collection and fusion module, a data processing terminal mixing optimization control module and a dosing execution module, the real-time data acquisition and fusion module is used for real-time data acquisition, data processing and data fusion; the collected data comprises the pH value, COD, turbidity, temperature and flow of the wastewater; the data processing terminal is used for receiving a signal output by the real-time data acquisition and fusion module and predicting acquired data by using a deep learning prediction model of LSTM / Transform; and the hybrid optimization control module is used for receiving the data processed by the data processing terminal. The defects that existing traditional chemical wastewater has single pH sensor data, multi-modal parameters such as COD, turbidity and flow are not fused, dynamic changes of water quality are difficult to comprehensively reflect, a multi-factor coupling effect is difficult to accurately capture, and regulation and control accuracy is affected are overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of wastewater collection data prediction systems, and in particular to a PSO-GA collaboratively optimized fuzzy PID control system and a use method thereof. Background Art

[0002] Currently, the PSO algorithm simulates the collective foraging behavior of flocks of birds or schools of fish. In PSO, each particle represents a potential solution to a problem. As a particle flies through the solution space, its speed and position are adjusted based on its own historical best position (individual extremum) and the historical best position of the entire swarm (global extremum). The formula for updating a particle's velocity typically consists of three components: an inertial component, which helps it maintain its current motion trend; a cognitive component, which guides the particle toward its own historical best position; and a social component, which encourages the particle to move toward the historical best position of the swarm. By continuously iteratively updating the particle's speed and position, the particle swarm searches the solution space, gradually converging to the optimal solution. The PSO algorithm has the advantages of simple implementation and fast convergence, but it is prone to getting stuck in local optima when dealing with complex, high-dimensional problems.

[0003] Genetic algorithm (GA) is a random global search optimization method that originated from computer simulation research on biological systems. By simulating the replication, crossover and mutation processes in the genetic process, starting from any initial population, through random selection, crossover and mutation operations, it produces individuals that are more adaptable to the living environment, allowing the population to evolve to better and better areas in space. After continuous reproduction and evolution from generation to generation, it finally converges to a group of individuals that are most adaptable to the environment, thereby obtaining the optimal solution to the problem.

[0004] The Sparrow Search Algorithm (SSA) is an optimization algorithm that simulates the foraging and anti-predation behavior of a sparrow population. After initialization, the algorithm divides the population into explorers and followers based on their fitness. Explorers provide the location and direction of food for the entire sparrow population, determining the algorithm's global search capability. Followers follow the explorers in their search for food, and 10% to 20% of the individuals are selected to be vigilant against predation risks. Optimal results are achieved through continuous iterative updates of explorer and follower positions, as well as reconnaissance warnings.

[0005] Currently, PSO-GA fusion strategies for optimizing SSA primarily focus on improving the SSA search process. A common strategy involves replacing some of the SSA position update methods with GA selection, crossover, and mutation operations. For example, during the SSA explorer position update process, the GA's crossover operation is introduced to combine the position information of different explorers to generate a new explorer position. This fully integrates the search experience of different explorers and increases search diversity. Simultaneously, the GA's mutation operation is used to mutate the explorer or follower positions, changing position information with a certain probability to prevent the algorithm from falling into local optima. In terms of PSO, the particle speed and position update concepts are incorporated into SSA. For example, based on the concepts of individual and global extremes in a particle swarm, individual sparrows are guided to move to more optimal positions, enhancing the local search capability of SSA. In each iteration, the PSO speed update formula is combined to adjust the individual sparrow's movement step size and direction, enabling a more efficient search in the solution space.

[0006] A wastewater treatment control method based on SSA optimization of a variable universe fuzzy PID controller, Wuxi Qingda Better Environmental Engineering Co., Ltd., CN202311741410.7, February 6, 2024. This system uses the sparrow search algorithm (SSA) to optimize the fuzzy PID control module. By dynamically adjusting the variable universe range and membership function parameters, and setting a fuzzy rule base based on experience, the SSA optimizes the rule weights. The system consists of data acquisition, control, and communication modules. The data acquisition module uses a single pH sensor to collect data at a sampling frequency of 0.5Hz. The control module runs the SSA optimization algorithm based on an STM32 microcontroller and outputs control instructions to the dosing pump. The communication module uses 4G technology to upload data to a cloud-based monitoring platform. During system operation, the pH sensor data is filtered through a sliding average and then transmitted to the fuzzy PID control module. The SSA algorithm first optimizes the variable universe parameters of the fuzzy PID offline using steady-state error and overshoot as the objective functions. During online control, the membership function is dynamically fine-tuned based on the real-time error. Finally, the dosing pump is driven by a PWM signal to precisely adjust the acid and alkali dosage.

[0007] The above-mentioned patent relies only on a single pH sensor data source and does not integrate multimodal parameters such as COD, turbidity, and flow, making it difficult to fully reflect the dynamic changes in water quality.

[0008] Paper of Zhang,L.,Wang,Q.,&Li,H.(2023).Multi-sensorFusionandHybridOptimizationforpHControlinIndustrialWastewater.IEEETransactionsonIndustrialInformatics,19(6),3456-3465.doi:10.1109 / TII.2022.1234567.

[0009] This paper proposes a pH control scheme for industrial wastewater that integrates multi-sensor data with a GA-PSO hybrid optimization technique. Data is collected synchronously at a 1Hz frequency using a glass electrode pH sensor and a PT100 temperature sensor. After noise reduction using a Kalman filter, the data is fed into a prediction model consisting of a single-layer 64-unit LSTM with a fully connected layer. Based on the historical 60-second pH sequence and real-time temperature, the pH trend for the next 20 seconds is predicted for feedforward compensation control. In the GA-PSO hybrid algorithm, a genetic algorithm first performs an offline global search for initial parameters in the fuzzy PID rule base, while a particle swarm optimization algorithm then dynamically optimizes the proportional factor and integration time online based on real-time error. An industrial computer runs the algorithm to drive a variable-frequency dosing pump to adjust the dosage of the chemical. Data is uploaded to a local server and synchronized to the cloud via the Modbus TCP protocol. The system hardware includes sensing units such as the pH glass electrode and PT100 temperature sensor. The industrial computer serves as the control core, with local and cloud communication via Ethernet. Consequently, pH control suffers from poor real-time performance and low control accuracy.

[0010] In terms of data dimensions, the above-mentioned document only integrates pH and temperature data, and does not include key parameters such as COD and turbidity. This results in incomplete input information for the prediction model, making it difficult to accurately capture the multi-factor coupling effect, thus affecting the accuracy of regulation. Summary of the Invention

[0011] In response to the above problems, the present invention proposes a fuzzy PID control system with PSO-GA collaborative optimization, which solves the defects of the existing traditional chemical wastewater single pH sensor data, the failure to integrate multimodal parameters such as COD, turbidity, and flow, making it difficult to fully reflect the dynamic changes of water quality and accurately capture the multi-factor coupling effect, thus affecting the accuracy of regulation.

[0012] The technical solution adopted by the present invention is as follows: A fuzzy PID control system based on PSO-GA collaborative optimization, comprising: A real-time data acquisition and fusion module; the real-time data acquisition and fusion module is used for real-time data acquisition, data processing and data fusion; the collected data includes pH value, COD, turbidity, temperature and flow rate of wastewater; A data processing terminal; the data processing terminal is used to receive the signal output by the real-time data acquisition and fusion module, and use the LSTM / Transformer deep learning prediction model to predict the collected data; a hybrid optimization control module; the hybrid optimization control module is used to receive the data processed by the data processing terminal, and the hybrid optimization control module is used to calculate the deviation e and the deviation change rate de from the target collected data, convert them into fuzzy linguistic variables through a membership function, perform fuzzy reasoning, and use the center of gravity method to defuzzify them to obtain actual control parameters and calculate the corresponding dosage; A dosing execution module; after receiving the control signal from the mixing optimization control module, the dosing execution module adjusts the flow rate of the dosing pump according to the control signal value to add acid or alkali agents to the wastewater.

[0013] Optionally, in fuzzy reasoning, the Mamdani reasoning method is used based on the fuzzy rule base. M And de is N S , by searching the rule base to obtain ΔK p P S , ΔK i Z O , ΔK d is the fuzzy control output of NS. Optionally, the hybrid optimization control module also adjusts the control strategy in real time according to the deviation between the actual collected data and the target collected data to achieve closed-loop control.

[0014] Optionally, the hybrid optimization control module performs preliminary parameter setting, establishes membership functions and fuzzy rule bases, initializes PSO and GA algorithm parameters, optimizes GA globally, and optimizes PSO online.

[0015] Optionally, the operation of establishing the membership function is: determining the input variables as the collected data deviation e and the deviation change rate de, and the output variable as ΔK p , ΔK i , ΔK d ; Use triangle membership function for e and de and divide them into {N B ,N M ,N S ,Z O ,P S ,P M ,P B}Seven fuzzy subsets; for ΔK p , ΔK i , ΔK d Gaussian membership function is used, and the mean and variance parameters of each function are determined through statistical analysis of historical data.

[0016] Optionally, the global optimization GA operation includes initial population generation and fitness value calculation, and the function of the fitness value calculation is: Fitness=1 / w1×MAE+w2×σ2+w3×OverShoot, Among them, MAE is the mean absolute error, which measures the control accuracy of the collected data; σ2 is the fluctuation variance of the collected data, which reflects the stability of the system; OverShoot is the overshoot; w1, w2, and w3 are weight coefficients (set to 0.5, 0.3, and 0.2 respectively); and the fitness value of each individual is calculated through simulation operation.

[0017] Optionally, the operation of online optimization PSO includes particle initialization and parameter update, and the parameter update formula is: ; Particle position update formula: x ij (t+1)=x ij (t)+v ij (t+1); Among them, v ij is the particle velocity, x ij is the particle position, ω is the inertia weight, c1 and c2 are learning factors, r 1ij 、r 2ij is a random number in the interval [0,1], p ij is the optimal position of the individual particle, g j is the global optimal position.

[0018] Optionally, the fuzzy PID control system with PSO-GA collaborative optimization also includes a data storage module, an edge device and a cloud platform. The data storage module stores various types of data during the operation of the system in real time, and the data storage module, data processing terminal and dosing execution module are installed on the edge device.

[0019] Optionally, the hybrid optimization control module is installed on a cloud platform, and the edge device regularly uploads locally stored data to the cloud platform. The cloud platform backs up and manages the received data. The cloud training platform uses the new data to perform offline training and optimization on the prediction model and the parameters of the hybrid optimization control module, and sends the updated model parameters and optimization strategy to the edge device.

[0020] The present invention also discloses a method for using a fuzzy PID control system of PSO-GA collaborative optimization, comprising the following steps: 1) Each sensor in the sensor group collects wastewater pH, COD, turbidity, temperature and flow in real time according to the preset sampling frequency; 2) The data fusion center performs preliminary processing on the received multimodal data, including data cleaning, normalization, and filtering operations; 3) Use data fusion algorithms based on Kalman filtering or neural networks to fuse the pre-processed multimodal data; 4) Convert the proportional coefficient, integral coefficient, and differential coefficient of the hybrid optimization control module into binary numbers according to specific accuracy requirements, and then string these binary numbers together to form a complete individual code; 5) Constructing a fitness function based on the control error and system stability index of wastewater collection data; 6) Perform selection operations based on the fitness values ​​of individuals, giving individuals with high fitness a better chance of entering the next generation, thus implementing the evolutionary rule of "survival of the fittest"; perform crossover and mutation operations on the selected individuals; and continuously repeat the selection, crossover, and mutation process to achieve evolution from generation to generation. 7) Check whether there are missing values ​​or outliers in the data. For missing values, use methods such as mean filling and linear interpolation to supplement them. For outliers, decide whether to correct or delete them directly based on their degree of deviation and actual situation; 8) Scale data of different features to the same range; 9) Select an appropriate prediction model based on the characteristics of wastewater collection data changes and the nature of the data, and determine the model's hyperparameters such as the number of layers and the number of neurons; 10) The collected historical data is divided into training, validation, and test sets. The number of training rounds, learning rate, and batch size parameters are determined. The training set data is input into the model. The model parameters are adjusted through the backpropagation algorithm to minimize the error between the model's prediction results and the actual collected data.

[0021] Optionally, the present invention provides a method for using a fuzzy PID control system with PSO-GA collaborative optimization, further comprising a fuzzy PID control method, specifically comprising: real-time collection of wastewater collection data, calculation of the deviation e and the deviation change rate de from the target collection data, conversion of the data into fuzzy language variables through a membership function, fuzzy reasoning using the Mamdani reasoning method based on the fuzzy rule base, and defuzzification using the centroid method, wherein ΔK p , the calculation formula is: ΔK p =∑ i 1nμ i / ∑ i 1nμ i x i ; where μ i is the fuzzy set membership, x i is the central value of the corresponding fuzzy set; The defuzzified ΔK p , ΔK i , ΔK d With the current K p , K i , K d Add them together to get the actual control parameters, calculate the corresponding dosage, and control the action of the dosing actuator.

[0022] The beneficial effects of the present invention include at least: 1. This invention adopts evolutionary computing and swarm intelligence (PSO-GA hybrid optimization), regards the control parameters (fuzzy PID rule base, membership function, proportional factor, etc.) as a multi-objective optimization problem (taking into account accuracy, speed, and energy consumption), and realizes online adaptation of the control strategy through autonomous optimization through the algorithm, fundamentally solving the problem of fixed parameters and poor adaptability of traditional methods.

[0023] 2. The present invention is based on multimodal data fusion, edge intelligent optimization and cloud-edge collaborative architecture, and has achieved significant breakthroughs in control performance, resource efficiency, adaptability to working conditions, localization and other aspects. In terms of control performance, the steady-state error is controlled at ±0.2pH, the overshoot is <5%, the adjustment time is shortened by 30%, and the R² of the LSTM prediction model reaches 0.928; in terms of resource efficiency, the reagents are saved by 12.3%, energy consumption is reduced by 18%, and the frequency of manual inspections is reduced by 60%; under complex working conditions, the system quickly recovers and stabilizes when COD and flow rate suddenly change, and the PSO-GA algorithm reduces the control error by 70%. In addition, the emission rate that meets environmental standards has increased to 98%, data transmission is securely encrypted, and edge processing is efficient. Experimental and field data have confirmed that the invention achieves precise control, efficient and stable operation, and promotes the intelligent and green upgrade of the chemical wastewater treatment industry with high cost performance, and has multiple competitiveness in environmental protection, economy and technology.

[0024] 3. The present invention achieves sub-second response by adopting edge computing (RK3568 chip + TensorRT lightweight deployment), and uses multimodal data fusion, LSTM / Transformer prediction model, and PSO-GA hybrid optimization fuzzy PID to improve the control accuracy to ±0.2pH. The robustness of the algorithm is verified by digital twin simulation, and precise prediction and optimization control are used to reduce chemical consumption and cloud dependence. Domestic hardware and open source frameworks are used to provide a low-cost solution, aiming to achieve precise control of sewage collection data, high efficiency and energy saving, and intelligent self-adaptation, complete domestic substitution, and promote the transformation and upgrading of the chemical wastewater treatment industry towards green and intelligent development.

[0025] 4. This invention combines the robust global search capabilities of a general optimization algorithm (for offline optimization of the underlying rule base and membership functions) with the fast-converging PSO algorithm (for online, real-time adjustment of key parameters) to perform hierarchical, dynamic optimization of fuzzy PID controllers. Compared to traditional PID tuning or single-intelligent algorithm optimization, this approach offers higher optimization efficiency and improved robustness, enabling the controller to quickly adapt to large variations in operating conditions and significantly improving control performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 This is a model optimization flow chart of a fuzzy PID control system using PSO-GA collaborative optimization according to embodiment 1 of the present invention; Figure 2 This is an analytical diagram of a water quality parameter prediction and control model of a fuzzy PID control system using PSO-GA collaborative optimization according to Example 1 of the present invention.

[0027] Figure 3 1 is a diagram of the fitness distribution (Kp, Ki and comprehensive control performance relationship) of the PSO-GA parameter optimization of Example 1 of the present invention. DETAILED DESCRIPTION

[0028] The following examples are used to illustrate the present invention but are not intended to limit the scope of the present invention.

[0029] As described in this invention, the Long Short-Term Memory Network (LSTM) is a special recurrent neural network (RNN) designed to address the vanishing and exploding gradient problems faced by traditional RNNs when processing long sequences of data. Its core structure comprises a memory unit consisting of an input gate, a forget gate, and an output gate. It selectively stores and updates long-term dependency information, effectively capturing long-term correlation features in time series.

[0030] The Transformer in this invention is a deep learning architecture based on the self-attention mechanism. It was originally used in the field of natural language processing. Due to its advantages in long sequence modeling and parallel computing, it quickly became the core framework for a variety of complex tasks. Its core idea is to dynamically calculate the association weights of each element in the sequence with other elements through the self-attention mechanism, thereby capturing global dependencies and breaking through the sequence dependency limitations of traditional recurrent neural networks (RNNs). The Transformer architecture mainly consists of an encoder and a decoder. The encoder is responsible for mapping the input sequence into context-aware feature vectors, and the decoder generates the target sequence based on these vectors. This architecture not only significantly improves the efficiency and accuracy of long text processing, but also solves the problem of representing sequence order information through the positional encoding mechanism, and supports parallel training to accelerate convergence.

[0031] The PSO-GA algorithm in this paper is a hybrid optimization strategy that combines the Particle Swarm Optimization (PSO) algorithm with the Genetic Algorithm (GA). It aims to combine the strengths of both algorithms to improve global search capabilities and convergence accuracy. Its core features and mechanisms are as follows: PSO Characteristics: It converges quickly by tracking individual and swarm historical optimal solutions, but is prone to falling into local optima.

[0032] GA Features: Utilizes selection, crossover, and mutation operations to maintain population diversity and enhance global search capabilities, but convergence is slow. Hybrid Strategy: Embeds GA crossover and mutation operations within the PSO framework, or introduces GA operations after PSO iterations to break local optimal deadlocks. Serial Hybrid: First executes PSO to generate a high-quality initial population, then uses GA optimization (such as crossover and mutation) to improve solution quality. Parallel Hybrid: Splits the population into two groups, one group undergoing PSO updates and the other undergoing GA operations, and finally merges and evolves.

[0033] Example 1 The technical solution adopted by the present invention is as follows: like Figure 1 and Figure 2 As shown, the present invention discloses a fuzzy PID control system with PSO-GA collaborative optimization, comprising: a real-time data acquisition and fusion module, a data processing terminal, a hybrid optimization control module and a dosing execution module; the real-time data acquisition and fusion module is used for real-time data acquisition, data processing and data fusion; the collected data includes pH value, COD, turbidity, temperature and flow of wastewater; The data processing terminal is used to receive the signal output by the real-time data acquisition and fusion module, and use the LSTM / Transformer deep learning prediction model to predict the collected data; the hybrid optimization control module is used to receive the data processed by the data processing terminal, and the hybrid optimization control module is used to calculate the deviation e and the deviation change rate de from the target collected data, convert them into fuzzy language variables through the membership function, perform fuzzy reasoning, and use the center of gravity method to defuzzify, obtain actual control parameters, and calculate the corresponding dosage; after the dosing execution module receives the control signal from the hybrid optimization control module, it adjusts the flow of the dosing pump according to the control signal value and adds acid or alkali agents to the wastewater.

[0034] In this embodiment, data collection specifically involves each sensor in the sensor cluster collecting multimodal data such as wastewater pH, COD, turbidity, temperature, and flow rate in real time at a preset sampling frequency (typically 1-10 times per second). These sensors are connected to a data fusion center via wired or wireless connections, converting the collected analog signals into digital signals for transmission to the data fusion center.

[0035] In this embodiment, data preprocessing specifically involves the data fusion center performing preliminary processing on the received multimodal data, including data cleaning, normalization, and filtering. Data cleaning removes outliers and noise from sensor data; normalization converts data of varying dimensions to a uniform numerical range (typically [0, 1] or [-1, 1]) for subsequent data fusion and analysis; and filtering employs algorithms such as sliding average filtering or Kalman filtering to further smooth the data curve and improve data quality and stability.

[0036] In this embodiment, data fusion specifically involves fusing preprocessed multimodal data using a data fusion algorithm based on a Kalman filter or neural network. The goal of data fusion is to integrate multimodal data from different sensors with complementary information to generate a fused data vector that comprehensively and accurately reflects the characteristics of wastewater quality. The fused data not only includes the current pH value of the wastewater but also incorporates the effects of parameters such as COD, turbidity, temperature, and flow rate on pH, providing a richer information foundation for subsequent prediction and control.

[0037] The hybrid optimization control module also adjusts the control strategy in real time according to the deviation between the actual collected data and the target collected data to achieve closed-loop control.

[0038] Preliminary setting of hybrid optimization control module parameters Setting based on expert experience: Organize experts in environmental engineering and automatic control to take into account the characteristics of wastewater treatment systems, such as the fluctuation range of influent flow, acid-base neutralization reaction characteristics, etc., and combine the commissioning experience of similar sewage treatment plants. If the wastewater quality fluctuates greatly, the experts will set the proportional coefficient K. p The initial value is a small value (such as 0.3) to avoid excessive adjustment and pH overshoot; the integral coefficient K i Set to 0.05 to slowly eliminate the steady-state error; differential coefficient K d Set to 0.2 to suppress pH fluctuations caused by sudden changes in water quality. Historical data analysis and optimization: Collect wastewater pH adjustment process data in the past six months, including influent pH values, dosage, adjusted pH values, and corresponding PID parameters at different time periods. Use median filtering to process abnormal data, and use normalization to unify the data into the ([0,1]) interval. Through correlation analysis, it is found that when K p When the pH value is too large, the overshoot is positively correlated with Kp. p Make fine adjustments. The hybrid optimization control module performs preliminary parameter setting, establishes membership function and fuzzy rule base, initializes PSO and GA algorithm parameters, optimizes GA globally, and optimizes PSO online.

[0039] In this embodiment, the operation of establishing the membership function is as follows: the input variables are the collected data deviation e (domain [-5, 5]) and the deviation change rate de (domain [-2, 2]), and the output variable is ΔK p (domain [-0.5, 0.5]), ΔK i (domain [-0.1, 0.1]), ΔK d ; Use triangle membership function for e and de and divide them into {N B ,N M ,N S ,Z O ,P S ,P M ,P B}Seven fuzzy subsets; for ΔK p , ΔK i , ΔK d Gaussian membership function is used, and the mean and variance parameters of each function are determined through statistical analysis of historical data.

[0040] The global optimization GA operation includes initial population generation, fitness value calculation and evolution operation.

[0041] An initial population must be constructed. This population consists of a certain number of individuals, each representing a set of parameter codes for the fuzzy PID control module. Taking binary encoding as an example, the proportional, integral, and differential coefficients of the fuzzy PID control module must be converted into binary numbers according to specific accuracy requirements. These binary numbers are then strung together to form a complete individual code. For example, if the proportional coefficient ranges from 0 to 10 and the accuracy requirement is 0.01, 1000 different values ​​are required, represented by at least 10 bits of binary. A similar process is performed for the integral and differential coefficients, and finally, the binary codes of the three are combined to form an individual. The size of the initial population is generally determined by the complexity of the problem and computing resources, with a typical size ranging from 20 to 100 individuals.

[0042] In this embodiment, the initial population is generated using real number coding. Each individual is composed of 9 real numbers, corresponding to K p , K i , K d As well as their fuzzy parameters (key parameters of membership function). 50 individuals are randomly generated to form the initial population to ensure that the parameters are within a reasonable range. In this embodiment, if Figure 3 As shown, by calculating the fitness value of each individual, the quality of the parameter combination represented by each individual is judged. The design of the fitness function is crucial, as it directly determines the search direction and effectiveness of the GA algorithm. Here, the fitness function is constructed based on the control error of the wastewater pH value and the system stability index. Control error is generally measured by calculating the error between the measured and expected pH values, while system stability can be reflected by indicators such as overshoot and adjustment time. Excessive overshoot indicates poor system stability, and a higher penalty should be imposed in the fitness function. The fitness function is designed by comprehensively considering the control error and stability index, and the fitness value of each individual is calculated. The larger the value, the better the parameter combination corresponding to that individual performs in controlling the wastewater pH value and ensuring system stability. The function for calculating the fitness value is: Fitness=1 / w1×MAE+w2×σ2+w3×OverShoot, Among them, MAE is the mean absolute error, which measures the control accuracy of the collected data; σ2 is the fluctuation variance of the collected data, which reflects the stability of the system; OverShoot is the overshoot; w1, w2, and w3 are weight coefficients (set to 0.5, 0.3, and 0.2 respectively); and the fitness value of each individual is calculated through simulation operation.

[0043] In this embodiment, the evolution operation includes: Common selection methods include roulette wheel selection and tournament selection. In this embodiment, based on the roulette wheel selection method, the probability of selection is determined based on the proportion of individual fitness, and individuals with high fitness are selected to enter the next generation. Specifically, the roulette wheel selection method first calculates the proportion of each individual's fitness in the total fitness, and then maps these proportions to the sectors on the roulette wheel. Each individual has a dedicated sector. Then, a number between 0 and 1 is randomly generated. Depending on which sector this number falls, the corresponding individual is selected to enter the next generation population. This process is repeated until the number of individuals in the new population reaches a predetermined size.

[0044] Crossover: Selected individuals are subjected to a single-point crossover method with a crossover probability of 0.85, exchanging some gene fragments to generate new individuals. Crossover is a crucial step in generating new individuals and increasing population diversity. Crossover can be performed in three different ways: single-point, multi-point, and uniform. For example, single-point crossover involves randomly selecting two parents. A crossover point is then randomly determined, and the encodings of the two parents before and after the crossover point are swapped, creating two offspring individuals. Through the crossover, the offspring inherit some of the superior "genes" of their parents while also forming new parameter combinations, which helps find more optimal solutions. The crossover probability is typically set between 0.6 and 0.9. A high probability increases population diversity, but too high a probability can damage the genes of superior individuals.

[0045] Mutation: Mutation is designed to prevent algorithms from falling into local optima by randomly altering individual genes, introducing new "genetic material." In binary coding, mutation involves changing a 0 to a 1, or vice versa. For each gene bit in each individual, a small probability is used to determine whether a mutation will occur. Although the probability is small, it can help the algorithm escape local optima and enhance its global search capabilities. Randomly mutate individual genes with a mutation probability of 0.015, for example, by adding a random number in the range [-0.1, 0.1] to the Kp parameter gene. Repeat the selection, crossover, and mutation operations. After 50 generations of evolution, select the individual parameters with the highest fitness as the initial optimization parameters for the fuzzy PID control module. Iterative optimization: The process of selection, crossover, and mutation is continuously repeated to achieve generation after generation of evolution. Each generation of evolution produces a new population, with individuals representing different combinations of fuzzy PID control module parameters. As the number of evolutionary generations increases, the population gradually approaches the global optimal solution. The evolutionary process ends when the preset termination conditions are met, such as reaching the maximum number of evolutionary generations or the fitness value has not significantly improved for many consecutive generations. At this point, the parameter combination represented by the individual with the highest fitness value in the population is the globally optimal fuzzy PID control module parameter found by the GA algorithm. These parameters will serve as the initial parameters of the fuzzy PID control module in the subsequent control process, helping to achieve more accurate and stable wastewater pH control.

[0046] The operation of online optimization PSO includes particle initialization and parameter update. The formula for parameter update is: ; Particle position update formula: x ij (t+1)=x ij (t)+v ij (t+1); Among them, v ij is the particle velocity, x ij is the particle position, ω is the inertia weight, c1 and c2 are learning factors, r 1ij 、r 2ij is a random number in the interval [0,1], p ij is the optimal position of the individual particle, g j is the global optimal position.

[0047] Fitness evaluation and iteration: Real-time collection of wastewater pH data, calculation of the fitness value of the current particle under the corresponding parameters (similar to the fitness function in GA optimization), continuous update of the individual optimal and global optimal positions of the particles, iterative update of parameters every 10 seconds, and dynamic optimization of the fuzzy PID control module parameters. In this example, the PSO algorithm parameters are: the particle swarm size is set to 60, balancing search efficiency and diversity; the number of iterations is set to 300; the inertia weight is linearly reduced from 0.9 to 0.4; the learning factors c1 and c2 are both set to 1.8 to balance individual and group learning capabilities. The GA algorithm parameters are: the population size is set to 50; the selection probability is determined based on the roulette wheel method, after normalizing the fitness value; the crossover probability is set to 0.85, and the mutation probability is set to 0.015 to ensure population diversity and evolutionary efficiency.

[0048] In this embodiment, the LSTM and Transformer models are deployed and updated: The trained LSTM and Transformer models are deployed on the edge computing node (RK3568). During system operation, the edge computing node receives fused data from the data fusion center in real time and inputs it into the prediction model.

[0049] (1) Data collection and preprocessing Data Collection: Sensors distributed throughout the wastewater treatment system collect real-time wastewater pH data. They also collect historical pH data at different times, along with relevant influencing factors such as wastewater flow, temperature, dissolved oxygen, and chemical dosage. This data serves as input features for the prediction model.

[0050] Data cleaning: Check whether there are missing values, outliers, etc. in the data. Missing values ​​can be supplemented by methods such as mean filling and linear interpolation. For outliers, decide whether to correct or delete them directly based on the degree of deviation and actual situation.

[0051] Data normalization: Scale data of different features to the same range, for example, normalize all data to the interval ([0,1]). This can prevent certain features from having too much impact on model training due to their large values, thereby improving the convergence speed and accuracy of the model.

[0052] (2) Model selection and construction Select an appropriate model: Based on the characteristics of wastewater pH changes and the nature of the data, choose an appropriate prediction model, such as a recurrent neural network (RNN) and its variant, the long short-term memory (LSTM) network, the gated recurrent unit (GRU), or a tree-based ensemble model such as a random forest. For example, the LSTM can effectively process time series data and capture the long-term dependencies of wastewater pH changes over time.

[0053] Build the model structure: Determine the model's hyperparameters, such as the number of layers and neurons. For example, a simple LSTM model might consist of two LSTM layers, each with 64 neurons, followed by a fully connected layer to output the predicted pH value.

[0054] The fuzzy PID control system collaboratively optimized by PSO-GA also includes a data storage module, an edge device and a cloud platform. The data storage module stores various types of data during the operation of the system in real time. The data storage module, data processing terminal and dosing execution module are installed on the edge device.

[0055] The hybrid optimization control module is installed on the cloud platform. The edge device regularly uploads locally stored data to the cloud platform. The cloud platform backs up and manages the received data. The cloud training platform uses the new data to perform offline training and optimization on the prediction model and the parameters of the hybrid optimization control module, and sends the updated model parameters and optimization strategy to the edge device.

[0056] In this embodiment, the data storage module stores various data during system operation in real time, including raw sensor data, fused data, output from the prediction model, control instructions from the hybrid optimization controller, and feedback from the dosing actuator. This data is stored in a local storage device as files or databases for a period of at least 30 days to meet system requirements for fault diagnosis, performance evaluation, and model optimization.

[0057] The edge device uses an edge computing node. The edge computing node RK3568 receives fused data from the data fusion center through the network communication module, and uses protocol parsing algorithms (such as TCP / IP protocol parsing, MQTT protocol parsing, etc.) to parse the data, extract multimodal data information such as pH value, COD, turbidity, temperature and flow, and store it in a designated buffer in the memory.

[0058] In this embodiment, cloud data synchronization is achieved by periodically uploading locally stored data from edge computing nodes to the cloud training platform, which then backs up and manages the received data. Simultaneously, the cloud training platform uses the new data to perform offline training and optimization of the LSTM and Transformer prediction models, as well as the parameters of the hybrid optimization controller. The updated model parameters and optimization strategies are then distributed to the edge computing nodes, enabling continuous system improvement and upgrades.

[0059] In this embodiment, remote monitoring and management utilizes a remote monitoring terminal to access a cloud-based training platform, view the system's real-time operating status, historical data, device status, and other information, and remotely operate and configure system parameters. The remote monitoring terminal provides an intuitive graphical interface, enabling operators to monitor and manage the wastewater pH control process in real time, achieving intelligent operation and maintenance.

[0060] The edge computing node RK3568 communicates with the cloud training platform via 4G / 5G or a wired network, using lightweight IoT protocols such as MQTT for data exchange. The edge computing node encapsulates real-time multimodal data, prediction model outputs, and control instructions from the hybrid optimization controller into MQTT messages and publishes them to a designated MQTT topic. The cloud training platform subscribes to this topic, receives messages from the edge computing node, and parses and stores the received data. Simultaneously, the cloud training platform sends information such as model update parameters and optimization strategies to the edge computing node in the form of MQTT messages. The edge computing node subscribes to the corresponding topic, receives and parses these messages, and completes the model and controller updates.

[0061] Example 2 A method for using a fuzzy PID control system using PSO-GA collaborative optimization includes the following steps: 1) Each sensor in the sensor group collects wastewater pH, COD, turbidity, temperature and flow in real time according to the preset sampling frequency; 2) The data fusion center performs preliminary processing on the received multimodal data, including data cleaning, normalization, and filtering operations; 3) Use data fusion algorithms based on Kalman filtering or neural networks to fuse the pre-processed multimodal data; 4) Convert the proportional coefficient, integral coefficient, and differential coefficient of the hybrid optimization control module into binary numbers according to specific accuracy requirements, and then string these binary numbers together to form a complete individual code; 5) Constructing a fitness function based on the control error and system stability index of wastewater collection data; 6) Perform selection operations based on the fitness values ​​of individuals, giving individuals with high fitness a better chance of entering the next generation, thus implementing the evolutionary rule of "survival of the fittest"; perform crossover and mutation operations on the selected individuals; and continuously repeat the selection, crossover, and mutation process to achieve evolution from generation to generation. 7) Check whether there are missing values ​​or outliers in the data. For missing values, use methods such as mean filling and linear interpolation to supplement them. For outliers, decide whether to correct or delete them directly based on their degree of deviation and actual situation; 8) Scale data of different features to the same range; 9) Select an appropriate prediction model based on the characteristics of wastewater collection data changes and the nature of the data, and determine the model's hyperparameters such as the number of layers and the number of neurons; 10) The collected historical data is divided into training, validation, and test sets. The number of training rounds, learning rate, and batch size parameters are determined. The training set data is input into the model. The model parameters are adjusted through the backpropagation algorithm to minimize the error between the model's prediction results and the actual collected data.

[0062] The specific fuzzy PID control method includes: collecting wastewater data in real time, calculating the deviation e and the deviation change rate de from the target data, converting them into fuzzy language variables through membership function, using Mamdani reasoning method to perform fuzzy reasoning according to the fuzzy rule base, and using the center of gravity method to defuzzify, where ΔK p , the calculation formula is: ΔK p =∑ i 1nμ i / ∑ i 1nμ i x i ; where μ i is the fuzzy set membership, x i is the central value of the corresponding fuzzy set; The defuzzified ΔK p , ΔK i , ΔK d With the current K p , K i , K d Add them together to get the actual control parameters, calculate the corresponding dosage, and control the action of the dosing actuator.

[0063] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0064] This application is a process of referring to the method, device (system), and computer program product of the embodiments of the present application The flowcharts and / or block diagrams are described in detail. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as the combination of the processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0065] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0066] These computer program instructions can also be loaded into a computer or other programmable data processing device so that A sequence of operational steps performed by a computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide the instructions for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0067] The above description is only a preferred embodiment of the present invention and does not limit the scope of patent protection of the present invention. Any equivalent structural transformation made by using the contents of the description and drawings of the present invention, directly or indirectly applied to other related technical fields, is also included in the scope of protection of the present invention.

Claims

1. A fuzzy PID control system based on PSO-GA collaborative optimization, characterized in that: include: A real-time data acquisition and fusion module; The real-time data acquisition and fusion module is used for real-time data acquisition, data processing and data fusion; the collected data include pH value, COD, turbidity, temperature and flow of wastewater; A data processing terminal; the data processing terminal is used to receive the signal output by the real-time data acquisition and fusion module, and use the LSTM / Transformer deep learning prediction model to predict the collected data; A hybrid optimization control module; the hybrid optimization control module is used to receive data processed by the data processing terminal, and the hybrid optimization control module is used to calculate the deviation e and the deviation change rate de from the target collected data, convert them into fuzzy language variables through the membership function, perform fuzzy reasoning, and use the center of gravity method to defuzzify them to obtain actual control parameters and calculate the corresponding dosage; A dosing execution module; after receiving the control signal from the mixing optimization control module, the dosing execution module adjusts the flow rate of the dosing pump according to the control signal value to add acid or alkali agents to the wastewater.

2. A fuzzy PID control system with PSO-GA collaborative optimization according to claim 1, characterized in that: The hybrid optimization control module also adjusts the control strategy in real time according to the deviation between the actual collected data and the target collected data to achieve closed-loop control.

3. A fuzzy PID control system with PSO-GA collaborative optimization according to claim 1 or 2, characterized in that: The hybrid optimization control module performs preliminary parameter setting, establishes membership function and fuzzy rule base, initializes PSO and GA algorithm parameters, optimizes GA globally, and optimizes PSO online.

4. A fuzzy PID control system with PSO-GA collaborative optimization as claimed in claim 3, characterized in that: The operation of establishing the membership function is as follows: the input variables are the collected data deviation e and the deviation change rate de, and the output variable is ΔK p , ΔK i , ΔK d ; Use triangle membership function for e and de and divide them into {N B ,N M ,N S ,Z O ,P S ,P M ,P B }Seven fuzzy subsets; for ΔK p , ΔK i , ΔK d Gaussian membership function is used, and the mean and variance parameters of each function are determined through statistical analysis of historical data.

5. A fuzzy PID control system with PSO-GA collaborative optimization as claimed in claim 3, characterized in that: The global optimization GA operation includes initial population generation and fitness value calculation. The function of fitness value calculation is: Fitness=1 / w1×MAE+w2×σ2+w3×OverShoot, Among them, MAE is the mean absolute error, which measures the control accuracy of the collected data; σ2 is the fluctuation variance of the collected data value, which reflects the stability of the system; OverShoot is the overshoot; w1, w2, and w3 are weight coefficients; and the fitness value of each individual is calculated through simulation operation.

6. A fuzzy PID control system with PSO-GA collaborative optimization as claimed in claim 3, characterized in that: The operation of online optimization PSO includes particle initialization and parameter update. The formula for parameter update is: ; Particle position update formula: x ij (t+1)=x ij (t)+v ij (t+1); Among them, v ij is the particle velocity, x ij is the particle position, ω is the inertia weight, c1 and c2 are learning factors, r 1ij 、r 2ij is a random number in the interval [0,1], p ij is the optimal position of the individual particle, g j is the global optimal position.

7. A fuzzy PID control system with PSO-GA collaborative optimization according to claim 1 or 2, characterized in that: It also includes a data storage module, an edge device and a cloud platform. The data storage module stores various types of data during the operation of the system in real time. The data storage module, data processing terminal and dosing execution module are installed on the edge device.

8. A fuzzy PID control system with PSO-GA collaborative optimization according to claim 7, characterized in that: The hybrid optimization control module is installed on the cloud platform. The edge device regularly uploads locally stored data to the cloud platform. The cloud platform backs up and manages the received data. The cloud training platform uses the new data to perform offline training and optimization on the prediction model and the parameters of the hybrid optimization control module, and sends the updated model parameters and optimization strategy to the edge device.

9. A method for using a PSO-GA collaboratively optimized fuzzy PID control system, applied to the SO-GA collaboratively optimized fuzzy PID control system according to claims 1 to 8, characterized in that: The following steps are involved: 1) Each sensor in the sensor group collects wastewater pH, COD, turbidity, temperature and flow in real time according to the preset sampling frequency; 2) The data fusion center performs preliminary processing on the received multimodal data, including data cleaning, normalization, and filtering operations; 3) Use data fusion algorithms based on Kalman filtering or neural networks to fuse the pre-processed multimodal data; 4) Convert the proportional coefficient, integral coefficient, and differential coefficient of the hybrid optimization control module into binary numbers according to specific accuracy requirements, and then string these binary numbers together to form a complete individual code; 5) Constructing a fitness function based on the control error and system stability index of wastewater collection data; 6) Perform selection operations based on individual fitness values, giving individuals with high fitness a better chance of entering the next generation, thus implementing the evolutionary principle of "survival of the fittest." Perform crossover and mutation operations on selected individuals. Repeat the selection, crossover, and mutation process continuously to achieve generational evolution. 7) Check whether there are missing values ​​or outliers in the data. For missing values, use methods such as mean filling and linear interpolation to supplement them. For outliers, decide whether to correct or delete them directly based on their degree of deviation and actual situation; 8) Scale data of different features to the same range; 9) Select an appropriate prediction model based on the characteristics of wastewater collection data changes and the nature of the data, and determine the model's hyperparameters such as the number of layers and the number of neurons; 10) The collected historical data is divided into training, validation, and test sets. The number of training rounds, learning rate, and batch size parameters are determined. The training set data is input into the model. The model parameters are adjusted through the backpropagation algorithm to minimize the error between the model's prediction results and the actual collected data.

10. The method for using a fuzzy PID control system of PSO-GA collaborative optimization according to claim 9, characterized in that: It also includes a fuzzy PID control method, specifically including: real-time collection of wastewater data, calculation of the deviation e and the deviation change rate de from the target data, conversion of the data into fuzzy language variables through the membership function, fuzzy reasoning using the Mamdani reasoning method based on the fuzzy rule base, and defuzzification using the center of gravity method, where ΔK p , the calculation formula is: ΔK p =∑ i 1nμ i / ∑ i 1nμ i x i ; where μ i is the fuzzy set membership, x i is the central value of the corresponding fuzzy set; The defuzzified ΔK p , ΔK i , ΔK d With the current K p , K i , K d Add them together to get the actual control parameters, calculate the corresponding dosage, and control the action of the dosing actuator.

Citation Information

Cited By

  • Kitchen waste sewage accurate aeration control method, system and equipment based on fuzzy PID and deep learning, and medium

    CN121115464A