A closed-loop optimization control method and system for water production and regeneration based on dual-tank softening

CN122568944APending Publication Date: 2026-08-14HUITAI (TIANJIN) ENVIRONMENTAL PROTECTION EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-20
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0005]为了克服上述缺陷,提出了本发明,以提供解决或至少部分地解决现有技术数据采集的不全面和计算方法的简单粗放,导致对制水罐运行状态的判断不够精准,容易出现误判和决策失误

Benefits of technology

在实施本发明的技术方案中,闭环数据驱动控制通过实时监测和优化再生参数,实现双罐连续制水、水质稳定、废液回用高效化及制水与再生流程自动协调管理,提高系统可靠性和资源利用效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122568944A_ABST
    Figure CN122568944A_ABST
Patent Text Reader

Abstract

This application discloses a closed-loop optimization control method and system for water production and regeneration based on dual-tank softening, belonging to the field of water treatment technology. The method includes: real-time acquisition of raw water flow rate, hardness, and sodium ion concentration data from the first water production tank; calculation of the sodium ion concentration in the outlet water based on the softening state; determination of bed saturation state based on concentration and saturation threshold, generating a regeneration trigger judgment; acquisition of the bed state in the second water production tank during regeneration triggering; calculation of dual-tank switching and water supply connection; control of water production in the second water production tank; instruction to the first water production tank to prepare for regeneration; calculation of regenerated liquid flow rate and concentration adjustment and control of brine injection; prediction of bed ion migration to generate optimized regeneration parameters; execution of regeneration control; acquisition of the real-time state of the second water production tank; optimization of dual-tank circulation and wastewater reuse, forming a closed-loop control. This solution achieves continuous water production from two tanks, stable water quality, efficient wastewater reuse, and automatic coordinated management of the water production and regeneration processes, improving system reliability and resource utilization efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of water treatment technology, specifically relating to a closed-loop optimization control method and system for water production and regeneration based on dual-tank softening. Background Technology

[0002] In the industrial and domestic water treatment sectors, to ensure stable water quality and meet diverse water demands, precise control and dynamic regulation of the water treatment tank's operation are essential. Especially in the water softening process, it's crucial not only to ensure the effluent water meets specific sodium ion concentration standards but also to achieve efficient regeneration and recycling of the water treatment tank to maintain a continuous and stable water output and optimize resource utilization. This drives the industry to continuously explore advanced data-driven control technologies.

[0003] The existing water treatment system, during operation, focuses only on raw water flow rate and hardness during data acquisition, neglecting to monitor raw water sodium ion concentration. When calculating softening status, it relies on simple empirical formulas, estimating the sodium ion concentration in the outlet water solely based on raw water flow rate and hardness, resulting in significant errors. Determining bed saturation involves setting a single threshold and triggering regeneration by simply comparing estimated values, without a thorough assessment of the actual bed condition. During dual-tank switching, the system determines water supply and regeneration preparation based on timed rules or a single pressure signal, completely disregarding the actual operating conditions of both tanks. Regeneration parameters are calculated rigidly, determining the regenerated liquid flow rate based on preset initial brine concentration and a simple flow rate formula, without considering brine consumption and dynamic changes in the bed. Dual-tank circulation and wastewater reuse control rely entirely on manual experience to set fixed circulation times and reuse ratios, without flexible adjustments based on real-time water treatment status.

[0004] However, the incomplete data collection and simplistic calculation methods of existing technologies lead to inaccurate judgments of the water treatment tank's operating status, easily resulting in misjudgments and decision-making errors. The fixed patterns of dual-tank switching and regeneration parameter calculations make the system difficult to adapt to dynamic changes in actual operation, reducing water treatment efficiency and regeneration effects. Manually experienced-based circulation and reuse control methods cannot achieve optimal resource allocation, resulting in some resource waste. Summary of the Invention

[0005] To overcome the aforementioned shortcomings, this invention is proposed to address, or at least partially address, the incomplete data collection and simplistic calculation methods in existing technologies, which lead to inaccurate judgments of the water tank's operating status and are prone to misjudgments and decision-making errors. The fixed mode of dual-tank switching and regeneration parameter calculation makes the system difficult to adapt to dynamic changes in actual operation, reducing water production efficiency and regeneration effect. The manually experienced-based cycle and reuse control methods cannot achieve optimal resource allocation, resulting in a certain degree of resource waste.

[0006] In a first aspect, the present invention provides a closed-loop optimization control method for water production and regeneration based on dual-tank softening, the method comprising: Real-time data on raw water flow rate, raw water hardness, and raw water sodium ion concentration are acquired from the first water treatment tank. Based on these data, the softening state is calculated to obtain the sodium ion concentration data of the outlet water from the first water treatment tank. Based on the sodium ion concentration data of the outlet water and the preset saturation threshold data, the saturation state of the bed is determined, and the regeneration trigger judgment data of the first water treatment tank is obtained; If the regeneration trigger judgment data reaches the preset regeneration conditions, the bed status data of the second water production tank is obtained. Based on the regeneration trigger judgment data and the bed status data, the dual-tank switching calculation is performed to obtain the water supply data of the second water production tank and the regeneration preparation data of the first water production tank. Based on the water supply data, the second water production tank is controlled to start water production, and the first water production tank is instructed to enter the regeneration preparation state. Based on the prepared regeneration data and the preset initial brine concentration data, the regeneration parameters of the first water production tank bed are calculated to obtain the regeneration liquid flow rate data and regeneration liquid concentration adjustment data of the first water production tank. Based on the regeneration liquid flow rate data and regeneration liquid concentration adjustment data, the brine injection and circulation flow rates of the first water production tank bed are controlled. Based on the regenerated liquid flow rate data, regenerated liquid concentration adjustment data, and bed ion migration kinetic model, prediction calculations were performed to obtain optimized control data for the regeneration parameters of the first water production tank, and regeneration control of the first water production tank was carried out based on the optimized control data for the regeneration parameters. The system acquires real-time water production status data from the second water production tank. Based on the regeneration parameter optimization control data and the real-time water production status data, it performs dual-tank circulation and waste liquid reuse control calculations to obtain continuous water output status data and waste liquid resource optimization data. Based on the continuous water output status data and waste liquid resource optimization data, it performs water production and regeneration parameter optimization calculations for the next cycle, forming a closed-loop data-driven control.

[0007] In a second aspect, the present invention provides a closed-loop optimized control system for water production and regeneration based on dual-tank softening, the system comprising: The raw water monitoring module acquires real-time data on raw water flow rate, hardness, and sodium ion concentration from the first water treatment tank. Based on these data, it calculates the softening state and obtains the sodium ion concentration data of the outlet water from the first water treatment tank. The saturation judgment module is used to judge the saturation state of the bed based on the sodium ion concentration data of the outlet water and the preset saturation threshold data, and to obtain the regeneration trigger judgment data of the first water production tank; The dual-tank switching module is used to obtain the bed status data of the second water production tank if the regeneration trigger judgment data reaches the preset regeneration conditions, perform dual-tank switching calculations based on the regeneration trigger judgment data and the bed status data, obtain the water supply data of the second water production tank and the regeneration preparation data of the first water production tank, and control the second water production tank to start water production based on the water supply data, while instructing the first water production tank to enter the regeneration preparation state; The regeneration parameter determination module is used to calculate the regeneration parameters of the first water production tank bed based on the prepared regeneration data and the preset initial concentration data of the brine solution, to obtain the regeneration liquid flow rate data and regeneration liquid concentration adjustment data of the first water production tank, and to control the brine injection and circulation flow rate of the first water production tank bed based on the regeneration liquid flow rate data and regeneration liquid concentration adjustment data; The optimization prediction module is used to perform prediction calculations based on regenerated liquid flow rate data, regenerated liquid concentration adjustment data, and bed ion migration kinetics model to obtain optimized control data for the regeneration parameters of the first water production tank, and to perform regeneration control of the first water production tank based on the optimized control data for the regeneration parameters; The closed-loop control module is used to acquire real-time water production status data of the second water production tank, optimize control data based on regeneration parameters and real-time water production status data, perform dual-tank circulation and waste liquid reuse control calculations, obtain continuous water output status data and waste liquid resource optimization data, and perform water production and regeneration parameter optimization calculations for the next cycle based on continuous water output status data and waste liquid resource optimization data, forming a closed-loop data-driven control.

[0008] In a third aspect, an electronic device is provided, comprising a processor, a memory, and a program or instructions stored in the memory and executable on the processor, the program or instructions being loaded and run by the processor to perform the steps of the aforementioned closed-loop optimized control method for water production and regeneration based on dual-tank softening.

[0009] In a fourth aspect, a computer-readable storage medium is provided, wherein a plurality of program codes are stored therein, the program codes being adapted to be loaded and run by a processor to perform the steps of the above-described closed-loop optimized control method for water production and regeneration based on dual-tank softening.

[0010] The above-described technical solutions of the present invention have at least one or more of the following beneficial effects: In implementing the technical solution of this invention, closed-loop data-driven control achieves continuous water production in dual tanks, stable water quality, efficient waste liquid reuse, and automatic coordinated management of water production and regeneration processes by real-time monitoring and optimization of regeneration parameters, thereby improving system reliability and resource utilization efficiency. Attached Figure Description

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

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

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

