A Multi-Agent Driven Method and Related Device for Urban Water Resource Optimization Allocation

CN122573009APending Publication Date: 2026-08-14ZHENGZHOU UNIV +2
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-26
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0004]本申请的目的是提供一种基于多智能体驱动的城市水资源优化配置方法及相关装置,可解决现有水资源优化配置中技术门槛高、流程繁琐、求解迭代效率低以及决策结果解释性差的问题

Benefits of technology

本申请提供了一种基于多智能体驱动的城市水资源优化配置方法及相关装置,通过任务解析智能体实现自然语言任务的自动结构化转换,依托大语言模型的语义理解能力,无需使用者掌握专业建模知识,即可完成任务输入;通过模型自动实例化与多目标进化求解,快速生成满足约束的帕累托最优解集;借助异常分析智能体自动排查约束冲突,替代人工完成报错分析与模型修正,大幅缩短迭代调试周期;最终自动输出可读性强的配置结果与分析报告,方便管理者直接参考应用。与传统方法相比,本申请依托多智能体的协同分工,将复杂的建模求解流程封装在智能交互体系内,在保证多目标、多情景优化精度的同时,显著提升了城市水资源配置决策的智能化水平与响应效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122573009A_ABST
    Figure CN122573009A_ABST
Patent Text Reader

Abstract

This application discloses a method and related apparatus for optimizing urban water resource allocation based on multi-agent driving, relating to the field of urban resource management. The method includes: receiving natural language input from a user; sequentially parsing and extracting the natural language input through a task parsing agent, and serializing the extracted results based on preset mapping rules to generate a structured parameter set; automatically instantiating a multi-objective water resource optimization allocation model based on fuzzy confidence constraints based on the structured parameter set, transforming the fuzzy confidence constraints into deterministic equivalence class boundary conditions through preset confidence level parameters, injecting the structured parameter set into the deterministic equivalence class boundary conditions and the objective function, and solving the model using a multi-objective evolutionary algorithm to generate a Pareto optimal solution set; and selecting the allocation scheme with the best overall benefit based on the Pareto optimal solution set and a preset multi-criteria decision-making method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of urban resource management, and in particular to a method and related apparatus for optimizing the allocation of urban water resources based on multi-agent driving. Background Technology

[0002] Therefore, the optimal allocation of urban water resources has become a comprehensive decision-making problem that requires consideration of data analysis, scenario assessment, model solving, scheme comparison, and result interpretation. Especially in the management of the planning year, the lack of efficient, intelligent, and interpretable allocation tools can easily lead to unreasonable resource allocation, localized water shortages, supply and demand imbalances, and delayed decision-making responses.

[0003] Currently, methods such as multi-objective programming, linear programming, fuzzy programming, scenario analysis, and genetic algorithms are commonly used for the optimal allocation of urban water resources. Although existing technologies (such as NSGA-II) can solve the models, the human-computer interaction interface is not user-friendly, parameter adjustment relies on human experience, and the results are difficult to translate into management language. Furthermore, these methods have the following prominent shortcomings in actual urban water management: high technical barriers to modeling (requiring collaboration from experts in multiple fields, difficult for government managers to operate, data adjustment relies on manual intervention, resulting in low efficiency), cumbersome problem-solving processes (key variables are uncertain, but fixed parameters or single-scenario processing are used, making it difficult to adapt to multiple scenario switching and batch comparison of schemes), extremely high debugging and iteration costs (numerous constraints, manual data investigation when conflicts occur, long iteration cycles, unable to meet the needs of near real-time decision-making), and poor interpretability of decision results (the output results lack in-depth analysis of the specific allocation strategies for each administrative region, making it difficult for managers to translate them into guidance documents). Summary of the Invention

[0004] The purpose of this application is to provide a method and related apparatus for optimizing urban water resource allocation based on multi-agent driving, which can solve the problems of high technical threshold, cumbersome process, low solution iteration efficiency and poor interpretability of decision results in existing water resource optimization allocation.

[0005] To achieve the above objectives, this application provides the following solution: Firstly, this application provides a method for optimizing urban water resource allocation based on multi-agent driven approaches, including: Receive natural language input from the user; the natural language input includes a description of the water resource allocation task and uncertainty scenario parameters; The task parsing agent sequentially parses and extracts the natural language input content, and serializes the extraction results based on preset mapping rules to generate a structured parameter set; the extraction results include constraints, optimization objectives, and multi-scenario configuration requirements. Based on a structured parameter set, a multi-objective water resource optimization allocation model based on fuzzy confidence constraints is automatically instantiated. The fuzzy confidence constraints are transformed into deterministic equivalence class boundary conditions through preset confidence level parameters. The structured parameter set is injected into the deterministic equivalence class boundary conditions and the objective function, and a multi-objective evolutionary algorithm is used to solve the problem to generate a Pareto optimal solution set. Based on the Pareto optimal solution set, and using a preset multi-criteria decision-making method, the configuration scheme with the best overall benefits is selected. The decision variable matrix of the optimal configuration scheme is reverse-parsed into business semantics, and the output results including water allocation table, water source flow direction diagram and natural language decision analysis report are automatically generated.

