A black and grey water moisture control method and system based on feature recognition and feedforward compensation

CN122789458APending Publication Date: 2026-09-22TIANJIN WOCHUAN WATER TREATMENT ENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610883871.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-18
Publication Date
2026-09-22

AI Technical Summary

Technical Problem

[0005]为了克服上述缺陷,提出了本发明,以提供解决或至少部分地解决现有技术固定阈值分类无法适应进水水质的实时波动,导致黑灰水辨识精度低;分流路径未结合处理区动态余量进行规划,易造成某一处理区过载;工艺调配与排泥控制均未引入时滞补偿与闭环寻优机制,当管网传输存在时延时,工艺参数调整滞后于实际负荷变化,排泥时机也无法匹配污泥的实际留存状态,最终导致处理效率下降与运行能耗偏高的技术问题

Benefits of technology

在实施本发明的技术方案中,实现源水识别至排泥的全流程闭环,通过实时负荷预测与时滞补偿动态匹配处理余量,精准调控生化工艺与排泥,确保处理过程处于稳态安全边界。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122789458A_ABST
    Figure CN122789458A_ABST
Patent Text Reader

Abstract

This application discloses a method and system for controlling black and gray water based on feature identification and feedforward compensation, belonging to the field of wastewater treatment technology. The method includes: generating logical tags for black and gray water in real time through multi-dimensional feature perception and classification mapping of source water; intelligent diversion path planning combined with dynamic capacity of the treatment area; and achieving time-delay alignment and precise feedforward control using flow prediction and pipeline delay compensation. Within the safety boundary, closed-loop adaptive optimization of process parameters is performed to generate dynamic process allocation instructions. Finally, based on time-varying reaction condition data, dynamic control of sludge retention period and optimization of sludge discharge sequence are achieved. This scheme realizes a closed-loop process from source water identification to sludge discharge, dynamically matching treatment capacity through real-time load prediction and time-delay compensation, precisely controlling the biological process and sludge discharge, and ensuring that the treatment process is within a steady-state safety boundary.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of wastewater treatment technology, specifically relating to a method and system for controlling black and gray water content based on feature identification and feedforward compensation. Background Technology

[0002] With the acceleration of urbanization, the problem of mixed collection of black and grey water has become increasingly prominent. These two types of wastewater differ significantly in organic matter concentration, nitrogen and phosphorus content, and treatment process requirements. Indiscriminate mixing and treatment not only wastes energy but also leads to substandard effluent due to load fluctuations. Therefore, achieving real-time identification and separation of black and grey water at the influent end, and accordingly coordinating the process operation and sludge discharge strategies of each treatment zone, has become a key requirement for improving the efficiency of wastewater treatment systems.

[0003] In existing technologies, a fixed threshold method is typically used to perform simple classification of influent water quality, and wastewater is diverted to the corresponding treatment zone according to preset diversion rules. Based on this, each treatment zone operates according to fixed process parameters, and sludge discharge is performed according to fixed cycles or empirical values. Throughout the entire process, water quality classification, diversion control, process adjustment, and sludge release are relatively independent, with data only being transferred briefly between steps.

[0004] However, fixed threshold classification cannot adapt to real-time fluctuations in influent water quality, resulting in low accuracy in identifying black and grey water; the diversion path is not planned in conjunction with the dynamic margin of the treatment area, which can easily cause overload in a certain treatment area; neither process allocation nor sludge discharge control has introduced time delay compensation and closed-loop optimization mechanisms. When there is a time delay in pipeline transmission, the adjustment of process parameters lags behind the actual load changes, and the timing of sludge discharge cannot match the actual retention state of sludge, ultimately leading to a decrease in treatment efficiency and high operating energy consumption. Summary of the Invention

[0005] To overcome the aforementioned shortcomings, this invention is proposed to provide solutions, or at least partially solutions, to the technical problems of existing technologies where fixed threshold classification cannot adapt to real-time fluctuations in influent water quality, resulting in low accuracy in identifying black and grey water; the lack of planning of diversion paths in conjunction with the dynamic margin of the treatment area, which easily leads to overload of a certain treatment area; and the absence of time delay compensation and closed-loop optimization mechanisms in process allocation and sludge discharge control, resulting in process parameter adjustments lagging behind actual load changes when there is a time delay in pipeline transmission, and the inability to match the actual retention state of sludge, ultimately leading to decreased treatment efficiency and high operating energy consumption.

[0006] In a first aspect, the present invention provides a black and gray water control method based on feature recognition and feedforward compensation, the method comprising: Continuously acquire the source water index dataset of the source water inlet pipeline, perform unified timestamp alignment and multi-dimensional feature extraction based on the source water index dataset, and obtain source water time-varying feature vector data containing black and gray water quality characteristic indicators; Real-time feature identification and classification mapping are performed based on the time-varying feature vector data of source water to obtain dynamic logical label data that distinguishes black water from grey water. The dynamic margin data of each processing zone is acquired, and dynamic diversion path planning is performed based on the dynamic logical tag data and the dynamic margin data of each processing zone to obtain real-time diversion control data for directing the diversion action; the processing zones include black water treatment zone and grey water treatment zone. Based on real-time diversion control data, the flow path is switched so that black water and grey water flow into their respective treatment areas. The flow rate of each diversion direction is dynamically predicted to obtain real-time flow load data of each treatment area. The reaction status data and pipeline transmission delay data of each processing zone are updated in real time due to liquid inflow. Based on the pipeline transmission delay data, the real-time flow direction load data entering each processing zone is time-domain shifted and aligned, and time delay compensation feedforward calculation is performed with the real-time updated reaction status data to obtain the dynamic process allocation instructions corresponding to each processing zone. Based on the dynamic process allocation command, the process operating parameters are adjusted in a closed loop adaptive optimization within the safety boundary of the dynamic reaction state of each corresponding processing zone to obtain the time-varying reaction condition data of each processing zone. Based on the time-varying reaction condition data of each treatment zone, dynamic control of sludge retention period and optimization of sludge discharge sequence are carried out to obtain dynamic sludge discharge control data of each treatment zone. Based on the dynamic sludge discharge control data, the actuators of each treatment zone are controlled to release sludge.

[0007] In a second aspect, the present invention provides a black and gray water control system based on feature recognition and feedforward compensation, the system comprising: The source water feature perception module is used to continuously acquire the source water index dataset of the source water inlet pipeline, and perform unified timestamp alignment and multi-dimensional feature extraction based on the source water index dataset to obtain source water time-varying feature vector data containing black and gray water quality feature indicators. The fluid property identification module is used to perform real-time feature identification and classification mapping based on the time-varying feature vector data of source water to obtain dynamic logical label data that distinguishes black water from grey water. The diversion path decision module is used to acquire dynamic margin data of each processing zone, and to perform dynamic diversion path planning based on dynamic logical tag data and dynamic margin data of each processing zone to obtain real-time diversion control data for directing diversion actions; wherein, the processing zones include black water treatment zone and grey water treatment zone. The flow dynamic prediction module is used to switch the flow path based on real-time diversion control data, so that black water and grey water flow into their respective corresponding treatment areas, and to perform dynamic flow prediction for each diversion direction to obtain real-time flow load data for each treatment area. The time delay compensation module is used to acquire the reaction status data and pipeline transmission delay data of each treatment zone updated in real time due to liquid inflow. Based on the pipeline transmission delay data, the real-time flow direction load data entering each treatment zone is time-domain shifted and aligned, and time delay compensation feedforward calculation is performed with the real-time updated reaction status data to obtain the dynamic process allocation instructions corresponding to each treatment zone. The process optimization control module is used to perform closed-loop adaptive optimization and control of process operating parameters within the dynamic reaction state safety boundary of each corresponding processing zone based on dynamic process allocation instructions, so as to obtain time-varying reaction condition data of each processing zone. The sludge discharge timing optimization module is used to dynamically regulate the sludge retention cycle and optimize the sludge discharge timing based on the time-varying reaction condition data of each treatment zone, thereby obtaining dynamic sludge discharge control data for each treatment zone. Based on the dynamic sludge discharge control data, the actuators of each treatment zone are regulated to release sludge.

[0008] In a third aspect, an electronic device is provided, comprising a processor, a memory, and a program or instructions stored in the memory and executable on the processor, the program or instructions being loaded and run by the processor to perform the steps of the aforementioned black and gray water control method based on feature recognition and feedforward compensation.

[0009] In a fourth aspect, a computer-readable storage medium is provided, wherein a plurality of program codes are stored therein, the program codes being adapted to be loaded and run by a processor to perform the steps of the aforementioned black and gray water control method based on feature identification and feedforward compensation.

[0010] The above-described technical solutions of the present invention have at least one or more of the following beneficial effects: In implementing the technical solution of this invention, a closed-loop process from source water identification to sludge discharge is achieved. By dynamically matching the treatment capacity through real-time load prediction and time delay compensation, the biochemical process and sludge discharge are precisely controlled to ensure that the treatment process is within a steady-state safety boundary. Attached Figure Description

[0011] The disclosure of this invention will become more readily understood with reference to the accompanying drawings. It will be readily understood by those skilled in the art that these drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. Furthermore, similar numbers in the drawings are used to denote similar components, wherein: Figure 1 This is a schematic diagram of the first main steps of a black and gray water control method based on feature recognition and feedforward compensation according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the second main step of a black and gray water control method based on feature recognition and feedforward compensation according to an embodiment of the present invention. Figure 3 This is a schematic diagram of the main structure of a black and gray water control system based on feature recognition and feedforward compensation according to an embodiment of the present invention. Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0012] Some embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.

[0013] In the description of this invention, "module" and "processor" can include hardware, software, or a combination of both. A module can include hardware circuitry, various suitable sensors, communication ports, memory, and may also include software components, such as program code, or a combination of software and hardware. A processor can be a central processing unit, microprocessor, image processor, digital signal processor, or any other suitable processor. The processor has data and / or signal processing capabilities. The processor can be implemented in software, in hardware, or a combination of both. Non-transitory computer-readable storage media includes any suitable medium capable of storing program code, such as magnetic disks, hard disks, optical disks, flash memory, read-only memory, random access memory, etc. The term "A and / or B" means all possible combinations of A and B, such as only A, only B, or A and B. The terms "at least one A or B" or "at least one of A and B" have a similar meaning to "A and / or B" and can include only A, only B, or A and B. The singular terms "a" or "this" can also include plural forms.