[0014] See appendix Figure 1 , Figure 1 This is a schematic diagram of the first main steps of a closed-loop optimization control method for water production and regeneration based on dual-tank softening according to an embodiment of the present invention. Figure 1As shown, the closed-loop optimization control method for water production and regeneration based on dual-tank softening in this embodiment of the invention mainly includes the following steps S101-S106.

[0015] In this solution, if a multi-tank water production and regeneration application scenario is involved, the processing logic of this solution can be applied between every two tanks, so that the processing logic of this solution can also be used in multi-tank water production and regeneration application scenarios.

[0016] Step S101: Obtain the raw water flow rate data, raw water hardness data, and raw water sodium ion concentration data of the first water treatment tank. Based on the raw water flow rate data, raw water hardness data, and raw water sodium ion concentration data, calculate the softening state to obtain the sodium ion concentration data of the outlet water of the first water treatment tank.

[0017] The first water production tank is the first water production unit in the dual-tank continuous softening system. It is primarily responsible for treating the raw water entering the system and outputting qualified softened water. In the dual-tank alternating water production operation mode, the first water production tank undertakes the main water production work. When the bed in the tank reaches the conditions requiring regeneration, it can switch to standby mode, allowing sufficient preparation time for subsequent regeneration processes. The first water production tank may include at least two sub-tanks.

[0018] The raw water flow rate data reflects the instantaneous or periodic average volumetric flow rate of the raw water flowing into the first water treatment tank, and its function is to quantify the water load of the softening bed.

[0019] The raw water hardness data is a quantitative record of the total concentration of calcium and magnesium ions in the raw water entering the first water treatment tank, and is mainly used to assess the softening requirements of the raw water.

[0020] The raw water sodium ion concentration data records the specific concentration of sodium ions in the raw water entering the first water treatment tank, which is used to monitor the operating status of the ion exchange process in the bed in real time.

[0021] The sodium ion concentration data for the outlet water is the specific value of the sodium ion concentration in the water flowing out after the first water treatment tank has completed the softening treatment. Its core purpose is to evaluate the softening treatment effect.

[0022] Real-time acquisition of raw water flow data from the first water treatment tank requires the installation of a high-precision electromagnetic flow meter on the pipeline. When raw water flows through the sensor, utilizing Faraday's law of electromagnetic induction, the flowing liquid cuts the magnetic field and generates an induced electromotive force. The sensor converts this physical signal into a standard industrial electrical signal. Subsequently, the signal conversion circuit performs high-frequency sampling and time-integrated accumulation of this current, thereby accurately quantifying the water load experienced by the softening bed during its operating cycle, providing an accurate volumetric reference for subsequent calculations.

[0023] For collecting raw water hardness data, an online colorimetric analyzer is deployed in the inlet sampling branch of the first water treatment tank. This equipment extracts raw water using fully automated sampling technology and precisely injects a specific ratio of colorimetric reagent, causing calcium and magnesium ions in the water to react chemically with the reagent and produce a specific color. Subsequently, a photoelectric sensor detects the change in absorbance after light passes through the solution, and a preset photoelectric linear conversion circuit directly maps the absorbance intensity to a numerical value of the total concentration of calcium and magnesium ions. This data can intuitively quantify the softening requirements of the raw water and clearly define the scale of ions that need to be replaced per unit volume of raw water.

[0024] The sodium ion concentration in the raw water is obtained using an electrochemical ion sensor installed at the inlet. When the sensor's sensitive membrane comes into contact with the raw water, a slight potential difference is generated based on the activity of sodium ions. To convert this physical potential into concentration data, a high-impedance amplifier circuit and a precision analog-to-digital converter are integrated at the sensor's backend. A built-in voltage-concentration mapping table is used for real-time lookup and conversion, directly outputting the specific mass concentration of sodium ions. This electrochemical sensing technology enables real-time monitoring of the initial operating status of the ion exchange process in the bed.

[0025] After obtaining the aforementioned real-time data, the softening state was calculated using stoichiometric equilibrium mapping technology. During the exchange process in the first water treatment tank, the resin adsorbs calcium and magnesium ions and releases sodium ions of equal charge, which is a physicochemical proportional replacement. During the calculation, the monitored raw water hardness data is converted into a digital signal corresponding to the charge quantity by a hardware processor, and then multiplied in real-time with the raw water flow rate data to obtain the total mass of sodium ions currently intercepted and replaced by the bed.

[0026] Finally, the sodium ion concentration data of the outlet water from the first water treatment tank is obtained through multi-source signal superposition technology. The system digitally accumulates the real-time calculated value of the newly added sodium ion mass with the baseline data of the raw water sodium ion concentration collected by the sensor. Through this mass balance superposition process, and by using division logic to eliminate the influence of flow fluctuations, the specific value of the sodium ion concentration in the outflowing water can be output in real time.

[0027] Based on the above technical solution, optionally, a softening state calculation can be performed based on raw water flow rate data, raw water hardness data, and raw water sodium ion concentration data to obtain the sodium ion concentration data of the outlet water of the first water treatment tank, including: Based on the raw water flow rate data, flow rate normalization calculation is performed to obtain the standardized flow rate data of the first water treatment tank; Based on the raw water hardness data, hardness mapping calculations were performed to obtain the standardized hardness data of the first water treatment tank; Based on the raw water sodium ion concentration data, a concentration normalization calculation was performed to obtain the standardized sodium ion concentration data for the first water treatment tank; Based on standardized flow rate data, standardized hardness data, and standardized sodium ion concentration data, a softening contribution matrix was generated and weighted to obtain the comprehensive softening status data of the first water tank; Based on comprehensive softening state data, the layer-by-layer ion distribution and adsorption capacity of the bed were simulated to obtain the ion occupancy data of each layer of the first water treatment tank bed; Based on the ion occupancy data of each layer of the first water treatment tank bed, the sodium ion leakage of the outlet water was estimated, and the sodium ion concentration data of the outlet water of the first water treatment tank was obtained.

[0028] In this scheme, the standardized flow data is the value obtained by normalizing the raw water flow data of the first water treatment tank, which reflects the relative size of the raw water flow within a preset range.

[0029] Standardized hardness data is the value obtained by mapping or normalizing the raw water hardness data of the first water treatment tank, representing the concentration of calcium and magnesium ions in the raw water under a standardized scale.

[0030] Standardized sodium ion concentration data is the value obtained by normalizing the sodium ion concentration data of the raw water in the first water treatment tank.

[0031] The comprehensive softening status data is an index of the overall softening capacity or load status of the bed, obtained by generating a softening contribution matrix and using a weighted superposition method based on standardized flow rate, standardized hardness, and standardized sodium ion concentration data.

[0032] The occupancy data is based on the comprehensive softening state data, which simulates the layer-by-layer distribution of ions and the adsorption capacity of each layer of the bed. It reflects the spatial distribution and capacity consumption of ion exchange in the bed.

[0033] High-frequency sampling technology using sensors is employed to acquire raw water flow data in real time from the inlet. Subsequently, a linear minimum-maximum scaling algorithm is applied to map the measured raw water flow data to a dimensionless range of zero to one. This process uses a preset maximum design load as a benchmark to perform normalization calculations, accurately producing standardized flow data that reflects the relative magnitude of the raw water flow within the preset range, thereby quantifying the water load of the softening bed.

[0034] Simultaneously, the hardness data of the raw water entering the first water treatment tank is collected using an online water quality analyzer. Numerical mapping technology is then used to convert this data into quantitative values ​​on a standard scale, thus obtaining standardized hardness data to clearly characterize the concentration levels of calcium and magnesium ions in the raw water. For the collected raw water sodium ion concentration data, an extreme value normalization algorithm is applied to convert it into standardized sodium ion concentration data. These three indicators, through unified scaling, provide a standardized input benchmark for real-time monitoring of the ion exchange process in the bed.

[0035] After obtaining the three standardized indicators mentioned above, a softening contribution matrix was generated using multidimensional matrix construction technology, aligning water load, hardness pressure, and initial ion concentration in terms of dimensions. A weighted summation algorithm was then applied to sum the weights of each factor in the matrix, resulting in comprehensive softening state data reflecting the overall softening capacity or load status of the bed. This data comprehensively reflects the immediate impact intensity of the inflow water on the bed's exchange capacity.

[0036] Based on the generated comprehensive softening state data, the filling medium layer inside the first water treatment tank was divided into multiple computational units using discretized spatial simulation technology. By executing layer-by-layer charge balance distribution logic, the dynamic replacement process of ion flow as it passes through the resin layer was simulated, and the actual retention of calcium and magnesium ions in each medium layer was calculated. This step produced occupancy data reflecting the distribution of ion exchange space and capacity consumption in the bed, clarifying the utilization level of exchangeable sites in each bed layer.