[0006] In a second aspect, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the multi-agent driven urban water resource optimization allocation method described in any one of the above-mentioned methods.

[0007] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described multi-agent driven urban water resource optimization allocation methods.

[0008] Fourthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described multi-agent driven urban water resource optimization allocation methods.

[0009] According to the specific embodiments provided in this application, this application has the following technical effects: This application provides a method and related apparatus for optimizing urban water resource allocation based on multi-agent driven technology. It utilizes a task parsing agent to automatically convert natural language tasks into structured forms, leveraging the semantic understanding capabilities of a large language model. This eliminates the need for users to possess specialized modeling knowledge to complete task input. Through automatic model instantiation and multi-objective evolutionary solving, it rapidly generates a Pareto optimal solution set that satisfies constraints. An anomaly analysis agent automatically identifies constraint conflicts, replacing manual error analysis and model correction, significantly shortening the iteration and debugging cycle. Finally, it automatically outputs highly readable configuration results and analysis reports for direct reference and application by managers. Compared to traditional methods, this application relies on the collaborative division of labor among multiple agents, encapsulating the complex modeling and solving process within an intelligent interactive system. While ensuring the accuracy of multi-objective and multi-scenario optimization, it significantly improves the intelligence level and response efficiency of urban water resource allocation decisions. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 A flowchart illustrating a multi-agent-driven urban water resource optimization allocation method provided in an embodiment of this application; Figure 2 A visual flow diagram provided in one embodiment of this application; Figure 3 Sankey diagram of optimized configuration results provided in one embodiment of this application; Figure 4 A water supply structure diagram provided in one embodiment of this application; Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0012] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0013] Optimal allocation of urban water resources is a core component of the urban water security system, directly impacting residents' water supply safety, stable industrial production, agricultural irrigation, ecological restoration, and sustainable urban development. For typical plain cities, water resource allocation faces coupled challenges of multiple water sources, users, receiving areas, objectives, and constraints. It requires coordinating various water sources such as surface water, groundwater, diverted water, and reclaimed water, while also considering diverse water needs from domestic, industrial, agricultural, and ecological sectors. Furthermore, it necessitates meeting the requirements for fairness, security, and ecological constraints in water supply among different districts and counties. With accelerated urbanization, industrial restructuring, population growth, and the intensifying impacts of climate change, urban water resource systems exhibit significant uncertainties.

[0014] The purpose of this application is to provide a method and related apparatus for optimizing urban water resource allocation based on multi-agent driving, which can solve the problems of high technical threshold, cumbersome process, low solution iteration efficiency and poor interpretability of decision results in existing water resource optimization allocation.

[0015] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0016] In one exemplary embodiment, such as Figure 1 As shown, a method for optimizing urban water resource allocation based on multi-agent driving is provided. This method is executed by computer equipment, specifically by a terminal or server alone, or by both a terminal and a server, and includes the following steps 101 to 105. Wherein: Step 101: Receive natural language input from the user; the natural language input includes a description of the water resource allocation task and uncertainty scenario parameters; Step 102: The task parsing agent sequentially parses and extracts the natural language input content, and serializes the extraction results based on preset mapping rules to generate a structured parameter set; the extraction results include constraints, optimization objectives and multi-scenario configuration requirements. Step 103: Based on the structured parameter set, automatically instantiate a multi-objective water resource optimization allocation model based on fuzzy confidence constraints, transform the fuzzy confidence constraints into deterministic equivalence class boundary conditions through preset confidence level parameters, inject the structured parameter set into the deterministic equivalence class boundary conditions and objective function, and solve them using a multi-objective evolutionary algorithm to generate a Pareto optimal solution set; Step 104: Based on the Pareto optimal solution set, and using a preset multi-criteria decision-making method, select the configuration scheme with the best overall benefits. Step 105: The decision variable matrix of the optimal configuration scheme is reverse-parsed into business semantics, and the output results including water allocation table, water source flow direction map and natural language decision analysis report are automatically generated.