[0014] See appendix Figure 1 , Figure 1 This is a schematic flowchart of the first main steps of a black and gray water control method based on feature recognition and feedforward compensation according to an embodiment of the present invention. Figure 1 As shown, a black and gray water control method based on feature recognition and feedforward compensation in an embodiment of the present invention mainly includes the following steps S101-S107.

[0015] Step S101: Continuously acquire the source water index dataset of the source water inlet pipeline, perform unified timestamp alignment and multi-dimensional feature extraction based on the source water index dataset, and obtain source water time-varying feature vector data containing black and gray water quality characteristic indicators.

[0016] The raw water inlet pipe refers to the physical channel that collects and transports untreated raw water mixed with black and gray water to the diversion system. It is the starting point for the system to carry out diversion control and constitutes the physical front end for data acquisition.

[0017] The source water index dataset is a dynamic time-series data set that reflects the physical and chemical properties of source water, including pH value, turbidity, conductivity, chemical oxygen demand, ammonia nitrogen concentration, water temperature and flow velocity. It is a basic information source for characterizing water quality fluctuations and compositional features.

[0018] Source water time-varying feature vector data refers to a high-dimensional mathematical feature matrix that can characterize the dynamic evolution of black water and grey water quality components over time after time alignment and multi-dimensional feature reconstruction of source water index datasets.

[0019] First, various online monitoring instruments and transmitters are deployed at the collection points in the raw water inlet pipeline to continuously sample the raw water flow containing black and grey water at fixed time steps. Each online instrument utilizes physical or chemical sensing principles such as electrode sensing, photoelectric colorimetry, and ultrasonic time-of-flight methods to collect real-time data on the pipeline water flow's pH, turbidity, conductivity, chemical oxygen demand (COD), ammonia nitrogen concentration, water temperature, and flow velocity. The raw electrical signals collected by these sensors are converted into digital signals via analog-to-digital converters and transmitted in real-time to the edge controller's memory buffer using the industrial Ethernet protocol. Using a streaming data writing algorithm, various physical and chemical time-series data with collection time tags are extracted according to the parameter dimensions of the physical and chemical indicators, thus constructing a high-dimensional data stream arranged in chronological order, which yields the raw water indicator dataset.

[0020] After acquiring the source water index dataset, to overcome the data alignment challenges caused by internal sampling delays and asynchronous communication among different online monitoring instruments, the system performs multi-source data time alignment processing. The edge controller first extracts the global master clock stamp from the source water index dataset as the reference time axis. For long-period sampling data such as chemical oxygen demand (COD) and ammonia nitrogen concentration, which suffer from timestamp misalignment and sparse data due to time-consuming chemical analysis or slow sensor response, cubic spline interpolation is performed using known measurements from adjacent time nodes to fit the continuous water quality change trajectory at the missing time points. Simultaneously, for short-period data such as pH, turbidity, conductivity, water temperature, and flow velocity, which are data-intensive and respond quickly, resampling mapping is performed using a linear interpolation algorithm based on the target timestamp, or downsampling alignment is performed using a moving average window. Through this fusion and alignment processing of heterogeneous sampling rate data, all water quality index data are normalized to a unified absolute timestamp, eliminating time deviations in physical transmission and sensing, resulting in unified timestamp aligned data.

[0021] After obtaining the unified timestamp aligned data, a sliding window technique was used to perform multidimensional feature extraction to accurately characterize the dynamic evolution of black and grey water quality components over time. The system extracts a fixed-length historical window from the absolute time axis of the unified timestamp aligned data. Within the window, for pH, turbidity, conductivity, chemical oxygen demand, ammonia nitrogen concentration, water temperature, and flow velocity, first-order and second-order statistical features representing the mean fluctuation and severity of disturbances in water quality concentrations were extracted using moving average and moving standard deviation algorithms, respectively. A feature selection method based on variance expansion factor was used to perform multicollinearity tests on the extracted first-order and second-order statistical features, eliminating highly redundant feature components and selecting and retaining independent core water quality characteristic indicators that retain their original physical dimensions, thus obtaining multidimensional feature extraction data.

[0022] After obtaining the multidimensional feature extraction data, in order to directly use it as input features for diversion decisions, the system performs feature matrix construction during the feature engineering phase. The system uses the multidimensional feature extraction data as column vectors and the corresponding absolute timestamp nodes in the unified timestamp aligned data as row indices, concatenating and merging the multidimensional matrices in the dynamic memory space of the edge controller. By horizontally stacking these dynamic features of different dimensions according to strict temporal logic and spatial dimensions, and performing data flattening operations, all water quality characteristic indicators that retain their original physical interpretability are ultimately structured and encapsulated into a standard data matrix to dynamically reflect the rheological trend and component mutation characteristics of the influent water quality over time, thereby obtaining the source water time-varying feature vector data.

[0023] Step S102: Based on the time-varying feature vector data of the source water, perform real-time feature identification and classification mapping to obtain dynamic logical label data that distinguishes between black water and grey water.

[0024] Dynamic logical label data is probabilistic state data used to logically distinguish and mark whether real-time water flow belongs to the category of black water or gray water. It is a criterion used in the system to characterize the boundary state of black and gray water in the current water inlet pipe and drive the switching of diversion paths.

[0025] At each sampling moment, the edge controller periodically extracts the latest generated time-varying feature vector data of the source water from memory and inputs it as a high-dimensional mathematical feature matrix into the Gaussian discriminant analysis algorithm. The Gaussian discriminant analysis algorithm uses the built-in Mahalanobis distance as the core metric for class conditional probability density, calculates the distance measure between this high-dimensional mathematical feature matrix and the preset prior mean vectors of black water and grey water, and calculates the normalized posterior probability of the water flow belonging to the black water and grey water categories at the current sampling moment online by eliminating the influence of the dimensions of each water quality parameter through covariance normalization calculation, thus obtaining real-time water quality probability distribution data.

[0026] Based on real-time water quality probability distribution data, the system performs category mapping. It extracts the probability value of black water classification from the real-time water quality probability distribution data and uses a dual-threshold hysteresis comparison algorithm to perform output latching control on this probability value. The sum of the high-order and low-order thresholds in the dual-threshold hysteresis comparison algorithm is strictly equal to one. When the probability value of black water classification exceeds the high-order threshold, the system performs category mapping, classifying the influent state at the current sampling time as black water; when the probability value of black water classification is lower than the low-order threshold, the system classifies it as grey water. If the probability value of black water classification is in the fuzzy region between the high and low thresholds, the classification at the previous sampling time remains unchanged to eliminate output jitter caused by water quality disturbances. The system encodes the black water or grey water state determined by output latching control into binary values ​​representing discrete category labels. These values ​​characterize the black and grey water boundary state in the current influent pipe and drive the switching of the diversion path, resulting in dynamic logical label data.

[0027] Based on the above technical solution, optionally, real-time feature identification and classification mapping can be performed based on the source water time-varying feature vector data to obtain dynamic logical label data that distinguishes black water from grey water, including: The source water time-varying feature vector data is decomposed into components to obtain composite water quality real-time feature indicators. Based on the composite water quality real-time feature indicators, the corresponding target interval components are matched and compared in the preset feature interval matrix to obtain the real-time decoupled quantization feature values ​​corresponding to the composite water quality feature indicators. Based on real-time decoupled quantized feature values, multi-feature collaborative logic judgment and weighted combination verification are performed to obtain the real-time feature identification results of the current source water. Based on the real-time feature identification results, the corresponding preset classification mapping rules are matched, and the normalized logical state mapping of the black and gray water logic decoupling matrix is ​​performed to obtain dynamic initial label data that distinguishes black water from gray water. Based on the dynamic initial label data, temporal step rejection and rolling smoothing filtering are performed to obtain dynamic logical label data that distinguishes black water from grey water.

[0028] In this scheme, the composite water quality real-time characteristic index refers to the set of multi-dimensional physicochemical monitoring parameters extracted from the source water time-varying characteristic vector data to characterize the organic load, acid-base balance, inorganic ion concentration and suspended solids content of wastewater.

[0029] The preset feature interval matrix refers to a multidimensional lookup table pre-established within the system. This table defines different water quality categories by pre-storing a series of key numerical boundaries. For example, a pH value in the range of 7.5 to 8.5 is classified as alkaline black water, and a pH value in the range of 6.5 to 7.5 is classified as neutral grey water.

[0030] The target interval component refers to the reference numerical unit corresponding to a specific level area locked after the source water quality characteristic index is searched and matched in the preset characteristic interval matrix.

[0031] Real-time decoupled quantitative eigenvalues ​​refer to normalized mathematical eigenvalues ​​obtained by decentralizing and standardizing the real-time eigenvalues ​​of composite water quality and the components of the target interval, eliminating the dimensional differences between different sensors and possessing a unified standard scale.

[0032] Real-time feature identification results refer to the probability distribution and category attribute assessment conclusions of water flow belonging to different black and gray water categories obtained after performing discriminant function calculation on real-time decoupled quantized feature values ​​using Gaussian discriminant analysis algorithm.

[0033] The preset classification mapping rule refers to a set of decision criteria based on logical conditions configured within the system. This rule specifies the logical state transition logic to be output when the probability feature meets specific conditions. For example, when the probability value of black water exceeds the high-order set threshold, the current attribute is forcibly mapped to black water; when the probability value is lower than the low-order set threshold, it is determined to be gray water; if the probability value is in the fuzzy area between the high and low set thresholds, the output latch logic is executed to maintain the previous state to eliminate jitter.

[0034] Dynamic initial label data refers to the instantaneous binary logic state value that maps the probability distribution in the real-time feature identification results to the current water flow attributes in the pipeline, based on preset classification mapping rules.