[0037] Finally, based on the ion occupancy data of each layer of the bed, sodium ion leakage in the effluent water is estimated using ion penetration estimation technology. This process employs a mass conservation material balance algorithm, calculating the unexchanged hardness ions and the total amount of sodium ions displaced in the effluent water based on the remaining adsorption capacity of the bottom layer and the ion exchange kinetic constant. By executing convection-diffusion numerical calculation logic, the specific numerical value of sodium ion concentration in the effluent water is generated in real time.

[0038] This solution enables precise quantification and stratified management of bed operation status, improves softening efficiency, reduces salt consumption, and provides reliable data support for effluent water quality prediction and regeneration control.

[0039] Step S102: Based on the sodium ion concentration data of the outlet water and the preset saturation threshold data, the saturation state of the bed is judged to obtain the regeneration trigger judgment data of the first water production tank.

[0040] The preset saturation threshold data is a pre-set upper limit value for sodium ion saturation or a threshold value for bed adsorption capacity in a dual-tank continuous softening system, used to quantify the degree of utilization of exchangeable sites in the bed.

[0041] The regeneration trigger judgment data is a judgment index generated during the bed saturation state assessment process to control the regeneration operation, reflecting whether the bed of the first water production tank has reached the preset regeneration conditions.

[0042] The sodium ion concentration data of the outlet water is captured in real time from the ion-selective electrode sensor installed at the outlet of the first water treatment tank by calling the Modbus TCP communication protocol. These values ​​reflect the specific quality of the raw water after softening treatment in the first water treatment unit, and are stored in a high-speed cache using time-series data acquisition technology to ensure real-time performance. Simultaneously, preset saturation threshold data is extracted from the system configuration table using SQL database query commands. This data clarifies the upper limit of sodium ion saturation in the bed and serves as a standardized basis for quantifying the degree of exchangeability of the bed.

[0043] After acquiring the two core indicators mentioned above, the threshold comparison algorithm dynamically evaluates the operating status of the first water treatment tank. During the logical operation, the real-time collected sodium ion concentration data of the outlet water is compared one by one with the static preset saturation threshold data to determine whether the sodium ion content in the current outflowing water exceeds the critical point of the bed's adsorption capacity. By executing a Boolean logic decision function, the system can identify the current saturation state of the bed in the first water treatment tank. If the concentration value reaches or exceeds the threshold, it is determined that the bed has entered a state of oversaturation, which meets the preset regeneration execution conditions.

[0044] Finally, based on the logical judgment results, event-driven programming technology is used to generate regeneration trigger judgment data reflecting the current state of the water production unit. Once the comparison result shows that the bed has reached its saturation limit, the system will automatically switch the status of the judgment indicator from normal to triggered regeneration, thus accurately reflecting that the first water production tank has reached the preset regeneration conditions. This generated judgment data is then encapsulated using JSON serialization technology and sent to the system's scheduling chain using an asynchronous message push mechanism. This signifies that the first water production tank can switch from primary water production to standby mode.

[0045] Based on the above technical solution, optionally, the bed saturation state is determined based on the sodium ion concentration data of the outlet water and the preset saturation threshold data to obtain the regeneration trigger judgment data of the first water treatment tank, including: Based on the sodium ion concentration data of the outlet water and the preset saturation threshold data, a threshold comparison calculation was performed to obtain the sodium ion saturation ratio data of the first water treatment tank; Based on the sodium ion saturation ratio data, the saturation state is classified and graded according to the preset grading rules to obtain the bed saturation grade data of the first water treatment tank; Based on the bed saturation level data and preset regeneration trigger rules, logical matching and trigger determination are performed to obtain the regeneration trigger determination data of the first water production tank.

[0046] In this scheme, the sodium ion saturation ratio is the ratio between the current sodium ion content in the first water treatment tank bed and the maximum designed ion exchange capacity of the bed, which is used to quantify the saturation level of the bed.

[0047] The preset grading rules are standards for segmenting or grading sodium ion saturation ratio data, used to classify the saturation level of the bed into different levels.

[0048] The bed saturation level data is a code or level representation obtained by classifying the sodium ion saturation ratio of the bed based on preset grading rules, and is used to reflect the current saturation state of the bed.

[0049] The preset regeneration trigger rule is a judgment condition or logic set based on the bed saturation level data, used to determine when to start the bed regeneration process.

[0050] Electrochemical analysis technology is used to acquire real-time sodium ion concentration data of the outlet water at the end of the first water treatment tank, which serves as the core variable reflecting the current softening effect. Simultaneously, preset saturation threshold data is retrieved from the system memory; this data defines the critical upper limit of the bed's adsorption capacity. A numerical proportional mapping algorithm is applied to divide the real-time monitored concentration value by the preset upper limit of the exchange capacity, calculating the percentage of current sodium ion occupancy relative to the total designed bed capacity, thus generating sodium ion saturation ratio data to quantify the bed's saturation level.

[0051] After obtaining the saturation ratio, data interval matching technology is invoked to associate the obtained sodium ion saturation ratio data with predefined preset grading rules. By executing piecewise function mapping logic, the system automatically identifies which preset interval the current saturation ratio falls within and uses tagging technology to convert it into the corresponding code or grade symbol. This step transforms continuous numerical indicators into structured bed saturation grade data, accurately reflecting the current saturation stage of the first water treatment tank bed, such as slightly saturated, moderately saturated, or approaching the limit state.

[0052] Finally, the generated bed saturation level data is compared logically using a Boolean logic algorithm within the preset regeneration trigger rules. By executing a state machine-based conditional query command, the system checks whether the current level code has triggered the set regeneration start threshold. Once a match is successful, the system uses event-driven programming technology to generate regeneration trigger judgment data in real time, clearly reflecting whether the bed in the first water treatment tank has reached the preset regeneration conditions. This indicator directly determines when the system switches the first water treatment tank to standby mode, thus reserving sufficient switching and preparation time for subsequent regeneration processes and ensuring the continuous quality of softened water output.

[0053] This solution enables the quantitative and hierarchical management of bed saturation, allowing for accurate determination of regeneration timing, improved softened water quality stability, optimized regeneration cycle, and reduced salt and energy consumption.

[0054] Step S103: If the regeneration trigger judgment data reaches the preset regeneration conditions, obtain the bed status data of the second water production tank, perform dual-tank switching calculation based on the regeneration trigger judgment data and the bed status data, obtain the water supply data of the second water production tank and the regeneration preparation data of the first water production tank, and control the second water production tank to start water production based on the water supply data, while instructing the first water production tank to enter the regeneration preparation state.

[0055] The preset regeneration conditions are threshold standards for bed saturation or operating status set to determine whether the first water production tank needs to start the regeneration process.

[0056] The second water production tank is a backup water production unit in a dual-tank continuous softening system, excluding the first water production tank. It primarily undertakes water production tasks during the preparation or regeneration process of the first water production tank, ensuring continuous water output from the system. In the dual-tank alternating operation mode, the second water production tank automatically takes over the water supply based on the regeneration trigger judgment of the first water production tank and the bed status data, maintaining a stable softened water supply. The second water production tank may include at least two sub-tanks.

[0057] The bed status data is a quantitative information on the current operating status of the bed in the second water treatment tank, including the bed ion occupancy rate, the remaining adsorption capacity of the bed, and the overall operating health status of the bed.

[0058] The water supply data is the operating instructions or parameters generated by the system during the dual-tank switching process to control the second water production tank to start producing water, including start time, flow rate setting, and water quality control indicators.

[0059] The preparation data for regeneration are the operating parameters or control signals generated during the dual-tank switchover process to guide the first water preparation tank into the regeneration preparation state, including the bed flushing plan, brine injection volume, and circulation flow rate settings.

[0060] Boolean logic judgment technology is used to monitor regeneration trigger judgment data in real time and compare it frequently with preset regeneration conditions in the configuration database. Once the judgment index reaches or exceeds the set bed saturation threshold, the system immediately calls the OPC-UA communication protocol to initiate a polling request to the sensor array of the second water treatment tank. By executing multi-channel data synchronous acquisition commands, bed status data including bed ion occupancy rate, remaining bed adsorption capacity, and overall bed health status are obtained. This quantitative information is structured and stored using in-memory database temporary storage technology to ensure that the operation of the standby unit can support immediate switchover requirements.

[0061] After obtaining complete input information, heuristic logic mapping technology is applied to perform dual-tank switching calculations. This process uses the saturation level reflected by the regeneration trigger judgment data and the bed state data of the second water treatment tank as input variables, and uses a multi-constraint dynamic programming algorithm to calculate the optimal switching timing. By executing the business logic preset script, the start-up time, flow setting, and water quality control indicators of the second water treatment tank are automatically calculated based on the current total system flow demand, thereby producing accurate connection and water supply data. Simultaneously, using parameter correlation derivation technology, preparation regeneration data including the bed flushing plan, brine injection volume, and circulation flow setting are generated based on the actual saturation status of the first tank, providing standardized guidance parameters for subsequent process switching.

