Industrial control security-oriented sewage treatment edge intelligent decision control system
By deploying edge agents on embedded terminals for wastewater treatment and utilizing lightweight language models and mechanism formula libraries for real-time control, the problem of time-consuming and ineffective wastewater treatment control has been solved, thereby improving the stability of effluent quality and resource efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING UNIV
- Filing Date
- 2026-03-10
- Publication Date
- 2026-06-05
AI Technical Summary
Existing wastewater treatment and control methods are time-consuming and have poor control effects, making it difficult to guarantee the stability of effluent quality.
An edge agent deployed on an embedded terminal for wastewater treatment is used. A lightweight language model based on the Transformer architecture, trained by knowledge distillation, is used to acquire wastewater treatment data and generate control commands through a data acquisition module. The execution module executes the commands to achieve the wastewater treatment goals, and real-time regulation is achieved by combining a mechanism formula library.
It achieves real-time and effective control of wastewater treatment, ensures the stability of effluent quality, reduces resource consumption, and improves control efficiency.
Smart Images

Figure CN122151699A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of wastewater treatment technology, and in particular to an edge intelligent decision control system for wastewater treatment oriented towards industrial control security. Background Technology
[0002] Wastewater treatment refers to the process of altering the physical, chemical, and biological characteristics of wastewater through a series of physical, chemical, or biological means to make it meet specific uses or discharge standards.
[0003] To ensure the stability of effluent quality from wastewater treatment, real-time control is required during the treatment process. Existing technologies often use predetermined rules or manual methods to obtain control commands for wastewater treatment, and then use these commands to control the process. However, these control methods suffer from drawbacks such as long processing times and poor control effectiveness, thus compromising the stability of the effluent quality. Summary of the Invention
[0004] This invention proposes an edge intelligent decision control system for wastewater treatment oriented towards industrial control security. It directly uses an edge intelligent agent deployed on an embedded terminal of the wastewater treatment plant to infer control commands for regulating wastewater treatment based on wastewater treatment data and wastewater treatment targets. The above process does not require human intervention, is real-time, and can also ensure the control effect, thereby ensuring the stability of the effluent quality of the wastewater treatment plant.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: This invention provides an edge intelligent decision-making control system for wastewater treatment aimed at industrial control security, comprising a data acquisition module, an edge agent, and an execution module. The data acquisition module acquires wastewater treatment data. The edge agent determines control commands based on the wastewater treatment data and the wastewater treatment objective; wherein the edge agent includes a control command generation model, which is a lightweight language model based on the Transformer architecture trained using knowledge distillation; the edge agent is deployed on an embedded terminal for wastewater treatment. The execution module executes the control commands to achieve the wastewater treatment objective.
[0006] In one implementation, the training process of the control command generation model includes the following steps 1 to 4. Step 1: Fine-tune the teacher model to enable it to have water quality control reasoning ability. The teacher model is a large language model based on the Transformer architecture. Water quality control reasoning ability refers to the ability to deduce control commands to achieve wastewater treatment goals based on wastewater treatment data and wastewater treatment objectives. Step 2: Construct a supervised fine-tuning dataset based on the fine-tuned teacher model. The supervised fine-tuning dataset includes the reasoning process of the fine-tuned teacher model inferring control commands to achieve wastewater treatment goals based on wastewater treatment data and wastewater treatment objectives. Step 3: Use the supervised fine-tuning dataset to perform supervised fine-tuning on the student model to obtain a supervised fine-tuned student model. The student model is a lightweight language model based on the Transformer architecture. The supervised fine-tuned student model has water quality control reasoning ability. Step 4: Prune and quantize neurons in the supervised fine-tuned student model that are unrelated to water quality control reasoning ability to obtain the control command generation model.
[0007] In one implementation, determining control commands based on wastewater treatment data and wastewater treatment objectives includes: acquiring the wastewater treatment objective; generating prompts based on the wastewater treatment data, wastewater treatment objective, and control commands; using a control command generation model to reason about the wastewater treatment data and wastewater treatment objective to obtain the operating condition type required to achieve the wastewater treatment objective; and calling the mechanism formulas / rules related to the operating condition type from the mechanism formula library to obtain and output the control commands; the control command generation prompts are used to guide the control command generation model to output control commands.
[0008] In one implementation, the operating conditions include toxic shock, adsorption saturation trend, membrane fouling risk, and insufficient dissolved oxygen. The mechanism formula library includes mechanism models / rules related to the operating conditions.
[0009] In one implementation, the system further includes a target distribution module. This module is used to distribute wastewater treatment targets.
[0010] In one implementation, the wastewater treatment objective is to improve the stability of effluent quality or to enter an energy-saving mode. Wastewater treatment data includes process parameters, equipment status, and water quality data. Control commands include process parameter adjustment commands and equipment control commands.
[0011] Compared with the prior art, the present invention has the following beneficial effects.
[0012] This invention provides an edge intelligent decision-making control system for wastewater treatment aimed at industrial control security. After acquiring wastewater treatment data through a data acquisition module, the edge agent analyzes and infers control commands based on the wastewater treatment data and the wastewater treatment target. The execution module then executes the control commands to achieve the wastewater treatment target. In this process, because the control command generation model in the edge agent deployed on the embedded terminal of the wastewater treatment system is a lightweight language model based on the Transformer architecture trained using knowledge distillation, this model not only learns the reasoning ability for control commands through knowledge distillation but also has advantages such as low resource consumption, rapid response, and strong real-time performance. This ensures the control effect of wastewater treatment and, consequently, the stability of the effluent quality. Attached Figure Description
[0013] Figure 1 This is one of the schematic diagrams of an edge intelligent decision control system for wastewater treatment aimed at industrial control security provided in this application embodiment; Figure 2 This is the second schematic diagram of a wastewater treatment edge intelligent decision control system for industrial control security provided in this application embodiment; Figure 3 This is a schematic diagram of the workflow of the edge agent provided in the embodiments of this application; Figure 4 This is a schematic diagram of the training process of the control instruction generation model provided in the embodiments of this application; Figure 5 This is the third schematic diagram of a wastewater treatment edge intelligent decision control system for industrial control security provided in this application embodiment. Detailed Implementation
[0014] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0015] In the description of this invention, unless otherwise stated, "multiple sets" means two or more sets. For example, multiple sets of wastewater treatment control data refers to two or more sets of wastewater treatment control data.
[0016] The methods and apparatus provided in this application relate to wastewater treatment and can be used to regulate the wastewater treatment process to ensure the stability of the effluent quality.
[0017] To address the shortcomings of existing wastewater treatment control methods in the background art, such as long processing time and poor control effect, which leads to the inability to guarantee the stability of effluent quality, this application provides an edge intelligent decision control system for wastewater treatment aimed at industrial control security. This system directly uses an edge intelligent agent deployed on an embedded terminal of the wastewater treatment plant to infer control commands for wastewater treatment based on wastewater treatment data and targets. The above process requires no human intervention, is real-time, and can guarantee the control effect, thereby ensuring the stability of effluent quality.
[0018] For example, such as Figure 1 As shown in the figure, an edge intelligent decision control system for wastewater treatment oriented towards industrial control security is provided in this application embodiment, including a data acquisition module, an edge intelligent agent, and an execution module.
[0019] The aforementioned data acquisition module is used to acquire wastewater treatment data.
[0020] Optionally, the aforementioned wastewater treatment data may include process parameters, equipment status, and water quality data. The process parameters may include rotary disc rotation speed, aeration blower frequency, reflux ratio, influent flow rate, transmembrane pressure differential (TMP), dissolved oxygen setpoint, and dosing dosage setpoint. The equipment status may include pump start / stop status, blower start / stop status, valve opening / closing status, regeneration dosing system operation status, PLC interlock status, and equipment fault alarm status. The water quality data may include ammonia nitrogen concentration, nitrate nitrogen concentration, total nitrogen concentration, influent toxicity, effluent toxicity, dissolved oxygen (DO), pH value, conductivity, and turbidity. For example, wastewater treatment data related to rotary discs in wastewater treatment may include ammonia nitrogen, nitrate nitrogen, total influent toxicity, rotary disc effluent toxicity, current rotation speed, pump status, and regeneration dosing system status. Wastewater treatment data related to MBR (membrane bioreactor) may include transmembrane pressure differential, dissolved oxygen, effluent / reflux status, blower status, and pump status. The aforementioned wastewater treatment data can be acquired through a sensor network deployed at each stage of wastewater treatment, or through other means. This application embodiment does not limit the acquisition method of the aforementioned wastewater treatment data.
[0021] The aforementioned edge agent is used to determine control commands based on wastewater treatment data and wastewater treatment objectives.
[0022] Understandably, the aforementioned edge intelligence agent is deployed on an embedded terminal for wastewater treatment. This embedded terminal can be a terminal specifically designed to carry the edge intelligence agent (e.g., a lightweight AI development motherboard like Orange Pie), or it can be a terminal commonly used for controlling wastewater treatment. This application embodiment does not limit the type of the embedded terminal. The wastewater treatment objective can be to improve the stability of the effluent quality or to enter an energy-saving mode. This application embodiment does not limit the specific content of the aforementioned wastewater treatment objective.
[0023] The aforementioned edge agent includes a control instruction generation model, which is a lightweight language model based on the Transformer architecture, trained using knowledge distillation. These control instructions can include process parameter adjustment instructions and equipment control instructions, and are in machine language form, such as PLC timing action instructions.
[0024] Optionally, such as Figure 2 and Figure 3 As shown, the control instructions determined above based on wastewater treatment data and wastewater treatment objectives include S101-S102.
[0025] S101. Obtain wastewater treatment objectives; S102. Generate prompt words based on wastewater treatment data, wastewater treatment targets, and control commands. Use the control command generation model to reason about the wastewater treatment data and wastewater treatment targets to obtain the operating condition type that needs to be adjusted to achieve the wastewater treatment targets. Then, call the mechanism formulas / rules related to the operating condition type in the mechanism formula library to obtain and output the control commands.
[0026] The aforementioned control command generation prompts are used to guide the control command generation model to output control commands. For example, the specific content of the aforementioned control command generation prompts is shown below.
[0027] For example, the control command generation prompt may include the following: "You are a wastewater treatment process control expert. Please make operational condition judgments and control decisions based on the following input data:" Current wastewater treatment data: {process parameters, equipment status, water quality data} Current wastewater treatment goals: {e.g., improving effluent quality stability / entering energy-saving mode} Known and identifiable operating conditions include: toxic shock, adsorption saturation trend, membrane fouling risk, and insufficient dissolved oxygen.
[0028] Please follow these steps: (1) Analyze whether there are any abnormal trends in the current data; (2) Determine the type of operating condition; (3) Invoke the corresponding mechanism rule category; (4) Output structured control decision results, including: Determine the type of operating condition; Call the rule name; It is recommended to control the type of action (speed adjustment / start / stop / switch / drug administration). Specifically, wastewater treatment data, wastewater treatment targets, and control command generation prompts are input into the control command generation model. Guided by the control command generation prompts, the control command generation model infers from the wastewater treatment data and wastewater treatment targets to obtain the operating condition type that needs to be adjusted to achieve the wastewater treatment targets. It then calls the mechanism formulas / rules related to the operating condition type from the mechanism formula library to obtain and output the control commands.
[0029] Optionally, the aforementioned operating conditions may include toxic shocks, adsorption saturation trends, membrane fouling risks, and insufficient dissolved oxygen. The aforementioned mechanism formula library may include mechanism models / rules related to the operating condition type.
[0030] In one application scenario of S102 above, after inputting wastewater treatment data, wastewater treatment targets, and control command generation prompts into the control command generation model, the control command generation model analyzes the wastewater treatment data to obtain abnormal situations existing in the wastewater treatment process (such as continuous increase of ammonia nitrogen, abnormal effluent toxicity, increase of transmembrane pressure difference and / or low dissolved oxygen, etc.), it infers the operating condition type required to achieve the wastewater treatment target based on the abnormal situation and the wastewater treatment target, and calls the mechanism formulas / rules related to the operating condition type in the mechanism formula library to obtain the control command in text form, and then converts the text control command into control command in machine language form.
[0031] Specifically, when the abnormality is a continuous increase in ammonia nitrogen, rules related to nitrification status criteria / treatment capacity assessment in the mechanism formula library can be invoked to determine whether the rotary table speed needs to be adjusted. When the abnormality is abnormal influent and effluent toxicity, toxicity shock criteria rules in the mechanism formula library can be invoked to provide the shock level and protection strategy direction. When the abnormality is a continuous increase in transmembrane pressure differential, rules related to transmembrane pressure differential risk criteria / increased trend assessment in the mechanism formula library can be invoked to determine whether to switch back from the effluent or take shutdown protection measures. When the abnormality is excessively low dissolved oxygen, rules related to dissolved oxygen qualification criteria in the mechanism formula library can be invoked to determine the start / stop of the blower. In addition, when the abnormality is persistently high effluent toxicity and exhibits breakthrough characteristics, adsorption saturation criteria in the mechanism formula library can be invoked to determine whether to initiate the regeneration dosing process.
[0032] The construction process of the above mechanism formula library is given below.
[0033] 1) List observable and controllable quantities. Observable measurements (corresponding water quality data): ammonia nitrogen, nitrate nitrogen, influent toxicity, effluent toxicity (and TMP, DO of MBR), etc.
[0034] Controllable quantities (corresponding to equipment status): rotary table speed, pump start / stop, regeneration dosing start / stop / dosing amount (if adjustable), MBR effluent / recirculation switching, blower start / stop, etc.
[0035] 2) Solidify commonly used engineering calculations / criteria into function entries. Function entries include: input variables, judgment thresholds or calculation formulas, output results, and triggerable action types (speed / start / stop / switch / drug dosing).
[0036] 3) Thresholds and parameters are calibrated using historical field data. For example: toxicity alarm threshold, TMP alarm threshold, upper and lower limits of turntable speed, regeneration trigger conditions, etc.
[0037] 4) Unify the function interface for easy calling. 5) Match the mechanism formulas / rules with the operating condition types. A. Rotary disc system (including adsorption saturation → regeneration and dosing) High / increasing ammonia nitrogen levels → Invoke "Nitrification Limitation Criterion / Ammonia Nitrogen Removal Requirement Calculation"; Purpose: To determine whether it is necessary to increase the rotation speed (enhanced treatment).
[0038] Increased toxicity in influent or effluent → Invoke the "Toxicity Shock Criterion". Output the toxicity level and trigger protective actions (e.g., limit influent pump / stop pump protection, or enter conservative operation).
[0039] Adsorption saturation determination is met → "Adsorption saturation criterion + regeneration dosing calculation / control rules" are invoked.
[0040] The trigger signal can be, for example, "under conditions where the rotation speed and influent toxicity are similar, the effluent toxicity continues to increase or the influent and effluent toxicities continue to increase to the threshold," which is considered adsorption saturation. Action: Trigger the start and stop of the regeneration dosing system (and the dosing duration / dosing amount, if adjustable), and may be accompanied by "rotary disc rotation speed strategy / pump start and stop strategy during regeneration".
[0041] B.MBR system TMP rises or exceeds limits → invokes "TMP Risk Criterion / Rise Rate Calculation"; Action: outputs a suggestion to "cut backflow / suspend water output (or stop pump protection)".
[0042] DO is below the lower limit → invoke "DO qualification criterion"; Action: fan start / stop control.
[0043] When switching between effluent and reflux is required, call the "Switch Feasibility Verification Rule". Purpose: To avoid switching to an inappropriate mode when TMP is high-risk or DO is not up to standard (output allow / reject and reason).
[0044] As can be seen from the above, the aforementioned edge intelligence agent overcomes the shortcomings of existing language models that are prone to producing illusions (resulting in low reliability of calculated values), and uses deterministic mechanism formulas / rules to ensure the accuracy of industrial control, thus achieving a combination of AI flexibility and engineering rigor.
[0045] In one implementation, such as Figure 4 As shown, the training process of the above control command generation model includes the following steps 1 to 4.
[0046] Step 1: Fine-tune the teacher model so that it has the ability to reason about water quality control.
[0047] The aforementioned teacher model is a large language model based on the Transformer architecture, i.e., a pre-trained model with specific language understanding capabilities. For example, the aforementioned large language model based on the Transformer architecture can be a GPT series model, an LLaMA series model, a BERT series model, a GLM series model, an ERNIE series model, or other pre-trained language models with general language understanding and reasoning capabilities, but is not limited to the above models. Since the Transformer architecture is a commonly used framework in the field of artificial intelligence, this application embodiment will not further describe the specific structure of the aforementioned Transformer architecture.
[0048] In one application scenario, the process of fine-tuning the above teacher model is as follows.
[0049] Step 1.1: Obtain multiple sets of wastewater treatment control data.
[0050] Each set of wastewater treatment control data mentioned above includes wastewater treatment data corresponding to a specific historical moment, a mechanistic model, wastewater treatment objectives, and control commands. The aforementioned mechanistic model is used to illustrate the process mechanism of wastewater treatment.
[0051] Step 1.2: Fine-tune the teacher model using multiple sets of wastewater treatment control data so that the teacher model can infer control decisions consistent with the control instructions in the multiple sets of wastewater treatment control data based on the wastewater treatment data and wastewater treatment objectives in the multiple sets of wastewater treatment control data.
[0052] The aforementioned water quality control reasoning ability refers to the ability to deduce control instructions to achieve wastewater treatment objectives based on wastewater treatment data, mechanistic models, and wastewater treatment targets. Specifically, for each set of wastewater treatment control data, the wastewater treatment data, mechanistic model, wastewater treatment targets, and control instruction generation prompts are input into the teacher model. Guided by the control instruction generation prompts, the teacher model outputs a control decision. The control decision is then compared with the control instructions in the set of wastewater treatment control data. Based on the comparison results, the instruction generation prompts are adjusted. The adjusted instruction generation prompts, wastewater treatment data, mechanistic model, and wastewater treatment targets are then input into the teacher model again, until the teacher model can deduce a control decision consistent with the control instructions in the multiple sets of wastewater treatment control data based on the wastewater treatment data and wastewater treatment targets. Thus, the fine-tuned teacher model is obtained. Since the fine-tuned teacher model can output control decisions consistent with the control commands, it can be considered that the fine-tuned teacher model has water quality control reasoning ability, has mastered expert-level knowledge such as the process mechanism of sewage treatment, fault evolution law, and parameter coupling relationship, and has formed decision-making logic for complex process problems.
[0053] Step 2: Construct a supervised fine-tuning dataset based on the fine-tuned teacher model.
[0054] The aforementioned supervised fine-tuning dataset includes the reasoning process by which the fine-tuned teacher model infers control instructions to achieve wastewater treatment objectives based on wastewater treatment data and objectives.
[0055] Specifically, the construction process of the aforementioned supervised fine-tuning dataset is as follows: For each set of wastewater treatment control data from multiple sets of wastewater treatment control data, the wastewater treatment data, mechanistic model, wastewater treatment target, and prompts generated from the first inference process are input into the fine-tuned teacher model. Guided by the prompts generated from the first inference process, the fine-tuned teacher model outputs a reasoning process that infers the control decision to achieve the wastewater treatment target based on the wastewater treatment data, mechanistic model, and wastewater treatment target. Then, the wastewater treatment data, wastewater treatment target, reasoning process, and control decision are treated as a set of supervised fine-tuning data to construct a supervised fine-tuning dataset containing multiple sets of supervised fine-tuning data. It can be understood that the prompts generated from the first inference process are used to guide the fine-tuned teacher model to output a reasoning process that infers the control decision to achieve the wastewater treatment target based on the wastewater treatment data and wastewater treatment target.
[0056] Step 3: Use the supervised fine-tuning dataset to perform supervised fine-tuning on the student model to obtain the supervised fine-tuned student model.
[0057] The aforementioned student model is a lightweight language model based on the Transformer architecture, i.e., a pre-trained model with language understanding capabilities. This lightweight language model based on the Transformer architecture can be a DistilBERT model, a TinyBERT model, a MobileBERT model, a lightweight version of the LLaMA model, a lightweight version of the Qwen model, or other pre-trained language models with a smaller parameter size than the teacher model and suitable for edge deployment. This application embodiment does not limit this specific model.
[0058] The student model after the above-mentioned supervised fine-tuning possesses water quality control reasoning capabilities. In one embodiment, the process of supervising the student model using the supervised fine-tuning dataset includes: for each set of supervised fine-tuning data contained in the supervised fine-tuning dataset, the wastewater treatment data, wastewater treatment target, and first reasoning process generation prompts in that set of supervised fine-tuning data are input into the student model. Guided by the second reasoning process generation prompts, the student model reasones about the wastewater treatment data and wastewater treatment target to obtain the operating condition type required to achieve the wastewater treatment target, and calls the mechanism formulas / rules related to the operating condition type from the mechanism formula library to obtain control instructions, and outputs the above-mentioned reasoning process and control instructions. The above-mentioned reasoning process and control instructions are compared with the reasoning process and control decisions in that set of supervised fine-tuning data, and the second reasoning process generation prompts are adjusted based on the comparison results. The adjusted second reasoning process generation prompts, wastewater treatment data, and wastewater treatment target are then input into the student model until the reasoning process and control instructions output by the student model are consistent with the reasoning process and control decisions in that set of supervised fine-tuning data. Thus, the supervised fine-tuned student model is obtained. Since the supervised fine-tuned student model can output results consistent with the reasoning process and control decisions in the supervised fine-tuned dataset, it can be considered that the supervised fine-tuned student model has water quality control reasoning ability.
[0059] Understandably, the prompt words generated in the second reasoning process above are used to guide the student model to output the operating condition type that needs to be adjusted to achieve the wastewater treatment target based on reasoning from the wastewater treatment data and wastewater treatment target. The model then calls the mechanism formulas / rules related to the operating condition type in the mechanism formula library to obtain the control instructions and outputs the above reasoning process and the above control instructions.
[0060] Alternatively, a wastewater treatment corpus (including process mechanisms, failure cases, and expert operation logs) can be used to supervise and fine-tune the student model, correcting its output and enabling the model to shift from general dialogue to precise industry-specific decision-making.
[0061] It should be noted that the student model requires less storage space and computing resources than the teacher model. Therefore, the supervised fine-tuning student model not only has the same water quality control reasoning ability as the fine-tuned teacher model, but also requires less storage space and computing resources, thus making it suitable for environments with more demanding storage space and computing resources.
[0062] Step 4: Prune and quantize the neurons in the supervised fine-tuned student model that are not related to water quality control reasoning ability to obtain the control command generation model.
[0063] In one implementation, the process of pruning and quantizing neurons in the supervised fine-tuned student model that are unrelated to water quality control reasoning ability includes: removing neurons in the supervised fine-tuned student model that do not contribute to water quality control reasoning ability using model pruning, obtaining a control instruction generation model using INT8 quantization, and then deploying the control instruction generation model in the NPU (Neural Processing Unit) of the embedded terminal. Since the above pruning and quantization are common techniques in this technical field, the specific implementation process of the above pruning and quantization will not be described in detail in this application embodiment.
[0064] In one embodiment of the above implementation, the supervised fine-tuned student model is quantized using 8-bit or 4-bit methods to obtain a control instruction generation model. This model is then deployed on an embedded terminal (such as an ARM industrial computer or an edge device with an NPU), and the output actions are converted into write instructions executable by the PLC. To ensure industrial control safety, the edge agent can perform the following processing on the control instructions output by the control instruction generation model: boundary pruning: limiting outputs such as frequency, valve position, and reflux ratio within the allowable range of the equipment; interlock verification: verifying the legality of actions by combining PLC interlock bits and alarm bits (if not satisfied, execution is rejected or an alternative action is output); cycle time constraint: ensuring that inference and verification are completed within a single cycle and control suggestions are output. Through these steps, the control instruction generation model can still reproduce the decision-making logic of the teacher model in the wastewater treatment control scenario under low power consumption and low computing power conditions, thereby achieving real-time inference and control support for key process links.
[0065] For example, the above model pruning and quantization process can be based on the following four principles.
[0066] 1. Task Relevance Principle The core logic is to retain only neurons directly related to control command reasoning and remove redundant connections and neurons that do not contribute to task objectives such as "condition-operation" pairs, specialized mechanism models (e.g., ASM), and industry standards. For example, if some neurons in the model are designed for general natural language understanding (e.g., sentiment analysis, text summarization), but these functions are completely unnecessary in water treatment process decisions, they will be deemed redundant and removed.
[0067] 2. Weight Sensitivity Principle Core logic: By analyzing the absolute values of neuron connection weights, identify "low-weight connections" and "unactivated neurons" that have minimal impact on the model output. Operation method: Apply a threshold to the weight matrix; connections below the set threshold are pruned. Simultaneously, testing is conducted on a large amount of water treatment scenario data; neurons that have never been activated are also identified as redundant and removed.
[0068] 3. Principle of minimizing performance loss Core logic: During pruning, it is essential to ensure that key performance indicators such as inference accuracy and response speed on the target task do not significantly decrease. Operation method: An "iterative pruning + fine-tuning recovery" process is adopted. After each pruning, the model is tested on a water treatment-specific dataset. If the performance degradation exceeds an acceptable threshold (e.g., accuracy loss <2%), the pruning strategy is rolled back and adjusted to ensure that the pruned model still maintains near-expert-level process inference capabilities.
[0069] 4. Hardware compatibility principle Core logic: The pruned model structure must be adapted to the computational characteristics of the embedded terminal NPU (such as tensor operation efficiency and memory bandwidth limitations). Operation method: Prioritize pruning neurons and connections that cause memory fragmentation or cannot be efficiently parallelized by the NPU, allowing the model to achieve optimal inference speed and power consumption on edge hardware.
[0070] Therefore, it can be seen that the control instruction generation model, compared with the supervised fine-tuned student model, not only has the same water quality control reasoning ability, but also has lower requirements for storage space and computing resources, thus enabling it to be deployed in embedded terminals with relatively demanding storage space and computing resources.
[0071] The aforementioned execution module is used to execute control commands to achieve wastewater treatment objectives.
[0072] In one application scenario, after obtaining the control instructions in machine language form, the execution module first determines the executability of the control instructions based on the equipment operation constraints and interlock logic. If the control instructions are determined to be executable, the process parameters and equipment status of the wastewater treatment are adjusted through the control instructions to achieve the wastewater treatment goal; otherwise, the control instructions are not executed, and a clear reason for rejection or alternative suggestions is output.
[0073] Specifically, a dynamic state space table is maintained within the embedded terminal for wastewater treatment, synchronizing the register states of the PLC (Programmable Logic Controller) (such as pump operating status, fault bits, and interlock bits) in real time. For example, when the edge agent outputs a control command to achieve the wastewater treatment goal (entering energy-saving mode), the execution module decomposes it into a specific PLC action sequence. Subsequently, the execution module checks whether this action sequence will trigger the PLC's hard interlock protection (such as protection against frequent equipment start-stop). If the verification passes, it is written to the PLC via Modbus / TCP; if the verification fails, the agent generates a 'logic conflict report' and sends it back to the cloud, requesting a replanning.
[0074] The aforementioned dynamic state space table is a real-time data mirror between the edge agent and the field PLC. It is used to continuously synchronize and maintain the core operating state of the PLC, providing the underlying basis for instruction verification and action decomposition. The contents stored in the aforementioned dynamic state space table are shown below.
[0075] 1. Real-time status data of PLC registers Core basic data directly maps to the hardware and software status of the PLC.
[0076] • Input Register (DI / AI): Real-time feedback from field sensors and equipment; for example: the operating status of pumps / fans (running / stopped / faulty); current values of water quality parameters such as dissolved oxygen (DO), ammonia nitrogen, and pH; process parameters such as valve opening and motor frequency.
[0077] • Output Register (DO / AO): Status of the execution instructions currently issued by the PLC, such as the current frequency of the aeration tank blower; start / stop instructions for the sludge return pump.
[0078] • Intermediate registers (M) and flag bits: The internal logic state of the PLC, such as: equipment interlock flags (e.g., "fan failure → aeration prohibited"); fault alarm bits (e.g., "liquid level too high" "current over limit"); mode switching flags (e.g., "energy saving mode" "emergency mode").
[0079] 2. Equipment hardware interlock and protection rule base The table's "logic verification engine" stores the PLC's built-in hardware-level safety rules, used to check whether the action sequence is compliant, including: • Hard interlock rules: such as "two pumps in the same process section cannot be started at the same time" and "when the aeration blower stops, the electric valve must be closed in conjunction with the operation".
[0080] • Equipment protection rules: such as "the pump start-stop interval shall not be less than 300 seconds (to prevent frequent start-stop)" and "the motor current shall be triggered to stop protection when it exceeds 120% of the rated value".
[0081] • Process safety thresholds: such as “energy-saving mode is prohibited when dissolved oxygen is below 0.5 mg / L” and “emergency bypass is triggered when influent flow exceeds 150% of design value”.
[0082] 3. Instruction decomposition and action sequence caching The dynamic workspace is used to handle the parsing and verification of cloud commands.
[0083] • High-level instruction breakdown results: For example, "enter energy-saving mode" can be broken down into specific PLC action instructions such as "reduce aeration frequency to 30Hz" and "turn off standby pump".
[0084] • Action sequence to be verified: A list of actions arranged in execution order, waiting for the logic engine to check whether interlocks are triggered or protection rules are violated.
[0085] • Verification results and conflict records: Record the pass / fail status of each action and the reason for the conflict (such as "Action 2 triggers frequent pump start-stop protection"), which is used to generate a conflict report and send it back to the cloud.
[0086] 4. Timestamp and version synchronization information To ensure the real-time nature and consistency of the status, the table also includes: • Data update timestamp: The last synchronization time of each piece of status data, ensuring that the edge agent always makes decisions based on the latest PLC status.
[0087] • Version number: Used for state synchronization verification between the cloud and edge agents to prevent instructions from being executed based on expired states.
[0088] In some embodiments, combined with Figure 2 ,like Figure 5 As shown, the system also includes a target distribution module.
[0089] The target distribution module is used to distribute wastewater treatment targets.
[0090] In one embodiment of the above embodiments, the target distribution module is deployed on a cloud server, and the wastewater treatment target is distributed through the cloud server.
[0091] In summary, the wastewater treatment edge intelligent decision control system for industrial control security provided in this application involves an edge agent acquiring wastewater treatment data through a data acquisition module, then analyzing and reasoning based on the wastewater treatment data and the wastewater treatment target to obtain control commands. The execution module then executes these control commands to achieve the wastewater treatment target. In this process, the control command generation model in the edge agent deployed on the embedded terminal of the wastewater treatment system is a lightweight language model based on the Transformer architecture, trained using knowledge distillation. This allows the control command generation model to not only learn the reasoning ability for control commands through knowledge distillation but also to have advantages such as low resource consumption, rapid response, and strong real-time performance. This ensures the control effect of wastewater treatment and, consequently, the stability of the effluent quality.
[0092] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A wastewater treatment edge intelligent decision control system for industrial control security, characterized in that, It includes a data acquisition module, an edge agent, and an execution module; The data acquisition module is used to acquire wastewater treatment data; The edge agent is used to determine control commands based on the wastewater treatment data and wastewater treatment objectives; wherein, the edge agent includes a control command generation model, which is a lightweight language model based on the Transformer architecture trained by knowledge distillation; the edge agent is deployed on an embedded terminal for wastewater treatment. The execution module is used to execute the control instructions to achieve the wastewater treatment objective.
2. The system as described in claim 1, characterized in that, The training process of the control command generation model includes the following steps 1 to 4; Step 1: Fine-tune the teacher model to enable it to have water quality control reasoning capabilities; the teacher model is a large language model based on the Transformer architecture; the water quality control reasoning capability refers to the ability to deduce control instructions to achieve the wastewater treatment goals based on wastewater treatment data and wastewater treatment objectives. Step 2: Construct a supervised fine-tuning dataset based on the fine-tuned teacher model; the supervised fine-tuning dataset includes the reasoning process of the fine-tuned teacher model inferring control instructions to achieve the wastewater treatment objectives based on wastewater treatment data and wastewater treatment objectives; Step 3: Use the supervised fine-tuning dataset to perform supervised fine-tuning on the student model to obtain the supervised fine-tuned student model; the student model is a lightweight language model based on the Transformer architecture; the supervised fine-tuned student model has water quality control inference capabilities; Step 4: Prune and quantize the neurons in the supervised fine-tuned student model that are not related to water quality control reasoning ability to obtain the control command generation model.
3. The system as described in claim 1 or 2, characterized in that, The step of determining control commands based on the wastewater treatment data and wastewater treatment targets includes: Obtain wastewater treatment targets; Based on the wastewater treatment data, the wastewater treatment target, and the control command, a prompt word is generated. The control command generation model is used to reason about the wastewater treatment data and the wastewater treatment target to obtain the operating condition type that needs to be adjusted to achieve the wastewater treatment target. The control command is then obtained and output by calling the mechanism formula / rule related to the operating condition type in the mechanism formula library. The control command generation prompt word is used to guide the control command generation model to output the control command.
4. The system as described in claim 3, characterized in that, The operating conditions include toxic shock, adsorption saturation trend, membrane fouling risk, and insufficient dissolved oxygen. The mechanism formula library includes mechanism models / rules related to operating condition types.
5. The system as described in claim 1, characterized in that, The system also includes a target distribution module; The target distribution module is used to distribute wastewater treatment targets.
6. The system as described in claim 1, characterized in that, The goal of the wastewater treatment is to improve the stability of the effluent quality or to enter an energy-saving mode. The wastewater treatment data includes process parameters, equipment status, and water quality data. The control commands include process parameter adjustment commands and equipment control commands.