A two-dimensional configuration method and system for water plants
Patent Information
- Application Number
- CN202511863427.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2045-12-11
AI Technical Summary
鉴于现有技术的上述缺点、不足,本申请提供一种面向水厂的二维组态方法,其解决了人工组态的方式高度依赖工程师个人经验,错误率较高,且效率低下的技术问题
本申请的一种面向水厂的二维组态方法和系统,通过预先训练的CART决策树配置数据预测模型,可基于设备工况数据自动输出标准化配置数据,不仅复用了水厂历史运行经验,还借助专家约束策略的剪枝处理,确保配置数据符合行业规范与工程实际,显著提升了二维组态的自动化水平和可靠性的同时,抑制了参数冗余和过度拟合,提升了组态效率。
Smart Images

Figure CN121578770B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automation control technology, and in particular to a two-dimensional configuration method and a two-dimensional configuration system for water plants. Background Technology
[0002] Two-dimensional configuration is the core carrier for realizing water plant equipment monitoring, process visualization and remote operation and maintenance. In two-dimensional configuration, key tasks such as equipment tag number configuration, process animation presentation and multi-system data linkage need to be completed. It directly affects the construction efficiency and operation and maintenance stability of the water plant automatic control system, and is therefore widely used in the automated control scenarios of various processes in water plants.
[0003] When setting up an existing water plant configuration system, engineers typically need to first download equipment diagrams from professional configuration software, then manually bind tag numbers and real-time data points to each diagram, and then repeatedly verify parameters such as tag number naming, range, and PID initial values. For process animations such as water flow, chemical dosing diffusion, and sedimentation, UI designers also need to hand-draw animation effects frame by frame and implement them in hard-coded on the front end. At the same time, the equipment naming rules of different systems such as SCADA, Web configuration, and IoT platforms are not consistent, requiring manual export of Excel spreadsheets and manual import between the systems to complete parameter synchronization.
[0004] This manual configuration method often relies heavily on the personal experience of engineers. The same "dosing-sedimentation" process may encounter problems such as naming conflicts, range deviations, arbitrary initial PID values, and missing animation parameters in different projects, leading to repeated rework of subsequent configurations. Moreover, the manual configuration method is inefficient, and the configuration work of water plant expansion projects requires an average of 2 to 3 weeks of time from multiple people to complete. Summary of the Invention
[0005] (a) Technical problems to be solved In view of the above-mentioned shortcomings and deficiencies of the prior art, this application provides a two-dimensional configuration method for water plants, which solves the technical problems of manual configuration being highly dependent on the personal experience of engineers, having a high error rate, and being inefficient.
[0006] (II) Technical Solution To achieve the above objectives, the main technical solutions adopted in this application include: In a first aspect, embodiments of this application provide a two-dimensional configuration method for water plants, including: Input the operating data of any equipment in the water plant into a pre-trained configuration data prediction model to obtain the corresponding configuration data; The configuration data is rendered based on the pre-deployed Handlebars configuration strategy to obtain Web configuration data, tag point table data, and animation description data for supporting two-dimensional configuration of the device. The configuration data prediction model is trained based on the following steps: The model training set is built based on the pre-set historical operation records of each piece of equipment in the water plant; the equipment operation record corresponding to any piece of equipment includes historical operating data for multiple time periods, as well as the configuration data labels corresponding to the historical operating data for each time period; The pre-built CART decision tree model is trained based on the model training set. After training, all nodes of the CART decision tree model are traversed. If the splitting path conditions and node output of any node in the CART decision tree model do not match the pre-set expert constraint strategy, the node is pruned based on the expert constraint strategy to obtain a configuration data prediction model for predicting device configuration data.
[0007] Optionally, in one specific embodiment, both the configuration data and the configuration data tag include: device configuration data and animation configuration data; The model training set is constructed based on the pre-set historical operation records of each piece of equipment in the water plant, including: Collect the water plant location table and process as-built drawings of the water plant, and obtain all historical operating condition data of each piece of equipment in the water plant, as well as the equipment configuration data corresponding to each historical operating condition data, based on the water plant location table and process as-built drawings. Based on each historical working condition data and a pre-established mapping table, obtain the animation configuration data corresponding to each historical working condition data. The mapping table is a mapping relationship table between historical working condition data and animation configuration data; For each device, the historical operating condition data, device configuration data, and animation configuration data are preprocessed, and a model training set is established based on all the preprocessed historical operating condition data, device configuration data, and animation configuration data; the preprocessing includes data cleaning and field standardization.
[0008] Optionally, in one specific embodiment, training a pre-built CART decision tree model based on a model training set includes: Initialize the CART decision tree model; Feature extraction is performed on the model training set to obtain the first feature matrix corresponding to the historical working condition data and the second feature matrix corresponding to the configuration data labels; The first and second feature matrices are input into the CART decision tree model for recursive splitting; During training, the node sample set corresponding to each node in the CART decision tree model is obtained; each node sample set is a subset selected from the first feature matrix and the first feature matrix according to the splitting path conditions pre-set in the previous node of the CART decision tree model. Based on the node sample set corresponding to each node, obtain the first weighted Gini index of each node before splitting. Based on the splitting path conditions and node sample set of each node, the second weighted Gini index after splitting each node is obtained, and based on the first weighted Gini index and the second weighted Gini index of each node, the optimization magnitude corresponding to each node is obtained; the optimization magnitude is the difference between the first weighted Gini index and the second weighted Gini index. Based on the optimization magnitude corresponding to each node and the pre-set business penalty coefficient, the final split score corresponding to each node is obtained. The model parameters of the CART decision tree model are optimized based on the optimization magnitude and final split score corresponding to each node.
[0009] Optionally, in a specific embodiment, based on the splitting path conditions of each node and the node sample set, the second weighted Gini index after the split of each node is obtained, including: Based on the splitting path conditions of each node, the node sample set of each node is split into the first node sample set and the second node sample set. Based on the first and second node sample sets for each node, and a pre-set formula (Formula 1), the third and fourth weighted Gini indices for each node are obtained respectively; the first formula is: ; Where Gini is the weighted Gini index, K is the total number of variable categories, k is the index of the variable category, and w k For the variable category with index k, a pre-defined relevance weight is p. k This represents the percentage of all samples belonging to the variable category with index k. Based on the third and fourth weighted Gini indices corresponding to each node, the second weighted Gini index is obtained; the second weighted Gini index is the sum of the product of the proportion of the sample size in the first node sample set to the sample size in the node sample set and the third weighted Gini index, and the product of the proportion of the sample size in the second node sample set to the sample size in the node sample set and the fourth weighted Gini index.
[0010] Optionally, in a specific embodiment, the final split score for each node is obtained based on the optimization magnitude corresponding to each node and a pre-set business penalty coefficient, including: Based on a pre-set business conflict judgment strategy, determine whether there is a conflict in the split path conditions corresponding to each node. If there is no business conflict, the final split score for each node is the optimization magnitude for that node. If there is a business conflict, the final split score for each node is the difference between the optimization margin and the business penalty coefficient.
[0011] Optionally, in a specific embodiment, the Handlebars configuration strategy includes a tag point table configuration strategy, a Web configuration JSON configuration strategy, and an animation description JSON configuration strategy; Then, based on the pre-deployed Handlebars configuration strategy, the configuration data is rendered to obtain Web configuration data, tag point table data, and animation description data for supporting two-dimensional device configuration, including: The configuration data is subjected to feature extraction and data integration to obtain the corresponding JSON array; The JSON array is rendered based on the tag point table configuration strategy, the Web configuration JSON configuration strategy, and the animation description JSON configuration strategy, respectively, to obtain Web configuration data, tag point table data, and animation description data for supporting two-dimensional configuration of the device; Write the device's Web configuration data, tag point table data, and animation description data into the pre-configured Web configuration file, tag point table file, and animation description file, respectively.
[0012] Optionally, in a specific embodiment, all nodes of the CART decision tree model are traversed. If the splitting path conditions and node output of any node in the CART decision tree model do not match a pre-set expert constraint strategy, pruning is performed on that node based on the expert constraint strategy, including: The process involves traversing the CART decision tree model layer by layer from the bottom node upwards, and verifying the splitting path conditions and node outputs of each node during the traversal. If the splitting path conditions and node output of any node in the CART decision tree model do not match the pre-set expert constraint strategy, the node output of that node is replaced / deleted based on whether the node output is related to the expert constraint strategy.
[0013] Optionally, in a specific embodiment, the device's Web configuration data, tag point table data, and animation description data are respectively written into a pre-set Web configuration file, tag point table file, and animation description file, including: Generate a corresponding unique identification code based on the device's tag number table data, and write the device's tag number table data and unique identification code as a single data entry into the tag number table file. Write the device's Web configuration data and unique identification code as a set of data into the Web configuration file. Write the device's animation description data and unique identification code as a single data entry into the animation description file. Based on the unique identifiers in the Web configuration file, tag point table file, and animation description file, the Web configuration data, tag point table data, and animation description data are mapped and aligned.
[0014] Optionally, in a specific embodiment, after mapping and aligning the Web configuration data, tag point table data, and animation description data, the method further includes: When any Web configuration data, tag point table data, or animation description data in the Web configuration file, tag point table file, and animation description file is modified, the content of the Web configuration data, tag point table data, or animation description data in the Web configuration file, tag point table file, and animation description file is synchronized.
[0015] Secondly, embodiments of this application provide a two-dimensional configuration system for water plants, including a memory, a processor, and a computer program stored in the memory, characterized in that the processor executes the computer program to implement the aforementioned two-dimensional configuration method for water plants.
[0016] (III) Beneficial Effects This application presents a two-dimensional configuration method and system for water plants. By using a pre-trained CART decision tree configuration data prediction model, it can automatically output standardized configuration data based on equipment operating data. This not only reuses the historical operating experience of water plants, but also uses expert constraint strategies for pruning to ensure that the configuration data conforms to industry standards and engineering realities. This significantly improves the automation level and reliability of two-dimensional configuration, while suppressing parameter redundancy and overfitting, thus improving configuration efficiency. Attached Figure Description
[0017] Figure 1 A schematic diagram of a two-dimensional configuration method for water plants provided in this application embodiment; Figure 2 A flowchart of a two-dimensional configuration method for water plants is provided in this application embodiment; Figure 3 This is a schematic diagram of the training process for the configuration data prediction model provided in the embodiments of this application. Detailed Implementation
[0018] To better explain and facilitate understanding of this application, the following detailed description of the application is provided in conjunction with the accompanying drawings and specific embodiments.
[0019] Two-dimensional configuration is the core carrier for realizing equipment monitoring, process visualization, and remote operation and maintenance in water plants. During two-dimensional configuration, key tasks such as equipment tag number configuration, process animation presentation, and multi-system data linkage need to be completed. This directly affects the construction efficiency and operation and maintenance stability of the water plant's automation system, thus it is widely used in automated control scenarios for various processes in water plants. However, traditional configuration methods heavily rely on manual operation. Engineers need to manually download graphics and bind data points, repeatedly verifying various process parameters; process animations require UI designers to hand-draw frame by frame and hard-code on the front end; and the naming rules of multiple systems such as SCADA and Web configuration are inconsistent, requiring manual export of tables to synchronize parameters. This method is not only inefficient—on average, configuration for water plant expansion projects requires multiple people and 2-3 weeks—but also, due to its reliance on engineers' personal experience, often results in naming conflicts, range deviations, and arbitrary initial PID values, leading to repeated rework and severely impacting the construction efficiency and operation and maintenance stability of the automation system. This application proposes a two-dimensional configuration method for water plants. This method utilizes a pre-trained CART decision tree configuration data prediction model to automatically output standardized configuration data based on equipment operating data. It fully leverages historical operating experience of water plants and employs expert constraint strategies to prune model nodes, ensuring that the configuration data conforms to industry standards and engineering realities. This method significantly improves the automation level and parameter reliability of two-dimensional configuration, effectively suppressing model parameter redundancy and overfitting problems. It fundamentally solves the problems of experience dependence and rework in manual configuration, greatly improving the overall efficiency of two-dimensional configuration for water plants.
[0020] To better understand the above technical solutions, exemplary embodiments of this application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application can be understood more clearly and thoroughly, and that the scope of this application can be fully conveyed to those skilled in the art.
[0021] This application provides a two-dimensional configuration method for water plants, such as... Figure 1 and Figure 3 As shown, it includes: S10. Input the operating condition data of any equipment in the water plant into the pre-trained configuration data prediction model to obtain the corresponding configuration data; S20. Render the configuration data based on the pre-deployed Handlebars configuration strategy to obtain Web configuration data, tag point table data and animation description data for supporting two-dimensional configuration of the device. like Figure 2 As shown, the data prediction model is trained based on the following steps: S01. Construct a model training set based on the pre-set historical operation records of each piece of equipment in the water plant; the equipment operation record corresponding to any piece of equipment includes historical operating data for multiple time periods, as well as configuration data labels corresponding to the historical operating data for each time period; S02. Train the pre-built CART decision tree model based on the model training set; and after training, traverse all nodes of the CART decision tree model. When the splitting path conditions and node output of any node in the CART decision tree model do not match the pre-set expert constraint strategy, prune the node based on the expert constraint strategy to obtain a configuration data prediction model for predicting device configuration data.
[0022] This embodiment utilizes a pre-trained CART decision tree configuration data prediction model to automatically output standardized configuration data based on equipment operating data. This fully leverages the water plant's historical operating experience and employs expert constraint strategies to prune model nodes, ensuring the configuration data conforms to industry standards and engineering realities. This significantly improves the automation level and parameter reliability of two-dimensional configuration, effectively suppressing model parameter redundancy and overfitting issues. It fundamentally solves the problems of experience dependence and rework associated with manual configuration, greatly enhancing the overall efficiency of two-dimensional configuration in water plants.
[0023] Optionally, in a specific embodiment, the operating data includes, but is not limited to: process section, equipment type, flow rate Q, turbidity TU, pump frequency Hz, valve opening degree; configuration data includes, but is not limited to: tag name string, upper limit of range, alarm high, PID_P, PID_I, PID_D, animation speed, particle color, and diffusion radius. Common process sections include seven main processes: water intake, chemical dosing, flocculation, sedimentation, filtration, disinfection, and sludge discharge.
[0024] Optionally, in a specific embodiment, the Handlebars configuration strategy includes a tag point table configuration strategy, a Web configuration JSON configuration strategy, and an animation description JSON configuration strategy; Then, based on the pre-deployed Handlebars configuration strategy, the configuration data is rendered to obtain Web configuration data, tag point table data, and animation description data for supporting two-dimensional device configuration, including: Feature extraction and data integration are performed on the configuration data to obtain the corresponding JSON array; The JSON array is rendered based on the tag point table configuration strategy, the Web configuration JSON configuration strategy, and the animation description JSON configuration strategy, respectively, to obtain Web configuration data, tag point table data, and animation description data for supporting two-dimensional configuration of the device; Write the device's Web configuration data, tag point table data, and animation description data into the pre-configured Web configuration file, tag point table file, and animation description file, respectively.
[0025] Specifically, to automatically convert the "candidate table + animation parameters" output by the decision tree into three heterogeneous files that can be directly read by SCADA, Web configuration, and animation engines, this system uses a lightweight template engine to complete the synchronous rendering of the three configuration files in a single process. The specific steps are as follows: Three template files (i.e., Handlebars configuration strategies) are pre-defined in a designated directory on the server: a tag point table template, a Web configuration JSON template, and an animation description JSON template. An input subdirectory is also created to store the uniformly formatted JSON files generated after decision tree inference; an output subdirectory is created to store the rendered final version file.
[0026] The tag number, unique identifier, coordinates, style, interface address, animation speed, particle color, range, alarm value, and unit fields of each device output by the configuration data prediction model are written into the same JSON array to ensure that the field names correspond one-to-one with the template placeholders.
[0027] Examples of template content: Tag Number Table Template: The first line contains a Chinese title: "Tag Number, Unique Identifier, Range, Unit, Alarm High, Alarm Low, Proportional Coefficient, Integral Time, Derivative Time". Subsequent lines use placeholders and loop through each device record. Web Configuration JSON Template: Using "Device" as the key, it loops through arrays of objects containing tag number, unique identifier, coordinate objects, style strings, and data interface addresses. Animation Description JSON Template: Using "Animation" as the key, it loops through arrays of objects containing tag number, unique identifier, water flow velocity, particle color, diffusion radius, and sedimentation time.
[0028] The process of rendering a JSON array using Handlebars configuration strategies is as follows: Read the input JSON array to obtain the device array; The template engine compilation function is called to inject the device arrays into the three templates mentioned above. CSV data (location point table data), Web configuration JSON data (Web configuration data), and animation JSON data (animation description data) are generated in parallel within the same process. The three sets of text are written synchronously to the corresponding files in the input directory, and the file digests are calculated for version verification.
[0029] The rendering result is shown below: Tag number table data: tag number, unique identifier, range, unit, high alarm, low alarm, proportional coefficient, integral time, derivative time (PAC03,3fa2c4b9,400,L / h,360,0,1.2,0.3,0).
[0030] Web configuration JSON data: {"equipment":[{ "Tag Number": "PAC03", "Unique Identifier": "3fa2c4b9", "Coordinates": {"x": 120, "y": 80}, "style": "position:absolute;width:32px;height:32px;background:url(pump.png)", "Interface": " / api / realtime / 3fa2c4b9"}]}.
[0031] Animation JSON file: {“Animation”:[{ "Tag Number": "PAC03", "Unique Identifier": "3fa2c4b9", "Water Flow": {"Speed": 73, "Color": "#00BFFF"}, "Particles": {"Radius": 84}, "Sedimentation": 0}]}.
[0032] This application embodiment utilizes three preset templates—a tag point table, a Web configuration JSON, and an animation description JSON—combined with a standardized JSON array output by the decision tree. This enables the simultaneous rendering of three heterogeneous files for 5000 devices within 300ms, significantly improving configuration file generation efficiency. Furthermore, through precise matching of field names and template placeholders and a parallel rendering mechanism, the output CSV tag point table, Web configuration JSON, and animation description JSON can be directly imported into SCADA, the front-end framework, and the animation engine, achieving a one-time implementation of "tag-position-animation," reducing the error rate of manual operation to zero. Simultaneously, the templates and the decision tree model are completely decoupled; subsequent field changes only require updating the template, without adjusting the model, significantly reducing system maintenance costs. Moreover, standardized configuration data effectively avoids synchronization problems caused by naming and parameter differences between multiple systems, further ensuring the standardization and stability of the water plant automation system.
[0033] Optionally, in a specific embodiment, the device's Web configuration data, tag point table data, and animation description data are respectively written into a pre-set Web configuration file, tag point table file, and animation description file, including: Generate a corresponding unique identification code based on the device's tag number table data, and write the device's tag number table data and unique identification code as a single data entry into the tag number table file. Write the device's Web configuration data and unique identification code as a set of data into the Web configuration file. Write the device's animation description data and unique identification code as a single data entry into the animation description file. Based on the unique identifiers in the Web configuration file, tag point table file, and animation description file, the Web configuration data, tag point table data, and animation description data are mapped and aligned.
[0034] Furthermore, after mapping and aligning the Web configuration data, tag point table data, and animation description data, the method also includes: When any Web configuration data, tag point table data, or animation description data in the Web configuration file, tag point table file, and animation description file is modified, the content of the Web configuration data, tag point table data, or animation description data in the Web configuration file, tag point table file, and animation description file is synchronized.
[0035] The specific process is as follows: Initial synchronization: After rendering is complete, the Web configuration module inserts records into the "Tag Point Table File" in batches, and generates a UUID for each record; the "Tag Point Table File" immediately broadcasts the UUID and neutral field through the MQTT Tag / Initial topic; the SCADA and IoT platforms subscribe to this topic, and after receiving the message, they establish a mapping view of external UUID → internal point number to complete the first alignment, all within 3 seconds.
[0036] Operational modifications (taking SCADA as an example): Maintenance personnel change the upper limit of the PAC03 range from 400L / h to 450L / h on the SCADA HMI interface; SCADA calls the RESTful interface PATCH / tag / {UUID} / range, with the request body containing only the field "range:450"; the tag number table file verifies the existence of the UUID → updates the field → writes the operation log → provides feedback OK; the pig data table immediately pushes a JSON message to the MQTT Tag / Update topic; the Web configuration and IoT platform subscribe to the same topic, and upon receiving the message: the Web configuration updates the VuexStore in real time, the range bar on the screen automatically lengthens without refreshing the liquid level, the IoT platform updates the device shadow document, and the energy consumption benchmark is recalculated after triggering.
[0037] When two platforms modify the same field simultaneously (with a preset time range), the one with the later timestamp wins. If the timestamp difference is less than 1 second, the decision is made according to the preset priority. The decision result is broadcast along with the MQTT message, and each platform rolls back its local value and notifies the user.
[0038] Hot-plugging and rollback: When a new device is added, it is rendered and inserted into the master data table, automatically triggering a "Tag / Add" broadcast. The mapping is dynamically appended to each system without restarting. When a device is deleted, it is marked "deprecated" in the master data table and broadcast. The interface of each system displays it in grayscale. After a 30-day cooling-off period, it is physically deleted to prevent accidental deletion. For version rollback, the master data table retains the snapshots of the most recent 10 versions. Administrators can restore to any historical point through "one-click rollback". The rollback message is broadcast with the "Tag / Rollback" topic. Each system receives the message and synchronously overwrites its local value.
[0039] In this embodiment, a "tag point table file" is established in the water plant field. The 32-bit globally unique identifier (UUID) is used as the primary key, and "tag name, range, unit, alarm upper and lower limits, PID initial value, and animation parameters" are stored as neutral fields. When any system initiates a write operation, it is pushed to the other two systems in seconds through a publish-subscribe mechanism, so as to achieve "one modification, three changes".
[0040] Furthermore, to overcome the shortcomings of traditional solutions that rely on professional UI software (InTouch, iFix, KingView, etc.), water plant process personnel can complete the entire process of "equipment placement → data binding → process animation" simply through a browser, without the need to install plugins or hand-draw animations.
[0041] The prerequisites are: the initial synchronization of the "UUID" has been completed, and the "2D Web configuration engine" (approximately 320KB WebAssembly+JS, automatically cached on the first visit) provided by this system has been loaded on the browser.
[0042] The operation process is as follows: Enter the configuration platform URL in the browser address bar, and you will be automatically redirected to the "Project List Page"; click "Create Project", and a dialog box will pop up. Fill in only the "Project Name" and "Process Section Type" (drop-down options: water intake, chemical dosing, flocculation, sedimentation, filtration, disinfection, sludge discharge). The system background will immediately call the decision tree reasoning interface, return the default equipment list and animation parameters for the process section, and automatically generate the project UUID.
[0043] Upon entering the "Canvas Page," the left side displays the "Equipment Pool" panel. Icons within this panel are pre-filtered by the decision tree according to "Process Section + Equipment Type," listing only equipment likely used in this project (e.g., for the dosing room project, only PAC metering pumps, electromagnetic flow meters, turbidity meters, and agitators appear). When the user drags an icon to any position on the canvas and releases the mouse, the front-end reads the pixel coordinates (x, y) using getBoundingClientRect(), converts them to 0.1% precision relative coordinates, and immediately writes them to temporary JSON. The back-end sends a "Position Change" message via WebSocket, and the main data table records the latest coordinates of the device's UUID—all within <200ms. If the user wishes to place icons in batches, they can click the "Automatic Layout" button: the system automatically calculates row and column spacing based on typical water plant flow directions (top-down, zigzag, concentric), generates anti-collision grid coordinates, and places the icons with a single click, avoiding overlap.
[0044] Clicking on any placed device element will bring up an "Attribute Drawer" on the right. The "Data Binding" area within the drawer lists all bindable quantities (flow rate, frequency, turbidity, valve opening, etc.) corresponding to the device's UUID. This list is retrieved in real-time from the main data table. Users only need to select "True Point Number of This Plant" in the "Binding Point" dropdown (the dropdown content is dynamically obtained via a REST interface and is consistent with the SCADA point table). The system immediately writes the binding field and saves it back to the main data table. After successful binding, a "chain" icon automatically appears in the lower right corner of the element. Hovering the mouse over it allows you to view the real-time value (pushed once per second via WebSocket) without refreshing the page.
[0045] Process animation configuration: After selecting the equipment, switch the drawer to the "Animation" tab. The system has pre-filled default values based on the decision tree output: water flow speed, particle color, diffusion radius, and sedimentation residence time. Users can directly modify the values or click the "Visual Adjustment" button. A timeline + slider window pops up at the bottom of the canvas: when the slider is dragged, the Canvas redraws the particle movement in real time, achieving "what you see is what you get". After confirmation, click "Apply". The system writes the latest animation parameters into the ani.json template and synchronizes it to the main data table, and then broadcasts the MQTT AniUpdate topic to the animation engine. The whole process takes less than 1 second. If you need to turn off the animation, simply switch the "Enable / Disable" switch. There is no need to delete the primitives.
[0046] Saving and Publishing: Clicking the "Save" button at the top, the frontend writes the current canvas JSON (including coordinates, bindings, and animations) to the backend via PUT / project / {project UUID}; the backend immediately performs triple validation: coordinate conflict detection (overlapping area > 0 is considered a conflict); binding missing detection (unbound real-time points are highlighted in red); animation exceeding limits detection (speed > 200 px / s or color not in the Web safe color list is blocked); after passing the validation, a "release version number Vn+1" is automatically generated, and a "ConfigUpdate" event is broadcast to the SCADA and IoT platforms; each platform receives the event, pulls the latest JSON, completes the hot update, and does not require a restart.
[0047] Online Preview and Rollback: After successful saving, a "Preview" button will appear in the upper right corner. Clicking it will open a read-only address in a new tab. The address includes the project UUID and can be accessed directly from any terminal (PC / tablet / phone). If an error is found, you can click "Rollback to Vn" in the "Version History" list. The system will immediately restore the main data table and canvas JSON to the previous version and broadcast the event again, achieving a rollback within seconds.
[0048] This embodiment establishes a multi-file data mapping through a globally unique identifier (UUID) and combines it with the MQTT publish-subscribe mechanism to achieve "one-place modification, three-place simultaneous change". This not only achieves precise alignment and second-level synchronization of Web configuration, tag point table, and animation description data, but also resolves conflicts caused by concurrent modifications across multiple platforms through timestamp priority adjudication. Coupled with hot-swapping and version rollback mechanisms, it supports dynamic addition and removal of devices without system restart, and enables one-click rollback through historical snapshots, effectively avoiding the risk of accidental operation and ensuring the consistency and security of configuration data. On the other hand, based on the lightweight 2DWeb configuration engine, process engineers can complete the entire process configuration with just a browser, without the need to install professional software and plugins. It can automatically filter equipment pools according to process sections, support drag-and-drop equipment placement and batch automatic arrangement, and the equipment attributes and animation parameters are pre-filled with default values by the decision tree. It supports visual adjustment and real-time preview, and the triple verification during saving can intercept configuration anomalies. After publishing, it can realize hot updates on multiple platforms. It not only reduces the threshold of configuration operation and improves configuration efficiency, but also realizes the "what you see is what you get" process animation configuration, completely eliminating the dependence on professional UI and coding personnel, greatly reducing the configuration error rate, and realizing the lightweight and intelligent two-dimensional configuration of water plants.
[0049] Optionally, in one specific embodiment, both the configuration data and the configuration data label include: device configuration data and animation configuration data; The model training set is constructed based on the pre-set historical operation records of each piece of equipment in the water plant, including: Collect the water plant location table and process as-built drawings of the water plant, and obtain all historical operating condition data of each piece of equipment in the water plant, as well as the equipment configuration data corresponding to each historical operating condition data, based on the water plant location table and process as-built drawings. Based on each historical working condition data and a pre-established mapping table, obtain the animation configuration data corresponding to each historical working condition data. The mapping table is a table showing the mapping relationship between historical operating condition data and animation configuration data; For each device, the historical operating condition data, device configuration data, and animation configuration data are preprocessed, and a model training set is established based on all the preprocessed historical operating condition data, device configuration data, and animation configuration data; the preprocessing includes data cleaning and field standardization.
[0050] Specifically, a historical sample database was constructed, extracting data points and process as-built diagrams from the DCS / SCADA platforms of completed water plants over the past 5 years, covering 7 major process stages including water intake, chemical dosing, flocculation, sedimentation, filtration, disinfection, and sludge discharge, totaling 183,420 equipment records.
[0051] Data cleaning was performed to remove sensor faulty segments and abnormal segments during the commissioning period, retaining samples that had been in steady-state operation for more than 30 days.
[0052] The fields are standardized. Heterogeneous names such as "P101" and "Level 1 Pump #1" are mapped to the "Unified Coding Guidelines for Water Plant Automation Design" according to existing rules and experience, forming a standard tag.
[0053] Animation annotations: The UI designer supplements the pixel speed, color, and radius of water flow, chemical diffusion, and sedimentation as animation labels.
[0054] This embodiment integrates experience from water plant DCS / SCADA point tables, process as-built drawings, and UI animation design to construct a high-quality, structured multimodal training sample library. This library not only covers core process sections and contains over 180,000 steady-state operation records, but also standardizes equipment naming conventions and supplements animation configuration tags. This effectively solves the problems of heterogeneous historical data, high noise levels, and semantic inconsistencies. The model training set formed on this basis enables the configuration data prediction model to synchronously output compliant equipment parameters and visually consistent animation parameters. This ensures both the accuracy and reliability of control logic such as tag numbers, ranges, and alarms, and the realism and credibility of animation effects such as water flow velocity, particle color, and diffusion radius, significantly improving configuration efficiency.
[0055] Optionally, in one specific embodiment, training a pre-built CART decision tree model based on a model training set includes: Initialize the CART decision tree model; Feature extraction is performed on the model training set to obtain the first feature matrix corresponding to the historical working condition data and the second feature matrix corresponding to the configuration data labels; The first and second feature matrices are input into the CART decision tree model for recursive splitting; During training, the node sample set corresponding to each node in the CART decision tree model is obtained; each node sample set is a subset selected from the first feature matrix and the first feature matrix according to the splitting path conditions pre-set in the previous node of the CART decision tree model. Based on the node sample set corresponding to each node, obtain the first weighted Gini index of each node before splitting. Based on the splitting path conditions and node sample set of each node, the second weighted Gini index after splitting each node is obtained, and based on the first weighted Gini index and the second weighted Gini index of each node, the optimization magnitude corresponding to each node is obtained; the optimization magnitude is the difference between the first weighted Gini index and the second weighted Gini index. Based on the optimization magnitude corresponding to each node and the pre-set business penalty coefficient, the final split score corresponding to each node is obtained. The model parameters of the CART decision tree model are optimized based on the optimization magnitude and final split score corresponding to each node.
[0056] Furthermore, based on the splitting path conditions and node sample set of each node, the second weighted Gini index after each node split is obtained, including: Based on the splitting path conditions of each node, the node sample set of each node is split into the first node sample set and the second node sample set. Based on the first and second node sample sets for each node, and the pre-set Formula 1, the third and fourth weighted Gini indices for each node are obtained respectively; Formula 1 is: ; Where Gini is the weighted Gini index, K is the total number of variable categories, k is the index of the variable category, and w k For the variable category with index k, a pre-defined relevance weight is p. k This represents the percentage of all samples belonging to the variable category with index k. Based on the third and fourth weighted Gini indices corresponding to each node, the second weighted Gini index is obtained. The second weighted Gini index is the sum of the product of the proportion of the sample size in the first node sample set to the total sample size in the node sample set and the third weighted Gini index, and the product of the proportion of the sample size in the second node sample set to the total sample size in the node sample set and the fourth weighted Gini index.
[0057] Furthermore, based on the optimization magnitude corresponding to each node and the pre-set business penalty coefficient, the final split score corresponding to each node is obtained, including: Based on a pre-set business conflict judgment strategy, determine whether there is a conflict in the split path conditions corresponding to each node. If there is no business conflict, the final split score for each node is the optimization magnitude for that node. If there is a business conflict, the final split score for each node is the difference between the optimization margin and the business penalty coefficient.
[0058] Specifically, model parameter initialization and basic parameter settings include: setting tree structure constraint parameters, including a maximum tree depth of 8 and a minimum sample size of 50 for leaf nodes; simultaneously initializing business-related parameters, such as sensor accuracy benchmarks (used to determine the range difference threshold), business penalty coefficient λ = 0.05~0.1 (empirical value), and mutual information-weight mapping rules (the higher the inter-column mutual information, the higher the weight w). k The smaller).
[0059] The model input is defined as historical operating condition features, and the output is an 8-dimensional configuration vector (tag name, range, alarm value, PID parameters, animation parameters), ensuring that the model completes multi-label joint learning under the same splitting criterion, rather than being trained independently in 8 separate sessions.
[0060] Historical operating condition data of all equipment was extracted from the model training set, including features such as process section, equipment type, flow rate Q, turbidity TU, pump frequency Hz, and valve opening percentage, and organized into a historical operating condition feature matrix X (i.e., the first feature matrix). Configuration data tags corresponding to each historical operating condition data point were extracted and integrated into an 8-dimensional configuration tag matrix Y (i.e., the second feature matrix) according to fixed dimensions (tag number, upper and lower limits of the measuring range, four-limit alarm values, PID parameters, and animation parameters), establishing a one-to-one mapping relationship between "operating condition feature X → configuration tag Y".
[0061] Use the complete feature matrix X and label matrix Y as the initial sample set for the root node.
[0062] During the recursive splitting process, the sample set S of the current node is obtained from the sample set of its parent node according to the splitting path conditions of the parent node (such as "process section = dosing and Q>2000m"). 3 The subset selected by / h”; if the current node is the root node, then S = the initial sample set.
[0063] For the current node sample set S, calculate the first weighted Gini index Gini(S) before splitting according to Formula 1; Formula 1 is: ; Where Gini is the weighted Gini index, K is the total number of variable categories, k is the index of the variable category, and wk For the variable category with index k, a pre-defined relevance weight is p. k This represents the percentage of all samples belonging to the variable category with index k.
[0064] Based on the splitting path conditions of the current node (e.g., "Q>2000m") 3 / h"), splitting the sample set S into the left child node sample set S left and the right child node sample set S right .
[0065] Calculate S respectively left and S right The weighted Gini index, denoted as the third-weighted Gini index (S left ) and the fourth weighted Gini index (S right The calculation logic is consistent with that of the first weighted Gini index.
[0066] The second weighted Gini index (S) is calculated by summing the samples based on the proportion of each child node. split ).
[0067] The formula for calculating the improvement in node purity (optimization margin) ΔGini after splitting is as follows: △Gini = Gini(S) - Gini(S) split The larger △Gini is, the better the splitting scheme optimizes node purity.
[0068] Verify the left child node sample set S after splitting left and the right child node sample set S right The range difference of the corresponding equipment, if the difference is greater than 10 × sensor accuracy (e.g., flow sensor accuracy 0.5m) 3 / h, then the threshold = 5m 3 If the condition is determined to be a business conflict (e.g., / h), a penalty of Penalty=0.05 is triggered; otherwise, Penalty=0.
[0069] The final split score is calculated by combining the optimization magnitude and business penalty items, using the following formula: Score = △Gini - λ·Penalty; If there is no business conflict: Score = ΔGini, the score is determined by data gain; if there is a business conflict: Score = ΔGini 0.05λ, business conflicts reduce the priority of the solution.
[0070] Iterate through all possible splitting path conditions for the current node, select the scheme with the highest final splitting score to perform node splitting, ensuring that the splitting conforms to both data patterns and engineering constraints; split the node according to the selected scheme, if the child node sample set satisfies "minimum sample size of leaf node ≥ 50" or "maximum tree depth = 8", then stop the branch splitting, mark the child node as a leaf node, and store the 8-dimensional configuration vector joint mode of the node sample set (instead of the single majority class of traditional CART); otherwise, take the child node sample set as the new S, and repeat the above recursive splitting process; repeat the above steps until all branches meet the stopping conditions, generating a preliminary CART decision tree model, and then perform pruning through expert constraint strategies to obtain the final configuration data prediction model.
[0071] This embodiment constructs a dual feature matrix of operating conditions and configurations, combined with hierarchical screening of node sample sets and weighted Gini index calculation. This not only accurately quantifies the optimization effect of splitting on node purity, but also weakens the interference of redundant columns through mutual information weight allocation, allowing the model to prioritize core operating condition variables and effectively suppress overfitting. At the same time, it incorporates business penalty coefficients and conflict judgment mechanisms to reduce the weight of splitting schemes with excessive range jumps, ensuring that the splitting results conform to the engineering reality of water plant equipment procurement and operation and maintenance. Coupled with a multi-label integrated training mode, the model can output a complete set of configuration vectors at once, avoiding parameter mismatch. Furthermore, it iterative optimization selects the optimal splitting scheme, and the design of storing the joint mode in leaf nodes further improves the consistency and accuracy of configuration data prediction. This lays a high-quality data foundation for subsequent Handlebars rendering and multi-system configuration, significantly reducing the cost of manual intervention and configuration error rate.
[0072] Optionally, in a specific embodiment, all nodes of the CART decision tree model are traversed. If the splitting path conditions and node output of any node in the CART decision tree model do not match a pre-set expert constraint strategy, pruning is performed on that node based on the expert constraint strategy, including: The process involves traversing the CART decision tree model layer by layer from the bottom node upwards, and verifying the splitting path conditions and node outputs of each node during the traversal. If the splitting path conditions and node outputs of any node in the CART decision tree model do not match the pre-set expert constraint strategy, the node outputs of that node are replaced or deleted based on whether they are related to the expert constraint strategy.
[0073] Specifically, national standards and corporate procedures are transformed into "hard rules," and forced pruning is performed after the decision tree is trained to ensure that the model is readable and conforms to the standards. Examples are provided below (only a few examples): Range rule: IF process section = dosing AND design flow rate > 2000 m³3 / hTHEN metering pump range = 400L / h; Alarm rule: IF sedimentation tank AND raw water turbidity > 20 NTU; Effluent turbidity alarm limit = 18 NTU; PID rule: IF dosing AND variable frequency metering pump THEN initial P=1.2, I=0.3, D=0; Animation rules: IF Add drug AND PAC solution THEN Water flow color = #00BFFF, Particle velocity = 60px / s.
[0074] The above rules are written into the "Expert Constraint Table". After the CART tree is built, the nodes are traversed from bottom to top: any branches that conflict with the expert rules are deleted or merged to form a compliant-interpretable final version tree.
[0075] This embodiment uses four types of expert constraint rules—range, alarm, PID, and animation—to enforce verification on the trained CART decision tree nodes. It can directly identify and handle situations where split path conditions or node outputs do not match the rules. By replacing conflicting outputs and deleting illegal branches, it completely avoids prediction results that do not conform to water plant operation and maintenance specifications due to the model simply fitting the data.
[0076] In addition, this application provides a two-dimensional configuration system for water plants, including a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement a two-dimensional configuration method for water plants as described in the above embodiment.
[0077] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0078] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0079] In this application, unless otherwise expressly specified and limited, "above" or "below" the second feature can mean that the first and second features are in direct contact, or that they are in indirect contact through an intermediate medium. Furthermore, "above," "on top of," and "over" the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.
[0080] In the description of this specification, the terms "one embodiment," "some embodiments," "embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0081] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make modifications, alterations, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A two-dimensional configuration method for water plants, characterized in that, include: The operating condition data of any equipment in the water plant is input into a pre-trained configuration data prediction model to obtain the corresponding configuration data; wherein, the configuration data is the configuration vector corresponding to the operating condition data, so as to ensure that the configuration data prediction model completes multi-label joint learning under the same splitting criterion; The configuration data is rendered based on a pre-deployed Handlebars configuration strategy to obtain Web configuration data, tag point table data, and animation description data for supporting two-dimensional device configuration; wherein, the Handlebars configuration strategy includes a tag point table configuration template, a Web configuration JSON configuration template, and an animation description JSON configuration template. The configuration data prediction model is trained based on the following steps: The model training set is built based on the pre-set historical operation records of each piece of equipment in the water plant; the equipment operation record corresponding to any piece of equipment includes historical operating data for multiple time periods, as well as the configuration data labels corresponding to the historical operating data for each time period; The pre-built CART decision tree model is trained based on the model training set. After training, all nodes of the CART decision tree model are traversed. If the splitting path conditions and node output of any node in the CART decision tree model do not match the pre-set expert constraint strategy, the node is pruned based on the expert constraint strategy to obtain a configuration data prediction model for predicting device configuration data.
2. The two-dimensional configuration method for water plants according to claim 1, characterized in that, Both the configuration data and the configuration data tags include: device configuration data and animation configuration data; The model training set is constructed based on the pre-set historical operation records of each piece of equipment in the water plant, including: Collect the water plant location table and process as-built drawings of the water plant, and obtain all historical operating condition data of each piece of equipment in the water plant, as well as the equipment configuration data corresponding to each historical operating condition data, based on the water plant location table and process as-built drawings. Based on each historical working condition data and a pre-established mapping table, obtain the animation configuration data corresponding to each historical working condition data. The mapping table is a mapping relationship table between historical working condition data and animation configuration data; For each device, the historical operating condition data, device configuration data, and animation configuration data are preprocessed, and a model training set is established based on all the preprocessed historical operating condition data, device configuration data, and animation configuration data; the preprocessing includes data cleaning and field standardization.
3. The two-dimensional configuration method for water plants according to claim 1, characterized in that, The pre-built CART decision tree model is trained based on the model training set, including: Initialize the CART decision tree model; Feature extraction is performed on the model training set to obtain the first feature matrix corresponding to the historical working condition data and the second feature matrix corresponding to the configuration data labels; The first and second feature matrices are input into the CART decision tree model for recursive splitting; During training, the node sample set corresponding to each node in the CART decision tree model is obtained; each node sample set is a subset selected from the first feature matrix and the first feature matrix according to the splitting path conditions pre-set in the previous node of the CART decision tree model. Based on the node sample set corresponding to each node, obtain the first weighted Gini index of each node before splitting. Based on the splitting path conditions and node sample set of each node, the second weighted Gini index after splitting each node is obtained, and based on the first weighted Gini index and the second weighted Gini index of each node, the optimization magnitude corresponding to each node is obtained; the optimization magnitude is the difference between the first weighted Gini index and the second weighted Gini index. Based on the optimization magnitude corresponding to each node and the pre-set business penalty coefficient, the final split score corresponding to each node is obtained. The model parameters of the CART decision tree model are optimized based on the optimization magnitude and final split score corresponding to each node.
4. The two-dimensional configuration method for water plants according to claim 3, characterized in that, Based on the splitting path conditions and node sample set for each node, the second weighted Gini index after each node split is obtained, including: Based on the splitting path conditions of each node, the node sample set of each node is split into the first node sample set and the second node sample set. Based on the first and second node sample sets for each node, and a pre-set formula (Formula 1), the third and fourth weighted Gini indices for each node are obtained respectively; the first formula is: ; Where Gini is the weighted Gini index, K is the total number of variable categories, k is the index of the variable category, and w k For the variable category with index k, a pre-defined relevance weight is p. k This represents the percentage of all samples belonging to the variable category with index k. Based on the third and fourth weighted Gini indices corresponding to each node, the second weighted Gini index is obtained; the second weighted Gini index is the sum of the product of the proportion of the sample size in the first node sample set to the total sample size in the node sample set and the third weighted Gini index, and the product of the proportion of the sample size in the second node sample set to the total sample size in the node sample set and the fourth weighted Gini index.
5. The two-dimensional configuration method for water plants according to claim 4, characterized in that, Based on the optimization magnitude corresponding to each node and the pre-set business penalty coefficient, the final split score corresponding to each node is obtained, including: Based on a pre-set business conflict judgment strategy, determine whether there is a conflict in the split path conditions corresponding to each node. If there is no business conflict, the final split score for each node is the optimization magnitude for that node. If there is a business conflict, the final split score for each node is the difference between the optimization margin and the business penalty coefficient.
6. The two-dimensional configuration method for water plants according to claim 1, characterized in that, The configuration data is rendered based on a pre-deployed Handlebars configuration strategy to obtain Web configuration data, tag point table data, and animation description data for supporting two-dimensional device configuration, including: The configuration data is subjected to feature extraction and data integration to obtain the corresponding JSON array; The JSON array is rendered based on the tag point table configuration template, the Web configuration JSON configuration template, and the animation description JSON configuration template, respectively, to obtain Web configuration data, tag point table data, and animation description data for supporting two-dimensional configuration of the device; Write the device's Web configuration data, tag point table data, and animation description data into the pre-set Web configuration file, tag point table file, and animation description file, respectively.
7. The two-dimensional configuration method for water plants according to claim 1, characterized in that, Traverse all nodes of the CART decision tree model. When the splitting path conditions and node output of any node in the CART decision tree model do not match the pre-set expert constraint policy, prune the node based on the expert constraint policy, including: The process involves traversing the CART decision tree model layer by layer from the bottom node upwards, and verifying the splitting path conditions and node outputs of each node during the traversal. If the splitting path conditions and node output of any node in the CART decision tree model do not match the pre-set expert constraint strategy, the node output of that node is replaced / deleted based on whether the node output is related to the expert constraint strategy.
8. The two-dimensional configuration method for water plants according to claim 6, characterized in that, Write the device's Web configuration data, tag point table data, and animation description data into the pre-configured Web configuration file, tag point table file, and animation description file, respectively, including: Generate a corresponding unique identification code based on the device's tag number table data, and write the device's tag number table data and unique identification code as a single data entry into the tag number table file. Write the device's Web configuration data and unique identification code as a set of data into the Web configuration file. Write the device's animation description data and unique identification code as a single data entry into the animation description file. Based on the unique identifiers in the Web configuration file, tag point table file, and animation description file, the Web configuration data, tag point table data, and animation description data are mapped and aligned.
9. The two-dimensional configuration method for water plants according to claim 7, characterized in that, After mapping and aligning the Web configuration data, tag point table data, and animation description data, the method further includes: When any Web configuration data, tag point table data, or animation description data in the Web configuration file, tag point table file, and animation description file is modified, the content of the Web configuration data, tag point table data, or animation description data in the Web configuration file, tag point table file, and animation description file is synchronized.
10. A two-dimensional configuration system for water plants, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the two-dimensional configuration method for water plants as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Water affair system configuration design system and method
CN114818033A
Diagnosis apparatus, equipment, computer-readable storage medium, and control method of diagnosis apparatus
US20230311907A1