[0062] After obtaining the above data, the system uses JSON serialization and data encapsulation technology to convert the water supply takeover data into command messages that the underlying controller can recognize. By calling the high-priority transmission protocol of industrial Ethernet, the operation command containing the start-up parameters is sent to the actuator of the second water production tank. Using distributed clock synchronization technology, it ensures that the solenoid valve and water pump are triggered simultaneously the moment the command is issued, and the second water production tank is officially started to produce water according to the flow rate setting in the takeover command. By performing real-time feedback signal verification, it is ensured that the backup unit has successfully taken over the water supply before the first water production tank is ready for regeneration, maintaining the continuity and stability of the softened water supply of the entire system.

[0063] Simultaneously with the startup of the second tank, the system utilizes asynchronous message push technology to transmit the generated regeneration preparation data to the control terminal of the first water production tank. By executing a PLC register mapping rewrite operation, the bed flushing plan and brine injection parameters are injected into the operating logic. A state machine jump instruction is triggered, instructing the first water production tank to immediately disconnect from the online water supply link and enter the regeneration preparation state. Distributed fieldbus technology is used to monitor the execution feedback of the first water production tank in real time, confirming that it has completed the initial circulation flow setting and system isolation according to the preparation instructions. This series of coordinated operations ensures the smooth operation of the dual-tank alternation mode, enabling the first water production tank to accurately connect with the subsequent regeneration process within the reserved preparation time.

[0064] Step S104: Based on the prepared regeneration data and the preset initial concentration data of the brine, calculate the regeneration parameters of the first water production tank bed to obtain the regeneration liquid flow rate data and regeneration liquid concentration adjustment data of the first water production tank, and control the brine injection and circulation flow rate of the first water production tank bed based on the regeneration liquid flow rate data and regeneration liquid concentration adjustment data.

[0065] The preset initial concentration data of the brine solution is a standard value of brine solution concentration set in advance by the system to guide the regeneration process of the first water treatment tank bed. It is used to calculate the brine solution injection volume and the concentration adjustment range required for regeneration.

[0066] The regenerated solution flow rate data is the volumetric flow rate information of the brine injected during the bed regeneration process, calculated by the system based on the prepared regeneration data and the preset initial brine concentration.

[0067] The regenerated solution concentration adjustment data is the salt solution concentration adjustment information generated by the system during the regeneration parameter calculation process. It is used to dynamically adjust the salt ion concentration in the regenerated solution of the bed to adapt to the ion occupancy status of different layers of the bed.

[0068] The bed is the filling medium layer inside the first water treatment tank used for ion exchange, and it is usually composed of resin or filler with ion exchange function.

[0069] The system retrieves regeneration preparation data from the cache register, utilizes the brine injection volume information and combines it with preset initial brine concentration data, and applies arithmetic logic operations to calculate the volumetric flow rate of the brine injection within a predetermined time. This process integrates the brine injection volume with the regeneration time span to generate accurate regeneration fluid flow rate data, providing a quantitative standard for subsequent control of the brine pump's physical output.

[0070] Next, decision tree mapping technology was used to logically correlate the bed flushing scheme in the regeneration data with the preset initial brine concentration data. To ensure the regenerated solution could adapt to the ion occupancy of different media layers within the bed, weighted logical interpolation technology was applied to dynamically calculate the brine concentration offset, thereby generating regenerated solution concentration adjustment data. This data clearly defines the dynamic adjustment range of salt ion concentration during regeneration, ensuring that the resin or packing material within the bed achieves optimal exchange site recovery.

[0071] After obtaining the above parameters, the regenerated liquid flow rate data is converted into an electronic control signal using analog-to-digital conversion technology to drive the brine injection pump to start. Pulse width modulation (PWM) control technology is applied to precisely adjust the pump speed, controlling the rate at which brine is injected into the bed inside the first water treatment tank in real time based on the flow information. Proportional-integral-derivative (PID) control technology is used to align the actual flow feedback with the target data in real time, ensuring that the brine injection process strictly adheres to the predetermined flow rate standard.

[0072] Finally, the system utilizes variable frequency speed control technology to drive the circulating pump, combining the circulating flow rate setting from the regeneration data and the generated regenerated solution concentration adjustment data for joint control of fluid circulation. During circulation, real-time sensor feedback technology monitors changes in fluid pressure and conductivity within the bed, dynamically adjusting the output frequency of the circulating pump. This adjustment ensures that the regenerated solution remains uniformly distributed within the filling medium layer in the first water treatment tank, maintaining a high degree of synergy between the circulating flow rate and the injected brine concentration, thereby achieving efficient regeneration of the bed.

[0073] Based on the above technical solution, optionally, the regeneration parameters of the first water treatment tank bed are calculated based on the prepared regeneration data and the preset initial concentration data of the brine, to obtain the regeneration liquid flow rate data and regeneration liquid concentration adjustment data of the first water treatment tank, including: Based on the prepared regeneration data and the preset initial concentration data of the brine solution, the adsorption capacity of the bed brine solution was evaluated and the segmented flow rate requirement analysis was performed to obtain the target flow rate data for bed regeneration; Based on the target flow rate data of bed regeneration and the preset initial concentration data of brine, gradient concentration distribution and flow rate matching optimization are performed to obtain the regenerated liquid flow rate data of the first water production tank; Based on the target flow rate data of bed regeneration and the preset bed adsorption capacity data, the salt concentration is adjusted in segments and the gradient is optimized to obtain the regenerated liquid concentration adjustment data of the first water production tank.

[0074] In this scheme, the target flow rate for bed regeneration is calculated based on the remaining adsorption capacity of the first water treatment tank bed during the regeneration preparation stage and the preset initial concentration of brine. This calculation is performed by assessing the bed brine adsorption capacity and analyzing the segmented flow rate requirements. The target brine flow rate required to be injected into each segment of the bed during the regeneration process is obtained through the analysis of the bed brine adsorption capacity and segmented flow rate requirements.

[0075] The preset bed adsorption capacity data is the numerical information of the amount of sodium ions or total hardness ions that each layer of the bed can adsorb under saturation conditions, determined in the early stages of design and operation based on the characteristics of the bed material and historical experimental data.

[0076] In generating the target flow rate data for bed regeneration, the first step is to retrieve the bed flushing plan and circulation flow rate settings recorded in the regeneration data. Digital integration technology is used to calculate the total ion exchange volume accumulated in the first water treatment tank bed during its operating cycle, and this is logically compared with the preset initial brine concentration data to determine the distribution depth of failed resin within the bed. Next, spatial discretization modeling technology is used to divide the bed into multiple physical levels along the axial direction. Based on the ion exchange driving force provided by the preset initial brine concentration, the minimum volume of brine that each level must contact to restore its exchange capacity during regeneration is calculated using equivalence displacement logic. Through this segmented flow rate demand analysis, the system ultimately outputs the injection flow rate values ​​covering all stages of the regeneration process, i.e., the target flow rate data for bed regeneration, thereby quantifying the specific brine intake requirements of each bed segment.

[0077] Obtaining the regenerated liquid flow rate data from the first water treatment tank requires real-time matching and dynamic mapping between the target regeneration flow rate data of the bed and the preset initial brine concentration data. During this stage, high-precision variable frequency servo control technology is used to drive the brine pump, precisely adjusting the pump speed according to the time series set by the target flow rate data. To ensure the stability of the injection process, the system employs closed-loop load servo technology, using the preset initial brine concentration as a reference value. By adjusting the mixing ratio of dilution water and saturated brine, the real-time flow rate is kept highly consistent with the preset stepped flow scheme. In this flow matching optimization process, the system uses linear interpolation adjustment logic to smoothly switch the injection flow rate at different time periods based on the adsorption rate differences at different regeneration stages of the bed, ultimately generating regenerated liquid flow rate data containing precise flow rate commands at each time point.

[0078] The generation of regenerated solution concentration adjustment data for the first water treatment tank involves a deep benchmarking between the target regeneration flow rate data and the preset bed adsorption capacity data. First, using dynamic mass balance mapping technology, the saturated ion load defined in the preset bed adsorption capacity data is correlated with the current target flow rate to assess the sensitivity of different depth levels of the bed to sodium ion concentration. Then, an automated multi-stage proportional mixing technology is employed to execute gradient optimization logic for brine concentration based on the difference in failure levels from the upper to the lower parts of the bed. During the process, the system no longer uses fixed concentration injection but instead utilizes segmented concentration compensation logic to increase the salt ion supply density in areas with low remaining adsorption capacity and decrease the supply in areas with slight failure. Through this segmented adjustment, the system outputs a series of command parameters for controlling the regulating valves, i.e., the regenerated solution concentration adjustment data, thereby achieving precise restoration of ion occupancy at different levels of the bed.

[0079] This scheme can achieve balanced regeneration distribution in each layer of the bed, improve ion exchange efficiency and regeneration thoroughness, and optimize the amount of brine used, reducing resource waste.

[0080] Step S105: Based on the regenerated liquid flow rate data, regenerated liquid concentration adjustment data and bed ion migration kinetic model, predictive calculations are performed to obtain the optimized control data of the regeneration parameters of the first water production tank, and the regeneration control of the first water production tank is performed based on the optimized control data of the regeneration parameters.

[0081] The bed ion migration kinetics model is a mathematical or empirical model used to describe the temporal and spatial distribution of ions in the bed of the first water treatment tank. This model considers processes such as ion exchange, diffusion, convection, and adsorption kinetics within the bed. This model can predict the migration rate, concentration gradient changes, and adsorption capacity consumption of ions in each layer of the bed.