[0035] The system decomposes the time-varying feature vector data of source water to obtain real-time composite water quality feature indicators. Based on these real-time composite water quality feature indicators, it matches and compares the corresponding target interval components in a preset feature interval matrix to obtain the real-time decoupled quantized feature values ​​corresponding to the composite water quality feature indicators. At each sampling time, the edge controller periodically extracts the latest generated time-varying feature vector data of source water from memory. Using principal component analysis for dimensionality reduction, it decomposes the high-dimensional mathematical feature matrix representing the dynamic evolution of black water and grey water quality components over time, extracting multiple independent orthogonal basis components that respectively map wastewater organic load, acid-base balance, conductivity, and suspended solids content, thus obtaining the real-time composite water quality feature indicators. The system retrieves a pre-defined multidimensional numerical reference table in memory, defining the safety range and threshold division points of each water quality feature parameter for black water and grey water (i.e., the preset feature interval matrix), and calls the multidimensional lookup table interval mapping for interval positioning, matching the interval category to obtain the target interval component. Finally, the system uses a feature standardization algorithm to perform mean centering and standard deviation normalization operations on the real-time feature indicators of the composite water quality and the target interval components, transforming them into standard feature vectors that eliminate the differences in parameter dimensions, and obtaining the real-time decoupled quantitative feature values ​​corresponding to the composite water quality feature indicators.

[0036] Based on real-time decoupled quantized feature values, multi-feature collaborative logic judgment and weighted combination verification are performed to obtain the real-time feature identification result of the current source water. The edge controller periodically extracts the latest generated real-time decoupled quantized feature values ​​at each sampling time and inputs them as a feature space matrix into the Gaussian discriminant analysis algorithm. The Gaussian discriminant analysis algorithm uses the built-in Mahalanobis distance as the core metric for class conditional probability density, calculates the distance measure between the feature space matrix and the preset black water prior mean vector and grey water prior mean vector, and calculates the normalized posterior probability of the water flow belonging to the black water and grey water categories at the current sampling time online by eliminating the influence of the dimensions of each water quality parameter through covariance normalization calculation, thus obtaining real-time water quality probability distribution data. The system uses the real-time decoupled quantized feature values ​​to perform posterior probability threshold verification on the real-time water quality probability distribution data, completing the preliminary classification and discrimination of the current source water quality category attributes, and obtaining the real-time feature identification result of the current source water.

[0037] Based on the real-time feature identification results, a corresponding preset classification mapping rule is matched, and a normalized logical state mapping of the black and grey water logical decoupling matrix is ​​performed to obtain dynamic initial label data that distinguishes between black and grey water. The system retrieves the real-time feature identification results from memory and searches for predefined logical mapping standards that specify the correspondence between different identification conclusions and black and grey water categories, i.e., preset classification mapping rules. The system executes the preset classification mapping rules, extracts the real-time water quality probability distribution data from the real-time feature identification results, and inputs the black water attribution probability value in the real-time water quality probability distribution data as a state transition condition into the binary classification discrimination state machine. The binary classification discrimination state machine maps the dynamically continuously distributed black water attribution probability value to a time-series probability value through a probability threshold determination rule, thereby obtaining dynamic initial label data that distinguishes between black and grey water.

[0038] Based on dynamic initial label data, temporal step rejection and rolling smoothing filtering are performed to obtain dynamic logical label data that distinguishes black water from grey water. The system extracts this dynamic initial label data. To remove periodic process noise introduced by transient water flow fluctuations at each sampling time, the system first inputs the dynamic initial label data into a moving average filtering algorithm for rolling smoothing filtering, generating a smoothed black water attribution probability value. Subsequently, to eliminate non-steady-state high-frequency pulses and state switching jitter caused by sudden changes in water quality, the system performs category mapping based on real-time water quality probability distribution data. The system extracts the smoothed black water attribution probability value and uses a dual-threshold hysteresis comparison algorithm to perform output latching control on the black water attribution probability value to achieve hysteresis-resistant jitter latching. The sum of the high-order set threshold and the low-order set threshold of the dual-threshold hysteresis comparison algorithm is strictly equal to one. When the probability value of black water classification exceeds the high-order set threshold, the system performs category mapping, classifying the influent state at the current sampling time as black water; when the probability value of black water classification is lower than the low-order set threshold, the system classifies it as grey water; if the probability value of black water classification is in the fuzzy region between the high and low set thresholds, the classification at the previous sampling time remains unchanged to eliminate output jitter caused by water quality disturbances. The system encodes the black water or grey water state determined by output latch control into binary values ​​representing discrete category labels, which are used to characterize the black and grey water boundary state in the current influent pipe and drive the switching of the diversion path, obtaining dynamic logical label data.

[0039] In this solution, real-time quantization and multi-level filtering eliminate sensor dimension differences and water quality abrupt changes, enabling accurate identification of the black and gray water boundary and improving the stability of diversion path switching and the accuracy of automated control.

[0040] Step S103: Obtain dynamic margin data for each processing zone, perform dynamic diversion path planning based on dynamic logical tag data and dynamic margin data for each processing zone, and obtain real-time diversion control data for directing diversion actions; wherein, the processing zones include black water treatment zone and grey water treatment zone.

[0041] A treatment zone refers to an independent functional area within a system used for the physical purification, biodegradation, or storage of a specific type of wastewater.

[0042] Blackwater treatment zones are independent areas specifically designed for receiving, storing, and biochemically degrading wastewater containing high concentrations of organic matter and pathogens.

[0043] Greywater treatment area refers to a separate area specifically used for receiving, storing, and physically purifying domestic washing or bathing wastewater.

[0044] Dynamic margin data refers to the real-time monitoring value of the remaining sewage capacity or treatment load that each treatment zone can currently handle.

[0045] Real-time diversion control data refers to a set of digital instructions used to direct the diversion network to perform path switching actions, which includes the specific target processing area address and the corresponding switch status code.

[0046] The edge controller periodically reads analog electrical signals from level sensors and flow meters deployed within the black water and grey water treatment zones. It then performs analog-to-digital conversion on these signals to obtain real-time liquid level heights and inflow / outflow rates for each treatment zone. The system subtracts the current water volume (calculated from the real-time liquid level height) from the designed volume of each treatment zone to calculate the current remaining volume. Simultaneously, it smooths the inflow / outflow rates using a moving average filtering algorithm to calculate the current actual treatment load. This actual load is then subtracted from the preset maximum treatment load to obtain the remaining treatment capacity. Finally, the system combines and encapsulates the current remaining volume and remaining treatment capacity into a standard data structure, serving as a real-time monitoring value for the remaining uncapacitated wastewater capacity or treatment load in each treatment zone, thus obtaining dynamic margin data for each treatment zone.

[0047] Dynamic diversion path planning is performed based on dynamic logical tag data and dynamic reserve data of each processing zone. The system reads dynamic logical tag data representing the boundary state of black and grey water in the current inlet pipe and dynamic reserve data of each processing zone in parallel in memory. The current remaining volume and remaining processing capacity of the black water treatment zone and grey water treatment zone are used as boundary constraints for their respective independent channels and input into the logical rule engine. The logical rule engine parses the binary values ​​representing discrete category labels in the dynamic logical tag data. When the dynamic logic tag data indicates that the current water flow belongs to the black water category, the logic rule engine only retrieves the current remaining volume and remaining processing capacity of the black water treatment area for constraint checks. If the current remaining volume is greater than the preset safety threshold and the current remaining processing capacity is greater than the preset safety load, it is jointly determined that the entry condition is met, and the logic rule engine outputs a switching path instruction to the black water treatment area. If the current remaining volume is lower than the preset safety threshold or the current remaining processing capacity is lower than the preset safety load, it is determined that the black water treatment area is in a full-load state. At this time, the logic rule engine outputs a black water area overload alarm state, closes the path to the black water treatment area, and switches the water flow to an independent emergency regulating pool for temporary storage. At the same time, the source water inflow is limited by adjusting the opening of the main inlet valve.

[0048] When the dynamic logic tag data indicates that the current water flow belongs to the grey water category, the logic rule engine only retrieves the current remaining volume and remaining processing capacity of the grey water treatment area for constraint checks. If the current remaining volume is greater than the preset safety threshold and the current remaining processing capacity is greater than the preset safety load, it is jointly determined that the entry condition is met, and the logic rule engine outputs a switching path instruction to the grey water treatment area. If the current remaining volume is lower than the preset safety threshold or the current remaining processing capacity is lower than the preset safety load, it is determined that the grey water treatment area is in a full-load state. At this time, the logic rule engine outputs a grey water area overload alarm state, closes the path to the grey water treatment area, and similarly switches the water flow to the emergency regulating tank for temporary storage and limits the source water inflow.

[0049] After completing the diversion path planning, the system performs subsequent delayed scheduling treatment on the temporarily stored sewage in the emergency regulating tank. The edge controller monitors the stored water volume in real time through level transmitters deployed in the emergency regulating tank. When it receives a signal that the dynamic reserve data of the black water treatment zone or grey water treatment zone has recovered to an idle state above the preset safety threshold, the logic rule engine triggers the emptying control of the temporary storage tank. Based on the dynamic logic tag data, it verifies the water quality category of the temporarily stored sewage and controls the emergency return pump group to quantitatively return the temporarily stored sewage in the emergency regulating tank to the corresponding black water treatment zone or grey water treatment zone for biochemical degradation or physical purification through equivalent independent channels, thereby achieving flow balance regulation through the temporary storage tank. Finally, based on the calculation results under their respective independent channels and emergency bypass channels, the logic rule engine merges and maps the selected target treatment zone identifier, the emergency regulating tank switching status, and the control logic that allows flow cutting into electric valve switching control signals and pump group start / stop control commands, obtaining real-time diversion control data for directing flow cutting actions.

[0050] Based on the above technical solution, optionally, dynamic diversion path planning can be performed based on dynamic logical tag data and dynamic margin data of each processing area to obtain real-time diversion control data for directing diversion actions, including: Based on the dynamic margin data of each treatment zone, a safety boundary cascade verification is performed to obtain the time-varying pollution-bearing capacity space of each treatment zone. Virtual flux time-domain feedforward compensation is performed based on time-varying pollution capacity space to obtain real-time net pollution capacity boundary constraints for each treatment zone. Based on dynamic logical tag data and real-time net pollution boundary constraints, multi-objective path decision-making and flow direction conflict resolution control are carried out to obtain real-time diversion target orientation results. Based on the real-time diversion target pointing result matched with the preset action mapping table, the control timing is arranged and the smooth transition is converted to obtain real-time diversion control data for directing the diversion action.

[0051] In this scheme, the time-varying wastewater capacity space refers to the upper limit of the total amount of wastewater and the dynamic range of load change of each treatment area under a specific time dimension, reflecting the total wastewater carrying capacity of the system under the constraint of safety boundary.