[0017] In one exemplary embodiment, such as Figure 2 As shown, when performing steps 101-105, the specific steps can be as follows: First, we need to define the implementing entity and related terms uniformly, as follows: Users: Urban water management personnel who provide natural language commands and basic business data.

[0018] Multi-agent system: An AI hub running on the server side, containing the following core components: Task parsing agent: responsible for converting natural language tasks and uncertainties into structured parameters, generating data formats that can be directly fed into the Python solver.

[0019] The optimization agent is responsible for calling the optimization algorithm module in Python to solve uncertain multi-objective models and output Pareto solutions and recommended solutions.

[0020] The overall decision-making agent is responsible for selecting the most suitable solution from the Pareto solution set to meet the current management objectives, and outputting tables, graphs, and text descriptions.

[0021] Anomaly analysis agent: When constraint conflicts, missing parameters, solution failures, or no feasible solutions occur, it automatically locates the errors and generates correction suggestions, forming a re-solution task.

[0022] Then, determine the key steps and processes of each agent's operation: Step 1: Task parsing and uncertainty analysis are performed by the task parsing agent. Its role is to automatically identify the content of the instruction when the user inputs an instruction (such as: "Considering market fluctuations and rainfall uncertainty, calculate the optimal configuration for the city under 50% and 75% water inflow scenarios"), extract the constraints, establish the corresponding set of uncertainty scenarios, and generate a set of structured parameters. This breaks down the communication barriers between humans and machines and eliminates the need for manual preprocessing.

[0023] Step Two: Model Construction and Optimization Solution (Execution Subject: Optimization Solution Agent): The computer automatically performs a feasibility check and, based on the data generated in step one, automatically instantiates a multi-objective water resource optimization allocation model based on uncertainty in the algorithm environment, generating a Pareto front.

[0024] Step 3: Anomaly Diagnosis and Feedback Iteration (Executor: Anomaly Analysis Agent): Function: Urban water resource constraints are extremely stringent (unsolvable in extreme drought scenarios). If the algorithm fails to converge, the anomaly analysis agent intercepts the error message, uses LLM to deduce the cause (e.g., "the lower limit of industrial water allocation in a certain area exceeds the groundwater extraction threshold"), sends it to the failure pool, and automatically feeds back the corrected constraint parameters to step two. This achieves automatic closed-loop iteration of the system.

[0025] Step 4: Strategy Application and Decision Generation (Executing Entity: Overall Decision-Making Intelligent Agent): Function: Receives successfully validated Pareto solutions and automatically selects the optimal combination of solutions with the best overall benefits. It generates a water flow map and outputs a natural language decision analysis report, directly providing operational strategies to urban water administration departments (such as issuing management instructions to "reduce deep groundwater extraction in a certain county").

[0026] In some embodiments, a multi-objective water resource optimization allocation model based on fuzzy confidence constraints is constructed, specifically as follows: Urban water resource systems involve multiple water supply sources, receiving districts and counties, and water-using sectors. The system boundaries encompass all stages, including water intake, supply, use, and wastewater discharge. Against the backdrop of climate change and rapid economic and social development, water resource management must not only comprehensively consider the social and economic benefits of each district and county but also minimize the ecological and environmental impacts (such as pollutants and carbon emissions) during water resource development and utilization. Multi-objective programming is widely used to balance water use conflicts among multiple objectives, thereby obtaining a water resource compromise decision that takes into account all objectives and constraints. Therefore, this embodiment utilizes multi-objective programming methods for urban water resource management. A general multi-objective programming (MOP) model can be expressed as: (1).

[0027] (2).

[0028] (3).

[0029] (4).

[0030] (5).

[0031] In the formula: Let be the objective function; where and These represent the number of multidimensional variables and the number of objectives, respectively. For decision variables; It is a coefficient, c i Let K be the coefficient, K be the number of objective functions, and n be the number of decision variables.

[0032] However, in actual urban water supply schemes, the water demand of different water users in each district and county may fluctuate with extreme weather, and the actual available water volume of each water source is often unknown. If the coefficients on the right side of formula (4) are only deterministic values, they cannot accurately represent fuzzy information. Fuzzy-credibility constraint programming (FCP) can effectively reflect the degree of constraint satisfaction using fuzzy sets. In addition, in such a fuzzy environment, constraint violations often occur, requiring FCP to weigh system objectives against the risk of violation. Therefore, FCP is introduced here, transforming formula (4) into the following formula: (6).

[0033] In the formula: a i Decision variables xi constant coefficients, For a fuzzy set with an imprecise right-hand side and a credibility constraint, This is the lower bound of the value of t. Let be the upper limit of the possible values ​​of t, where t is the most likely value. The confidence level is represented by I, which represents the number of decision variables, and Cr, which represents the confidence level and indicates the degree to which the association constraints are satisfied. It can be expressed as: (7).