[0082] The optimized control data for regeneration parameters is a set of key control parameters generated based on predictive analysis of regenerated liquid flow rate data, regenerated liquid concentration adjustment data, and bed ion migration kinetics model. This data guides the regeneration operation of the first water treatment tank bed. It includes information such as regenerated liquid injection rate, brine concentration adjustment scheme, and regeneration cycle time.

[0083] Utilizing the volumetric flow rate information provided by the regenerated liquid flow rate data, and combining it with the dynamic changes in ion concentration reflected by the regenerated liquid concentration adjustment data, the first water treatment tank bed was divided into multiple discrete meshes using finite element numerical simulation technology. By calling a fluid dynamics calculation program, the permeation and convection processes of the brine in the filling medium of each layer of the bed were simulated, and the exchange ratio of sodium ions to calcium and magnesium ions in each mesh cell was calculated in real time. This calculation method transforms macroscopic flow rate and concentration into microscopic spatial changes, outputting real-time predicted ion distribution data reflecting the changes in ion migration velocity and concentration gradient in each layer of the bed.

[0084] After obtaining the distribution data, the evolution of the local concentration gradient in the bed is predicted using the pre-set diffusion and adsorption kinetic parameters in the bed ion migration kinetic model, combined with a time-step integral algorithm. By performing mass balance constraint calculations, the adsorption capacity consumption of the ion exchange resin at different depths in the bed is dynamically evaluated, and the evolution of ion distribution with spatial variation is quantitatively described. This process uses a nonlinear regression algorithm to perform online simulation of the ion exchange kinetics, thereby generating regeneration progress prediction data that includes the current regeneration completion rate and the recovery degree of each layer of media, providing predictive support for the regeneration closed loop of the first water treatment tank.

[0085] Subsequently, the generated regeneration progress prediction data was correlated with the initial regenerated liquid flow rate data and regenerated liquid concentration adjustment data in multiple dimensions. A multi-objective optimization genetic algorithm was applied to perform optimal matching analysis on the regenerated liquid injection rate, brine concentration adjustment scheme, and regeneration cycle time, while ensuring the bed adsorption capacity recovery effect. Constraint logic solving technology was used to eliminate operating parameters that did not meet the system water quality standards, ultimately obtaining a set of key control parameters that can accurately guide the regeneration operation of the first water treatment tank bed, namely, the regeneration parameter optimization control data, ensuring that the injection rate and cycle time achieve optimal energy efficiency.

[0086] After obtaining the optimized data, the system encapsulates the optimized regeneration parameter control data into low-level control instructions using an object serialization protocol. By invoking the register mapping technology of the industrial control system, the optimal regenerated liquid injection rate, brine concentration adjustment scheme, and regeneration cycle time are written into the execution logic of the first water treatment tank control terminal in real time. Using closed-loop proportional-integral feedback technology, the variable frequency brine pump and proportional regulating valve are driven to strictly execute the brine injection and fluid circulation according to the optimized scheme. By executing a real-time interrupt service routine to monitor the regeneration process, it is ensured that the filling medium layer completes ion potential recovery within the reserved backup time, enabling the first water treatment tank to regain the ability to process raw water and output qualified softened water.

[0087] The training process for the bed ion migration kinetics model is as follows: A massive amount of raw records covering multiple different water treatment tanks were extracted from the system's historical operation database. Apache Spark distributed computing technology was used to perform large-scale parallel processing of the operation logs across devices and cycles. A global timestamp alignment algorithm was executed to synchronize data on sodium ion concentration in the outlet water, regenerated liquid flow rate, and bed pressure changes at different sampling frequencies. Then, an outlier filtering algorithm was applied to remove noise, and multi-source data fusion compensation technology was used to fill in record gaps, ultimately forming a standardized historical operation database. This provides a realistic physical basis for subsequent simulations and real-time predictions of ion distribution data.

[0088] For the aggregated dataset, one-hot encoding technology was used to identify water treatment tanks of different specifications, and a time-series feature matrix was constructed using sliding window segmentation technology. Correlation coefficient matrix analysis was performed to select core feature vectors strongly correlated with ion exchange, diffusion, and adsorption kinetics. This process not only characterizes the commonalities of ion migration in each layer of the bed but also extracts key control variable features that can support the generation of optimized regeneration parameter control data by learning from successful historical regeneration cases, transforming fragmented records into a training feature set with strong generalization capabilities.

[0089] In the algorithm construction phase, a long short-term memory neural network was selected to build a bed ion migration dynamics model, and a multi-head attention mechanism was introduced to capture complex spatiotemporal dependencies. The feature set was input into the network, and the backpropagation algorithm was used to train the model's ability to infer the internal state of the bed. This enabled the model to accurately output real-time predicted ion distribution data reflecting the positional relationships of ions in the medium layer based on the input flow rate and concentration parameters. By iterating the weights using the Adam adaptive optimization algorithm, the model mastered the general logic of concentration gradient evolution and adsorption capacity consumption, thus possessing the computational core for generating online regeneration progress prediction data.

[0090] After model training, cross-validation was used to evaluate its robustness in predicting different water treatment tank bed conditions. The mean absolute percentage error (MAE) was calculated to ensure high accuracy in outputting regeneration progress prediction data, and weight decay was applied to prevent overfitting. Finally, model serialization technology was used to encapsulate the parameter set into a general-purpose inference engine. This engine can quickly deduce and generate optimized control data for regeneration parameters based on real-time regeneration liquid flow and concentration adjustment data, providing a logical closed loop for precise regeneration control of the entire softening system in multi-tank alternating operation mode.

[0091] Based on the above technical solution, optionally, predictive calculations can be performed based on regenerated liquid flow rate data, regenerated liquid concentration adjustment data, and bed ion migration kinetics model to obtain optimized control data for the regeneration parameters of the first water production tank, including: Based on the regenerated liquid flow rate data and regenerated liquid concentration adjustment data, the ion migration state of each layer of the bed is simulated to obtain the real-time predicted ion distribution data of the first water production tank bed; Based on real-time predicted ion distribution data and bed ion migration kinetics model, the evolution of local concentration gradient in the bed and dynamic analysis of adsorption capacity are performed to obtain the predicted regeneration progress data of the first water treatment tank bed; Based on the regeneration progress prediction data, regenerated liquid flow rate data, and regenerated liquid concentration adjustment data, parameter optimization and matching analysis was performed to obtain the optimized control data of the regeneration parameters of the first water production tank.

[0092] In this scheme, the real-time predicted ion distribution data is based on the regenerated liquid flow rate data and regenerated liquid concentration adjustment data, and the instantaneous spatial distribution of sodium ion and calcium and magnesium ion concentrations in each layer of the first water treatment tank bed is obtained by simulating the ion migration state of each layer of the bed.

[0093] The regeneration progress prediction data is based on real-time predicted ion distribution data and bed ion migration kinetics model. It is obtained by analyzing the changes in ion concentration gradient and adsorption capacity consumption in each layer of the bed to determine the completion status of the first water treatment tank regeneration process.

[0094] Based on regenerated liquid flow rate data and regenerated liquid concentration adjustment data, the system inputs the real-time collected flow rate and concentration time-series features into the model serialization inference file loaded by the hardware processor. The long short-term memory neural network inference engine then simulates the ion migration state of each layer of the bed. During this stage, the model automatically captures the spatial dependence of different depths in the bed under brine flushing using a multi-head attention mechanism. Through this spatiotemporal feature mapping technique, the model simulates the instantaneous physical process of sodium ions replacing calcium and magnesium ions, thereby obtaining the instantaneous spatial distribution of sodium and calcium / magnesium ion concentrations in each layer of the first water treatment tank bed, i.e., generating real-time predicted ion distribution data.

[0095] Based on real-time predicted ion distribution data and a bed ion migration kinetic model, the system invokes a computational core iteratively optimized using the Adam adaptive algorithm, instructing the model to predict the local concentration gradient evolution and dynamically analyze adsorption capacity. The model calculates the trend of ion concentration differences between adjacent resin layers based on the positional relationships of ions in the current media layer and the deductive capabilities derived from the error backpropagation logic. Combining the model's internal characterization of adsorption kinetics and diffusion processes, the system compares the current ion occupancy state with the preset saturation limit in real time, thereby accurately assessing the recovery progress of the resin exchange capacity and obtaining regeneration progress prediction data reflecting the completion status of the first water treatment tank regeneration process.

[0096] Based on regeneration progress prediction data, regenerated liquid flow rate data, and regenerated liquid concentration adjustment data, the system uses multi-source data fusion compensation technology to compare the current regeneration progress with the preset process target. The multi-dimensional data is then input into the inference interface, where the model performs parameter optimization and matching analysis. Based on the real-time evolution of the ion gradient within the bed, the model uses a robust inference algorithm with weighted decay to online deduce and dynamically adjust the subsequent brine injection rate and concentration gradient distribution scheme. Through this adaptive optimization control logic, the model ultimately generates optimized control data for regeneration parameters, including the regenerated liquid injection rate, brine concentration adjustment scheme, and regeneration cycle time, to guide the system in controlling the first water treatment tank bed to accurately complete the remaining regeneration operations.