[0052] Real-time net pollution carrying capacity boundary constraints refer to the critical limits on pollution carrying capacity and load that each treatment zone must strictly adhere to at the current sampling time. These are hard safety thresholds for system operation.

[0053] The real-time diversion target orientation result refers to the optimal treatment area allocation and corresponding diversion pipeline target after multi-objective optimization and flow conflict resolution of the current influent flow direction.

[0054] The preset action mapping table refers to the built-in logical reference set, which records in detail the precise correspondence between various real-time diversion target pointing results and the action commands of physical valves, pump sets or flow cutting actuators. For example, when the diversion target pointing result is "black water treatment area", the corresponding black water inlet valve fully open command, high frequency pump set start command and gray water treatment area inlet bypass valve interlocking close command are triggered.

[0055] The edge controller periodically retrieves dynamic margin data for each processing zone from the memory buffer at the current sampling time. The system inputs this dynamic margin data into a multi-level constraint check algorithm, which performs a safety boundary constraint check by comparing the liquid level safety limit with the bioburden carrying capacity threshold in a hierarchical manner. This algorithm evaluates the maximum carrying capacity and load fluctuation range of each functional area online within a specific time window, calculates the total contaminant carrying capacity of each area under the safety boundary constraints, and obtains the time-varying contaminant carrying capacity space of each processing zone.

[0056] The system extracts the time-varying wastewater capacity space and inputs it as a known boundary condition into the feedforward compensation calculation. The system runs a time series prediction algorithm and estimates the predicted instantaneous flow rate for the next period based on historical wastewater trends. Subsequently, the feedforward algorithm performs predicted load feedforward compensation, dynamically subtracting the predicted load corresponding to the predicted instantaneous flow rate from the time-varying wastewater capacity space. This accurately quantifies the wastewater capacity flow rate and critical load limits that each treatment zone must strictly adhere to at the current sampling time, obtaining the real-time net wastewater capacity boundary constraints for each treatment zone.

[0057] The system acquires dynamic logical tag data to logically label the current real-time water flow category, and inputs it along with the real-time net wastewater discharge boundary constraint into a multi-objective decision-making algorithm to perform multi-objective path decision-making and flow conflict handling. When the diversion demand direction indicated by the dynamic logical tag data exceeds the hard safety threshold of the real-time net wastewater discharge boundary constraint, the system runs a priority arbitration state machine to dynamically reallocate paths and switch overflows for each wastewater flow direction according to the scheduling priority matrix. Finally, it determines the optimal treatment area and corresponding diversion pipeline target for the current influent flow direction after multi-objective dynamic optimization, and obtains the real-time diversion target pointing result.

[0058] The system extracts the real-time diversion target indication result and uses an index lookup algorithm to perform key-value matching retrieval in a preset action mapping table, retrieving the built-in mapping table entries. The system matches the action commands of the physical valves, pump sets, or flow-cutting actuators that precisely correspond to the indication result. For example, when the real-time diversion target indication result is "black water treatment area," the corresponding commands are: black water inlet valve fully open, high-frequency pump set start, and grey water treatment area inlet bypass valve interlocked shut-off. Subsequently, the system runs the interlocking logic control program to perform timing control and arrangement of the above commands, and uses ramp function control to smoothly transition the valve opening and pump set speed. Finally, the timing action sequence is encoded into a digital instruction set containing the target treatment area address and the corresponding switch status code, obtaining real-time diversion control data for directing flow-cutting actions.

[0059] In this scheme, the problem of load fluctuation caused by sudden changes in water quality is effectively solved by real-time quantification of time-varying capacity and dynamic resolution of multi-objective path conflicts. It achieves precise and smooth scheduling of flow cutting commands and significantly improves the operational safety and diversion control efficiency of multi-regional wastewater collaborative treatment.

[0060] Step S104: Based on real-time diversion control data, switch the flow path so that black water and grey water flow into their respective treatment areas, and perform dynamic flow prediction for each diversion direction to obtain real-time flow load data for each treatment area.

[0061] Real-time flow load data refers to the instantaneous sewage flow rate of each specific treatment zone monitored by the system at the current moment, as well as the expected total sewage treatment load entering each treatment zone per unit time within a future preset time window based on the flow rheological trend.

[0062] The programmable logic controller (PLC) receives a set of digital instructions in real time to direct the diversion network to perform path switching actions. It then parses the specific target processing area address and corresponding switch status code from the real-time diversion control data, converts the switch status code into a drive electrical signal, and outputs it to the corresponding diversion network actuators to control the opening and closing of the main inlet valve, black water inlet electric valve, grey water inlet electric valve, and emergency regulating tank inlet valve. When the real-time diversion control data indicates a switch to the black water treatment area, grey water treatment area, or the emergency regulating tank, the corresponding pipeline is independently connected.

[0063] While completing the physical flow path switching, the edge controller collects the current signals from each electromagnetic flowmeter deployed on the main inlet pipes of the black water treatment area, the main inlet pipe of the grey water treatment area, and the inlet and outlet pipes of the emergency regulating pool in real time. This data is then converted into the instantaneous wastewater flow rates of each specific treatment area and the emergency regulating pool as monitored by the system at the current moment through analog-to-digital conversion. Within each preset sampling period, the edge controller periodically pushes the instantaneous wastewater flow rates of each specific treatment area, including the emergency regulating pool, into a circulating buffer in chronological order, constructing a discrete time series containing flow time series characteristics.

[0064] The system utilizes a differential autoregressive moving average algorithm to estimate parameters and extrapolate the discrete time series, capturing online the random fluctuations and trend components of water flow under normal diversion, emergency storage, and storage tank emptying and recirculation conditions. Based on the changing characteristics of the discrete time series of flow, the differential autoregressive moving average algorithm performs multi-step forward predictions into a preset future time window, online calculating the predicted flow sequences of black water direction, grey water direction, and inflow / outflow directions of the emergency regulating tank within a specific future period.

[0065] The edge controller extracts the predicted flow sequence of each flow direction, uses the trapezoidal numerical integration method to accumulate the predicted flow within a future preset time window, calculates the predicted treatment load entering each treatment area and the emergency regulating pool per unit time within the future preset time window, and combines it with the instantaneous sewage flow of each specific treatment area and the emergency regulating pool monitored by the system at the current moment. The data is then encapsulated according to the Modbus register mapping structure corresponding to the programmable logic controller to obtain the real-time flow direction load data entering each treatment area.

[0066] Based on the above technical solution, optionally, flow path switching can be performed based on real-time diversion control data, allowing black water and grey water to flow into their respective corresponding treatment areas. Dynamic flow prediction can be performed on each diversion direction to obtain real-time flow load data entering each treatment area, including: Based on real-time diversion control data, the action timing decomposition and switching timing calculation of the underlying diversion control object are performed to obtain the switching time window data corresponding to each processing area. Based on the switching time window data corresponding to each processing zone, perform time-domain logic verification during the flow path switching process to determine the time-domain division sequence of each diversion direction after black water and grey water flow into their respective corresponding processing zones; Based on the time-domain partitioning sequence of each flow direction, real-time data capture of each flow direction is performed synchronously, and time-domain sliding window reconstruction and real-time feature extraction are performed to obtain the real-time load sequence of each flow direction. Based on the real-time load sequence of each diversion direction, dynamic flow prediction and time-domain rolling trend extrapolation are performed to obtain the real-time flow direction load data entering each processing area.

[0067] In this scheme, the switching time window data refers to the set of precise time intervals required for actuators such as valves and pump groups to switch from the current state to the target state when each processing zone executes real-time diversion control data commands. It includes the time span parameters of opening, closing, and intermediate transition stages.

[0068] The diversion flow direction time domain division sequence refers to the logical sequence formed by the system discretizing the time axis of sewage entering each treatment area according to the valve action logic and the transient characteristics of pipeline fluid during the flow path switching process, which clarifies the specific belonging status of sewage flow direction in different time periods.

[0069] The real-time load sequence of traffic diversion refers to the data stream that the system synchronously captures and reassembles based on the time-domain division sequence of traffic diversion. It includes the time-series record of the instantaneous flow data and corresponding load values ​​actually carried by each specific processing area within the current time window.

[0070] The edge controller periodically extracts real-time diversion control data at the current sampling time to direct the diversion network to perform path switching actions. The system inputs this real-time diversion control data into the protocol parsing program to extract the target processing area address and the corresponding switch state code. Based on the inherent physical response parameters of the actuators in each processing area, the program decomposes the control commands into independent action nodes for valve opening, closing, and intermediate transition stages. Subsequently, the system runs a state machine-based timing calculation program, combining the mechanical stroke and electrical control delay of each valve and pump group, to accurately calculate the start and end times of the actions required for these actuators to switch from the current physical state to the target state, forming a precise time series set, and obtaining the switching time window data corresponding to each processing area.

[0071] The system extracts the switching time window data corresponding to each treatment zone and imports it into the time interval conflict detection program. Combining the preset valve interlock control logic and the inherent hydraulic transition flow characteristics of the pipeline, the system performs time-domain logic verification during the flow path switching process. By performing boundary safety checks on fluid mixing and transient backflow during the overlapping opening periods of valves in different treatment zones, the system determines the flow direction conversion time during the switching process. After successful verification, the time series segmentation program discretizes and slices the time axis of sewage entering each treatment zone according to the flow direction conversion time, clarifying the specific attribution status of sewage flow direction in different time periods, and obtaining the time-domain division sequence of each diversion flow direction.

[0072] The system acquires the time-domain segmentation sequence of the diversion flow direction and uses it as a hardware-driven trigger signal to control multiple high-frequency sampling channels to synchronously capture real-time data for each diversion flow direction. Continuous analog signals such as conductivity and instantaneous flow rate collected by field sensors are converted from analog to digital and then sent to a sliding window data reconstruction program. This program uses the discrete slice boundaries defined by the time-domain segmentation sequence of the diversion flow direction as a benchmark to extract water quality monitoring time-series data within a specific time window, performing sliding window stitching and noise reduction. Subsequently, the feature extraction program calculates the mean, cumulative amount, and instantaneous flow rate change rate from the reconstructed time-series records, generating a data stream characterizing the current carrying capacity of each specific treatment area, thus obtaining the real-time load sequence of each diversion flow direction.