[0034] Generally, in the optimization process of management and planning, the confidence level should be greater than 0.5. Therefore, the confidence level constraint can be further transformed into a deterministic form: (8).

[0035] (9).

[0036] This embodiment utilizes the FCP (Functional Water Use Processing) technique to construct a multi-objective optimization model for cities, thereby balancing the conflicting interests among different water use objectives and handling uncertain parameters in the model. In the model... i =1-23 represent 23 types of water sources, including surface water, groundwater, and water diverted from other regions; j =1-4 represent four categories: daily life, industry, agriculture, and ecology. j Water users; k= 1-8 represent the city's eight districts / counties. (Settings) x ijk For decision variables (i.e., water source) i Assigned to k districts and counties j Departmental water volume, 10,000 / m 3 ).

[0037] Then, the objective function of the multi-objective water resource optimization allocation model with fuzzy confidence constraints is constructed: The objective functions include maximizing net economic benefits, minimizing social water shortage, and minimizing ecological and environmental impacts.

[0038] Specifically, the objective of maximizing net economic benefits is as follows: Water resource allocation must ensure the stable development of the regional economy. This example comprehensively considers the output benefits per unit of water volume and the water supply cost, and sets the objective of maximizing net economic benefits as follows: (10).

[0039] Minimizing social water shortage target: Water users are the end point of the water resource system. In order to meet the water needs of urban domestic, ecological, industrial and agricultural water use sectors to the greatest extent possible, a target of minimizing social water shortage is set: (11).

[0040] Minimizing ecological and environmental impact: The main pollutant-generating links in the water resource system are domestic, industrial, and agricultural water use. Minimizing the discharge of major pollutants by each water user in each district and county is taken as the ecological and environmental benefit target. (12).

[0041] Specifically, the fuzzy credibility constraints include constraints on the available water supply, constraints on the minimum and maximum water demand of water users, constraints on the groundwater extraction red line, and constraints on pollutant discharge.

[0042] The water supply constraint stipulates that the total amount of various types of water allocated to any district or county shall not exceed the fuzzy upper limit of the water supply for that water source. The formula expression is as follows: (13).

[0043] Water users' minimum and maximum water demand constraints: To ensure basic livelihoods and economic operation, the actual water supply must meet the fuzzy minimum demand and not exceed the maximum maximum demand. The formula is as follows: (14).

[0044] (15).

[0045] Groundwater extraction red line constraints: To curb the expansion of urban groundwater over-extraction funnels, strict fuzzy red line constraints are implemented on its extraction volume, and the formula expression is as follows: (16).

[0046] Pollutant emission constraints: namely, chemical oxygen demand (COD) emission limits.

[0047] (17).

[0048] Non-negativity constraint.

[0049] (18).

[0050] As can be seen, the multi-objective optimization model constructed in this embodiment can handle the multiple uncertainties of the objective function and constraints in the urban water resources system management framework. Furthermore, the model can generate flexible compromise solutions, supporting detailed analysis under different supply and demand scenarios and multiple confidence levels. The detailed solution process is described below: Step 1: Establish a multi-objective optimization model for urban water resources under uncertainty.

[0051] Step 2: Based on the theory of fuzzy variable expectation value and the worst-case scenario principle, convert the fuzzy numbers of unit benefit, cost and emission in the objective function of the model into their expected values.

[0052] Step 3: Use FCP to transform the constraints in the model, such as the upper limit of available water, the lower limit of water demand, and the groundwater extraction limit, which have fuzzy parameters, into a deterministic form.

[0053] Step 4: Use the NSGA-II algorithm to solve the deterministic multi-objective model obtained in Step 3. After multiple generations of population evolution and crossover mutation, obtain the Pareto optimal solution set for water resource allocation.