[0097] This solution allows for real-time monitoring of ion changes and regeneration progress in each layer of the bed, enabling precise optimization of regeneration parameters, improving brine utilization efficiency, and ensuring stable and reliable softened water quality.

[0098] Step S106: Obtain real-time water production status data of the second water production tank, optimize control data based on regeneration parameters and real-time water production status data, perform dual-tank circulation and waste liquid reuse control calculations, obtain continuous water output status data and waste liquid resource optimization data, and perform water production and regeneration parameter optimization calculations for the next cycle based on continuous water output status data and waste liquid resource optimization data, forming a closed-loop data-driven control.

[0099] Real-time water production status data is an instant record of various operating parameters and water quality indicators of the second water production tank during the water production process, including information such as the inflow of raw water, the ion occupancy of the bed, the sodium ion concentration of the outlet water, and the water temperature.

[0100] The continuous water output status data is the real-time performance of the overall water quality and flow rate of the system's outlet water in the dual-tank alternating water production mode, including comprehensive indicators such as sodium ion concentration, total flow rate, and softening uniformity of the water output from each water production tank.

[0101] Waste liquid resource optimization data is a set of key control parameters generated after analyzing the collection, reuse ratio and treatment scheme of waste liquid generated during the regeneration process, based on the dual-tank circulation and regeneration parameter optimization control.

[0102] By utilizing the sensor synchronization technology of the industrial IoT gateway, various operating parameters of the second water treatment tank, which is currently undertaking the water production task, are captured in real time. A high-frequency pulse counting algorithm is used to collect the inflow of raw water, while a multi-point conductivity array sampling technology installed inside the tank reconstructs the ion occupancy of the bed. Ion-selective electrode monitoring technology is applied to obtain the sodium ion concentration of the outlet water in real time, and a resistance temperature detector (RTD) sensor is used to record water temperature information. These multi-dimensional real-time records are processed through data normalization to ultimately form real-time water production status data reflecting the current operating efficiency of the standby unit.

[0103] After the system enters the dual-tank alternating operation phase, a multi-source data weighted fusion algorithm is used to correlate and calculate the regeneration parameter optimization control data guiding the regeneration of the first water production tank with the real-time water production status data of the second water production tank. By executing fluid mixing model derivation technology, the sodium ion concentration and total flow rate of the output water from both tanks are superimposed in real time, and the softening uniformity is evaluated using the coefficient of variation calculation method, thereby generating continuous effluent status data representing the overall system performance. Simultaneously, a mass conservation material balance algorithm is applied, and linear programming optimization technology is used to analyze the collection and reuse ratio of the waste liquid generated during the regeneration process, generating waste liquid resource optimization data including treatment plans. The specific treatment plan includes: using ion concentration thresholds, waste liquid that has not reached saturation but still has effective ion exchange capacity is classified as reusable and injected into a standby water treatment tank according to a preset ratio matched with the remaining adsorption capacity of the bed; waste liquid that has reached saturation or whose ion concentration exceeds the safety limit is identified as unreusable and discharged from the system through a discharge pipeline; at the same time, the flow rate and injection point of the reusable waste liquid are optimized in segments to ensure that no local overload of the bed or abnormal water quality indicators are caused; throughout the process, the waste liquid distribution ratio and circulation path are adjusted in real time during the calculation to form a dynamic closed-loop control, ensuring that reuse is limited to effective resources and that polluted water is discharged in a timely manner.

[0104] After obtaining the above data, real-time feedback control technology of edge computing nodes is used to take the continuous effluent status data as the system's performance evaluation index, and asynchronous logic scheduling technology is applied to execute wastewater reuse control. Based on the key control parameters in the wastewater resource optimization data, servo solenoid valve proportional adjustment technology is used to precisely switch the wastewater flow direction and adjust the reuse rate. This process realizes dynamic resource allocation for regeneration operations and water production tasks, ensuring that the system maintains stable continuous effluent while maximizing resource utilization during the regeneration process.

[0105] Finally, the continuous effluent status data and waste liquid resource optimization data generated in this cycle are stored in the historical record using database appending technology, serving as the input for the next cycle iteration. An incremental strategy optimization algorithm from reinforcement learning is applied to compare the deviation between the actual effluent indicators and the expected targets, and the preset water production and regeneration parameters are corrected online. Automatic parameter reconstruction technology is used to adjust the regenerated liquid injection rate and circulation time settings for the next cycle, and the calculation results are fed back to the bed ion migration kinetics model for weight updates.

[0106] Based on the above steps S101-S106, the closed-loop data-driven control achieves continuous water production in dual tanks, stable water quality, efficient waste liquid reuse, and automatic coordinated management of water production and regeneration processes by real-time monitoring and optimization of regeneration parameters, thereby improving system reliability and resource utilization efficiency.

[0107] Based on the above technical solution, optionally, dual-tank circulation and waste liquid reuse control calculations can be performed based on regeneration parameter optimization control data and real-time water production status data to obtain continuous effluent status data and waste liquid resource optimization data, including: Based on the optimized control data of regeneration parameters and real-time water production status data, water production task priority ranking and cycle switching strategy are generated to obtain dual-tank cycle control data; Based on the dual-tank circulation control data, water quality index weighting fusion and flow dynamic matching analysis are performed to obtain continuous effluent status data; Based on continuous effluent status data and regeneration parameter optimization control data, the waste liquid reuse ratio is simulated and optimized, and the allocation scheme is parameterized to obtain waste liquid resource optimization data.

[0108] In this scheme, the dual-tank cycle control data is a set of control information generated by optimizing control data based on regeneration parameters and real-time water production status data, and by prioritizing water production tasks and generating a cycle switching strategy. It is used to guide the rotation sequence, runtime, and flow distribution of each water production unit in the dual-tank system, ensuring that the other tank can continuously supply water while one tank is regenerating, thus maintaining stable water quality and optimal water production efficiency in the system.

[0109] Based on optimized control data of regeneration parameters and real-time water production status data of the second water production tank, a priority ranking and cycle switching strategy for water production tasks is generated. During this process, a weighted multi-objective priority scheduling technique is used to logically align the required regeneration cycle time and brine injection rate of the first water production tank with the current bed ion occupancy and sodium ion concentration of the outlet water in the second water production tank. Discrete event-triggered control logic is used to calculate the time overlap between the two tanks in water production and regeneration tasks, and a deterministic timing allocation algorithm is used to determine the rotation order and runtime of each water production unit. The final generated dual-tank cycle control data covers flow allocation schemes for different water production stages, ensuring the system maintains overall operational continuity through precise switching logic when executing complex optimized control of regeneration parameters.

[0110] Based on the dual-tank circulation control data, the system performs weighted fusion of water quality indicators and dynamic flow matching analysis. Utilizing multi-channel signal weighted fusion technology, the system summarizes the output parameters of the water treatment tanks at different operating stages in real time. Specifically, for the sodium ion concentration and total flow rate of the water output from each tank, linear compensation dynamic adjustment logic is applied for smooth transition processing. During the instantaneous switching between the two tanks, servo feedback flow synchronization technology is used to adjust the opening of the electric regulating valve in real time according to the flow distribution parameters in the circulation control data, ensuring physical uniform mixing of the softened water produced by each unit at the confluence point. The resulting continuous effluent status data, presented digitally, visually demonstrates the overall softening uniformity and real-time flow performance of the system's outlet water, reflecting the supporting effect of the circulation switching strategy on system stability.

[0111] Based on continuous effluent status data and optimized control data for regeneration parameters, the system performs simulation optimization of waste liquid reuse ratios and generates parameterized mixing schemes. The system utilizes digital twin simulation technology to simulate the impact of different reuse ratios on subsequent regeneration effects based on the ion concentrations of the waste liquid generated during regeneration at different times, combined with the regenerated liquid concentration adjustment scheme. Using mass conservation iterative optimization logic, the system calculates the critical point for waste liquid collection that meets regeneration performance requirements and applies parameterized mapping technology to transform the complex simulation results into specific reuse valve control timing and mixing ratio parameters. Through this in-depth optimization of the waste liquid collection and treatment scheme, the resulting optimized waste liquid resource data provides the system with specific instructions for brine recovery and mixing, achieving the recycling of waste liquid resources in the regeneration process while maintaining stable water quality and optimal water production efficiency.

[0112] This solution enables continuous switching between dual-tank water production and balanced flow distribution, ensuring continuous water supply to the system. It also optimizes water quality control and regeneration scheduling, improving operational efficiency and resource utilization.

[0113] See appendix Figure 2 , Figure 2This is a schematic diagram of the second main step of a closed-loop optimization control method for water production and regeneration based on dual-tank softening according to an embodiment of the present invention. Figure 2 As shown, the closed-loop optimization control method for water production and regeneration based on dual-tank softening in this embodiment of the invention mainly includes the following steps S201-S208.