[0073] The system extracts the real-time load sequence of the diversion flow direction and inputs it into an autoregressive integral moving average model. The system uses the autoregressive integral moving average model to perform sliding window predictions on the historical flow and load values ​​in the real-time load sequence of the diversion flow direction, capturing the characteristics of the current flow change trend online. Within each prediction step, the model performs linear trend extrapolation to a preset future time window, calculating the expected total wastewater treatment load and instantaneous wastewater flow rate entering each treatment area per unit time, ultimately obtaining the real-time flow direction load data entering each treatment area.

[0074] In this solution, through precise time-series action calculation and sliding window data recombination, flexible switching of diversion paths and accurate prediction of flow trends are achieved, effectively avoiding flow regime conflicts in the pipeline network and significantly improving the dynamic response capability and operational stability of sewage treatment.

[0075] Step S105: Obtain the reaction status data and pipeline transmission delay data of each processing zone updated in real time due to liquid inflow. Based on the pipeline transmission delay data, perform time-domain translation and alignment processing on the real-time flow direction load data entering each processing zone, and perform time-delay compensation feedforward calculation with the real-time updated reaction status data to obtain the dynamic process allocation instructions corresponding to each processing zone.

[0076] Reaction status data refers to monitoring values ​​that characterize the current biochemical purification or physical treatment process of wastewater, such as water quality biochemical indicators, dissolved oxygen concentration, sludge activity, and liquid level within the treatment area.

[0077] Pipeline transmission delay data refers to the time span required for the physical transmission of sewage from the front end of the influent pipeline to the end of the pipeline in each specific treatment area.

[0078] Dynamic process control instructions refer to a set of operating parameter control instructions that are issued in real time to the aeration equipment, dosing pump group and stirring device in the treatment area based on the current reaction progress and inflow load prediction.

[0079] The edge controller periodically reads analog electrical signals from dissolved oxygen analyzers, sludge concentration meters, and level gauges deployed within the black water and grey water treatment zones. After performing analog-to-digital conversion, it acquires the reaction status data of the treatment zones. Simultaneously, the edge controller monitors in real-time the flow rate mutation points of the main inlet pipe and the opening times of the inlet valves in each treatment zone. Using a cross-correlation function algorithm, it performs time series analysis on the signals from the inlet flow sensor and the level sensor inside the treatment zone to calculate the lag period of the signal response from the front end of the inlet network to the end of each treatment zone, thus obtaining the network transmission delay data.

[0080] Based on pipeline transmission delay data, the real-time inflow load data entering each processing zone is time-domain shifted and aligned. The edge controller reads the real-time inflow load data entering each processing zone from memory. According to the pipeline transmission delay data corresponding to each processing zone, it uses a buffer to perform time-domain delay processing on the real-time inflow load data, shifting the predicted load data entering the processing zone at future times backward, so that it is synchronized with the actual inflow load occurring in the processing zone at the current time on the time axis, generating time-domain aligned inflow load data.

[0081] The dynamic process control instructions for each treatment zone are obtained by performing time-delay compensation feedforward calculations based on the real-time updated reaction status data. The edge controller uses the time-domain aligned inflow load data as a predictive control variable and inputs it into the feedforward compensation control algorithm. The feedforward compensation control algorithm, combined with the real-time updated reaction status data, calculates the biochemical reaction adjustment range required to eliminate future load shocks based on the deviations of water quality biochemical indicators, dissolved oxygen concentration, sludge activity, and liquid level. The feedforward compensation control algorithm maps the calculated adjustment range to the frequency setpoint of the aeration equipment inverter, the dosing flow command of the dosing pump group, and the motor speed command of the stirring device, and encapsulates them into a binary data packet containing the set of operating parameter control instructions to obtain the dynamic process control instructions.

[0082] Based on the above technical solution, optionally, the real-time flow direction load data entering each processing zone is time-domain shifted and aligned based on pipeline transmission delay data, and then used for time-delay compensation feedforward calculation with the real-time updated reaction status data to obtain the dynamic process allocation instructions corresponding to each processing zone, including: Based on pipeline transmission delay data and real-time flow load data entering each processing zone, time-domain pointer offset is calculated to obtain the time-domain shift data corresponding to each processing zone. Based on the time-domain shift data corresponding to each processing zone, the real-time flow load data entering each processing zone is written into a dynamic cache queue and step-by-step mapping is performed to obtain the time-domain aligned load data of each processing zone. Based on real-time updated reaction status data and time-domain aligned load data of each processing zone, multivariate process indicators are decoupled collaboratively and load disturbance intensity is transformed to obtain intermediate control parameters for process allocation in each processing zone. Based on the intermediate control parameters of process allocation in each processing zone and the preset process control strategy, control variables are calculated and instructions are reconstructed to obtain the dynamic process allocation instructions corresponding to each processing zone.

[0083] In this scheme, the time-domain shift data refers to the time offset value mapped by each treatment zone based on its corresponding pipeline transmission delay data, which is used to compensate for the lag effect of physical transmission of sewage. It represents the magnitude of the load data that needs to be compensated forward or backward on the time axis.

[0084] A dynamic cache queue is a circular data structure within a system specifically designed to temporarily store and manage real-time load data flowing from each processing area. It can perform data read / write offsets and step mappings based on time-domain shift data to achieve orderly storage and time-series synchronization of historical and real-time load data.

[0085] Time-domain aligned load data refers to a sequence of load values ​​that, after being processed by dynamic buffer queue step mapping, are synchronized with the reaction status data of each treatment zone in the time dimension, reflecting the actual wastewater load contribution entering the treatment zone at the current moment.

[0086] Intermediate control parameters for process allocation refer to the set of indicators calculated by the system based on time-domain aligned load data and response status data, after multi-variable collaborative decoupling and load disturbance intensity transformation, used to quantify the operating conditions of the processing zone, and serve as the direct decision basis for generating the final control command.

[0087] The preset process control strategy refers to the standardized operating criteria and scheduling logic built into the system, including the biochemical degradation index thresholds, aeration intensity optimization paths, and dosing ratio logic for different treatment zones such as black water treatment zone or grey water treatment zone, which are used to guide the instruction reconstruction of dynamic process adjustment instructions.

[0088] The edge controller periodically extracts pipeline transmission delay data from the front end of the influent network to the end of the pipeline in each specific treatment zone, and simultaneously acquires real-time flow load data for each treatment zone. The system inputs this pipeline transmission delay data into a discretization calculation program, which converts continuous time span values ​​into corresponding discrete sampling points based on the system's fixed sampling period. The program then calculates the pointer offset of the data stream in memory based on the converted discrete sampling points, thereby quantifying the magnitude of forward or backward compensation required for the load data on the time-series axis, and obtaining the corresponding time-domain shift data for each treatment zone.

[0089] The system acquires the time-domain shift data and sequentially writes the current real-time load flow data into a dynamic buffer queue, which is a circular data structure. Utilizing a circular buffer read / write pointer control technique, the system reads historical data from the dynamic buffer queue using the time-domain shift data as the index offset of the read pointer, thereby performing static compensation for physical transmission lag in feedforward control. By adjusting the output position of the dynamic buffer queue, the read load value sequence is synchronized with the real-time updated reaction status data in the time dimension, resulting in time-domain aligned load data for each processing zone.

[0090] The system periodically extracts reaction status data characterizing the current wastewater biochemical purification or physical treatment process, and inputs it along with the time-domain aligned load data into the feedforward decoupling control program. This program's running status observer decouples the cross-coupling effects between variables such as water quality biochemical indicators and dissolved oxygen concentration. Subsequently, the program quantifies the disturbance caused by inflow load fluctuations by calculating the discrete difference between the time-domain aligned load data and the baseline load, determines the transient impact intensity of the current load change on the biochemical treatment process, and outputs intermediate control variables as the direct basis for generating the final control command, thus obtaining the intermediate control parameters for process allocation in each treatment zone.

[0091] The system extracts the intermediate control parameters for process allocation and imports them into the optimization solver, while simultaneously retrieving the system's built-in preset process control strategies. The program retrieves the constraint matrix corresponding to the black water or grey water treatment zone from the preset process control strategies, and inputs the intermediate control parameters as initial known variables into the constraint model predictive control algorithm. Within each control cycle, the algorithm uses a preset step response curve and a historical one-dimensional lookup table to online predict future trends. Within the inequality constraint boundary consisting of effluent water quality thresholds, maximum allowable aeration intensity, and upper limit of dosing pump operating frequency, it performs rolling optimization with the objective function of minimizing energy consumption and reagent cost, directly calculating the control increments for aeration volume, dosing volume, and stirring frequency. Finally, the control output processing program linearly superimposes the control increments with the baseline control parameters, uses ramp function control to rate-limit the superimposed control quantity to eliminate mechanical fatigue and hydraulic shock, and ultimately converts it into the setpoint of the standard DCS controller and outputs it, obtaining the dynamic process allocation instructions corresponding to each treatment zone.

[0092] In this scheme, through time-series compensation and constraint model predictive control, the precise synchronization and dynamic collaborative optimization of the inflow load of each processing zone are achieved, effectively avoiding the transient impact caused by fluctuations in process parameters.

[0093] Step S106: Based on the dynamic process allocation command, within the safety boundary of the dynamic reaction state of each corresponding processing zone, the process operating parameters are controlled by closed-loop adaptive optimization to obtain the time-varying reaction condition data of each processing zone.

[0094] The dynamic reaction state safety boundary refers to the dynamic constraint range of key biochemical and physical operating parameters such as dissolved oxygen, sludge load, and stirring rate set based on the biochemical reaction kinetic model of each treatment zone to ensure that the water treatment facility does not experience sludge bulking, biochemical system collapse, or equipment mechanical damage.

[0095] Time-varying reaction condition data refers to a comprehensive record of the process operation status of the treatment zone under the control of process operating parameters, which includes real-time pH value, effluent COD concentration, mixed liquor suspended solids concentration and aeration energy consumption curve.

[0096] Process operating parameters refer to the quantitative control quantities such as inverter frequency, motor voltage, dosing acceleration rate, and running time that directly drive the operation of aeration equipment, dosing pump group, and stirring device in the treatment area in order to maintain the biochemical degradation rate and load balance in the wastewater purification process.