[0054] Step 5: Primarily using Python software, the Analytic Hierarchy Process (AHP) is employed to calculate the maximization of economic benefits for the water resources system. f1 Minimize social water shortage ( f2 ) and minimizing ecological and environmental emissions ( f3 The weights of the objective function, for example f1 , f2 , f3 The weights were 0.258, 0.542, and 0.200 respectively (the calculated consistency ratio of these weights was less than 0.1, and the comparison matrix passed the consistency test). These weights were dynamically adjusted according to the user's preference instructions. Subsequently, the TOPSIS method was used to rank the non-dominated solutions in the Pareto front based on their relative proximity according to the target weights, and the optimal compromise solution was selected.

[0055] Step 6: For different confidence levels ( λ The fuzzy parameters under () can be calculated by repeating steps 3 to 5.

[0056] In some embodiments, the multi-criteria decision-making method is a combination of the analytic hierarchy process (AHP) and the approximation ideal solution ranking method; the AHP is used to determine the weights of each objective function; and the approximation ideal solution ranking method is used to rank the non-dominated solutions in the Pareto front according to their relative proximity in order to select the best compromise.

[0057] This application addresses the optimal allocation and management of urban water resources under uncertain conditions. It constructs a multi-agent workflow based on the Dify platform and solves the urban water resource optimization model using Python. The system uses natural language as the input and outputs optimization results and decision reports, achieving automatic analysis, automatic solution, and automatic interpretation of urban water resource allocation.

[0058] In the Dify platform, the orchestration of multi-agent workflows for urban water resource optimization and allocation management under uncertain conditions is based on implementing agents with different functions as specific nodes in the workflow, and realizing the interaction between nodes through visualized pre-orchestrated data streams. The specific orchestration method is as follows: First, a "Natural Language Parsing Agent Node" is set up as the entry point for the entire workflow. This node receives user requests for optimizing urban water resource allocation in natural language, such as "How to optimize the allocation of industrial, agricultural, and domestic water use in a city given uncertain future rainfall?" Using a built-in natural language processing model, the user's request is broken down into specific parameters, including the city name, the water-using sectors involved (industrial, agricultural, and domestic), the type of uncertainty (rainfall), and the optimization objective (such as balanced water resource allocation and maximizing economic benefits). These standardized parameters are then passed to the next node.

[0059] Next, the "Data Acquisition and Preprocessing Agent Node" is connected. This node automatically calls a preset data interface based on the city name and water-using departments parsed from the previous node. It collects historical water consumption, current water resource reserves, rainfall forecast data (covering rainfall data under different probability scenarios to reflect uncertainty), and economic benefits of water consumption for each department, among other relevant data. The collected data is then cleaned, outliers are removed, missing data is appropriately interpolated, and data of different formats is uniformly converted into a model-recognizable format. For example, rainfall forecast data is organized into tabular data containing different scenario probabilities and corresponding rainfall values. After completion, the preprocessed dataset is passed to the next node.

[0060] Then, the "Optimization Model Construction Agent Node" is connected. This node automatically selects a suitable optimization model structure based on the optimization objective and uncertainty type obtained from natural language parsing, as well as the preprocessed dataset. For urban water resource optimization problems with uncertain rainfall conditions, a multi-objective optimization model with stochastic parameters can be constructed. The objective function may include maximizing economic benefits and minimizing water waste, while constraints involve upper and lower limits on water consumption by various sectors, total water resource limits, and water supply capacity constraints under different rainfall scenarios. The node automatically sets relevant model parameters based on data characteristics, such as the weight coefficients of the objective function and the relaxation factors of constraints, and generates a complete mathematical expression for the model. It then passes the model structure and parameters to the solution node.

[0061] Next, the "Model Solver Agent Node" is connected. This node receives the optimized model and automatically invokes a Python-based solver interface, such as PuLP, Gurobi, or a custom-developed algorithm for solving optimization problems under uncertain conditions. During the solution process, the node automatically selects an appropriate solution strategy based on the model's complexity and scale; for example, for a multi-objective stochastic optimization model, it might use an evolutionary algorithm like NSGA-II. The model is solved using Python code, yielding water resource optimization allocation schemes under different uncertain scenarios, including specific water consumption allocation results for each sector and corresponding economic benefit values. The solution results are then passed to the result interpretation node.

[0062] Finally, a "Results Interpretation and Report Generation Agent Node" is set as the output end of the workflow. After receiving the model solution results, this node first analyzes the results, explaining the impact of different uncertain scenarios (such as different rainfall amounts) on the optimized allocation scheme. For example, when rainfall is lower than expected, the adjustment range and reasons for agricultural water use are explained. Then, the analysis content and optimized allocation results are integrated into a structured decision report. The report includes text descriptions, data tables (showing details of water allocation for each department), and visualization charts (such as comparison charts of water allocation under different scenarios and economic benefit trend charts), clearly presented to the user in natural language, realizing a complete process from natural language input to optimization results and decision report output.

[0063] Throughout the orchestration process, each Agent node is connected sequentially through the visual data stream of the Dify platform. The output data of the previous node is directly used as the input data of the next node, eliminating the need for complex dynamic API calls. This ensures the stable operation and efficient collaboration of the workflow, enabling automatic analysis, automatic solution, and automatic interpretation of urban water resource allocation.

[0064] This application also includes water resource optimization for city A, and the process of urban water resource optimization is as follows: This optimization task targets City A in Province S, assuming a dry year scenario. The core optimization objective is to minimize the total water shortage in the system. Users have set the water use priority order as: domestic > ecological > industrial > agricultural, to ensure that basic livelihood and ecological water use are prioritized under water shortage conditions.

[0065] The water demand for domestic, ecological, industrial, and agricultural use in each administrative district of City A is shown in Table 1, and the available water supply in each administrative district of City A is shown in Table 2. The water supply structure is as follows: Figure 4 As shown: Table 1 Water demand of each administrative district in City A

[0066] Table 2. Available Water Supply in Each Administrative District of City A

[0067] This calculation employs fuzzy uncertainty analysis, using a triangular fuzzy number model, with a set confidence level (λ value) of 0.8. This λ value represents a moderately conservative risk aversion. Under the condition of λ=0.8, the model considers the possible lower limit (reduction in available water volume) when calculating available water volume, and the possible upper limit (increase in demand) when calculating water demand. This allows for a safety margin of approximately 20% in the scheme formulation to cope with uncertainties in key parameters such as water inflow and demand.

[0068] Based on users' demand for "balanced development," the Analytic Hierarchy Process (AHP) was used to set weights for a comprehensive trade-off between multiple objectives. The specific weights are: economic benefit weight 0.540, total water shortage weight 0.297, and pollution emission weight 0.163. This weighting system reflects a comprehensive consideration of economic development and environmental protection while ensuring water supply security (controlling water shortages).

[0069] Guided by this decision-making preference, the core indicators of the comprehensive recommended solution (index number: 9) selected from the Pareto frontier are as follows: Expected economic benefits: RMB 16.61 billion; total water shortage of the system: 557 million cubic meters; total wastewater discharge: 25,300 tons; the TOPSIS comprehensive score of this scheme is 0.922, which achieves a good balance among economic benefits, water shortage control and pollution control.

[0070] Analysis of supply and demand balance and key allocation: According to the optimized allocation results, the city's total water supply is 1.869 billion cubic meters, and the total water shortage is 557 million cubic meters. The overall supply and demand contradiction is prominent, especially in the agricultural sector.

[0071] Water supply availability by sector: Domestic water use: Total water supply 157 million m³ 3 The average satisfaction rate is as high as 96.4%, providing the highest level of protection.

[0072] Ecological water use: Total water supply of 0.58 billion m³ 3 The average satisfaction rate is 94.5%, indicating good protection.

[0073] Industrial water use: Total water supply 194 million m³ 3 The average satisfaction rate is 96.0%, and it is less affected by water shortage.

[0074] Agricultural water use: Total water supply 1.46 billion m³ 3The average satisfaction rate is only 72.6%, making them the main sufferers of water shortage, with a water shortage of up to 479 million cubic meters, accounting for 86% of the city's total water shortage.

[0075] Water shortage analysis by district / county: Agricultural water shortage is widespread in all districts and counties, with Shenxian County, Yanggu County, and Guanxian County experiencing the most severe shortages, reaching 134 million cubic meters per second. 3 100 million m 3 and 0.99 billion m 3 Shenxian County has the highest agricultural water demand (369 million m³). 3 It has the lowest satisfaction rate (63.8%) and is the district / county in City A facing the greatest water shortage pressure.

[0076] Analysis of water source configuration structure: Main water sources: Groundwater and water diverted from the Yellow River are the primary water supply sources, each supplying 742 million cubic meters. 3 and 659 million m 3 This accounts for 74.9% of the total water supply.

[0077] Important supplement: 115 million cubic meters of water will be supplied by diverting water from the Yangtze River. 3 It is mainly used for domestic and some industrial purposes; 0.89 billion cubic meters of reclaimed water are supplied. 3 Primarily used in industry and ecology, it embodies the utilization of unconventional water sources.

[0078] Local rivers and reservoirs: Surface water from the Majia River, Tuhai River, Zhangwei River, Jindi River, and other rivers, as well as multiple reservoirs, provided approximately 264 million cubic meters of water. 3 Supplemental water supply.

[0079] Finally, risk warnings and management recommendations are provided: Based on the dry year scenario and a conservative uncertainty setting of λ=0.8, the following management recommendations are proposed: 1) Strengthen agricultural water conservation and structural adjustment to address the risk of rigid water shortage.

[0080] Under the current plan, agriculture is facing a water shortage of nearly 500 million cubic meters. 3 The situation is particularly severe in areas like Shenxian and Yanggu counties. It is recommended to immediately launch an emergency agricultural water conservation plan, promoting drought-resistant varieties, implementing integrated water and fertilizer management, adjusting planting structures (reducing water-intensive crops) in severely water-deficient counties, and using price mechanisms to guide water conservation. Simultaneously, agricultural water quota allocation and rotational irrigation schemes should be developed in advance, using the optimized model's determined agricultural water allocation for each county as a baseline for refined scheduling and management.

[0081] 2) Develop emergency plans for groundwater extraction to prevent over-extraction and water quality risks.