[0114] Step S201: Real-time acquisition of raw water flow rate data, raw water hardness data, and raw water sodium ion concentration data of the first water treatment tank; based on the raw water flow rate data, raw water hardness data, and raw water sodium ion concentration data, perform softening state calculation to obtain the sodium ion concentration data of the outlet water of the first water treatment tank.

[0115] Step S202: Based on the sodium ion concentration data of the outlet water and the preset saturation threshold data, the saturation state of the bed is judged to obtain the regeneration trigger judgment data of the first water production tank.

[0116] Step S203: If the regeneration trigger judgment data reaches the preset regeneration conditions, obtain the bed status data of the second water production tank. Based on the regeneration trigger judgment data and the bed status data, compare and prioritize the remaining adsorption capacity to obtain the dual-tank switching priority data.

[0117] Step S204: Based on the dual-tank switching priority data, perform water supply weight allocation and determine the connection sequence to obtain the connection water supply data for the second water tank.

[0118] Step S205: Based on the dual-tank switching priority data and bed status data, perform regeneration preparation sequence planning and brine distribution strategy generation to obtain the regeneration preparation data of the first water production tank, and control the second water production tank to start water production based on the water supply data, while instructing the first water production tank to enter the regeneration preparation state.

[0119] Step S206: Based on the prepared regeneration data and the preset initial concentration data of the brine, calculate the regeneration parameters of the first water production tank bed to obtain the regeneration liquid flow rate data and regeneration liquid concentration adjustment data of the first water production tank, and control the brine injection and circulation flow rate of the first water production tank bed based on the regeneration liquid flow rate data and regeneration liquid concentration adjustment data.

[0120] Step S207: Based on the regenerated liquid flow rate data, regenerated liquid concentration adjustment data and bed ion migration kinetic model, predictive calculations are performed to obtain the optimized control data of the regeneration parameters of the first water production tank, and the regeneration control of the first water production tank is performed based on the optimized control data of the regeneration parameters.

[0121] Step S208: Obtain real-time water production status data of the second water production tank, optimize control data based on regeneration parameters and real-time water production status data, perform dual-tank circulation and waste liquid reuse control calculations, obtain continuous water output status data and waste liquid resource optimization data, and perform water production and regeneration parameter optimization calculations for the next cycle based on continuous water output status data and waste liquid resource optimization data, forming a closed-loop data-driven control.

[0122] In this embodiment, the dual-tank switching priority data is used in a dual-tank continuous softening system to characterize the priority order and relative importance of the two water production tanks during water production and regeneration operations. This data is generated by comparing and analyzing the regeneration trigger judgment results of each water production tank with the remaining adsorption capacity of the bed, and by sorting them in conjunction with water production load demand and operating strategies. Its core function is to guide the system in determining which water production tank takes over the water supply first and which water production tank enters the regeneration preparation state first, thereby achieving efficient and continuous switching of dual-tank water production and optimized resource scheduling.

[0123] The process of generating dual-tank switching priority data begins with a deep benchmarking of the system's current load and bed capacity. When the first water treatment tank triggers a regeneration judgment due to near-saturation, the system immediately extracts the bed status data of the second water treatment tank. Using multi-criteria weighted sorting technology, the real-time ion saturation of the first water treatment tank is quantified and compared with the bed ion occupancy rate and remaining adsorption capacity of the second water treatment tank. During this process, the hardware logic processor compares the operational health status of the two tanks and executes a priority evaluation logic based on the percentage of remaining capacity, automatically assigning weights to the two tanks. If the first water treatment tank has been determined to meet regeneration conditions, and the health indicators of the second water treatment tank are in excellent condition, the sorting logic quickly sets the second water treatment tank as the highest priority takeover target, thereby generating accurate dual-tank switching priority data and clearly defining which device should immediately enter the water production sequence.

[0124] Based on the obtained dual-tank switching priority data, the system begins a smooth water supply load migration to generate the connection and supply data for the second water production tank. This process utilizes time-synchronized triggering technology and dynamic flow ratio logic. According to the connection sequence determined by priority ranking, the system uses progressive opening commands to control the outlet valve of the second water production tank, while simultaneously using feedback regulation technology to monitor the total water production of the system in real time. During this water supply weight allocation process, the system calculates the specific start-up time and initial flow setpoint required for the second water production tank to connect to the system, based on the preset constant pressure water supply logic. Subsequently, combined with the water quality treatment capacity recorded in the bed status, linear mapping technology is used to set the outlet hardness monitoring index, ultimately summarizing complete connection and supply data to ensure that the system's water supply pressure and quality do not fluctuate when the second water production tank replaces the first water production tank.

[0125] Obtaining the regeneration preparation data for the first water production tank requires deep coupling of the dual-tank switching priority data with the current bed status data. After confirming that the second water production tank has successfully taken over and is supplying water stably, the system plans the specific steps for the first water production tank, which is in standby mode, to enter regeneration using step-by-step timing control technology. Based on the total ion retention recorded in the bed status data, the system accurately calculates the required brine injection volume and dilution ratio for this regeneration using volume proportional metering logic, rather than using fixed empirical values. Simultaneously, combined with the system's operating strategy, the system uses adaptive circulation flow technology to determine the intensity and water consumption of bed flushing. Through this regeneration preparation sequence planning, the system outputs regeneration preparation data covering flushing pressure, brine distribution ratio, and circulation path settings, providing specific control signals for the subsequent efficient regeneration of the first water production tank.

[0126] In this embodiment, the switching sequence between the two tanks can be scientifically determined, improving water production continuity and system operating efficiency, avoiding excessive bed saturation, and achieving smooth switching and optimized resource utilization.

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

[0128] Furthermore, the present invention also provides a closed-loop optimized control system for water production and regeneration based on dual-tank softening.

[0129] See appendix Figure 3 , Figure 3 This is a main structural block diagram of a closed-loop optimized control system for water production and regeneration based on a dual-tank softening system, according to an embodiment of the present invention. Figure 3 As shown, it specifically includes: The raw water monitoring module 301 acquires real-time data on raw water flow rate, raw water hardness, and raw water sodium ion concentration from the first water treatment tank. Based on these data, it calculates the softening state and obtains the sodium ion concentration data of the outlet water from the first water treatment tank. The saturation judgment module 302 is used to judge the saturation state of the bed based on the sodium ion concentration data of the outlet water and the preset saturation threshold data, and to obtain the regeneration trigger judgment data of the first water production tank; The dual-tank switching module 303 is used to obtain the bed status data of the second water production tank if the regeneration trigger judgment data reaches the preset regeneration conditions, perform dual-tank switching calculations based on the regeneration trigger judgment data and the bed status data, obtain the water supply data of the second water production tank and the regeneration preparation data of the first water production tank, and control the second water production tank to start water production based on the water supply data, while instructing the first water production tank to enter the regeneration preparation state; The regeneration parameter determination module 304 is used to calculate the regeneration parameters of the first water production tank bed based on the prepared regeneration data and the preset initial concentration data of the brine solution, to obtain the regeneration liquid flow rate data and regeneration liquid concentration adjustment data of the first water production tank, and to control the brine injection and circulation flow rate of the first water production tank bed based on the regeneration liquid flow rate data and regeneration liquid concentration adjustment data; The optimization prediction module 305 is used to perform prediction calculations based on regenerated liquid flow rate data, regenerated liquid concentration adjustment data, and bed ion migration kinetics model to obtain optimized control data for the regeneration parameters of the first water production tank, and to perform regeneration control of the first water production tank based on the optimized control data for the regeneration parameters; The closed-loop control module 306 is used to acquire real-time water production status data of the second water production tank, optimize control data based on regeneration parameters and real-time water production status data, perform dual-tank circulation and waste liquid reuse control calculations, obtain continuous water output status data and waste liquid resource optimization data, and perform water production and regeneration parameter optimization calculations for the next cycle based on continuous water output status data and waste liquid resource optimization data, thus forming a closed-loop data-driven control.

[0130] The water production and regeneration closed-loop optimization control system based on dual-tank softening provided in this application embodiment can achieve… Figure 1 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.

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

[0132] Furthermore, the present invention also provides an electronic device 400, including a processor 401, a memory 402, and a program or instructions stored in the memory 402 and executable on the processor 401. When the program or instructions are executed by the processor 401, they implement the various processes of the above-described embodiment of a closed-loop optimized control method for water production and regeneration based on dual-tank softening, and achieve the same technical effect. To avoid repetition, they will not be described again here.

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

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

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

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

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

Claims