[0097] Based on dynamic process allocation instructions, closed-loop adaptive optimization control is performed on the process operating parameters within the dynamic reaction state safety boundaries of each corresponding processing zone. The edge controller receives dynamic process allocation instructions containing the set of operating parameter control instructions in real time and inputs them as the reference setpoint values ​​of the process operating parameters into the multi-loop adjustable proportional-integral-derivative control driver. At the same time, the edge controller extracts the dynamic reaction state safety boundary composed of the hard threshold interval preset by the static operating condition from memory and injects it directly into the output limiting register of the multi-loop adjustable proportional-integral-derivative control driver as high and low limiting constraints.

[0098] The multi-loop adjustable proportional-integral-derivative (PID) control drive compares the expected state set by the dynamic process adjustment command with the actual reaction state values ​​within each treatment zone fed back by the electrochemical sensor group in each control cycle, and calculates online the proportional, integral, and derivative control increments reflecting the deviation of the current purification process. The multi-loop adjustable PID control drive performs real-time negative feedback incremental correction on the reference setpoint, calculates online the optimal control sequence of process operating parameters within the safety boundary of the dynamic reaction state, and uses the first element of this optimal control sequence as the control output at the current moment, converting it into a corresponding standard industrial control signal. This signal directly drives the aeration equipment, dosing pumps, and stirring devices in the black water treatment zone to perform biochemical degradation of high-concentration organic matter and pathogen wastewater, or drives the corresponding equipment in the grey water treatment zone to perform physical purification of domestic washing or bathing wastewater, achieving closed-loop adaptive optimization control.

[0099] While the process operating parameters are subjected to closed-loop adaptive optimization control, the edge controller, through a fieldbus communication network, collects digital data streams in real time from pH sensors, online chemical oxygen demand (COD) analyzers, sludge concentration meters, and inverter status registers deployed in the black water and grey water treatment zones at preset time sampling intervals. The edge controller performs standard engineering quantity conversion on the collected digital data streams, acquiring real-time pH values, effluent COD concentrations, mixed liquor suspended solids concentrations, and aeration energy consumption data as the treatment zones evolve over time under the control of process operating parameters. Finally, the edge controller extracts the real-time pH values, effluent COD concentrations, mixed liquor suspended solids concentrations, and aeration energy consumption data, and uses a structured data encapsulation protocol to align and encapsulate these parameters according to a unified timestamp, constructing a time-series dataset characterizing the comprehensive operating status of the treatment zones, thus obtaining time-varying reaction condition data for each treatment zone.

[0100] Based on the above technical solution, optionally, within the safety boundary of the dynamic reaction state of each corresponding processing zone, closed-loop adaptive optimization control of the process operating parameters is performed based on dynamic process allocation commands to obtain time-varying reaction condition data for each processing zone, including: Based on the dynamic process scheduling instructions, multi-dimensional control variables are deconstructed to obtain the target operating parameters of each processing zone; Based on the operational target parameters of each processing zone, the control variables are analyzed in reverse, and the corresponding dynamic reaction state safety boundary constraints are matched. The optimal spatial-temporal mapping is then performed to obtain the safety control envelope of each processing zone. Based on the safety control envelope of each processing zone, the process operation parameters of each processing zone are optimized by time-domain gradient adaptive optimization and deviation closed-loop approximation calculation to obtain the dynamic control execution parameters of each processing zone. Based on the dynamic control execution parameters of each processing zone, the underlying control actions are issued, and the time-domain response features are extracted simultaneously to obtain the time-varying response condition data of each processing zone.

[0101] In this scheme, the target operating parameters refer to the specific operating settings of the aeration equipment, dosing pump group and stirring device respectively, which are decomposed into the macro control requirements according to the dynamic process adjustment instructions. These settings include quantitative indicators such as frequency conversion, dosing rate and motor operating voltage.

[0102] Constraints refer to the physical and biochemical operating limits set based on the safety boundary of the dynamic reaction state, including upper and lower limits of dissolved oxygen concentration, maximum volumetric load, critical value of sludge age, and mechanical safety range of equipment operation, which are intended to ensure the stability and safety of the treatment area operation process.

[0103] The safety control envelope refers to the boundary of the real-time controllable operating area defined by constraints in the multidimensional control variable space. It represents the range of dynamic fluctuations in operating parameters that the system can guarantee within a specific time domain without sludge bulking or biochemical collapse.

[0104] Dynamic control execution parameters refer to the real-time precise control commands that are finally determined and issued to the underlying actuators after gradient adaptive optimization and deviation closed-loop approximation calculation. These commands include the equipment frequency converter after compensating for dynamic environmental interference, the precise dosage of chemicals, and the timing sequence of stirring actions.

[0105] The edge controller extracts the generated dynamic process control instructions in real time. The system uses the control allocation module to decompose the instruction set in the dynamic process control instructions into independent components for different control channels. Subsequently, this module extracts specific parameter indices to transform the macroscopic multidimensional control requirements into corresponding baseline setpoints for aeration equipment, dosing pump sets, and stirring devices, clarifying the corresponding quantitative indicators such as frequency conversion, dosing rate, and motor operating voltage, and obtaining the operating target parameters for each treatment zone.

[0106] The system retrieves the target operating parameters and inputs them into the inverse model solver. This program calculates the mapping relationship between the output capabilities of each physical actuator and key process indicators, and then solves inversely to determine the control boundaries required to achieve the set values. Subsequently, the program retrieves the preset dynamic reaction state safety boundaries for each treatment zone and transforms them into constraints composed of upper and lower limits of dissolved oxygen concentration, maximum volumetric load, sludge age critical values, and the mechanical safety range of equipment operation. The constraint projection program projects the multidimensional spatial boundaries defined by these constraints onto the time axis based on the current sampling time, determining the allowable dynamic fluctuation range of the system's operating parameters within the current time period, and obtaining the safety control envelope for each treatment zone.

[0107] The system acquires the safety control envelope of each processing zone and extracts the collected process operating parameters for each zone, inputting them into the online optimizer. This online optimizer uses the safety control envelope as the hard boundary for control parameter optimization and employs an adaptive learning rate gradient descent algorithm to calculate the update direction of the process operating parameters towards the target operating parameters, while satisfying the constrained feasible region. Subsequently, the error compensator, incorporating feedback errors, corrects deviations caused by dynamic environmental disturbances through closed-loop iterative calculation, calculating the compensated equipment frequency converter, precise chemical dosing amount, and stirring control sequence, thus obtaining the dynamic control execution parameters for each processing zone.

[0108] The system extracts the dynamic control execution parameters and converts them into register values ​​recognizable by the underlying PLC actuator, directly driving the aeration equipment, dosing pump group, and stirring device in the treatment area to perform corresponding control actions. Simultaneously with the issuance of the underlying control actions, the system controls the high-frequency data acquisition channel to synchronously capture water quality and electrical parameter signals during the response process. Using feature extraction algorithms, it calculates real-time pH values, effluent COD concentration, mixed liquor suspended solids concentration, and aeration energy consumption curves from the time-series data, ultimately obtaining time-varying reaction condition data for each treatment area.

[0109] In this scheme, adaptive gradient optimization and dynamic constraint closed-loop control are used to achieve precise approximation of the target trajectory by the process operating parameters. While ensuring the safety of biochemical and physical operations, external dynamic disturbances are significantly eliminated.

[0110] Step S107: Based on the time-varying reaction condition data of each treatment zone, the sludge retention cycle is dynamically controlled and the sludge discharge sequence is optimized to obtain the dynamic sludge discharge control data of each treatment zone. Based on the dynamic sludge discharge control data, the actuators of each treatment zone are controlled to release sludge.

[0111] Dynamic sludge control data refers to a set of digital action commands generated in real time based on the evolution of sludge concentration and treatment efficiency within the treatment area. These commands are used to control the opening duration of sludge discharge valves, the operating speed of sludge discharge pumps, and the sludge discharge frequency.

[0112] The actuator refers to the electrically controlled valve, sludge pump set, and related flow regulation components that directly respond to digital commands and perform physical actions to discharge excess sludge in the sludge discharge process.

[0113] Based on the time-varying reaction condition data of each treatment zone, dynamic control of the sludge retention cycle and optimization of the sludge discharge sequence are performed to obtain dynamic sludge discharge control data for each treatment zone. The edge controller periodically reads the time-varying reaction condition data, consisting of real-time pH values, effluent chemical oxygen demand (COD) concentration, mixed liquor suspended solids (SLS) concentration, and aeration energy consumption, from memory. The measured SLS concentration is compared with the target control range, and the target sludge discharge flow rate required to maintain microbial community activity is calculated online using a proportional-integral-derivative (PID) control algorithm. Simultaneously, the system extracts the rate of change of effluent COD concentration and uses a feedforward compensation control algorithm to correct the target sludge discharge flow rate, calculating the actual total sludge discharge required for release online. Based on the actual total sludge discharge, the edge controller optimizes the sludge discharge sequence using an incremental PID control algorithm, calculating online the sludge discharge valve opening duration, sludge pump operating speed, and sludge discharge frequency during the optimal discharge period. Finally, the edge controller combines and encapsulates the above-mentioned sludge discharge valve opening duration, sludge discharge pump operating speed, and sludge discharge frequency to construct a digital action instruction set containing specific action parameters, thereby obtaining dynamic sludge discharge control data for each processing zone.

[0114] Based on dynamic sludge discharge control data, the actuators in each treatment zone are controlled to release sludge. The programmable logic controller (PLC) receives dynamic sludge discharge control data in real time via a fieldbus communication network, which controls the opening duration of sludge discharge valves, the operating speed of sludge discharge pumps, and the sludge discharge frequency. The PLC then performs discrete logic decoding on the digital action instruction set. The PLC converts the decoded sludge discharge valve opening duration and sludge discharge frequency into drive electrical signals, which are output to the corresponding actuators to control the electrically controlled valves and sludge discharge pump sets to perform physical actions. Under the excitation of the drive electrical signals, the electrically controlled valves open their corresponding flow channels. Simultaneously, the sludge discharge pump sets respond to the drive electrical signals and operate at variable frequency, quantitatively discharging the residual sludge deposited after the biochemical degradation of high-concentration organic matter and pathogens in the black water treatment zone, or the residual sludge deposited after the physical purification of domestic washing or bathing wastewater in the grey water treatment zone. Through precise control of the electrically controlled valves, sludge discharge pump sets, and related flow regulation components, the final sludge release is achieved.

[0115] Based on the above steps S101-S107, a closed-loop process from source water identification to sludge discharge is achieved. By dynamically matching the treatment capacity through real-time load prediction and time delay compensation, the biochemical process and sludge discharge are precisely controlled to ensure that the treatment process is within the steady-state safety boundary.