[0082] In this plan, groundwater accounts for as much as 39.7% of the water supply, making it highly dependent on groundwater during dry years. With λ=0.8, the actual usable groundwater volume may be lower than the model's calculated value. It is recommended that water authorities dynamically monitor groundwater levels in key areas and immediately activate emergency plans once they approach the warning line. This includes increasing the quota for diverting water from the Yangtze and Yellow Rivers, mandating the use of backup water sources, and implementing stricter restrictions on non-domestic water use to ensure that groundwater extraction does not exceed safety limits and avoid secondary risks such as land subsidence or water quality deterioration.

[0083] 3) Establish a multi-source coordinated scheduling and crisis management mechanism.

[0084] In highly uncertain dry years, fluctuations in a single water source can trigger a chain reaction. It is recommended to establish a real-time scheduling platform linking five water sources—Yellow River Diversion, Yangtze River Diversion, local reservoirs, groundwater, and reclaimed water—based on the water source configuration structure of this optimized plan. When the inflow from a certain water source (such as the Yellow River Diversion) falls below the predicted value of λ=0.8, the platform can quickly simulate and execute contingency plans, dynamically adjusting the water supply ratio from each source to different industries and districts, prioritizing the safety of water supply for domestic, ecological, and key industrial needs, and minimizing the risk of systemic water shortages.