1. A closed-loop optimization control method for water production and regeneration based on dual-tank softening, characterized in that... The method includes: Real-time data on raw water flow rate, raw water hardness, and raw water sodium ion concentration are acquired from the first water treatment tank. Based on these data, the softening state is calculated to obtain the sodium ion concentration data of the outlet water from the first water treatment tank. Based on the sodium ion concentration data of the outlet water and the preset saturation threshold data, the saturation state of the bed is determined, and the regeneration trigger judgment data of the first water treatment tank is obtained; If the regeneration trigger judgment data reaches the preset regeneration conditions, the bed status data of the second water production tank is obtained. Based on the regeneration trigger judgment data and the bed status data, the dual-tank switching calculation is performed to obtain the water supply data of the second water production tank and the regeneration preparation data of the first water production tank. Based on the water supply data, the second water production tank is controlled to start water production, and the first water production tank is instructed to enter the regeneration preparation state. Based on the prepared regeneration data and the preset initial brine concentration data, the regeneration parameters of the first water production tank bed are calculated to obtain the regeneration liquid flow rate data and regeneration liquid concentration adjustment data of the first water production tank. Based on the regeneration liquid flow rate data and regeneration liquid concentration adjustment data, the brine injection and circulation flow rates of the first water production tank bed are controlled. Based on the regenerated liquid flow rate data, regenerated liquid concentration adjustment data, and bed ion migration kinetic model, prediction calculations were performed to obtain optimized control data for the regeneration parameters of the first water production tank, and regeneration control of the first water production tank was carried out based on the optimized control data for the regeneration parameters. The system acquires real-time water production status data from the second water production tank. Based on the regeneration parameter optimization control data and the real-time water production status data, it performs dual-tank circulation and waste liquid reuse control calculations to obtain continuous water output status data and waste liquid resource optimization data. Based on the continuous water output status data and waste liquid resource optimization data, it performs water production and regeneration parameter optimization calculations for the next cycle, forming a closed-loop data-driven control.

2. The closed-loop optimization control method for water production and regeneration based on dual-tank softening as described in claim 1, characterized in that... Among them, based on raw water flow rate data, raw water hardness data, and raw water sodium ion concentration data, the softening state is calculated to obtain the sodium ion concentration data of the outlet water of the first water treatment tank, including: Based on the raw water flow rate data, flow rate normalization calculation is performed to obtain the standardized flow rate data of the first water treatment tank; Based on the raw water hardness data, hardness mapping calculations were performed to obtain the standardized hardness data of the first water treatment tank; Based on the raw water sodium ion concentration data, a concentration normalization calculation was performed to obtain the standardized sodium ion concentration data for the first water treatment tank; Based on standardized flow rate data, standardized hardness data, and standardized sodium ion concentration data, a softening contribution matrix was generated and weighted to obtain the comprehensive softening status data of the first water tank; Based on comprehensive softening state data, the layer-by-layer ion distribution and adsorption capacity of the bed were simulated to obtain the ion occupancy data of each layer of the first water treatment tank bed; Based on the ion occupancy data of each layer of the first water treatment tank bed, the sodium ion leakage of the outlet water was estimated, and the sodium ion concentration data of the outlet water of the first water treatment tank was obtained.

3. The closed-loop optimization control method for water production and regeneration based on dual-tank softening as described in claim 1, characterized in that... Among them, based on the sodium ion concentration data of the outlet water and the preset saturation threshold data, the saturation state of the bed is determined, and the regeneration trigger judgment data of the first water treatment tank is obtained, including: Based on the sodium ion concentration data of the outlet water and the preset saturation threshold data, a threshold comparison calculation was performed to obtain the sodium ion saturation ratio data of the first water treatment tank; Based on the sodium ion saturation ratio data, the saturation state is classified and graded according to the preset grading rules to obtain the bed saturation grade data of the first water treatment tank; Based on the bed saturation level data and preset regeneration trigger rules, logical matching and trigger determination are performed to obtain the regeneration trigger determination data of the first water production tank.

4. The closed-loop optimization control method for water production and regeneration based on dual-tank softening as described in claim 1, characterized in that... The process involves performing dual-tank switching calculations based on regeneration trigger judgment data and bed status data to obtain the connection and water supply data for the second water production tank and the regeneration preparation data for the first water production tank, including: Based on the regeneration trigger judgment data and bed status data, the remaining adsorption capacity is compared and prioritized to obtain the dual-tank switching priority data; Based on the dual-tank switching priority data, water supply weight allocation and connection sequence determination are performed to obtain the connection and water supply data for the second water tank; Based on the dual-tank switching priority data and bed status data, the regeneration preparation sequence planning and brine distribution strategy are generated to obtain the regeneration preparation data for the first water production tank.

5. The closed-loop optimization control method for water production and regeneration based on dual-tank softening as described in claim 1, characterized in that... The process involves calculating the regeneration parameters of the first water treatment tank bed based on the prepared regeneration data and the preset initial brine concentration data, resulting in the regeneration liquid flow rate data and regeneration liquid concentration adjustment data for the first water treatment tank, including: Based on the prepared regeneration data and the preset initial concentration data of the brine solution, the adsorption capacity of the bed brine solution was evaluated and the segmented flow rate requirement analysis was performed to obtain the target flow rate data for bed regeneration; Based on the target flow rate data of bed regeneration and the preset initial concentration data of brine, gradient concentration distribution and flow rate matching optimization are performed to obtain the regenerated liquid flow rate data of the first water production tank; Based on the target flow rate data of bed regeneration and the preset bed adsorption capacity data, the salt concentration is adjusted in segments and the gradient is optimized to obtain the regenerated liquid concentration adjustment data of the first water production tank.

6. The closed-loop optimization control method for water production and regeneration based on dual-tank softening as described in claim 1, characterized in that... Among them, based on the regenerated liquid flow rate data, regenerated liquid concentration adjustment data, and bed ion migration kinetic model, prediction calculations were performed to obtain the optimized control data of the regeneration parameters of the first water production tank, including: Based on the regenerated liquid flow rate data and regenerated liquid concentration adjustment data, the ion migration state of each layer of the bed is simulated to obtain the real-time predicted ion distribution data of the first water production tank bed; Based on real-time predicted ion distribution data and bed ion migration kinetics model, the evolution of local concentration gradient in the bed and dynamic analysis of adsorption capacity are performed to obtain the predicted regeneration progress data of the first water treatment tank bed; Based on the regeneration progress prediction data, regenerated liquid flow rate data, and regenerated liquid concentration adjustment data, parameter optimization and matching analysis was performed to obtain the optimized control data of the regeneration parameters of the first water production tank.

7. The closed-loop optimization control method for water production and regeneration based on dual-tank softening as described in claim 1, characterized in that... Among them, based on the regeneration parameter optimization control data and real-time water production status data, dual-tank circulation and waste liquid reuse control calculations are performed to obtain continuous effluent status data and waste liquid resource optimization data, including: Based on the optimized control data of regeneration parameters and real-time water production status data, water production task priority ranking and cycle switching strategy are generated to obtain dual-tank cycle control data; Based on the dual-tank circulation control data, water quality index weighting fusion and flow dynamic matching analysis are performed to obtain continuous effluent status data; Based on continuous effluent status data and regeneration parameter optimization control data, the waste liquid reuse ratio is simulated and optimized, and the allocation scheme is parameterized to obtain waste liquid resource optimization data.

8. A closed-loop optimized control system for water production and regeneration based on dual-tank softening, characterized in that... The system includes: The raw water monitoring module acquires real-time data on raw water flow rate, hardness, and sodium ion concentration from the first water treatment tank. Based on these data, it calculates the softening state and obtains the sodium ion concentration data of the outlet water from the first water treatment tank. The saturation judgment module is used to judge the saturation state of the bed based on the sodium ion concentration data of the outlet water and the preset saturation threshold data, and to obtain the regeneration trigger judgment data of the first water production tank; The dual-tank switching module is used to obtain the bed status data of the second water production tank if the regeneration trigger judgment data reaches the preset regeneration conditions, perform dual-tank switching calculations based on the regeneration trigger judgment data and the bed status data, obtain the water supply data of the second water production tank and the regeneration preparation data of the first water production tank, and control the second water production tank to start water production based on the water supply data, while instructing the first water production tank to enter the regeneration preparation state; The regeneration parameter determination module is used to calculate the regeneration parameters of the first water production tank bed based on the prepared regeneration data and the preset initial concentration data of the brine solution, to obtain the regeneration liquid flow rate data and regeneration liquid concentration adjustment data of the first water production tank, and to control the brine injection and circulation flow rate of the first water production tank bed based on the regeneration liquid flow rate data and regeneration liquid concentration adjustment data; The optimization prediction module is used to perform prediction calculations based on regenerated liquid flow rate data, regenerated liquid concentration adjustment data, and bed ion migration kinetics model to obtain optimized control data for the regeneration parameters of the first water production tank, and to perform regeneration control of the first water production tank based on the optimized control data for the regeneration parameters; The closed-loop control module is used to acquire real-time water production status data of the second water production tank, optimize control data based on regeneration parameters and real-time water production status data, perform dual-tank circulation and waste liquid reuse control calculations, obtain continuous water output status data and waste liquid resource optimization data, and perform water production and regeneration parameter optimization calculations for the next cycle based on continuous water output status data and waste liquid resource optimization data, forming a closed-loop data-driven control.

9. An electronic device, comprising a processor, a memory, and a program or instructions stored in the memory and executable on the processor, characterized in that... The program or instructions are adapted to be loaded and run by the processor to perform the closed-loop optimized control method for water production and regeneration based on dual-tank softening as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a plurality of program codes, characterized in that... The program code is adapted to be loaded and run by a processor to perform a closed-loop optimization control method for water production and regeneration based on dual-tank softening, as described in any one of claims 1 to 7.