[0116] See appendix Figure 2 , Figure 2 This is a schematic flowchart of the second main step of a black and gray water control method based on feature recognition and feedforward compensation according to an embodiment of the present invention. Figure 2 As shown, a black and gray water control method based on feature recognition and feedforward compensation in an embodiment of the present invention mainly includes the following steps S201-S209.

[0117] Step S201: Continuously acquire the source water index dataset of the source water inlet pipeline, perform unified timestamp alignment and multi-dimensional feature extraction based on the source water index dataset, and obtain source water time-varying feature vector data containing black and gray water quality characteristic indicators.

[0118] Step S202: Based on the time-varying feature vector data of the source water, perform real-time feature identification and classification mapping to obtain dynamic logical label data that distinguishes between black water and grey water.

[0119] Step S203: Obtain dynamic margin data for each processing zone, perform dynamic diversion path planning based on dynamic logical tag data and dynamic margin data for each processing zone, and obtain real-time diversion control data for directing diversion actions; wherein, the processing zones include black water treatment zone and grey water treatment zone.

[0120] Step S204: Based on real-time diversion control data, switch the flow path so that black water and grey water flow into their respective treatment areas, and perform dynamic flow prediction for each diversion direction to obtain real-time flow load data for each treatment area.

[0121] Step S205: Obtain the reaction status data and pipeline transmission delay data of each processing zone updated in real time due to liquid inflow. Based on the pipeline transmission delay data, perform time-domain translation and alignment processing on the real-time flow direction load data entering each processing zone, and perform time-delay compensation feedforward calculation with the real-time updated reaction status data to obtain the dynamic process allocation instructions corresponding to each processing zone.

[0122] Step S206: Based on the dynamic process allocation command, within the safety boundary of the dynamic reaction state of each corresponding processing zone, the process operating parameters are controlled by closed-loop adaptive optimization to obtain the time-varying reaction condition data of each processing zone.

[0123] Step S207: Based on the time-varying reaction condition data of each processing zone, calculate the reaction time constant and extract the time-domain feature distribution trend to obtain the operating time series data of each processing zone.

[0124] Step S208: Based on the working condition time series data of each processing zone and the preset periodic constraints, perform optimization feasible region limitation and boundary time domain feature extraction to obtain the optimization feasible region boundary constraint data of each processing zone.

[0125] Step S209: Based on the boundary constraint data of the feasible region of each processing zone, perform nonlinear optimization of the intermittent release window and optimization of the sludge discharge timing within the boundary constraint range of the feasible region to obtain the dynamic sludge discharge control data of each processing zone, and adjust the actuator of each processing zone to release sludge based on the dynamic sludge discharge control data.

[0126] In this embodiment, the operating condition time series data refers to the dynamic numerical set formed by the system after calculating the reaction time constant and analyzing the trend of the time-varying reaction operating condition data, which reflects the evolution of the operating status of the treatment area over time. It includes the time series records of pH value change rate, COD degradation rate, mixed liquor suspended solids concentration fluctuation trend and aeration energy consumption.

[0127] The preset cycle constraints refer to the standardized operating limits set by the system for sludge retention cycle and sludge discharge operation. These include the longest sludge discharge time per cycle, sludge concentration warning threshold, sludge discharge valve operation frequency limit, and the physical safety operating cycle of the sludge discharge process in the treatment area.

[0128] The optimal feasible domain boundary constraint data refers to the mathematically feasible operating range determined by the real-time operating condition evolution trend of the processing area under the preset periodic constraint conditions. It represents the boundary of the optimal solution range allowed by the sludge discharge time window and sludge discharge intensity under the premise of ensuring the biochemical stability of the system.

[0129] The edge controller periodically acquires time-varying reaction condition data for each treatment zone. The system utilizes first-order inertial link response analysis technology to calculate the dynamic response delay of state variables such as real-time pH value and effluent COD concentration to the control input, thus determining the reaction time constant reflecting the system's time delay and inertial characteristics. Subsequently, the system runs an autocorrelation analysis module, combined with moving average filtering, to extract time-series records reflecting the rate of change of pH value, COD degradation rate, mixed liquor suspended solids concentration fluctuation trend, and aeration energy consumption from the time-varying reaction condition data dataset. This forms a dynamic characteristic characterizing the system's evolution over time, yielding the operating time-series data for each treatment zone.

[0130] The system acquires the operating condition time series data and simultaneously retrieves the system's built-in preset periodic constraints. The feasible region calculation module retrieves the longest sludge discharge time per single cycle, sludge concentration warning threshold, sludge discharge valve operation frequency limit, and physical safety operation cycle included in the preset periodic constraints, and converts them into inequality boundaries of state variables. Subsequently, the boundary feature extraction program calculates the difference between the mixed liquor suspended solids concentration fluctuation trend in the operating condition time series data and the sludge concentration warning threshold, quantifying online the time domain deviation of the current operating condition from the biochemical collapse or sludge expansion critical point, thereby limiting the feasible region and obtaining the optimal feasible region boundary constraint data for each treatment zone.

[0131] The system extracts the boundary constraint data of the optimal feasible region for each processing zone and imports it into a nonlinear programming solver. Within the boundary conditions of the feasible region defined by the boundary constraints, the nonlinear programming solver uses a nonlinear gradient optimization algorithm with the total sludge discharge volume and system biochemical stability as the composite objective function. This algorithm calculates the allowable intermittent sludge discharge timing online and optimizes the sludge discharge valve opening duration, sludge discharge pump operating speed, and sludge discharge frequency. Finally, the control output module converts the optimized solution into digital control instructions executable by a standard programmable logic controller and issues them to obtain the dynamic sludge discharge control data corresponding to each processing zone.

[0132] In this embodiment, online nonlinear gradient optimization was used to achieve dynamic matching between sludge discharge timing and sludge retention period. While ensuring the stability of the biochemical treatment system and avoiding sludge bulking, the sludge discharge frequency and load balance were effectively optimized, significantly improving treatment efficiency and operational reliability.

[0133] It should be noted that although the steps in the above embodiments are described in a specific order, those skilled in the art will understand that in order to achieve the effects of the present invention, different steps do not necessarily have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders, and these variations are all within the scope of protection of the present invention.

[0134] Furthermore, the present invention also provides a black and gray water control system based on feature recognition and feedforward compensation.

[0135] See appendix Figure 3 , Figure 3 This is a main structural block diagram of a black and gray water control system based on feature recognition and feedforward compensation according to an embodiment of the present invention. Figure 3 As shown, it specifically includes: The source water feature perception module 301 is used to continuously acquire the source water index dataset of the source water inlet pipeline, perform unified timestamp alignment and multi-dimensional feature extraction based on the source water index dataset, and obtain source water time-varying feature vector data containing black and gray water quality feature indicators. The fluid property identification module 302 is used to perform real-time feature identification and classification mapping based on the time-varying feature vector data of source water to obtain dynamic logical label data that distinguishes black water from grey water. The diversion path decision module 303 is used to acquire dynamic margin data of each processing zone, perform dynamic diversion path planning based on dynamic logical tag data and dynamic margin data of each processing zone, and obtain real-time diversion control data for directing the diversion action; wherein, the processing zone includes black water treatment zone and grey water treatment zone. The flow dynamic prediction module 304 is used to switch the flow path based on real-time diversion control data, so that black water and grey water flow into their respective corresponding treatment areas, and to perform dynamic flow prediction for each diversion direction to obtain real-time flow load data entering each treatment area. The time delay compensation module 305 is used to acquire the reaction status data and pipeline transmission delay data of each processing zone updated in real time due to liquid inflow. Based on the pipeline transmission delay data, the real-time flow direction load data entering each processing zone is time-domain shifted and aligned, and time delay compensation feedforward calculation is performed with the real-time updated reaction status data to obtain the dynamic process allocation instructions corresponding to each processing zone. The process optimization control module 306 is used to perform closed-loop adaptive optimization control of process operating parameters within the dynamic reaction state safety boundary of each corresponding processing zone based on dynamic process allocation instructions, so as to obtain time-varying reaction condition data of each processing zone. The sludge discharge timing optimization module 307 is used to dynamically regulate the sludge retention cycle and optimize the sludge discharge timing based on the time-varying reaction condition data of each treatment zone, obtain dynamic sludge discharge control data of each treatment zone, and regulate the actuators of each treatment zone to release sludge based on the dynamic sludge discharge control data.

[0136] The black and gray water control system based on feature recognition and feedforward compensation provided in this application embodiment can achieve... Figure 1 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.

[0137] Those skilled in the art will understand that all or part of the processes in the method of the above embodiment of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable storage medium can include any entity or device capable of carrying the computer program code, a medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory, a random access memory, an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content included in the computer-readable storage medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable storage medium does not include electrical carrier signals and telecommunication signals.

[0138] Furthermore, the present invention also provides an electronic device 400, including a processor 401, a memory 402, and a program or instructions stored in the memory 402 and executable on the processor 401. When the program or instructions are executed by the processor 401, they implement the various processes of the above-described embodiment of the black and gray water control method based on feature recognition and feedforward compensation, and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0139] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0140] Furthermore, the present invention also provides a computer-readable storage medium. In one embodiment of the computer-readable storage medium according to the present invention, the computer-readable storage medium can be configured to store a program for executing a black-and-white water control method based on feature identification and feedforward compensation according to the above-described method embodiments. This program can be loaded and run by a processor to implement the above-described black-and-white water control method based on feature identification and feedforward compensation. For ease of explanation, only the parts related to the embodiments of the present invention are shown; for specific technical details not disclosed, please refer to the method section of the embodiments of the present invention. The computer-readable storage medium can be a storage device comprising various electronic devices. Optionally, in the embodiments of the present invention, the computer-readable storage medium is a non-transitory computer-readable storage medium.

[0141] Furthermore, it should be understood that since the various modules are only provided to illustrate the functional units of the device of the present invention, the physical devices corresponding to these modules may be the processor itself, or a part of the processor's software, a part of its hardware, or a combination of software and hardware. Therefore, the number of modules shown in the figures is merely illustrative.

[0142] Those skilled in the art will understand that the various modules in the device can be adaptively split or combined. Such splitting or combining of specific modules will not cause the technical solution to deviate from the principles of the present invention; therefore, the technical solutions after splitting or combining will fall within the protection scope of the present invention.