[0085] The optimized allocation of water resources in City A yielded the results shown in Table 3. This application also presents the allocation results in the form of a Sankey diagram, as detailed below. Figure 3 As shown, Table 3. Water resource allocation results (10,000 cubic meters)

[0086] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 5As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores output results. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a multi-agent-driven method for optimal allocation of urban water resources.

[0087] Those skilled in the art will understand that Figure 5 The structures shown are merely block diagrams of some structures related to the present application and do not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0088] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0089] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0090] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of the relevant data are carried out in compliance with the relevant data protection laws and policies of the country where the location is located, and with the authorization granted by the owner of the corresponding device.

[0091] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0092] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0093] In summary, this application has the following technical effects: Traditional urban water resource optimization and allocation typically requires experts to manually compile data, modify models, and run the process repeatedly. This application, however, automates all stages—task breakdown, parameter extraction, model invocation, and result analysis—through an LLM agent and Dify workflow. Users only need to input their natural language requirements to complete the entire process from "problem description" to "configuration solution output," significantly lowering the barrier to entry.

[0094] 1) Zero-code interaction and extremely low management threshold: Traditional methods require technical experts to manually type code and adjust complex matrix parameters. This method encapsulates highly complex low-level optimization algorithms within an LLM agent, allowing city water managers to simply "issue tasks" via natural language, truly achieving "management through dialogue, and output through input."

[0095] 2) Significantly improved configuration efficiency: In urban water resource management, uncertain scenarios change frequently, such as different guarantee rates, different inflow scenarios, and different assumptions about water demand growth. Traditional methods often require manual parameter resetting and repeated solutions. This solution can automatically organize multiple scenarios, perform batch modeling and solving, thereby improving the efficiency of multi-scenario comparison and is suitable for planning, contingency plans, and emergency scenarios.

[0096] 3) Powerful automatic error correction capabilities and high fault tolerance: Traditional optimization models often crash and terminate when encountering conflicts in underlying parameters (such as supply-demand imbalances during multi-source joint scheduling), requiring manual bug fixing. This method introduces an anomaly analysis intelligent agent mechanism. When an error occurs, the AI ​​can automatically summarize experience from the "failure pool," enabling rapid reconstruction and adaptive iteration of the solution, ensuring that complex water management calculations can be executed smoothly until the results are obtained.

[0097] 4) Balancing high-precision decision-making with intelligent insights: While retaining the high computational accuracy (up to 98.28%) of traditional rigorous mathematical models (such as the NSGA algorithm), the system overcomes the fatal weakness of traditional algorithms that "emphasize mathematical calculations but neglect management interpretation." The system can not only calculate massive water resource scheduling matrices but also automatically extract them into highly instructive natural language decision reports, lowering the barrier from scientific computing to urban administration.

