A flocculation reaction real-time intelligent analysis method and system and a storage medium
By constructing a time-series monitoring data stream and smooth evaluation of the flocculation reaction, combined with finite state machine and historical operating condition matching, the instability problem of the flocculation reaction control system under dynamic water quality changes was solved, and stable state assessment and parameter adjustment were achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- PUYANG CLEANWAY CHEM
- Filing Date
- 2026-04-23
- Publication Date
- 2026-07-31
AI Technical Summary
Existing flocculation reaction control systems suffer from inconsistent data timing, susceptibility to fluctuations in status judgment, and insufficient utilization of historical operating experience under dynamic water quality changes, leading to frequent adjustments to the dosing and stirring devices.
By acquiring basic operating condition parameters, constructing a time-series detection data stream, combining smooth evaluation and finite state machine for state judgment, and utilizing historical operating condition matching adjustment strategies, the impact of short-term fluctuations is reduced, and the system's adaptability to complex operating conditions is improved.
It enables steady-state assessment and parameter adjustment under dynamic water quality change conditions, reduces frequent switching of control commands, and improves the system's adaptability and control efficiency.
Smart Images

Figure CN122482575A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of water treatment automation control technology, specifically to a real-time intelligent analysis method, system, and storage medium for flocculation reaction. Background Technology
[0002] Flocculation is a core component of water treatment processes, and its operational status directly determines the load on subsequent processes and the overall effluent quality. With the development of water treatment automation, most facilities have introduced online water quality monitoring and dosing control equipment. However, existing technologies have significant limitations in real-time analysis and automatic control of flocculation reactions.
[0003] While existing flocculation control systems can connect to online monitoring devices for turbidity and water quality, the following problems still exist in actual operation: First, operating parameters and sensor data are collected in a scattered manner, and the time correspondence is not clear, which can easily affect the accurate judgment of the current reaction state; second, some systems mainly rely on instantaneous detection values for threshold judgment, which can easily cause false triggering when sensor readings fluctuate greatly, leading to frequent adjustments to the dosing or stirring devices; third, most existing control strategies rely on fixed rules or human experience, which are insufficient to adapt to complex water quality fluctuations, and historical operating data is not fully used for subsequent optimization. Therefore, how to achieve more stable state assessment and more effective parameter adjustment under dynamic water quality changes remains a problem that needs to be solved. Summary of the Invention
[0004] To address the problems of inconsistent data timing, susceptibility to fluctuations in state judgment, and insufficient utilization of historical operating experience in existing flocculation reaction analysis processes, this invention proposes a real-time intelligent analysis method, system, and storage medium for flocculation reactions. By uniformly organizing operating parameters and multi-dimensional water quality detection results, and combining smoothing evaluation, state judgment, and historical operating condition matching, dynamic analysis and strategy adjustment of the flocculation process can be achieved.
[0005] To achieve the above objectives, the present invention provides the following technical solution: The first aspect of the present invention provides a real-time intelligent analysis method for flocculation reactions, comprising the following steps: The basic operating parameters of the current flocculation reaction are obtained and structured into a set of operating parameters. Based on the set of operating parameters, various water quality physicochemical indicators are obtained, and a time-series detection data stream is constructed. Receive the time-series detection data stream, extract the corresponding dynamic feature quantities, perform weighted calculation to obtain a comprehensive evaluation value, retrieve the previous time-retained value and merge it with the comprehensive evaluation value to perform incremental update calculation, and output the smooth state evaluation value at the current time. The smooth state evaluation value is received and imported into the built-in finite state machine engine for comparison and state judgment. When it is determined that the current flocculation reaction is in the convergence interval, a suspension command is issued. When it is determined that the current flocculation reaction is in an abnormal state, the target record is extracted from the candidate working condition knowledge base and converted into a parameter adjustment strategy and issued. The smooth state evaluation value and the parameter adjustment strategy are encapsulated into a comprehensive output message frame. The operating condition parameter set, the time-series detection data stream, the smooth state evaluation value, and the parameter adjustment strategy are assembled into archived data. Based on the archived data, the calibration of the candidate operating condition knowledge base is performed.
[0006] This invention combines and analyzes the basic operating conditions, real-time detection results, and historical operation records during the flocculation reaction. By smoothing the current detection values, the impact of short-term fluctuations on the judgment results can be reduced; by setting a state determination mechanism with hysteresis characteristics, the frequent switching of control commands within the critical range can be reduced; when the current reaction state is detected to deviate from the target range, the operating conditions with a higher degree of matching are selected from the historical records as the basis for adjustment, thereby improving the system's adaptability to complex operating conditions.
[0007] In one specific embodiment, the structuring into a set of operating condition parameters and the acquisition of various water quality physicochemical indicators include: The input basic operating condition parameters consist of flocculant type, flocculant dosage, stirring rate, flocculation time, settling time, filtration method, filtration rate, and type of water sample to be treated, which are then assembled to obtain the set of operating condition parameters. At each sampling moment, the turbidity value of the water in the reaction vessel is read synchronously, and the parameters of the water sample type to be treated in the set of operating conditions are retrieved for logical judgment. When the judgment is successful, the auxiliary water quality index acquisition channel is opened to supplement the acquisition of hardness, urea and cyanuric acid concentration data, and package and combine them to generate a detection data vector, which includes various water quality physicochemical indicators.
[0008] In one specific embodiment, constructing the time-series detection data stream includes: Discrete detection values are obtained by setting a time interval trigger mechanism and a process stage node trigger mechanism; under the time interval trigger mechanism, external sensor values are extracted according to a preset sampling time interval; under the process stage node trigger mechanism, the flocculation time and settling time parameters in the working condition parameter set are called as trigger boundaries to extract values; the obtained discrete detection values are bound to the system clock information, assigned the same timestamp, and arranged in chronological order to construct the time-series detection data stream.
[0009] In one specific embodiment, the step of extracting the corresponding dynamic feature quantities and performing a weighted calculation to obtain a comprehensive evaluation value includes: A sliding data calculation window is established on the time axis. The turbidity removal rate is calculated by retrieving the initial raw water measurement data and the current reading. The turbidity decrease rate is calculated by extracting the difference between the sampling points at the beginning and end of the sliding data calculation window and combining it with the time span. The measurement values of various auxiliary water quality indicators in the initial reaction state are retrieved and combined with the measurement values of the various auxiliary water quality indicators at the current time. The changes in various auxiliary indicators are calculated. The turbidity removal rate and the changes in various auxiliary indicators are multiplied by their corresponding weighting coefficients and summed to obtain the comprehensive evaluation value at the current time.
[0010] In one specific embodiment, the output of the smooth state evaluation value at the current moment includes: The smoothed state evaluation value retained from the previous sampling period is retrieved and incrementally updated with the comprehensive evaluation value at the current moment. The comprehensive evaluation value at the current moment is multiplied by the incremental update forgetting coefficient to obtain a first value. The difference between the value 1 and the incremental update forgetting coefficient is multiplied by the smoothed state evaluation value retained from the previous sampling period to obtain a second value. The first value and the second value are summed to obtain the smoothed state evaluation value at the current moment after the incremental state update.
[0011] In one specific embodiment, the importing of the built-in finite state machine engine for state comparison includes: A target evaluation value is generated by combining the initial state variables of the reaction. A state machine decision dead zone with hysteresis characteristics is set along the target evaluation value. An upper recovery threshold and a lower trigger threshold are set as state decision boundary constraints. When the smooth state evaluation value is detected to be greater than or equal to the upper recovery threshold, or when the smooth state evaluation value is greater than or equal to the lower trigger threshold and less than the upper recovery threshold, the current flocculation reaction is determined to be in the convergence interval. When the smooth state evaluation value is detected to be less than the lower trigger threshold, the current flocculation reaction is determined to be in an abnormal state.
[0012] In one specific embodiment, the step of extracting target records from the candidate working condition knowledge base and converting them into parameter adjustment strategies for distribution includes: Assemble the current baseline feature vector, calculate the similarity distance between the current baseline feature vector and the baseline feature vector of historical records in the candidate working condition knowledge base, wherein the historical records include baseline feature vectors, bound working condition execution vectors, and historical result tags; filter historical records whose similarity distance values are less than the system's preset tolerance boundary threshold, and aggregate them into a matching candidate scheme set; for the matching candidate scheme set, combine the similarity distance values and the historical result tags, and calculate the predicted evaluation value of the candidate records based on the distance penalty mechanism; sort the predicted evaluation values in descending order, extract the target record at the first position of the descending sequence, obtain the bound working condition execution vector, and convert it into the parameter adjustment strategy for distribution.
[0013] In one specific embodiment, the step of calibrating the candidate operating condition knowledge base based on the archived data includes: The newly added archived data is parsed, wherein the feature calculation log records the intermediate derivation variables consisting of the turbidity decrease rate, the comprehensive evaluation value, and the smoothing state evaluation value; raw water feature parameters are extracted from the time-series detection data stream and assembled into a new background feature vector; the extracted parameter adjustment strategy vector is mapped to a new operating condition execution vector; and the final state recorded in the feature calculation log is converted into a result label; the new background feature vector, the new operating condition execution vector, and the result label are added to the old version of the knowledge base set before the update, and the updated candidate operating condition knowledge base is calculated.
[0014] A second aspect of the present invention provides a real-time intelligent analysis system for flocculation reactions, comprising: The parameter acquisition and data detection module acquires the basic operating parameters of the current flocculation reaction and structures them into an operating parameter set. Based on the operating parameter set, it acquires various water quality physicochemical indicators and constructs a time-series detection data stream. The feature analysis and evaluation calculation module receives the time-series detection data stream, extracts the corresponding dynamic feature quantities, performs weighted calculation to obtain a comprehensive evaluation value, retrieves the previous time-retained value and merges it with the comprehensive evaluation value to perform incremental update calculation, and outputs the smooth state evaluation value at the current time. The analysis and intelligent recommendation module receives the smooth state evaluation value, imports it into the built-in finite state machine engine for comparison and state judgment, and issues a suspension command when it determines that the current flocculation reaction is in the convergence range, and extracts the target record from the candidate working condition knowledge base and converts it into a parameter adjustment strategy for distribution when it determines that the current flocculation reaction is in an abnormal state. The result output and storage archiving module encapsulates the smooth state evaluation value and the parameter adjustment strategy into a comprehensive output message frame, assembles the core parameters into archived data, and performs calibration of the candidate working condition knowledge base based on the archived data.
[0015] A third aspect of the present invention provides a storage medium storing a computer program, which, when executed by a processor, implements the above-described real-time intelligent analysis method for flocculation reaction.
[0016] This invention provides a real-time intelligent analysis method, system, and storage medium for flocculation reactions. It offers the following advantages: 1. This invention obtains basic operating condition parameters and structures them into an operating condition parameter set. It extracts water quality physicochemical indicators by combining time interval triggering mechanism and process stage node triggering mechanism, and binds discrete values to the system clock and assigns them the same timestamp. This unifies static operating condition boundary and dynamic water quality data into a time-series detection data stream, avoiding data misalignment caused by asynchronous sensor feedback.
[0017] 2. This invention utilizes incremental updates to the forgetting coefficient to calculate a smoothed state evaluation value and introduces a state machine with hysteresis characteristics to determine the state dead zone. By setting an upper limit recovery threshold and a lower limit trigger threshold, the flocculation reaction determination process has a certain degree of inertial tolerance, filtering out sudden changes in determination caused by instantaneous water quality detection noise and maintaining the stability of the automated control logic.
[0018] 3. When the flocculation reaction is determined to be in an abnormal state, this invention calculates the similarity distance of the background feature vectors and introduces a distance penalty mechanism to deduce the predicted evaluation value, thereby extracting the target record and converting it into a parameter adjustment strategy; at the same time, the core parameters are encapsulated as archived data for incremental expansion of the knowledge base and calibration of the calculation model, which can reuse historical experience to solve the current water quality fluctuations and realize the closed-loop iteration of the evaluation mechanism. Attached Figure Description
[0019] Figure 1 This is a structural module block diagram of a real-time intelligent analysis system for flocculation reaction according to an embodiment of the present invention; Figure 2 This is a flowchart of a real-time intelligent analysis method for flocculation reaction according to an embodiment of the present invention; Figure 3 This is a flowchart of the method for state machine state determination and knowledge base optimization in an embodiment of the present invention; Figure 4 This is a comparison chart showing the effect of effluent turbidity control in response to sudden load changes in specific application embodiments of the present invention; Figure 5 This is a schematic diagram of the state machine evaluation value evolution and strategy triggering determination mechanism in a specific application embodiment of the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] See attached document Figure 1 The present invention provides a real-time intelligent analysis system for flocculation reaction, including a parameter acquisition and data detection module, a feature analysis and evaluation calculation module, an analysis judgment and intelligent recommendation module, and a result output and storage archiving module.
[0022] The parameter acquisition and data detection module acquires the basic operating parameters of the flocculation reaction and collects the time-series detection data stream of the reaction process.
[0023] The feature analysis and evaluation calculation module receives the time-series detection data stream, extracts the corresponding dynamic feature quantities, and calculates the comprehensive evaluation value characterizing the flocculation effect.
[0024] The analysis, judgment, and intelligent recommendation module determines the current flocculation state based on the received comprehensive evaluation value, and if the judgment result does not meet the standard, it retrieves and outputs parameter adjustment strategies from the candidate working condition knowledge base.
[0025] The results output and storage module interactively displays and stores the final evaluation results, adjustment strategies, and process data.
[0026] See attached document Figure 2 The present invention provides a real-time intelligent analysis method for flocculation reaction, using the above-mentioned system as a program execution carrier, and includes the following steps: Step S1: Obtain the basic operating parameters of the current flocculation reaction through the parameter acquisition and data detection module, structure them into an operating parameter set, and obtain various water quality physicochemical indicators based on the operating parameter set, the time interval triggering mechanism and the process stage node triggering mechanism, and construct a time-series detection data stream containing dynamic detection data and static operating condition boundaries by combining the timestamps.
[0027] Step S2: Receive the time-series detection data stream through the feature analysis and evaluation calculation module, extract the corresponding dynamic feature quantities based on the sliding data calculation window, and obtain the comprehensive evaluation value at the current moment through weighted calculation; retrieve the retained value from the previous moment and merge it with the comprehensive evaluation value to perform incremental update calculation, and output the smooth state evaluation value at the current moment.
[0028] Step S3: The smoothed state evaluation value is received through the analysis and intelligent recommendation module, and then compared with the set decision dead zone by the built-in finite state machine engine to determine the state. When it is determined that the current flocculation reaction is in the convergence interval, a suspension command to maintain the current working condition is issued; when it is determined that the system is in an abnormal state, similarity distance calculation and prediction evaluation value sorting are performed in the candidate working condition knowledge base, and the target record at the top of the descending sequence is extracted and converted into a parameter adjustment strategy and sent to the underlying execution mechanism.
[0029] Step S4: The target achievement status, smoothing status evaluation value and parameter adjustment strategy are encapsulated into a comprehensive output message frame for external interactive display through the result output and storage archiving module; the core parameters in the current analysis period are assembled into archived data, and the incremental expansion of the candidate working condition knowledge base and the calibration of the calculation model are performed based on the newly added archived data.
[0030] Regarding step S1, which involves constructing the timing detection data stream based on the process node, the following sub-steps are included: Step S101: The parameter acquisition and data detection module, equipped with a hardware interface and data parsing function, acquires the basic operating parameters of the current flocculation reaction and organizes them into a unified set of operating parameters. This set includes flocculant type, flocculant dosage, stirring rate, flocculation time, settling time, filtration method, filtration rate, and the type of water sample to be treated. These parameters characterize the basic boundary conditions of the current reaction and serve as a reference for subsequent state analysis and strategy adjustment.
[0031] In one embodiment, the flocculant type can be polyaluminum chloride, polyacrylamide, or other agents suitable for the target water sample; the flocculant dosage, stirring rate, and filtration method can be set according to the on-site process conditions. The system combines the aforementioned parameters to form a set of operating parameters and stores them in the running memory or configuration unit.
[0032] After the aforementioned parameters are input into the system, the set of operating parameters is obtained by assembling them using the following expression: ; in, Represents the set of operating parameters; Indicates the type of flocculant. This indicates the dosage of flocculant. Indicates the stirring rate. Indicates flocculation time. Indicates the settling time. Indicates the filtering method. Indicates filtration rate. This indicates the type of water sample to be treated. This parameter vector is permanently stored in the system memory, forming the steady-state reference frame for this reaction evaluation.
[0033] In step S102, the parameter acquisition and data detection module initiates data acquisition based on the operating condition parameter set. The parameter acquisition and data detection module is internally configured with a timing control unit, which executes two parallel or selective data acquisition triggering mechanisms: a time interval triggering mechanism and a process stage node triggering mechanism. The system can perform periodic sampling at preset time intervals or trigger sampling at process stage nodes.
[0034] Under the time interval triggering mechanism, the parameter acquisition and data detection module extracts external sensor values according to a preset sampling time interval. In this embodiment, the preset sampling time interval is set based on the hardware response cycle of the external sensor and the hydraulic residence time in the reaction vessel, and the preset sampling time interval ranges from 5 seconds to 30 seconds. In a specific embodiment, the preset sampling time interval is set to 10 seconds. From the initial moment when the reagent is injected into the water sample to be treated until the filtration process is completed, the system continuously issues reading commands according to the set time period to capture the real-time status of the water sample.
[0035] Under the process stage node triggering mechanism, the parameter acquisition and data detection module calls the flocculation time and settling time parameters from the operating condition parameter set as the trigger boundaries for state machine flow. The specific triggering logic is as follows: the first acquisition and recording of the initial raw water state is triggered when the stirring device starts; the second acquisition and recording of the mixed liquid state is triggered when the set flocculation time has elapsed and a stop stirring command is issued; the third acquisition and recording of the supernatant state is triggered when the set ...
[0036] In this embodiment, the timing control unit sets up time window alignment logic. For feedback data triggered by the same sampling command, the system stipulates that all index values arriving within the allowed time tolerance window are assigned the same timestamp, and data that exceeds the time limit is determined to be invalid and extracted from the dataset of the current stage. Discrete detection values are incorporated into the system data buffer layer and bound to the system clock information, and arranged in chronological order according to timestamps to form the timing data stream base.
[0037] Step S103: After the time coordinate axis is established, the parameter acquisition and data detection module acquires water quality physicochemical indicators at each sampling time.
[0038] At each sampling moment, the turbidity value of the water in the reaction vessel is read synchronously. The parameter acquisition and data detection module retrieves the water sample type parameter from the operating condition parameter set for logical judgment. When the judgment is successful (the water sample type belongs to a specific application scenario, such as the raw water source being marked as a swimming pool water circulation treatment system), the system activates the auxiliary water quality indicator acquisition channel to supplement the collection of hardness, urea, and cyanuric acid concentration data. These auxiliary indicators are used to characterize the water buffer environment and constitute supplementary data for multi-dimensional quantitative evaluation. The parameter acquisition and data detection module encapsulates and combines the extracted indicator values to generate a detection data vector. The detection data vector at the current moment is obtained by assembling the vector using the following expression: ; in, This represents the current detection data vector, which is the water quality physicochemical index. This represents the core turbidity measurement value at the current moment; This indicates the hardness measurement value at the current moment; This represents the urea measurement value at the current moment; This indicates the current measurement value of cyanuric acid.
[0039] When the system determines that the current application scenario has not triggered the auxiliary indicator collection conditions, the data bits of the corresponding auxiliary vector elements are replaced by system-preset constant placeholders. This operation maintains the uniformity of the data vector dimension. The parameter acquisition and data detection module continuously generates detection data vectors and stacks the detection data vectors generated at different times within the reaction cycle in chronological order to output a time-series detection data stream.
[0040] After loading the dynamic detection data and static operating condition boundaries in step S1, the system acquires a continuous time-series detection data stream. Next, step S2 is executed, which includes the following sub-steps: Step S201: The feature analysis and evaluation calculation module establishes a sliding data calculation window on the time axis. In this embodiment, a finite-length analysis slice is extracted through the calculation window to avoid the full data residing in memory for an extended period. Assume the time span covered by the sliding calculation window is... The current time is The system extracts the sliding calculation window coverage. The calculation window moves forward according to the set time step as a new sampling signal arrives, extracting old data and incorporating the latest data. Based on the calculation window, the feature analysis and evaluation calculation module extracts the first dynamic feature, namely the turbidity removal rate. It retrieves the initial raw water measurement data and combines it with the current reading to calculate the turbidity removal rate corresponding to the current moment using the following formula: ; in, This represents the turbidity removal rate at the current moment. This represents the core turbidity measurement value at the initial stage of the reaction. This represents the core turbidity measurement value at the current moment. If the denominator value is lower than the instrument's set minimum detection limit constant, the system directly issues a water quality compliance command. The feature analysis and evaluation calculation module simultaneously extracts the turbidity decrease rate feature within the window, extracts the difference between the sampling points at the beginning and end of the window, and combines it with the time span to calculate the turbidity decrease rate within the current calculation window using the following formula: ; in, This indicates the rate of turbidity decrease within the current calculation window. This represents the core turbidity measurement value corresponding to the start time of the sliding window. This indicates the time span covered by the sliding calculation window.
[0041] Step S202: After obtaining the dynamic characteristic quantities, the feature analysis and evaluation calculation module retrieves the measured values of various auxiliary water quality indicators (hardness, urea, and cyanuric acid) under the initial reaction conditions, and sets the aforementioned initial values as follows: , and Combined with the various measurements at the current moment. , and The feature analysis and evaluation calculation module calculates the comprehensive evaluation value at the current moment using the following weighted calculation formula: ; in, This represents the overall evaluation value at the current moment; , , These represent the measured values of various auxiliary water quality indicators under the initial reaction conditions. , , These represent the measured values of various auxiliary water quality indicators at the current moment; , and These are the changes in various auxiliary indicators; This represents the first weighting coefficient corresponding to the turbidity removal rate. This represents the second weighting coefficient corresponding to the change in hardness. This represents the third weighting coefficient corresponding to the change in urea levels. The fourth weighting coefficient corresponding to the change in cyanuric acid; This represents a preset, tiny positive constant.
[0042] If initial state parameters are missing due to power-on delay, the feature analysis and evaluation calculation module will automatically retrieve the system's preset historical average value of local conventional water sources as a substitute benchmark. If auxiliary indicator collection is not triggered, the preset placeholder will... , and Zeroed out. In this embodiment, the first weighting coefficient... The value of is strictly greater than the sum of the other three auxiliary weight coefficients, and the sum of each weight coefficient is limited to a constant 1. In step S203, after completing the aggregation operation, the feature analysis and evaluation calculation module allocates a register in memory to store the state evaluation value from the previous moment. When a new detection signal arrives and the calculation is completed, the stored value in the register is retrieved and fused with the instantaneous index. The smoothed state evaluation value for the current moment after the incremental state update is calculated using the following formula: ; in, This represents the smoothed state evaluation value at the current moment after the incremental state update. This represents the overall evaluation value at the current moment. This represents the smoothed state evaluation value retained from the previous sampling period and retrieved from the register. During the initial feature calculation, the smoothed state evaluation value retained from the previous period in the register is used. The default value is the initial comprehensive evaluation value. ; The incremental update forgetting coefficient represents the rate of change of the control state. Defined within the open interval (0, 1), the system dynamically adjusts according to the degree of fluid turbulence at the current reaction stage. After each calculation, the feature analysis and evaluation calculation module uses... Overwrite register .
[0043] Reference Appendix Figure 3 Step S3 specifically includes the following sub-steps: Step S301: The analysis, judgment, and intelligent recommendation module receives the smoothed state evaluation value at the current moment. It reads the upper limit of effluent turbidity constraint and various water quality compliance targets set by the host computer management terminal, and generates target evaluation values by combining them with the initial state variables of the reaction. .
[0044] Analysis and Judgment and Intelligent Recommendation Module Set a state machine with hysteresis to determine the dead zone, and set a lower limit trigger threshold downwards. Set an upper limit for the recovery threshold. The preset state determination boundary constraints give the current flocculation reaction a certain degree of inertial tolerance, reducing the frequency of start-stop operations of the actuator under similar operating conditions.
[0045] Step S302: Based on the set boundary parameters, the analysis and intelligent recommendation module activates its built-in finite state machine engine to perform state judgment. The system will input... Import the state machine's compare register and perform the following decision: When the state machine detects Or the system is in a compliance maintenance state and meets the requirements. At this point, the judgment program asserts that the current processing condition is in the adaptation channel and the current flocculation reaction is in the convergence range. The analysis, judgment, and intelligent recommendation module then issues a suspension command to maintain the current operating condition. The underlying execution mechanism freezes the optimization search thread, maintains the existing metering pump output frequency and agitator speed, and drives the system clock to enter the incremental evaluation calculation for the next sampling cycle.
[0046] When the state machine detects The current flocculation reaction is in an abnormal state. This state reflects the engineering reality that the existing treatment conditions are unable to overcome the pollution load of the raw water, facing the risk of effluent exceeding standards. At this point, the analysis, judgment, and intelligent recommendation module throws an interrupt signal, breaks out of the hold-and-wait logic, sends a trigger command to the system bus, and activates the candidate operating condition knowledge base optimization and recommendation ranking process.
[0047] Step S303: Following the interrupt signal, the analysis, judgment, and intelligent recommendation module loads the candidate operating condition knowledge base configured in the storage unit. This knowledge base is solidified based on the long-term accumulated discrete comparative experimental conclusions of the target water treatment facility. To transform unstructured laboratory ledgers or pilot-scale records into a machine-readable mathematical framework, the analysis, judgment, and intelligent recommendation module performs a data mapping and reconstruction operation, extracts the historical experimental record list, extracts the raw water quality parameters measured before each test, and constructs a background feature vector for similarity addressing. The first step is set... The background feature vector corresponding to each historical experimental record is The first one is obtained by assembling using the following formula. The background feature vector of a historical record: ; in, Indicates the first The baseline feature vector generated by aggregating historical records; , , , They represent the first time. The quantitative values of turbidity, hardness, urea and cyanuric acid in the raw water were measured in the initial stage of the discrete experiment.
[0048] The system synchronously retrieves the corresponding actual control parameters, such as the reagent dosage concentration setting and the metering pump stroke frequency, and the control commands are packaged into an operating condition execution vector. The analysis, judgment, and intelligent recommendation module calculates the historical experimental scores corresponding to the sedimentation effluent indicators based on the preceding weighted rules and records them as result labels. The analysis, judgment, and intelligent recommendation module will... Arrange the primary key index, and The resulting tuples are set as subordinate load nodes, and the entire population is traversed. The data is used to construct a searchable tree structure. For cold start scenarios with zero data and no available historical records, the analysis and intelligent recommendation module automatically fills the primary key and subordinate load nodes with the industry-standard processing benchmarks that are fixed at the system's factory, thus avoiding addressing dead zones.
[0049] Step S304: The analysis and intelligent recommendation module extracts the raw water characteristic benchmark value under the current initial reaction state and assembles the current background feature vector. ,Right now The candidate working condition knowledge base is traversed, and the following formula is used to calculate the result. and Similarity distance values between them: ; in, This indicates the characteristics of the initial raw water in the current reaction compared to the first... Similarity distance values between historical records; The dimension index parameter in the feature vector takes values from 1 to 4, corresponding to turbidity, hardness, urea, and cyanuric acid, respectively. express In the Initial baseline readings in each dimension; express In the Values in each dimension; This represents the distance weighting coefficient set for different water quality parameters; This represents a pre-set small constant to avoid division by zero.
[0050] To maintain logical consistency with the preceding evaluation feature dimensions, the distance weight coefficient... The value of is set as the dominant parameter, and its range covers the dynamic range greater than the sum of the other three coefficients.
[0051] After the calculation is completed, the analysis and judgment are compared with the preset tolerance boundary threshold of the intelligent recommendation module, which is used to filter similarity distance values. Historical records below this threshold are aggregated into a matching candidate set. Once the candidate set is asserted to be empty, the bus command will invoke the factory-built-in maximum power dosing combination as a conservative fallback plan to ensure continuous operation of the control thread.
[0052] Step S305: For the extracted set of matching candidate solutions, the analysis, judgment, and intelligent recommendation module initiates the calculation process for the predicted evaluation value. Considering the slight discrepancies between the current real-time water quality and historical records, directly copying historical labels would lead to prediction distortion. Therefore, the analysis, judgment, and intelligent recommendation module introduces a distance penalty mechanism into the set of matching candidate solutions, calculating the predicted evaluation value using the following formula. Predicted evaluation value for each candidate record: ; in, This indicates that for the first matching candidate solution in the set... The predicted evaluation value is generated by estimating each candidate record; Indicates the first The historical result label score retained for each candidate record; Indicates the calculated first The similarity distance value corresponding to each candidate record; This represents the distance penalty adjustment coefficient that controls the decay curvature, used to adjust the weight of similarity differences on the prediction results.
[0053] After the calculations are completed, the analysis, judgment, and intelligent recommendation module calls the built-in sorting function to sort the calculated result array in descending order. It then extracts the target record at the top of the descending sequence, extracts the internally bound operating condition execution vector, and converts it into discrete low-level electrical commands such as the metering pump stroke duty cycle and the mixer frequency converter level. These commands are then uniformly distributed to the low-level actuators as recommended adjustment strategies for current water quality fluctuations. Through closed-loop operations of similarity alignment, weighted prediction, and descending extraction, the system is endowed with adaptive control performance tailored to local conditions.
[0054] After receiving the underlying electrical command generated by the preceding descending extraction action, the system control flow leaves the simple numerical calculation range and enters step S4, which specifically includes the following sub-steps: Step S401: The result output and storage archiving module extracts the core parameters residing in the memory stack after the logic branch execution is complete, and performs data encapsulation for the external display terminal and host computer interface. Decoupled from the underlying background calculations, the system establishes structured data messages at this stage, transforming the hidden algorithmic decisions into a process view that field engineers can intuitively interpret. Based on the sampling timestamp of the current control cycle, the module collects and assembles core monitoring information in sequence to construct the comprehensive output message frame for the current moment. The data structure expression of the output message frame is as follows: ; in, This represents the integrated output message frame generated during the current sampling control cycle; Indicates the status of the mapped target being achieved; This represents the smoothed state evaluation value at the current moment, which is output in step S203 and used for state determination in step S3. This represents a vector-based parameter adjustment strategy developed in response to current water quality fluctuations.
[0055] For the mapping logic of various parameters within the message frame, the module performs the corresponding state translation. Regarding the goal achievement status... The system reads the assertion results given by the preceding state machine. When the current flocculation reaction is within the compliance maintenance range, the system assigns a normal convergence status code; when the system falls below the lower limit trigger threshold and enters the optimization channel, the system assigns a detuning alarm status code. This parameter is represented by indicator elements of different colors in the host computer system. Regarding the output format of the evaluation value, the system synchronously packages the target evaluation value and the dual boundary threshold determined by the aforementioned state machine in the message frame.
[0056] Regarding parameter adjustment strategies The system adaptively adjusts the packet encapsulation action based on the branch path of the control flow. When the system is in the compliance maintenance branch, the vector is automatically filled with silent placeholders to maintain the existing output; once the system enters the optimization branch and completes the strategy retrieval action, the module reverse-compiles the converted control parameters such as the metering pump stroke duty cycle and the reagent dosing concentration setpoint, converting them into process adjustment readings displayed in plain text on the operation panel. Through the feedback channel, field personnel can confirm the specific content of the automated recommended instructions and, if necessary, disconnect the handshake channel to switch to manual takeover mode. For the message packet and register address mapping process based on industrial control protocols, those skilled in the art can directly construct the underlying addressing channel using standard Modbus or OPC communication specifications, which will not be elaborated here.
[0057] In step S402, after pushing the real-time status message to the host computer, the system control bus enters the global information archiving sequence. The result output and storage archiving module retrieves discrete variables distributed in various cache blocks within the current analysis period and performs structured assembly operations targeting the local database. To ensure the data integrity and causal correspondence during the historical tracing phase, the system sets up a comprehensive archiving structure containing the characteristics of the entire data flow lifecycle. The result output and storage archiving module freezes the memory stack at a set time truncation node and encapsulates the archived data generated for the current analysis period using the following data packaging formula: ; in, This refers to the archived data generated for the current analysis period; This represents the initial set of operating parameters extracted from the system configuration table; This represents the vector of time-series detection data covering the time span of the current sliding calculation window; This represents a feature calculation log that records the core variable calculation process; This represents the parameter adjustment strategy vector output in the interactive interface.
[0058] For the loading logic of each component module within the structure, the result output and storage archiving modules perform differentiated mapping and compression operations. Regarding the initial operating condition parameter set... The output and storage module traces the boundary conditions at the beginning of this cycle and extracts the set of operating parameters constructed in step S101. All parameters within are packaged and imported.
[0059] For time-series detection data vectors The results output and archiving module summarizes the continuous dynamic readings acquired by the multi-dimensional sensors. Considering the inherent discrepancies in hardware sampling frequencies and communication delays among different water quality probes, the results output and archiving module performs time alignment before assembling the vectors. The system extracts the hardware timestamps of each sensor and interpolates asynchronously arriving acquisition frames onto the same reference time axis. Considering that high-frequency sampling and accumulation can easily occupy a large amount of storage space, the system uses a moving average algorithm to sparsify the dense floating-point data stream into a minute-level feature data node set.
[0060] Regarding feature calculation logs The system extracts intermediate derived variables from the preceding calculations, such as the turbidity decrease rate, comprehensive evaluation value, and smoothing state evaluation value, and performs serialization and storage. The purpose of retaining the calculation log is to move away from a purely black-box control mechanism and provide transparent diagnostic traceability for subsequent manual playback analysis. The module will archive the assembled data. Pushed into the underlying write buffer queue. A single, isolated control action is fully imprinted as an experience record with a complete causal chain.
[0061] Step S403: The result output and storage archiving module manages the underlying write buffer queue and performs the transfer of archived data to the persistent database. Considering the read / write latency differences of the industrial control computer's storage media, an asynchronous thread write mechanism is invoked to ensure that the background data write operation does not consume the main program's control computing power. The system sequentially pops message frames from the buffer queue and performs insertion operations based on the system timestamp primary key.
[0062] To address the iterative role of structured data within the closed-loop system, the result output and storage archiving module incorporates periodic decomposition and mapping logic, thereby expanding the candidate operating condition knowledge base. The system schedules background inspection scripts to parse newly added archived data in the persistent database and extract time-series detection data vectors. From the initial timestamp node, the original water feature parameters are extracted and assembled into a new background feature vector. Extract the parameter adjustment strategy vector Mapped to new working condition execution vector And calculate logs based on features The final state recorded in the document is converted into a result label. The new candidate operating condition knowledge base after data expansion for this control cycle is obtained by calculating using the following incremental expansion formula: ; in, This represents a new candidate operating condition knowledge base after the data expansion for this control cycle has been completed; Indicates that it contained before the update. A collection of old versions of the knowledge base containing historical records; This represents the union operation that represents newly added mapping entries in the database; , , These represent the first generation generated by disassembling the current period's archived structure. The group's baseline feature vector, operating condition execution vector, and result label.
[0063] The continuously accumulating structured data synchronously undertakes the calibration task of the candidate operating condition knowledge base. When the total number of records stored in the system exceeds the set calibration trigger number range, the offline maintenance program retrieves recent historical records and extracts the relevant information. Predicted evaluation value derived from group events Compared with the final true smooth state evaluation value The output results are compared with the prediction residuals calculated by the built-in verification script in the storage and archiving module. If the mean residual value deviates from the preset zero-point tolerance interval for multiple consecutive periods, it indicates a systematic shift in the empirical mapping of the current matching model. In this case, the program adjusts the distance penalty coefficient in step S3 based on the positive or negative direction of the residuals. Perform incremental adjustments.
[0064] With the continuous operation of the entire closed-loop process, the fit of the underlying feature calculation model has been gradually improved, completing the complete engineering automation evolution loop from environmental perception and strategy decision-making to experience reabsorption.
[0065] The present invention also provides a storage medium storing a computer program, which is executed by a processor to perform the method described above.
[0066] The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0067] Specific application examples: Application scenario settings: Take the water circulation system of a large indoor heated swimming pool in a certain city as an example. During the peak swimming season in summer, due to the sudden increase in the number of people entering the water, the turbidity and urea content in the raw water often undergo non-linear changes. The traditional constant dosing control system has a lag of 1-2 hours, resulting in the effluent water quality exceeding the standard in stages.
[0068] Implementation steps: Upon system power-on, acquire the set of operating parameters. Among them, flocculant types Specifically, the dosage of polyaluminum chloride and flocculant is... .
[0069] Initial raw water characteristic reference value for extraction reaction: turbidity ,hardness urea cyanuric acid .
[0070] Calculation of sudden change time: running to time 1 At times, peak passenger flow occurs. (Time-series detection data vector) An error was detected in the auxiliary measurement value at the current moment: the turbidity degradation was rapidly hindered, and the reading remained at [value missing]. Urea rose to .
[0071] According to the formula The current turbidity removal rate is calculated. .
[0072] Comprehensive evaluation calculation: preset weights Substitute the current measured value into the weighted calculation formula: (Note: Elevated urea levels have a negative impact on evaluation.)
[0073] Smooth state update: Set the register retention value from the previous cycle. Forgetting coefficient According to the formula The current smooth state evaluation value is obtained: .
[0074] State machine trigger: The lower limit trigger threshold set by the host computer. Due to the current situation The state machine throws an interrupt signal, asserting that the system is in an abnormal state.
[0075] Knowledge base addressing and estimation: The system extracts the initial measurement benchmark values of the raw water and assembles the current background feature vector. Match the knowledge base. Locate the 15th historical record. Its label score .
[0076] Calculated based on similarity formula (Extremely small distance, highly matched).
[0077] Based on the prediction formula Let the penalty coefficient be set. ,but .
[0078] Strategy Output: The system selects the high-scoring prediction record and extracts its operational execution vector. The dosage of polyaluminum chloride was increased to Increase stirring speed And this will be used as a parameter adjustment strategy. Packed into a composite output message frame Issue and implement.
[0079] Experimental verification and effect comparison section To verify the actual beneficial effects of the proposed solution, a 72-hour field test in a swimming pool was conducted. The performance of the traditional PID feedback control scheme and the real-time intelligent analysis system of this invention in dealing with three sudden peaks of water pollution was compared. The results are shown in the table below: Verification conclusion: Combining Figure 4 and Figure 5During the high-load pollution mutation range of 40 to 80 minutes, the traditional PID feedback control scheme causes the effluent turbidity to fluctuate violently and break through the water quality compliance limit of 1.0 NTU due to the inherent lag in the feedback loop. In contrast, the present invention keeps the effluent turbidity below 0.7 NTU and does not exceed the limit.
[0080] exist Figure 5 In the very early stages of water quality disturbance, although no exceedances were observed at the effluent outlet, the smoothing state evaluation value rapidly approached and fell below the set lower limit trigger threshold (0.65). The state machine immediately threw an interrupt at the threshold and issued a parameter adjustment strategy (marked by the solid square in the diagram), prompting... The curve quickly stopped falling and then reversed course, approaching the target evaluation value of 0.85.
[0081] As can be seen from the test curves, when the pollution load begins to rise, the proposed solution can identify the change in condition earlier and adjust the operating conditions in a timely manner, resulting in smaller fluctuations in effluent. In contrast, traditional PID control exhibits a certain response lag under sudden disturbances. This demonstrates that the proposed solution has practical application value in improving operational stability, shortening the duration of anomalies, and reducing reagent consumption.
Claims
1. A real-time intelligent analysis method for flocculation reaction, characterized in that, Includes the following steps: The basic operating parameters of the current flocculation reaction are obtained and structured into a set of operating parameters. Based on the set of operating parameters, various water quality physicochemical indicators are obtained, and a time-series detection data stream is constructed. Receive the time-series detection data stream, extract the corresponding dynamic feature quantities, perform weighted calculation to obtain a comprehensive evaluation value, retrieve the previous time-retained value and merge it with the comprehensive evaluation value to perform incremental update calculation, and output the smooth state evaluation value at the current time. The smooth state evaluation value is received and imported into the built-in finite state machine engine for comparison and state judgment. When it is determined that the current flocculation reaction is in the convergence interval, a suspension command is issued. When it is determined that the current flocculation reaction is in an abnormal state, the target record is extracted from the candidate working condition knowledge base and converted into a parameter adjustment strategy and issued. The smooth state evaluation value and the parameter adjustment strategy are encapsulated into a comprehensive output message frame. Intermediate derivation variables in the calculation process are extracted to generate feature calculation logs. The working condition parameter set, the time series detection data stream, the feature calculation logs, and the parameter adjustment strategy are assembled into archived data. The calibration of the candidate working condition knowledge base is performed based on the archived data.
2. The real-time intelligent analysis method for flocculation reaction according to claim 1, characterized in that, The structuring into a set of operating condition parameters and the acquisition of various water quality physicochemical indicators specifically include: The input basic operating condition parameters consist of flocculant type, flocculant dosage, stirring rate, flocculation time, settling time, filtration method, filtration rate, and type of water sample to be treated, which are then assembled to obtain the set of operating condition parameters. At each sampling moment, the turbidity value of the water in the reaction vessel is read synchronously, and the parameters of the water sample type to be treated in the set of operating conditions are retrieved for logical judgment. When the judgment is successful, the auxiliary water quality index acquisition channel is opened to supplement the acquisition of hardness, urea and cyanuric acid concentration data, and the data are packaged and combined to generate a detection data vector.
3. The real-time intelligent analysis method for flocculation reaction according to claim 2, characterized in that, The construction of the time-series detection data stream includes: Set time interval triggering mechanism and process stage node triggering mechanism to obtain discrete detection values; Under the time interval triggering mechanism, external sensor values are extracted according to a preset sampling time interval; Under the process stage node triggering mechanism, the flocculation time and the settling time in the operating condition parameter set are used as the trigger boundary to extract values. The acquired discrete detection values are bound to the system clock information, assigned the same timestamp, and arranged in chronological order to construct the time-series detection data stream.
4. The real-time intelligent analysis method for flocculation reaction according to claim 3, characterized in that, The step of extracting the corresponding dynamic feature quantities and performing a weighted calculation to obtain a comprehensive evaluation value specifically includes extracting the corresponding dynamic feature quantities based on a sliding data calculation window, wherein: A sliding data calculation window is established on the time axis. The initial raw water measurement data and the current reading are retrieved to calculate the turbidity removal rate. The difference between the sampling points at the beginning and end of the sliding data calculation window is extracted and combined with the time span to calculate the turbidity decrease rate. The changes in each auxiliary water quality indicator are calculated by retrieving the measured values of each auxiliary water quality indicator at the initial state of the reaction and combining them with the measured values of each auxiliary water quality indicator at the current time. The turbidity removal rate and the changes in each of the auxiliary indicators are multiplied by their respective weighting coefficients and then summed to obtain the comprehensive evaluation value at the current moment.
5. The real-time intelligent analysis method for flocculation reaction according to claim 4, characterized in that, The output of the smoothed state evaluation value at the current moment specifically includes: Retrieve the smooth state evaluation value stored from the previous moment and perform an incremental update with the comprehensive evaluation value at the current moment; The first value is obtained by multiplying the current comprehensive evaluation value by the incremental update forgetting coefficient, and the second value is obtained by multiplying the difference between the value 1 and the incremental update forgetting coefficient by the smooth state evaluation value retained in the previous sampling period. The first value and the second value are added together to obtain the smooth state evaluation value at the current time after the incremental state update.
6. The real-time intelligent analysis method for flocculation reaction according to claim 5, characterized in that, The import of the built-in finite state machine engine for state comparison specifically includes comparing a set decision dead zone with the smoothed state evaluation value, wherein: A target evaluation value is generated by combining the initial state variables of the reaction. A state machine decision dead zone with hysteresis characteristics is set along the target evaluation value. An upper recovery threshold and a lower trigger threshold are set as state decision boundary constraints, respectively. When the smooth state evaluation value is detected to be greater than or equal to the upper limit recovery threshold, or when the smooth state evaluation value is greater than or equal to the lower limit trigger threshold and less than the upper limit recovery threshold, it is determined that the current flocculation reaction is in the convergence interval. When the smooth state evaluation value is detected to be less than the lower limit trigger threshold, the current flocculation reaction is determined to be in an abnormal state.
7. The real-time intelligent analysis method for flocculation reaction according to claim 6, characterized in that, The step of extracting target records from the candidate working condition knowledge base and converting them into parameter adjustment strategies for distribution specifically includes extracting the target records based on similarity distance calculation and predicted evaluation value sorting, wherein: Assemble the current baseline feature vector and calculate the similarity distance value between the current baseline feature vector and the baseline feature vector of the historical records in the candidate working condition knowledge base. The historical records include the baseline feature vector, the bound working condition execution vector, and the historical result label. Historical records with similarity distance values less than a preset tolerance boundary threshold are filtered and aggregated into a set of matching candidate schemes; For the set of matching candidate schemes, the predicted evaluation value of the candidate record is calculated based on the distance penalty mechanism, combining the similarity distance value and the historical result label. The predicted evaluation values are sorted in descending order, the target record at the first position of the descending sequence is extracted, the bound working condition execution vector is obtained, and it is converted into the parameter adjustment strategy and issued.
8. The real-time intelligent analysis method for flocculation reaction according to claim 7, characterized in that, The step of calibrating the candidate operating condition knowledge base based on the archived data includes: The newly added archived data is parsed, wherein the feature calculation log records the intermediate derived variables consisting of the turbidity decrease rate, the comprehensive evaluation value, and the smoothness state evaluation value; Raw water feature parameters are extracted from the time-series detection data stream and assembled into a new background feature vector. The extracted parameter adjustment strategy vector is mapped to a new working condition execution vector. The final state recorded in the log is converted into a result label based on the feature calculation. The new background feature vector, the new working condition execution vector, and the result label are added to the old version of the knowledge base set before the update, and the updated candidate working condition knowledge base is calculated.
9. A real-time intelligent analysis system for flocculation reaction, used to execute the real-time intelligent analysis method for flocculation reaction according to any one of claims 1-8, characterized in that, include: The parameter acquisition and data detection module acquires the basic operating parameters of the current flocculation reaction and structures them into an operating parameter set. Based on the operating parameter set, it acquires various water quality physicochemical indicators and constructs a time-series detection data stream. The feature analysis and evaluation calculation module receives the time-series detection data stream, extracts the corresponding dynamic feature quantities, performs weighted calculation to obtain a comprehensive evaluation value, retrieves the previous time-retained value and merges it with the comprehensive evaluation value to perform incremental update calculation, and outputs the smooth state evaluation value at the current time. The analysis and intelligent recommendation module receives the smooth state evaluation value, imports it into the built-in finite state machine engine for comparison and state judgment, and issues a suspension command when it determines that the current flocculation reaction is in the convergence range, and extracts the target record from the candidate working condition knowledge base and converts it into a parameter adjustment strategy for distribution when it determines that the current flocculation reaction is in an abnormal state. The result output and storage archiving module encapsulates the smooth state evaluation value and the parameter adjustment strategy into a comprehensive output message frame, assembles the core parameters into archived data and transfers it into a persistent database, and performs calibration of the calculation model based on the archived data.
10. A storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the real-time intelligent analysis method for flocculation reaction as described in any one of claims 1 to 8.