[0143] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will all fall within the scope of protection of the present invention.

Claims

1. A method for controlling black and gray water content based on feature recognition and feedforward compensation, characterized in that, The method includes: Continuously acquire the source water index dataset of the source water inlet pipeline, perform unified timestamp alignment and multi-dimensional feature extraction based on the source water index dataset, and obtain source water time-varying feature vector data containing black and gray water quality characteristic indicators; Real-time feature identification and classification mapping are performed based on the time-varying feature vector data of source water to obtain dynamic logical label data that distinguishes black water from grey water. The dynamic margin data of each processing zone is acquired, and dynamic diversion path planning is performed based on the dynamic logical tag data and the dynamic margin data of each processing zone to obtain real-time diversion control data for directing the diversion action; the processing zones include black water treatment zone and grey water treatment zone. Based on real-time diversion control data, the flow path is switched so that black water and grey water flow into their respective treatment areas. The flow rate of each diversion direction is dynamically predicted to obtain real-time flow load data of each treatment area. The reaction status data and pipeline transmission delay data of each processing zone are updated in real time due to liquid inflow. Based on the pipeline transmission delay data, the real-time flow direction load data entering each processing zone is time-domain shifted and aligned, and time delay compensation feedforward calculation is performed with the real-time updated reaction status data to obtain the dynamic process allocation instructions corresponding to each processing zone. Based on the dynamic process allocation command, the process operating parameters are adjusted in a closed loop adaptive optimization within the safety boundary of the dynamic reaction state of each corresponding processing zone to obtain the time-varying reaction condition data of each processing zone. Based on the time-varying reaction condition data of each treatment zone, dynamic control of sludge retention period and optimization of sludge discharge sequence are carried out to obtain dynamic sludge discharge control data of each treatment zone. Based on the dynamic sludge discharge control data, the actuators of each treatment zone are controlled to release sludge.

2. The black and gray water control method based on feature recognition and feedforward compensation according to claim 1, characterized in that, in, Real-time feature identification and classification mapping based on source water time-varying feature vector data yields dynamic logical label data that distinguishes black water from grey water, including: The source water time-varying feature vector data is decomposed into components to obtain composite water quality real-time feature indicators. Based on the composite water quality real-time feature indicators, the corresponding target interval components are matched and compared in the preset feature interval matrix to obtain the real-time decoupled quantization feature values ​​corresponding to the composite water quality feature indicators. Based on real-time decoupled quantized feature values, multi-feature collaborative logic judgment and weighted combination verification are performed to obtain the real-time feature identification results of the current source water. Based on the real-time feature identification results, the corresponding preset classification mapping rules are matched, and the normalized logical state mapping of the black and gray water logic decoupling matrix is ​​performed to obtain dynamic initial label data that distinguishes black water from gray water. Based on the dynamic initial label data, temporal step rejection and rolling smoothing filtering are performed to obtain dynamic logical label data that distinguishes black water from grey water.

3. The black and gray water control method based on feature recognition and feedforward compensation according to claim 1, characterized in that, in, Dynamic diversion path planning is performed based on dynamic logical tag data and dynamic margin data of each processing area to obtain real-time diversion control data for directing diversion actions, including: Based on the dynamic margin data of each treatment zone, a safety boundary cascade verification is performed to obtain the time-varying pollution-bearing capacity space of each treatment zone. Virtual flux time-domain feedforward compensation is performed based on time-varying pollution capacity space to obtain real-time net pollution capacity boundary constraints for each treatment zone. Based on dynamic logical tag data and real-time net pollution boundary constraints, multi-objective path decision-making and flow direction conflict resolution control are carried out to obtain real-time diversion target orientation results. Based on the real-time diversion target pointing result matched with the preset action mapping table, the control timing is arranged and the smooth transition is converted to obtain real-time diversion control data for directing the diversion action.

4. The black and gray water control method based on feature recognition and feedforward compensation according to claim 1, characterized in that, in, Based on real-time diversion control data, flow path switching is performed to allow black water and grey water to flow into their respective treatment zones. Dynamic flow prediction is then performed for each diversion direction to obtain real-time flow load data for each treatment zone, including: Based on real-time diversion control data, the action timing decomposition and switching timing calculation of the underlying diversion control object are performed to obtain the switching time window data corresponding to each processing area. Based on the switching time window data corresponding to each processing zone, perform time-domain logic verification during the flow path switching process to determine the time-domain division sequence of each diversion direction after black water and grey water flow into their respective corresponding processing zones; Based on the time-domain partitioning sequence of each flow direction, real-time data capture of each flow direction is performed synchronously, and time-domain sliding window reconstruction and real-time feature extraction are performed to obtain the real-time load sequence of each flow direction. Based on the real-time load sequence of each diversion direction, dynamic flow prediction and time-domain rolling trend extrapolation are performed to obtain the real-time flow direction load data entering each processing area.

5. The black and gray water control method based on feature recognition and feedforward compensation according to claim 1, characterized in that, in, Based on pipeline transmission delay data, real-time flow direction load data entering each processing zone is time-domain shifted and aligned. This data is then used for time-delay compensation feedforward calculations with real-time updated reaction status data to obtain dynamic process allocation instructions for each processing zone, including: Based on pipeline transmission delay data and real-time flow load data entering each processing zone, time-domain pointer offset is calculated to obtain the time-domain shift data corresponding to each processing zone. Based on the time-domain shift data corresponding to each processing zone, the real-time flow load data entering each processing zone is written into a dynamic cache queue and step-by-step mapping is performed to obtain the time-domain aligned load data of each processing zone. Based on real-time updated reaction status data and time-domain aligned load data of each processing zone, multivariate process indicators are decoupled collaboratively and load disturbance intensity is transformed to obtain intermediate control parameters for process allocation in each processing zone. Based on the intermediate control parameters of process allocation in each processing zone and the preset process control strategy, control variables are calculated and instructions are reconstructed to obtain the dynamic process allocation instructions corresponding to each processing zone.

6. The black and gray water control method based on feature recognition and feedforward compensation according to claim 1, characterized in that, in, Based on dynamic process control commands, within the safety boundary of the dynamic reaction state of each corresponding processing zone, closed-loop adaptive optimization control of process operating parameters is performed to obtain time-varying reaction condition data for each processing zone, including: Based on the dynamic process scheduling instructions, multi-dimensional control variables are deconstructed to obtain the target operating parameters of each processing zone; Based on the operating target parameters of each processing zone, the control variables are analyzed in reverse, and the constraints within the corresponding dynamic reaction state safety boundary are matched. The optimal spatial-temporal mapping is then performed to obtain the safety control envelope of each processing zone. Based on the safety control envelope of each processing zone, the process operation parameters of each processing zone are optimized by time-domain gradient adaptive optimization and deviation closed-loop approximation calculation to obtain the dynamic control execution parameters of each processing zone. Based on the dynamic control execution parameters of each processing zone, the underlying control actions are issued, and the time-domain response features are extracted simultaneously to obtain the time-varying response condition data of each processing zone.

7. The black and gray water control method based on feature recognition and feedforward compensation according to claim 1, characterized in that, in, Based on the time-varying reaction condition data of each treatment zone, dynamic control of the sludge retention period and optimization of the sludge discharge sequence were performed to obtain dynamic sludge discharge control data for each treatment zone, including: Based on the time-varying reaction condition data of each processing zone, the reaction time constant is calculated and the time-domain characteristic distribution trend is extracted to obtain the operating time series data of each processing zone. Based on the operating time series data of each processing zone and the preset periodic constraints, the optimal feasible region is defined and the boundary time domain features are extracted to obtain the boundary constraint data of the optimal feasible region of each processing zone. Based on the boundary constraint data of the feasible region for each processing zone, nonlinear optimization of the intermittent release window and optimization of the sludge discharge timing are performed within the boundary constraint range of the feasible region to obtain the dynamic sludge discharge control data of each processing zone.

8. A black and gray water control system based on feature recognition and feedforward compensation, characterized in that, The system includes: The source water feature perception module is used to continuously acquire the source water index dataset of the source water inlet pipeline, and perform unified timestamp alignment and multi-dimensional feature extraction based on the source water index dataset to obtain source water time-varying feature vector data containing black and gray water quality feature indicators. The fluid property identification module is used to perform real-time feature identification and classification mapping based on the time-varying feature vector data of source water to obtain dynamic logical label data that distinguishes black water from grey water. The diversion path decision module is used to acquire dynamic margin data of each processing zone, and to perform dynamic diversion path planning based on dynamic logical tag data and dynamic margin data of each processing zone to obtain real-time diversion control data for directing diversion actions; wherein, the processing zones include black water treatment zone and grey water treatment zone. The flow dynamic prediction module is used to switch the flow path based on real-time diversion control data, so that black water and grey water flow into their respective corresponding treatment areas, and to perform dynamic flow prediction for each diversion direction to obtain real-time flow load data for each treatment area. The time delay compensation module is used to acquire the reaction status data and pipeline transmission delay data of each treatment zone updated in real time due to liquid inflow. Based on the pipeline transmission delay data, the real-time flow direction load data entering each treatment zone is time-domain shifted and aligned, and time delay compensation feedforward calculation is performed with the real-time updated reaction status data to obtain the dynamic process allocation instructions corresponding to each treatment zone. The process optimization control module is used to perform closed-loop adaptive optimization and control of process operating parameters within the dynamic reaction state safety boundary of each corresponding processing zone based on dynamic process allocation instructions, so as to obtain time-varying reaction condition data of each processing zone. The sludge discharge timing optimization module is used to dynamically regulate the sludge retention cycle and optimize the sludge discharge timing based on the time-varying reaction condition data of each treatment zone, thereby obtaining dynamic sludge discharge control data for each treatment zone. Based on the dynamic sludge discharge control data, the actuators of each treatment zone are regulated to release sludge.

9. An electronic device comprising a processor, a memory, and a program or instructions stored in the memory and executable on the processor, characterized in that, The program or instructions are adapted to be loaded and run by the processor to perform the black and gray water control method based on feature recognition and feedforward compensation as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a plurality of program codes, characterized in that, The program code is adapted to be loaded and run by a processor to perform a black and gray water control method based on feature recognition and feedforward compensation as described in any one of claims 1 to 7.