[0098] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0099] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for optimal allocation of urban water resources based on multi-agent driven mechanisms, characterized in that, include: Receive natural language input from the user; The natural language input includes a description of the water resources allocation task and parameters of the uncertainty scenario. The task parsing agent sequentially parses and extracts the natural language input content, and serializes the extraction results based on preset mapping rules to generate a structured parameter set; the extraction results include constraints, optimization objectives, and multi-scenario configuration requirements. Based on a structured parameter set, a multi-objective water resource optimization allocation model based on fuzzy confidence constraints is automatically instantiated. The fuzzy confidence constraints are transformed into deterministic equivalence class boundary conditions through preset confidence level parameters. The structured parameter set is injected into the deterministic equivalence class boundary conditions and the objective function, and a multi-objective evolutionary algorithm is used to solve the problem to generate a Pareto optimal solution set. Based on the Pareto optimal solution set, and using a preset multi-criteria decision-making method, the configuration scheme with the best overall benefits is selected. The decision variable matrix of the optimal configuration scheme is reverse-parsed into business semantics, and the output results including water allocation table, water source flow direction diagram and natural language decision analysis report are automatically generated.

2. The method for optimal allocation of urban water resources based on multi-agent driving as described in claim 1, characterized in that, When the solution of the multi-objective water resources optimization allocation model encounters constraint conflicts or no feasible solution, the anomaly analysis agent intercepts the error information and generates correction suggestions based on the large language model. Based on the aforementioned correction suggestions, the corrected multi-objective water resource optimization allocation model will be solved again.

3. The method for optimal allocation of urban water resources based on multi-agent driving as described in claim 1, characterized in that, The uncertainty scenario parameters include the fuzzy range of available water volume under different water supply guarantee rates, the fluctuation range of water demand in different districts and counties, and the fuzzy boundary of groundwater extraction red line; the task parsing agent performs semantic parsing of natural language instructions through a large language model and automatically establishes a solution for the specified scenario.

4. The method for optimal allocation of urban water resources based on multi-agent driving as described in claim 1, characterized in that, The objective functions of the multi-objective water resource optimization allocation model with fuzzy credibility constraints include maximizing net economic benefits, minimizing social water shortage, and minimizing ecological and environmental impacts. The fuzzy credibility constraints include constraints on available water supply, minimum and maximum water demand of water users, groundwater extraction limits, and pollutant discharge.

5. A method for optimizing urban water resource allocation based on multi-agent driving as described in claim 4, characterized in that, The functional expression for the objective of maximizing net economic benefits is: ; The functional expression for the objective of minimizing social water shortage is: ; The functional expression for the objective of minimizing ecological and environmental impacts is: ; in, i For the first i Water source j For the first j Each water-using department, k For the first k Each district and county x ijk for i Water source allocation k districts and counties j Water usage by water-using departments For the benefit coefficient, This is the cost coefficient. For the water demand of each department, This represents the pollutant emission coefficient.

6. The method for optimal allocation of urban water resources based on multi-agent driving as described in claim 5, characterized in that, The water supply capacity constraint is that the total amount of various water sources allocated to any district or county shall not exceed the fuzzy upper limit of the water supply capacity of the water source. The formula for the constraint on the available water supply from the water source is as follows: ; The constraints on water users' minimum and maximum water demand are as follows: the actual water supply of each district and county must meet the fuzzy minimum demand and not exceed the maximum maximum demand; the formula expressions for the constraints on water users' minimum and maximum water demand are as follows: and ; The formula for the constraint of groundwater extraction boundary is: ; The formula for pollutant emission constraints is as follows: ; in, Let i be the water supply available to k district / county. The minimum water demand of user j in district / county k. This represents the maximum water demand of user j in district / county k. Groundwater extraction is restricted in district K.

7. The method for optimal allocation of urban water resources based on multi-agent driving as described in claim 1, characterized in that, The multi-criteria decision-making method is a combination of the analytic hierarchy process (AHP) and the approximation of ideal solution ranking method. The AHP is used to extract preference keywords from the user's natural language instructions through a comprehensive decision-making agent, and to automatically generate an initial judgment matrix for the AHP using a large language model to determine the weights of each objective function. The approximation ideal solution ranking method is used to sort the non-dominated solutions in the Pareto front based on the weights, and select the best compromise solution.

8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that the processor executes the computer program to implement a multi-agent-driven urban water resource optimization allocation method according to any one of claims 1-7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements a multi-agent-driven urban water resource optimization allocation method according to any one of claims 1-7.

10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements a multi-agent-driven urban water resource optimization allocation method according to any one of claims 1-7.