Double drainage model topology simplification method, system and device for large language model context optimization

CN123013717APending Publication Date: 2026-10-30CHONGQING UNIV +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611499884.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-24
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0010]本发明的目的是提供面向大语言模型上下文优化的双排水模型拓扑简化方法、系统及装置,以解决简化后的水力模拟结果与基准模拟结果之间可能产生较大偏差,并可能导致目标大语言模型无法基于完整且保持主要水动力特征的模拟数据进行城市内涝分析的技术问题

Benefits of technology

[0012]本发明的显著效果为:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123013717A_ABST
    Figure CN123013717A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of graph topology data processing and artificial intelligence, in particular to a double-drainage model topology simplification method, system and device for large language model context optimization, which comprises obtaining a first candidate prompt data package through a pipe section level candidate simplification model; if the first candidate prompt data package meets the context word element capacity constraint, it is taken as an input context; otherwise, a second candidate prompt data package is obtained through a node level candidate simplification model; if the second candidate prompt data package meets the context word element capacity constraint, it is taken as an input context; otherwise, an aggregated prompt data package is obtained based on the second candidate simulation result, when the aggregated prompt data package meets the context word element capacity constraint, it is taken as an input context, otherwise, a capacity overrun state is output, and a target large language model obtains an urban waterlogging simulation analysis result based on the input context. The present application can simultaneously consider the hydraulic simulation error and the context word element capacity constraint.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of graph topology data processing and artificial intelligence technology, specifically to a method, system, and apparatus for topology simplification of dual-drainage models for context optimization of large language models. Background Technology

[0002] Urban flooding simulation refers to the use of computer technology, based on hydrological and hydrodynamic principles, to digitally reproduce and predict urban flooding processes such as water accumulation and inundation that may occur in urban areas under heavy rainfall conditions. Its core is the construction of a virtual urban hydrological system, which typically employs a dual-drainage model consisting of an underground drainage network and a surface road network. The underground drainage network simulates the transport process of rainwater within underground pipe sections and drainage facilities, while the surface road network simulates the convergence of rainwater exceeding the underground drainage capacity in urban roads and other surface spaces.

[0003] In a dual-drainage model, the underground drainage network and the surface road network share at least some nodes. The same shared node participates in both the hydraulic calculations of the underground drainage network and the surface runoff calculations of the surface road network. Underground pipe segments are interconnected through shared nodes, as are the edges of surface roads. These shared nodes also possess underground-surface exchange parameters characterizing the water exchange between the underground drainage network and the surface road network.

[0004] As the spatial resolution of urban drainage models continues to improve, the number of shared nodes, underground pipe sections, and surface roadside areas in dual-drainage models is also increasing. After performing hydraulic simulations on dual-drainage models, hydraulic simulation results such as maximum water accumulation depth, node water level, pipe section flow rate, and overflow status will also be generated.

[0005] When using large language models to analyze urban flooding, it is necessary to convert the topological data, hydraulic properties, and hydraulic simulation results of the dual drainage model into structured cue data packets. Due to the contextual lexical capacity limit of large language models, when the dual drainage model is large, the actual number of input lexical units in the cue data packet may exceed the number of input lexical units allowed by the target large language model, resulting in truncated cue data or incomplete input to the target large language model.

[0006] While directly reducing the number of output data fields can decrease the data volume, it can easily lead to the loss of information about underground drainage networks, surface road networks, and the hydraulic relationships between them. Directly deleting small-diameter underground pipe segments may alter the water storage space and hydraulic connectivity of the underground drainage network. Directly deleting intermediate nodes will simultaneously change the topology of underground pipe segments and surface road edges, and may also alter the distribution of catchment areas, node water storage properties, and underground-to-surface exchange relationships, resulting in significant discrepancies between the hydraulic simulation results of the simplified model and those of the unsimplified model.

[0007] Because underground drainage networks and surface road networks share nodes, determining whether a node can be deleted based solely on underground pipe segment constraints or solely on surface road constraints may disrupt the topology of the other side of the dual-drainage model. For example, a node in the underground drainage network might be a mergeable intermediate node of degree 2, but in the surface road network, it might be a road intersection, a location of abrupt changes in road slope, or a boundary of a traffic-affected state. Conversely, a node might be suitable for merging in the surface road network, but the underground pipe segments on either side of it might have different cross-sections, diameters, or hydraulic properties. Therefore, node deletion needs to consider both underground pipe network constraints and surface road constraints simultaneously.

[0008] Existing model simplification methods typically perform a one-time screening and deletion of model objects based on pipe diameter, node connectivity, or geometric location, lacking a mechanism to dynamically adjust the degree of simplification based on the simplified hydraulic simulation results. When a large number of underground pipe segments or shared nodes are deleted at once, the maximum water accumulation depth or the change in node water level may exceed the allowable range; when the number of deletions is small, the prompt data packet generated from the hydraulic simulation results may still exceed the context word capacity of a large language model.

[0009] Furthermore, aggregating hydraulic simulation results based solely on topological connectivity or geometric distance may merge results from adjacent roads with different traffic water crossing states, thereby obscuring locations where traffic water crossing states change, such as safe passage, decelerated passage, or physical blockage. Summary of the Invention

[0010] The purpose of this invention is to provide a method, system, and apparatus for topology simplification of dual drainage models for context optimization of large language models, in order to solve the technical problem that there may be a large deviation between the simplified hydraulic simulation results and the benchmark simulation results, which may cause the target large language model to be unable to perform urban flooding analysis based on complete simulation data that retains the main hydrodynamic characteristics.

[0011] In a first aspect, the present invention provides a topology simplification method for a dual-drainage model aimed at optimizing the context of a large language model, comprising the following steps: Obtain the operating condition data of the dual drainage model, and perform a baseline hydraulic simulation using the pre-built dual drainage model to obtain the baseline simulation results; Based on the dual drainage model, a pipe segment-level candidate simplified model is constructed. The operating data of the dual drainage model are used to perform hydraulic simulation through the pipe segment-level candidate simplified model to obtain the first candidate simulation result. The hydraulic error constraint satisfaction status of the pipe section-level candidate simplified model is determined based on the benchmark simulation results and the first candidate simulation results; when the pipe section-level candidate simplified model satisfies the hydraulic error constraints, the first candidate simulation results are converted into the first candidate prompt data packet. Determine whether the number of input tokens in the first candidate prompt data packet meets the context token capacity constraint. If so, use the first candidate prompt data packet as the input context of the target large language model. Otherwise, perform common node-level simplification on the pipe section-level candidate simplified model to obtain the node-level candidate simplified model. Then, perform hydraulic simulation on the dual drainage model working condition data through the node-level candidate simplified model to obtain the second candidate simulation result. The hydraulic error constraint satisfaction status of the node-level candidate simplified model is determined based on the benchmark simulation results and the second candidate simulation results; when the node-level candidate simplified model satisfies the hydraulic error constraints, the second candidate simulation results are converted into a second candidate prompt data packet. Determine whether the second candidate prompt data packet satisfies the context word capacity constraint. If so, use the second candidate prompt data packet as the input context of the target large language model. Otherwise, aggregate the second candidate simulation results to obtain an aggregate prompt data packet, and determine whether the aggregate prompt data packet satisfies the context word capacity constraint. When the aggregate prompt data packet satisfies the context word capacity constraint, use the aggregate prompt data packet as the input context of the target large language model. Otherwise, output the capacity limit exceeded status. The target large language model obtains the urban flooding simulation analysis results based on the first candidate cue data packet, the second candidate cue data packet, or the aggregated cue data packet.

[0012] The significant effects of this invention are: This invention employs a two-level topology simplification strategy, sequentially implementing pipe segment-level simplification and shared node-level simplification, and performs hydraulic error constraint judgment after each simplification level. This approach ensures that the deviation between the hydraulic simulation results of the simplified model and the baseline simulation results does not exceed a preset allowable range during urban flooding simulation analysis. It also progressively reduces the topological complexity of the dual drainage model, avoiding the problem of simulation accuracy distortion caused by excessive simplification at once.

[0013] By generating the first candidate prompt data packet after simplification at the segment level and performing context lexical capacity constraint judgment, the shared node-level simplification and subsequent aggregation processing are triggered only when the judgment result is not satisfied, forming a progressive data dimensionality reduction mechanism. This mechanism can dynamically adapt the data output granularity according to the actual lexical capacity limit of the target large language model, ensuring that the final output prompt data packet can be completely input into the target large language model.

[0014] When the second candidate simulation result after simplification at the shared node level still does not meet the context lexical capacity constraint, the second candidate simulation result is aggregated to obtain an aggregated cue data packet. Based on this aggregated cue data packet as the input context of the target large language model, the number of lexical packets in the cue data packet can be reduced by changing the expression granularity of the simulation result without further deleting the topological objects in the dual drainage model. This allows the overall hydraulic characteristics of the second candidate simulation result to be preserved while meeting the lexical capacity constraint.

[0015] This invention selects data packets that meet the constraints based on capacity judgment results and outputs first candidate prompt data packets, second candidate prompt data packets, or aggregated prompt data packets to the target large-scale language model. This enables the target large-scale language model to output fine-scale node-level waterlogging state analysis results, topology-simplified pipe network-level hydraulic state analysis results, or road network-level waterlogging corridor situation analysis results, depending on the different granularity levels of the input data packets. This provides matching analytical granularity for urban flooding simulation analysis tasks at different scales, solving the technical problem that the large-scale language model cannot fully output flooding analysis conclusions due to the mismatch between data scale and model capacity. It provides data support for urban flooding risk assessment, waterlogging point priority ranking, and drainage resource scheduling. Furthermore, this solution can reduce the input data scale while keeping the deviation of the maximum waterlogging depth and node water level of the simplified dual-drainage model from the baseline model within a preset range, and preserving the semantic boundaries of traffic-related water. Therefore, the data input to the target large-scale language model can still characterize the main hydrodynamic features of the urban flooding process.

[0016] Secondly, the present invention provides a dual-drainage model topology simplification system for large language model context optimization, used to implement the dual-drainage model topology simplification method for large language model context optimization as described above, including: The dual-drainage model working condition data acquisition module is used to acquire dual-drainage model working condition data; The benchmark simulation module is used to perform benchmark hydraulic simulations on the dual-drainage model working condition data through a pre-built dual-drainage model to obtain benchmark simulation results; The dual-drainage model topology simplification module is used to simplify the dual-drainage model to obtain segment-level candidate simplified models and / or node-level candidate simplified models; The hydraulic verification module is used to verify whether the candidate simplified models at the pipe segment level and / or node level meet the hydraulic error constraints. The first candidate suggestion data packet generation module is used to generate the first candidate suggestion data packet based on the simulation results of the pipe section-level candidate simplified model that meets the hydraulic error constraints. The second candidate suggestion data packet generation module is used to generate a second candidate suggestion data packet based on the simulation results of the node-level candidate simplified model that satisfies the hydraulic error constraints. The aggregated hint data packet generation module is used to generate aggregated hint data packets based on the simulation results of node-level candidate simplified models that satisfy hydraulic error constraints; The lexical verification module is used to verify whether the first candidate prompt data packet, the second candidate prompt data packet, and the aggregate prompt data packet meet the context lexical capacity constraint. The output module is used to output the first candidate prompt data packet, the second candidate prompt data packet, or the aggregated prompt data packet that meets the context lexical capacity constraint to the target large language model. The output module is also used to output the capacity over-limit status when the aggregated prompt data packet does not meet the context lexical capacity constraint. The urban flooding simulation analysis result acquisition module is used to acquire the urban flooding simulation analysis results obtained by the target large language model based on the first candidate prompt data packet, the second candidate prompt data packet, or the aggregated prompt data packet.

[0017] Thirdly, the present invention provides a dual-drainage model topology simplification apparatus for large language model context optimization, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above-described dual-drainage model topology simplification method for large language model context optimization. Attached Figure Description

[0018] Figure 1 This is a flowchart of a dual-drainage model topology simplification method for context optimization of large language models in an embodiment of the present invention; Figure 2 This is a schematic diagram of the deleted underground pipe segment and node entities in an embodiment of the present invention; Figure 3 This is a schematic diagram of the water storage parameters of a node in an embodiment of the present invention; Figure 4 This is a schematic diagram of the deletion of shared nodes and the joint reconstruction of underground pipe sections and surface roads in an embodiment of the present invention. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, a clear and complete description will be provided below in conjunction with the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the protection scope of the present invention.

[0020] See appendix Figure 1The dual-drainage model topology simplification method shown is used for context optimization of large language models in urban flooding simulation analysis. The context optimization referred to in this invention refers to reducing the actual number of input lexical units in the prompt data packet formed according to the preset data format and / or adjusting its data expression granularity, so that the prompt data packet meets the context lexical capacity constraint of the target large language model, under the premise of satisfying the preset hydraulic error constraints and maintaining the semantic features of traffic water-related issues. This is achieved by simplifying the dual-drainage model at the pipe segment level, the shared node level, and, when necessary, performing semantic-level macro-aggregation on the simulation results that have passed hydraulic error verification.

[0021] The context optimization targets the data size and data representation granularity of the input target large language model, without modifying the target large language model's maximum context window, model parameters, attention mechanism, or model structure. The context lexical capacity constraint is a constraint used to determine whether to continue to the next processing level and whether it is possible to input cue data packets to the target large language model when implementing the context optimization.

[0022] The large language model can be a large-scale language model based on the Transformer architecture or other models capable of natural language understanding and generation. For example, the target large language model can be a GPT series model, Claude series model, Gemini series model, DeepSeek series model, Qwen series model, or Llama series model, or other large language models with contextual lexical capacity limitations deployed in the cloud or locally. This invention does not limit the specific vendor, model name, model parameter scale, or deployment method of the target large language model.

[0023] The method specifically includes the following steps: S1. Obtain the operating condition data of the dual drainage model. Perform a baseline hydraulic simulation using the pre-built dual drainage model to obtain baseline simulation results. The operating condition data of the dual drainage model includes at least rainfall input, simulation start and end times, initial conditions, outlet boundary conditions, and hydraulic facility operating conditions. Rainfall input drives the urban flooding process; initial conditions determine the initial hydraulic state at the start of the simulation; outlet boundary conditions describe the external hydraulic boundaries of the underground drainage system outlets; and hydraulic facility operating conditions may include the operating status or control conditions of pumping stations, gates, or other hydraulic facilities. The specific details of acquiring the dual drainage model operating condition data are existing technology and will not be elaborated upon here.

[0024] The double-drainage model includes: A shared node set, in which shared nodes may possess at least one of the following: node identifier, spatial location, surface elevation, pipe bottom elevation, node water level, maximum water accumulation depth, catchment area, node water storage parameters, and groundwater-surface exchange parameters. At least some of the shared nodes in the shared node set simultaneously serve as groundwater hydraulic calculation nodes in the underground drainage network and surface runoff calculation nodes in the surface road network.

[0025] An underground pipe segment set is a collection of underground pipe segments connected by a common node as its endpoint. Each segment possesses at least one of the following parameters: length, cross-sectional type, pipe diameter, pipe material, roughness, starting pipe bottom elevation, ending pipe bottom elevation, and local head loss. The underground pipe segments are interconnected through common nodes, as are the segments along surface roads.

[0026] The set of surface road edges, with common nodes as endpoints, has at least one of the following characteristics: length, path geometry, road width, cross-section type, surface roughness, and road slope.

[0027] Each shared node has an underground connectivity score and a surface connectivity score. The underground connectivity score represents the number of underground pipe segments connected to the shared node, and the expression for the underground connectivity score is as follows: In the formula, To share nodes The number of connected underground pipe sections, For underground pipe sections, For underground pipe segments in a collection of underground pipe segments, The number of elements in the set. Indicates shared nodes underground pipe section The endpoints; Surface connectivity represents the number of surface road edges connected to the shared node, where the expression for surface connectivity is: In the formula, To share nodes The number of adjacent surface roads. It is a collection point along the roadside on the ground. For the surface road edges in the set of surface road edges, Indicates shared nodes For the side of the surface road The endpoints; The baseline simulation results obtained by performing a baseline hydraulic simulation using the dual-drainage model based on the operating data of the dual-drainage model include at least the maximum water accumulation depth of the shared nodes and the node water level of the evaluation nodes within the preset simulation time range. The specific details of the hydraulic simulation using the dual-drainage model are existing technology and will not be elaborated upon here.

[0028] S2. Based on the dual-drainage model, construct a segment-level candidate simplified model. Perform hydraulic simulations using the segment-level candidate simplified model on the dual-drainage model's operating conditions to obtain the first candidate simulation result. The steps in constructing the segment-level candidate simplified model include: A1. Candidate underground pipe segments to be deleted are selected based on pipe diameter conditions, surface road connectivity conditions, and hydraulic path protection conditions; the steps for selecting candidate underground pipe segments to be deleted include: Determine if the diameter of the underground pipe segment is greater than or equal to a preset diameter threshold. If so, do not consider the underground pipe segment as a candidate for deletion; otherwise: If the two endpoints of the underground pipe segment are both shared nodes that can participate in the surface road confluence calculation, and if the two shared nodes can still be connected to each other through the surface road edge in the surface road network after the underground pipe segment is deleted, and if deleting the underground pipe segment will not cause the preset protection node to lose the hydraulic path to the outlet or drainage facility, then the underground pipe segment is identified as a candidate for deletion; otherwise, the underground pipe segment is not considered as a candidate for deletion.

[0029] If at least one endpoint does not have a connection to the surface road network, or there is no surface reachable path between two endpoints sharing a node, or deleting the underground pipe segment would damage the hydraulic path of the preset protected node, the underground pipe segment shall be retained.

[0030] A2. Delete candidate underground pipe segments and calculate the water storage volume to be compensated based on the geometric parameters of the deleted underground pipe segments, as shown in the attached figure. Figure 2 As shown, the geometric parameters of the underground pipe segment include its length and cross-sectional area. For an underground pipe segment whose cross-section remains constant along its length, the volume of water to be compensated is expressed as: In the formula, To compensate for the water storage volume, The length of the underground pipe segment to be deleted. This represents the cross-sectional area of ​​the underground pipe section that was deleted.

[0031] A3. Obtain the node allocation weights corresponding to the shared nodes of the endpoints of the deleted underground pipe segment, and calculate the water storage volume of the endpoints of the deleted underground pipe segment based on the node allocation weights; specifically, according to the shared node allocation weights corresponding to the two endpoints of the deleted underground pipe segment, allocate the water storage volume to be compensated to the shared nodes of the two endpoints. The water storage volumes allocated to the shared nodes of the two endpoints are as follows: In the formula, The water storage volume is allocated to the first endpoint shared node. Assign weights to the nodes at the first endpoint. The water storage volume is allocated to the shared node at the second endpoint. Assign weights to the nodes at the second endpoint, where The node allocation weight can be determined based on the length of adjacent underground pipe sections, groundwater hydraulic relationship, or preset water storage allocation rules.

[0032] A4. Based on the updated water storage parameters of the shared nodes at the endpoints of the deleted underground pipe segments, candidate simplified models are generated. See attached details. Figure 3 As shown, obtain the reference water depth (greater than zero) corresponding to the deleted underground pipe segment, and calculate the additional surface area of ​​the shared node at the endpoints of the deleted underground pipe segment based on the water storage volume and the reference water depth: In the formula, Shared node for endpoints Additional surface area, Shared node for endpoints Water storage capacity, Shared node for endpoints The corresponding reference water depth can be determined based on the node's allowable water depth, the model's simulated water depth range, or the node's depth-volume relationship.

[0033] The additional surface area is added to the original surface area of ​​the corresponding endpoint shared node, or the depth-to-surface area or depth-to-volume relationship of the endpoint shared node is updated based on the additional surface area to compensate for at least part of the water storage volume loss caused by the deletion of underground pipe segments. When an endpoint shared node corresponds to multiple deleted underground pipe segments, the additional surface area generated by each deleted underground pipe segment for the endpoint shared node is accumulated.

[0034] When obtaining the first candidate simulation result by performing hydraulic simulation on the dual drainage model working condition data through the pipe section-level candidate simplified model, the pipe section-level candidate simplified model is re-simulated under the same simulation conditions as the baseline hydraulic simulation (including rainfall input, simulation start and end time, initial conditions, outlet boundary conditions and hydraulic facility operating conditions), and the hydraulic simulation result is used as the first candidate simulation result.

[0035] S3. Determine the hydraulic error constraint satisfaction status of the pipe segment-level candidate simplified model based on the benchmark simulation results and the first candidate simulation results; obtain the pipe segment-level simplified model based on the hydraulic error constraint satisfaction status of the pipe segment-level candidate simplified model and the pipe segment-level candidate simplified model.

[0036] The hydraulic error constraints include maximum water depth error constraints and node water level error constraints. When determining the satisfaction status of the hydraulic error constraints, the maximum water depth error of the candidate simplified model at the pipe section level is first calculated based on the benchmark simulation results and the first candidate simulation results. In the formula, The maximum water depth error for the candidate simplified model at the pipe segment level. The evaluation node set is a set of evaluation nodes that correspond to each other before and after the simplification of the candidate simplified model at the pipe section level. The evaluation node set includes shared nodes that are retained before and after simplification and have the same identifier or mapping relationship, traffic impact semantic boundary nodes, outlet-related nodes, and preset key location nodes as priority evaluation nodes. Evaluation nodes in the simplified candidate model at the pipe segment level Maximum water depth Evaluation nodes in the dual-drainage model Maximum water depth To find the maximum value function, This is the absolute value operator.

[0037] Secondly, based on the baseline simulation results and the first candidate simulation results, the nodal water level error of the candidate simplified model at the pipe section level is calculated: In the formula, For the nodal water level error of the candidate simplified model at the pipe segment level, This is the set of evaluation nodes that have a corresponding relationship before and after simplification in the pipe segment-level candidate simplified model. To preset the simulation time range, Evaluation nodes in the simplified candidate model at the pipe segment level In simulation time The node water level, Evaluation nodes in the dual-drainage model In simulation time The node water level, This is the absolute value operator.

[0038] When the maximum water depth error is less than or equal to the maximum water depth error threshold and the node water level error is less than or equal to the node water level error threshold, the hydraulic error constraint of the pipe segment-level candidate simplified model is satisfied as having passed the hydraulic error verification; otherwise, the hydraulic error constraint of the pipe segment-level candidate simplified model is not satisfied as having failed the hydraulic error verification.

[0039] When the first candidate simulation result of the pipe segment-level candidate simplified model causes the preset key location to change from one traffic water-related semantic interval to another, the pipe segment-level candidate simplified model is determined to have failed the hydraulic error verification.

[0040] The maximum water accumulation depth error threshold and the nodal water level error threshold are determined based on the purpose of the dual drainage model, simulation accuracy requirements, validation conditions, model spatial scale, or the accuracy requirements of hydraulic results for large-scale language model analysis tasks. Different error thresholds can be used for different simulation regions, rainfall conditions, or analysis tasks.

[0041] When obtaining a simplified pipe segment model based on the hydraulic error constraint satisfaction state of the pipe segment-level candidate simplified model and the pipe segment-level candidate simplified model, if the hydraulic error constraint satisfaction state of the pipe segment-level candidate simplified model is that it passes the hydraulic error verification, then the current pipe segment simplification is accepted; otherwise, the pipe segment-level candidate simplified model is restored to the model state before simplification, the screening threshold corresponding to the pipe segment simplification is reduced and / or the number of candidate underground pipe segments selected in the next batch is reduced, and steps S2 to S3 of pipe segment simplification, hydraulic simulation and hydraulic error verification are re-executed.

[0042] When iteratively performing pipe segment simplification, if the number of candidate underground pipe segments selected in the next batch has been reduced to a single candidate underground pipe segment, and the hydraulic error constraint cannot be met even after deleting the underground pipe segment alone, the underground pipe segment is added to the protection set, and the object will not be deleted again, and other underground pipe segments in the candidate set will continue to be processed.

[0043] When there are no candidate underground pipe segments that can pass the hydraulic error verification in the current pipe segment simplification, the pipe segment simplification ends. At this time, the model state that has passed the last hydraulic error verification is used as the current model, and step S4 is executed.

[0044] S4. Based on the hydraulic error constraint satisfaction state of the pipe segment-level candidate simplified model and the first candidate simulation results, a first candidate prompt data packet is obtained, and the number of input lexical units in the first candidate prompt data packet is counted. Specifically, the first candidate simulation results verified by hydraulic error are converted into the first candidate prompt data packet according to a preset data format, and the actual number of input lexical units in the first candidate prompt data packet is counted. The preset data format includes preset data fields, field order, numerical precision, and serialization format. The preset data fields in the first candidate prompt data packet and the second candidate prompt data packet may include at least one of the following: common node identifier, spatial location, surface elevation, pipe bottom elevation, maximum water accumulation depth of the node, node water level, underground pipe segment connection relationship, surface roadside connection relationship, pipe segment flow rate, overflow status, traffic water-related semantic interval, and object mapping relationship before and after simplification.

[0045] In one implementation, when used for identifying key waterlogged locations, the prompt data packet retains at least the spatial location and maximum waterlogging depth; when used for analyzing the impact of road traffic flooding, the prompt data packet retains at least the road topology, maximum waterlogging depth, and traffic flooding semantic range; when used for analyzing the operational status of underground drainage systems, the prompt data packet can retain node water levels, pipe segment flow rates, and overflow status. The specific content of converting the first candidate simulation results into the first candidate prompt data packet is prior art and will not be elaborated upon here.

[0046] S5. Determine whether the number of input lexical units in the first candidate prompt data packet meets the context lexical unit capacity constraint. If so, use the first candidate prompt data packet as the input context of the target large language model. Otherwise, perform common node-level simplification on the pipe section-level candidate simplified model to obtain the node-level candidate simplified model. Perform hydraulic simulation on the dual drainage model working condition data through the node-level candidate simplified model to obtain the second candidate simulation result. When determining whether the number of input tokens in the first candidate prompt data packet satisfies the context token capacity constraint, the following is included: To obtain the maximum number of context lexical units in the target large language model, the allowed number of input lexical units is determined based on the fixed prompt content, the reserved number of output lexical units, and the safety margin. The expression for the allowed number of input lexical units is: In the formula, The number of allowed input lexical units for the target large language model. For safety margin factor, where , The maximum number of context lexical units in the target large language model. Reserved output lexical units for the target large language model. This refers to the number of lexical units used for fixed prompts, including system prompts, task instructions, and other hints. When the target large language model, prompt template, serialization format, or reserved output lexical units change, the allowed input lexical units are redefined, and the actual input lexical units are recounted.

[0047] Using a word segmenter or lexical statistics rule corresponding to the target large language model, the actual number of input lexical units in the first candidate prompt data packet is calculated. If the actual number of input lexical units in the first candidate prompt data packet is less than or equal to the allowed number of input lexical units, it indicates that the first candidate prompt data packet meets the context lexical unit capacity constraint; otherwise, the first candidate prompt data packet does not meet the context lexical unit capacity constraint. When the allowed number of input lexical units is less than or equal to 0, the current input process is terminated and a budget configuration failure / capacity configuration abnormal status is output.

[0048] When the first candidate prompt data packet does not meet the context lexical capacity constraint, the segment-level candidate simplification model is simplified using a shared node level, wherein the steps of the shared node level simplification include: B1. Based on the shared node set and connectivity condition of the segment-level candidate simplification model, one or more shared nodes to be judged are obtained; specifically, the shared node-level simplification takes the shared nodes that participate in both the underground drainage pipe network topology and the surface road network topology as the processing objects, where the connectivity condition includes underground connectivity equal to 2 and surface connectivity equal to 2; when the shared nodes in the shared node set meet the connectivity condition, the shared node is taken as the shared node to be judged.

[0049] The shared nodes to be judged do not include road intersections, road branch nodes, local high points, local low points, surface drainage boundary nodes, traffic impact semantic boundary nodes, underground pipe bottom elevation change points, and nodes corresponding to hydraulic facilities, control facilities, or boundary conditions that cannot be equivalently transferred.

[0050] B2. Determine whether the shared nodes to be judged satisfy the joint deletion conditions, and obtain candidate shared nodes to be deleted based on the satisfaction of the shared nodes to be judged. The joint deletion conditions include the satisfaction of groundwater gradient smoothness constraints, underground pipe segment physical property consistency constraints, road slope smoothness constraints, surface road edge physical property consistency constraints, and traffic water-related semantic interval consistency constraints. When determining whether the shared nodes to be judged satisfy the groundwater gradient smoothness constraints, the hydraulic head gradient on both sides of the shared nodes to be judged is calculated. In the formula, For the first underground side of the shared node to be determined at the simulation time The head gradient at that time For the first underground adjacent shared node to be judged at the simulation time The water level at that time For the shared node to be determined at simulation time The water level at that time The length of the underground pipe segment between the shared node to be determined and the adjacent shared node on the first underground side is [not specified]. For the second underground side of the shared node to be determined at the simulation time The head gradient at that time For the second underground adjacent shared node of the node to be judged at the simulation time The water level at that time The length of the underground pipe segment between the shared node to be determined and the adjacent shared node on the second underground side.

[0051] Calculate the groundwater gradient smoothness index based on the head gradient on both sides of the shared node to be judged: In the formula, As an index of the smoothness of the groundwater gradient, To preset the simulation time range, This is the absolute value operator. In other implementations, the groundwater gradient smoothness index can also be calculated based on the peak water accumulation time, the peak water level time, or one or more preset representative times.

[0052] If the groundwater gradient smoothness index is less than or equal to the hydraulic gradient smoothness threshold, then the shared node to be judged satisfies the groundwater gradient smoothness constraint; otherwise, the shared node to be judged does not satisfy the groundwater gradient smoothness constraint.

[0053] When the shared node to be judged is a local extreme point of water head, or when there are sudden changes in the elevation of the underground pipe bottom, drop, reverse slope boundary or significant reversal of flow direction on both sides of it, the shared node is added to the protection set and is not deleted.

[0054] When determining whether the shared node to be judged satisfies the constraint of consistency of physical properties of underground pipe segments, if the underground pipe segments on both sides of the shared node to be judged have the same cross-sectional type and the pipe diameter, pipe material and roughness meet the preset consistency conditions, it is determined that the shared node to be judged satisfies the constraint of consistency of physical properties of underground pipe segments.

[0055] In one implementation, if the pipe diameter, pipe material, and roughness of the two underground pipe sections are all the same, then the shared node to be judged is determined to satisfy the physical property consistency constraint of the underground pipe sections.

[0056] In another implementation, the difference in pipe diameter and roughness between the two underground pipe sections is no greater than the corresponding consistency tolerance. When the hydraulic error exceeds the limit and a rollback is executed, the corresponding consistency tolerance can be reduced to decrease the number of candidate deletion shared nodes.

[0057] When two underground pipe sections have different cross-sectional types or physical property differences that exceed the corresponding consistency tolerance, the shared nodes between them are not deleted.

[0058] When determining whether the shared node to be judged satisfies the road slope smoothness constraint, the surface road slope on both sides of the shared node to be judged is first calculated: In the formula, The road slope on the first surface road side of the shared node to be determined. The elevation of the adjacent shared nodes on the first surface road side of the shared node to be determined is... To determine the surface elevation of the shared node, Let be the length of the surface road edge between the shared node to be judged and its adjacent shared node on the first surface road side. The road slope on the second surface road side of the shared node to be determined. The elevation of the adjacent shared nodes on the second surface road side of the shared node to be determined is... The length of the surface road edge between the shared node to be judged and the adjacent shared node on the second surface road side of the shared node to be judged.

[0059] Calculate the road slope smoothness index based on the surface road slopes on both sides of the shared node to be judged: In the formula, As an index of road slope smoothness, This is the absolute value operator. The road slope smoothness index is used to determine whether the slopes of the roads on both sides of a shared node are continuous, without requiring that the edges of the two surface roads themselves have a small slope.

[0060] When the road slope smoothness index is less than or equal to the road slope smoothness threshold, the shared node to be judged satisfies the road slope smoothness constraint; otherwise, the shared node to be judged does not satisfy the road slope smoothness constraint.

[0061] When the candidate simplified model after the simplification of the shared node level in this batch does not meet the hydraulic error constraint, the road slope smoothing threshold is reduced to improve the screening conditions for shared nodes and reduce the number of candidate shared nodes to be deleted.

[0062] When determining whether a shared node satisfies the consistency constraint of physical attributes of the roadside, if the roadsides on both sides of the shared node have the same cross-sectional type, and the road width, surface roughness, and other attributes used for surface runoff calculation meet the preset consistency conditions, the shared node is determined to satisfy the consistency constraint of physical attributes of the roadside.

[0063] When the cross-sectional types of two surface roads are different, or the differences in road width and surface roughness exceed the corresponding consistency tolerance, the shared nodes between them are not deleted.

[0064] When determining whether the shared nodes to be judged meet the consistency constraints of the traffic water wading semantic interval, the maximum water depth is divided into multiple traffic water wading semantic intervals based on the preset vehicle water wading depth threshold.

[0065] The semantic interval for traffic water crossings includes at least a safe passage zone, a deceleration zone, and a physical barrier zone. The boundaries of each semantic interval for traffic water crossings are determined based on vehicle type, road conditions, or traffic water crossing criteria.

[0066] Extract the maximum water depth of the shared node to be judged and its two adjacent shared nodes on the roadside. When the maximum water depth of the three shared nodes is within the same traffic water-related semantic interval, the shared node to be judged is determined to satisfy the traffic water-related semantic interval consistency constraint.

[0067] When the maximum water depth of three shared nodes crosses different traffic water-related semantic intervals, the shared node to be judged will be marked as a traffic impact semantic boundary node and deletion will be prohibited.

[0068] The semantic interval consistency constraint for traffic-related water-related issues is not relaxed due to exceeding the limit of the actual number of input lexical units or hydraulic error rollback.

[0069] The condition for joint deletion is whether the shared node to be determined satisfies the above-mentioned constraints on groundwater gradient smoothness, underground pipe segment physical property consistency, road slope smoothness, surface roadside physical property consistency, and traffic water-related semantic interval consistency. Specifically, the expression for the joint deletion condition is as follows: In the formula, For joint deletion conditions, The constraints are for the underground pipe network side, which includes groundwater gradient smoothness constraints and physical property consistency constraints for underground pipe segments. The surface road-side constraints include road slope smoothness constraints and surface road edge physical property consistency constraints. For semantic interval consistency constraints related to water-related traffic, This is the logical AND connector.

[0070] When the joint deletion conditions are met, that is, when the groundwater gradient smoothness constraint, the underground pipe segment physical property consistency constraint, the road slope smoothness constraint, the surface road edge physical property consistency constraint, and the traffic water-related semantic interval consistency constraint are all satisfied, the shared node to be judged is determined as a candidate for deletion of the shared node.

[0071] B3. Reconstruct the underground drainage network topology and surface road network topology based on the candidate deletion of shared nodes; specifically, after deleting shared nodes from the segment-level candidate simplified model based on the candidate deletion of shared nodes, reconstruct the underground drainage network topology and surface road network topology respectively; wherein, when deleting shared nodes, the following processing steps are performed: B301. Remove the candidate deletion shared node from the shared node set of the candidate simplified model at the pipe segment level, and remove the two underground pipe segments connected to the candidate deletion shared node from the underground pipe segment set of the candidate simplified model at the pipe segment level. Establish candidate deletion of shared nodes and merge underground pipe segments of adjacent shared nodes on the underground side; when merging underground pipe segments, first calculate the length of the merged underground pipe segment: In the formula, To merge the lengths of underground pipe sections, The length of the underground pipe segment connecting the candidate deleted shared node and the first underground adjacent shared node. This refers to the length of the underground pipe segment connecting the candidate deleted shared node and the adjacent shared node on the second underground side. The geometric path of the merged underground pipe segment is formed by sequentially splicing the geometric paths of the two original underground pipe segments, and the original path length is not replaced by the straight-line distance between the two adjacent shared nodes on the underground side.

[0072] The physical attribute parameters of the merged underground pipe segments are determined based on the physical attributes of the two underground pipe segments connected to the nodes shared by the deleted and candidate deleted segments: When two underground pipe segments connected to the candidate deletion shared node have the same physical properties such as cross-sectional type, pipe diameter, pipe material, and roughness, the merged underground pipe segment inherits the physical properties of the underground pipe segments connected to the candidate deletion shared node. The starting and ending pipe bottom elevations of the merged underground pipe segment inherit the pipe bottom elevations of the two underground pipe segments connected to the candidate deletion shared node at two adjacent shared nodes on the underground side, respectively. Therefore, the average slope of the merged underground pipe segment is: In the formula, To combine the average slope of underground pipe sections, To merge the initial pipe bottom elevation of underground pipe sections, To merge the underground pipe sections, the final pipe bottom elevation is required. To combine the lengths of underground pipe sections.

[0073] When two underground pipe segments connected to a shared node for candidate deletion have the same local head loss coefficient based on the same velocity head, the local head loss coefficient of the merged underground pipe segments is: In the formula, To combine the local head loss coefficients of underground pipe sections, The head loss coefficient is the coefficient for the underground pipe segment connecting the shared node to be deleted and the adjacent shared node on the first underground side. The head loss coefficient is the underground pipe section connecting the shared node to be deleted and the adjacent shared node on the second underground side.

[0074] When a shared node corresponds to a pumping station, gate, weir, orifice, storage facility, independent boundary condition, or local hydraulic structure that cannot be equivalently transferred, the shared node shall not be deleted.

[0075] B302. Remove two surface road edges connected to the candidate deletion shared nodes from the set of surface road edges in the segment-level candidate simplified model, and establish a merged surface road edge connecting two adjacent shared nodes on the surface road side of the candidate deletion shared node. The structure after deleting the candidate deletion shared nodes and completing the joint reconstruction of the underground drainage pipe network topology and the surface road network topology is shown in the attached figure. Figure 4 shown; specifically: First, establish a merged surface road edge connecting two adjacent shared nodes on the surface side of the candidate deletion shared node, where the length of the merged surface road edge is: In the formula, To combine the lengths of the roadside on the ground, The length of the original surface road edge connecting the candidate deleted shared node and the adjacent shared node on the first surface road side. This is the length of the original surface road edge connecting the candidate deleted shared node and the adjacent shared node on the second surface road side. The geometric path of the merged surface road edge is formed by sequentially splicing the geometric paths of the two original surface road edges.

[0076] If the starting and ending elevations of the merged surface road edges are inherited from the surface elevations of the two adjacent shared nodes connected on the surface side, then the average road slope of the merged surface road edges is: In the formula, To incorporate the average road slope along the surface roads, To merge the starting elevations of the roadside on the ground, To merge the endpoint elevations along the surface roads.

[0077] When two adjacent shared nodes connected on the surface side have the same cross-sectional type, road width, and surface roughness, the merged surface road edges inherit the corresponding attributes.

[0078] When the corresponding attribute only meets the preset consistency tolerance, the merging parameters are determined according to the surface runoff calculation method adopted by the dual drainage model; if the merging parameters cannot be formed according to the preset rules, the corresponding shared nodes are not deleted.

[0079] The two adjacent shared nodes on the underground pipeline side and the adjacent shared nodes on the surface road side can be the same or different.

[0080] B4. Calculate the water storage parameters of the adjacent retained shared nodes of the candidate deleted shared nodes; specifically, allocate the catchment area, transferable water storage attributes, and transferable underground-to-surface exchange parameters associated with the candidate deleted shared nodes to the adjacent retained shared nodes, and update the topological index between the adjacent retained shared nodes, underground pipe segments, and surface road edges; save the mapping relationship between the deleted shared nodes and the merged underground pipe segments and merged surface road edges. When adjacent shared nodes on the underground pipeline side are the same as adjacent shared nodes on the surface road side, the allocation weights of each attribute can be determined based on the same set of adjacent retained shared nodes. When adjacent shared nodes on the underground pipeline side are different from adjacent shared nodes on the surface road side, the catchment area associated with the deleted shared node is allocated to the adjacent retained shared nodes on the surface side, the node's water storage attribute is allocated to the adjacent retained shared nodes on the underground side, and the underground-to-surface exchange parameters that can be equivalently transferred are allocated to the retained logical shared nodes determined by the spatial proximity of the original exchange location, the catchment area coverage relationship, and the underground-to-surface hydraulic exchange mapping. Allocation weights are set for each type of attribute, and the sum of the weights of all receiving nodes corresponding to the same attribute is 1, and each weight is not less than 0. If an equivalent receiving node cannot be determined or attribute conservation cannot be maintained, the shared node is added to the protection set.

[0081] Specifically, after deleting a shared node, the catchment area associated with the deleted shared node is transferred to the adjacent retained shared node, wherein the catchment areas allocated to the two adjacent retained shared nodes are as follows: In the formula, The catchment area is allocated to the first adjacent reserved shared node. Assign weights to the catchment area of ​​the first adjacent reserved shared node, i.e., the set of surface-side receiving nodes and the weights assigned to the catchment area. The catchment area associated with the deleted shared node. To allocate the catchment area to the second adjacent reserved shared node, Assign weights to the catchment areas of the second adjacent reserved shared node. The weights for the catchment areas of the two adjacent reserved shared nodes satisfy the following conditions: The catchment area allocation weight is determined based on the length of adjacent pipe segments, path distance, or spatial overlap of the catchment area. Specifically, when the allocation length is determined by the length of adjacent underground pipe segments, the formula for calculating the catchment area allocation weight is: If a deleted shared node has an independent node surface area or depth-volume relationship, then the corresponding water storage attributes are allocated to adjacent retained shared nodes according to the catchment area allocation weight. Specifically, for a constant node surface area, the formula for calculating the additional surface area allocated to two adjacent retained shared nodes is: In the formula, Additional surface area to be allocated to the first adjacent reserved shared node, For constant nodal surface area, Additional surface area to be allocated to the second adjacent reserved shared node.

[0082] For the nodal surface area function that varies with water depth, the assignment relationship is as follows: In the formula, The surface area function of the first adjacent node that retains shared nodes. Let be the nodal surface area function that varies with water depth. The surface area function for the second adjacent node that shares a node.

[0083] The allocated additional surface area or additional surface area function is added to the original water storage parameters of the adjacent reserved shared nodes.

[0084] If the deleted shared node has equivalent underground-to-surface exchange parameters that can be transferred, i.e., the set of logically shared nodes that can maintain the exchange location relationship and the exchange parameter allocation weights, then the corresponding exchange parameters are allocated to adjacent retained shared nodes according to the catchment area allocation weights. Wherein, when the underground-to-surface exchange parameters are represented by equivalent exchange areas, the underground-to-surface exchange parameter allocation relationship can be expressed as: In the formula, The underground-to-surface exchange parameters are assigned to the first adjacent reserved shared node. For the underground-to-surface exchange parameters allocated to the second adjacent reserved shared node, This represents the equivalent swap area of ​​the deleted shared nodes.

[0085] When the independent switching facility corresponding to a shared node has control rules that cannot be migrated equivalently, the shared node is added to the protection set and is not deleted.

[0086] B5. Based on the reconstructed underground drainage network topology, surface road network topology, and water storage parameters of adjacent retained shared nodes, a node-level candidate simplified model is generated. The specific content of generating the node-level candidate simplified model is existing technology and will not be elaborated here.

[0087] When obtaining the second candidate simulation result by performing hydraulic simulation on the node-level candidate simplified model, the node-level candidate simplified model is re-simulated under the same simulation conditions as the baseline hydraulic simulation (including rainfall input, simulation start and end time, initial conditions, outlet boundary conditions and hydraulic facility operating conditions), and the hydraulic simulation result is used as the second candidate simulation result.

[0088] S6. Determine the hydraulic error constraint satisfaction status of the node-level candidate simplified model based on the benchmark simulation results and the second candidate simulation results; obtain the second candidate prompt data packet based on the hydraulic error constraint satisfaction status of the node-level candidate simplified model and the second candidate simulation results; specifically: When a candidate simplified model at the node level does not meet the hydraulic error constraints, the model is restored to its state before the shared node-level simplification in this batch. At least one of the hydraulic gradient smoothing threshold, road slope smoothing threshold, and physical property consistency tolerance is reduced, and / or the number of candidate deleted shared nodes selected in the next batch is reduced. Shared node-level simplification, hydraulic simulation, and hydraulic error verification are then re-executed.

[0089] When the simulation results of the hydraulic error verification of the node-level candidate simplified model meet the hydraulic error constraints, the second candidate simulation results are converted into a second candidate prompt data packet.

[0090] The hydraulic error verification content of the node-level candidate simplified model is the same as that of the pipe section-level candidate simplified model in step S3. The specific content of generating the second candidate prompt data packet is the same as that of generating the first candidate prompt data packet in step S4, and will not be repeated here.

[0091] When re-executing the shared node-level simplification, the consistency constraint of the traffic water-related semantic interval remains unchanged during the rollback and re-filtering process, and a higher simplification ratio is not obtained by relaxing the boundaries between different traffic water-related semantic intervals.

[0092] When the number of candidate shared nodes to be deleted in the next batch has been reduced to a single candidate shared node, and the hydraulic error constraint cannot be met even after deleting the shared node alone, the candidate shared node to be deleted is added to the protection set and will not be deleted again, while other candidate shared nodes to be deleted will continue to be processed.

[0093] When there are no candidate shared nodes that can pass the hydraulic error verification in the current shared node-level simplification, the shared node-level simplification ends, the model state that has passed the hydraulic error verification last time is used as the current model, and candidate prompt data packets are regenerated and the actual number of input lexical units is counted.

[0094] S7. Determine whether the second candidate prompt data packet satisfies the context word capacity constraint. If so, use the second candidate prompt data packet as the input context of the target large language model; otherwise, aggregate the second candidate simulation results to obtain an aggregated prompt data packet, and determine whether the aggregated prompt data packet satisfies the context word capacity constraint. When the aggregated prompt data packet satisfies the context word capacity constraint, use the aggregated prompt data packet as the input context of the target large language model; otherwise, output the capacity exceedance status. The specific content of determining whether the second candidate prompt data packet satisfies the context word capacity constraint is the same as the content of determining whether the first candidate prompt data packet satisfies the context word capacity constraint in steps S4 and S5, and will not be repeated here.

[0095] After simplifying the dual-drainage model at the pipe segment level and shared node level, if the candidate suggestion data packet still does not meet the context lexical capacity constraint, the deletion of underground pipe segments and shared nodes in the dual-drainage model is stopped, and semantic-level macro-aggregation is performed on the second candidate simulation results that have passed hydraulic error verification. Semantic-level macro-aggregation only changes the data expression granularity output to the target large language model; it does not change the node-level and pipe segment-level candidate simplified models that have passed hydraulic error verification, nor does it re-simulate the hydraulics using the macro-level waterlogging corridor object. The steps of semantic-level macro-aggregation include: C1. Traverse the second candidate simulation results to obtain at least one result object, and filter candidate waterlogging corridors based on the result objects. Each result object corresponds to a shared node, a surface road edge, or a preset road location, and has a maximum waterlogging depth and its corresponding traffic-related waterlogging semantic interval. During the traversal, the second candidate simulation results can be traversed based on the topological connections between result objects in the surface road network to obtain at least one result object. When selecting candidate waterlogged corridors based on the result objects, the results objects are sorted according to their topological connectivity within the surface road network. Multiple adjacent results objects that are topologically continuous in the surface road network are identified as candidate waterlogged corridors. When a road topological discontinuity is encountered during traversal of the surface road network, the extension of the current candidate waterlogged corridor is terminated, and this discontinuity is used as the termination boundary of the current candidate waterlogged corridor; macroscopic aggregation is not allowed to cross this road topological discontinuity.

[0096] C2. Determine one or more aggregation boundaries based on the traffic water-related semantic intervals of the result objects, the topological relationships of the surface road network, the surface drainage boundaries, and / or the protection sets; specifically, the aggregation boundaries are the locations where the traffic water-related semantic intervals of the result objects change, the locations of road intersections or road branches, the locations of surface drainage boundaries, and the locations of nodes or road topological discontinuities in the protection sets. The location where the semantic interval of traffic wading changes is determined by dividing the maximum water depth into traffic wading semantic intervals such as safe passage zone, deceleration passage zone, and physical blocking zone, based on a preset vehicle wading depth threshold. For result objects that are adjacent in the topological order of the surface road network, their respective traffic wading semantic intervals are determined according to the maximum water depth of each result object. When two adjacent result objects belong to different traffic wading semantic intervals, the connection position between the two result objects is determined as the location where the traffic wading semantic interval changes. This determination directly uses the maximum water depth from the simulation results verified by hydraulic error, without the need for additional hydraulic simulations.

[0097] The location of road intersections or road branches is determined by counting the number of surface road edges connected to a shared node based on the topological connectivity of the surface road network; this is known as the surface connectivity degree. For ordinary road intermediate nodes, the surface connectivity degree is typically 2. When a shared node connects to three or more surface road edges (i.e., the surface connectivity degree is greater than 2), that shared node is identified as a road intersection or road branch location. Therefore, these locations can be directly obtained from the existing node-road edge topological relationships of the surface road network.

[0098] The location of the surface drainage boundary is determined based on the existing surface runoff boundary conditions in the dual drainage model. When a shared node, surface road edge, or corresponding location is set as the outflow boundary for surface runoff calculation, the model region boundary, or belongs to a boundary object connected to an external surface runoff path, the corresponding location is determined as the surface drainage boundary location. The surface drainage boundary location originates from the boundary conditions and object attributes of the dual drainage model itself.

[0099] The nodes in the protection set are formed during the aforementioned pipe segment-level simplification and shared node-level simplification processes. This protection set is directly read and reused during the semantic-level macro-aggregation stage. For example, when the number of candidate simplification objects is reduced to a single object, and simplifying that object alone still results in hydraulic errors exceeding preset hydraulic error constraints, that object is added to the protection set. When a shared node is located at a position where the semantic range of traffic-related water inflow changes, it can be marked as a traffic impact semantic boundary node and added to the protection set. Objects such as local head extremes, sudden changes in underground pipe bottom elevation, drop structures, reverse slope boundaries, significant flow direction reversals, and hydraulic facilities, control facilities, or boundary conditions that cannot be equivalently transferred can also be retained or added to the protection set according to the aforementioned rules. During the semantic-level macro-aggregation process, when a candidate waterlogging corridor passes through a node or object in the protection set, its location is used as the aggregation boundary.

[0100] The location of a road topological discontinuity is determined based on the endpoint relationships of surface road edges and the topological mapping relationships between the resulting object and shared nodes and surface road edges. When there is no valid topological connection established by shared nodes or surface road edges between two adjacent resulting objects along the current road topological direction, the corresponding location is identified as a road topological discontinuity. This determination is based on the topological connections in the model, not solely on the spatial distance between the two resulting objects. Therefore, even if two resulting objects are spatially close, aggregation cannot be performed across this location if there is no valid topological connection in the surface road network.

[0101] C3. Based on adjacent aggregation boundaries, candidate waterlogged corridors are segmented to obtain macro waterlogged corridor objects. Specifically, multiple result objects continuously distributed between adjacent aggregation boundaries in the same candidate waterlogged corridor are aggregated into a macro waterlogged corridor object. For example, the same candidate waterlogged corridor is composed of continuous result objects A—B—C—D—E—F. If there is a road intersection between C and D, then that location forms an aggregation boundary, ultimately forming a first macro waterlogged corridor object composed of A, B, and C, and a second macro waterlogged corridor object composed of D, E, and F. The macro waterlogged corridor object includes at least the macro waterlogged corridor object identifier, start and end positions, the identifiers of the original result objects it contains, the traffic waterlogging semantic range, the representative maximum waterlogging depth, and the topological mapping relationship between it and the original shared nodes and the roadside on the ground.

[0102] For traffic impact semantic boundary nodes, local maximum water depth nodes, and preset key location nodes, they are not aggregated with adjacent result objects that cross the traffic water-related semantic interval into the same macro water-related corridor object.

[0103] The formula for calculating the representative maximum water depth of the macroscopic water-filled corridor object is as follows: In the formula, This represents the maximum representative water depth of the macroscopic waterlogged corridor object. The macroscopic waterlogged corridor object is a collection of resulting objects. For the result object Maximum water depth This is the function for finding the maximum value.

[0104] The specific details of aggregating adjacent result objects are existing technologies and will not be elaborated here.

[0105] C4. Generate aggregated prompt data packets based on the macroscopic water corridor object, and determine whether the aggregated prompt data packets meet the context lexical capacity constraint. If so, use the aggregated prompt data packets as the input context of the target large language model; otherwise, output the capacity limit exceeded state.

[0106] The target large language model obtains urban flooding simulation analysis results based on the first candidate prompt data package, the second candidate prompt data package, or the aggregated prompt data package. These results may include urban flooding status analysis text, urban flooding analysis report, waterlogging risk analysis results, key waterlogging location identification results, road traffic water impact analysis results, underground drainage system operation status analysis results, and / or disposal recommendations. When the target large language model or its connected visualization module has the corresponding capabilities, it can also generate charts, thematic maps, risk distribution maps, or other visual analysis results. The specific form of the urban flooding simulation analysis results does not constitute a limitation of this invention. When the large language model generates urban flooding simulation analysis results based on the prompt data package, its specific reasoning mechanism can adopt existing large language model reasoning methods, and this invention does not limit this.

[0107] In a specific application scenario, for the analysis of urban flooding risk in a target urban area, the design rainfall process or measured rainfall process, simulated start and end times, boundary conditions of underground drainage system outlets, and operating conditions of hydraulic facilities such as pumping stations and gates are obtained. The dual drainage model is then used for hydraulic simulation. Following the method of this invention, the dual drainage model is simplified at the pipe segment level, shared node level, and necessary semantic-level macro-aggregation. A prompt data packet that meets the contextual lexical capacity constraint is then input into the target large language model. Based on the information retained in the prompt data packet, such as the maximum water depth, node water level, road topology, and traffic-related water semantic intervals, the target large language model identifies key waterlogging locations, road water-related risk locations, and high-water-level nodes in the underground drainage system, generating corresponding urban flooding risk analysis results. This provides data support for assessing the risk level of waterlogging points, determining road traffic conditions, and scheduling drainage resources.

[0108] By constructing a candidate simplified model at the pipe segment level, candidate underground pipe segments to be deleted are selected based on pipe diameter conditions, surface road connectivity conditions, and hydraulic path protection conditions. The water storage volume of the deleted underground pipe segments is compensated to the endpoint shared nodes. This can compensate for at least part of the water storage volume loss caused by the deletion of underground pipe segments. Furthermore, the deviation between the simplified results and the baseline results can be controlled through subsequent hydraulic error verification, and the number of underground pipe segments can be reduced without destroying the surface road topology connectivity. This reduces the data size of the prompt data package generated by the subsequent hydraulic simulation result conversion.

[0109] By calculating the maximum water accumulation depth error and node water level error after pipe segment simplification, and accepting the simplification when the error meets the constraints, and restoring the model and dynamically adjusting the screening threshold or reducing the number of candidate deletions when the error does not meet the constraints, a closed-loop feedback mechanism is formed. This mechanism can control the hydraulic simulation deviation introduced by pipe segment simplification in batches, and ensure that the simplified model does not exceed the preset allowable range in both the maximum water accumulation depth and node water level dimensions.

[0110] By triggering shared node-level simplification when the candidate prompt data packet at the pipe segment level exceeds the capacity, and using groundwater gradient smoothness constraints, underground pipe segment physical attribute consistency constraints, road slope smoothness constraints, surface roadside physical attribute consistency constraints, and traffic water-related semantic interval consistency constraints as joint deletion conditions to screen candidate shared nodes for deletion, it is possible to maintain groundwater gradient smoothness, underground pipe segment physical attribute consistency, road slope smoothness, surface roadside physical attribute consistency, and traffic water-related semantic interval continuity when deleting shared nodes, thus avoiding topology destruction and hydraulic simulation distortion caused by unilateral constraints.

[0111] By deleting shared nodes and then allocating the catchment area, water storage properties, and groundwater-to-surface exchange parameters of the deleted shared nodes to adjacent retained shared nodes, and reconstructing the topological connections between underground pipe sections and surface roads, the hydraulic impact caused by the deletion of shared nodes can be localized and compensated to adjacent objects. This ensures that the simplified model maintains consistency with the unsimplified model in terms of node water level, maximum water accumulation depth, and groundwater-to-surface exchange.

[0112] By performing hydraulic error verification again after simplification at the shared node level, and dynamically reducing the hydraulic gradient smoothing threshold, road slope smoothing threshold, or physical property consistency tolerance based on the verification results, the cumulative error introduced by the simplification at the shared node level can be controlled by gradually tightening the screening conditions, thus avoiding the simulation results from deviating from the baseline value due to excessive node deletion.

[0113] When the second candidate prompt data packet still does not meet the context lexical capacity constraint, the location where the semantic interval of traffic water erosion changes, road intersections, surface drainage boundaries, protection set nodes, and road topological discontinuities are used as aggregation boundaries. Multiple result objects continuously distributed between adjacent aggregation boundaries in the same candidate water erosion corridor are aggregated into a macro water erosion corridor object. This can further reduce the number of lexical units in the prompt data packet by changing the data expression granularity without changing the simplified model that has passed hydraulic error verification. At the same time, it preserves the key locations of traffic water erosion state changes from being merged across intervals, providing a structurally clear and semantically accurate analytical basis for the large language model.

[0114] By sequentially executing the following progressive processing steps—baseline hydraulic simulation, pipe segment-level simplification and hydraulic verification, first lexical capacity judgment, shared node-level simplification and hydraulic verification, second lexical capacity judgment, and semantic-level aggregation—the hydraulic simulation accuracy constraints and the contextual lexical capacity constraints of the large language model are integrated into a unified data processing flow. This enables the simulation results of the dual-drainage model to be adaptively converted into structured prompt data packets that adapt to the input limitations of the target large language model, while ensuring simulation accuracy. This solves the technical problem that large-scale dual-drainage models cannot be fully input into the large language model due to excessive prompt data.

[0115] This invention also aims to provide a double-drainage model topology simplification system for large language model context optimization, used to implement the double-drainage model topology simplification method for large language model context optimization as described above, including: The dual-drainage model working condition data acquisition module is used to acquire dual-drainage model working condition data; The benchmark simulation module is used to perform benchmark hydraulic simulations on the dual-drainage model working condition data through a pre-built dual-drainage model to obtain benchmark simulation results; The dual-drainage model topology simplification module is used to simplify the dual-drainage model to obtain segment-level candidate simplified models and / or node-level candidate simplified models; The hydraulic verification module is used to verify whether the candidate simplified models at the pipe segment level and / or node level meet the hydraulic error constraints. The first candidate suggestion data packet generation module is used to generate the first candidate suggestion data packet based on the simulation results of the pipe section-level candidate simplified model that meets the hydraulic error constraints. The second candidate suggestion data packet generation module is used to generate a second candidate suggestion data packet based on the simulation results of the node-level candidate simplified model that satisfies the hydraulic error constraints. The aggregated hint data packet generation module is used to generate aggregated hint data packets based on the simulation results of node-level candidate simplified models that satisfy hydraulic error constraints; The lexical verification module is used to verify whether the first candidate prompt data packet, the second candidate prompt data packet, and the aggregate prompt data packet meet the context lexical capacity constraint. The output module is used to output the first candidate suggestion data packet, the second candidate suggestion data packet, or the aggregated suggestion data packet that meets the context lexical capacity constraint to the target large language model. The output module is also used to output the capacity limit exceeded state when there are no objects that can be further simplified or aggregated, and the actual number of input lexical units still exceeds the allowed number of input lexical units. The urban flooding simulation analysis result acquisition module is used to acquire the urban flooding simulation analysis results obtained by the target large language model based on the first candidate prompt data packet, the second candidate prompt data packet, or the aggregated prompt data packet.

[0116] This invention also aims to provide a dual-drainage model topology simplification device for large language model context optimization, comprising a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the steps of the aforementioned dual-drainage model topology simplification method for large language model context optimization. The device can be a server, workstation, or other computing device capable of performing dual-drainage hydraulic simulation, graph topology processing, and lexical statistics.

[0117] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it implements the above-described method for topology simplification of a dual-drainage model for large language model context optimization.

[0118] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the scope of the present invention should be included within the protection scope of the present invention.

Claims

1. A topology simplification method for dual-drainage models for context optimization in large language models, used for input context optimization in urban flooding simulation analysis, characterized in that... Includes the following steps: Obtain the operating condition data of the dual drainage model, and perform a baseline hydraulic simulation using the pre-built dual drainage model to obtain the baseline simulation results; Based on the dual drainage model, a pipe segment-level candidate simplified model is constructed. The operating data of the dual drainage model are used to perform hydraulic simulation through the pipe segment-level candidate simplified model to obtain the first candidate simulation result. The hydraulic error constraint satisfaction status of the candidate simplified model at the pipe section level is determined based on the baseline simulation results and the first candidate simulation results. When the candidate simplified model at the pipe segment level satisfies the hydraulic error constraint, the first candidate simulation result is converted into the first candidate prompt data packet; Determine whether the number of input tokens in the first candidate prompt data packet meets the context token capacity constraint. If so, use the first candidate prompt data packet as the input context of the target large language model. Otherwise, perform common node-level simplification on the pipe section-level candidate simplified model to obtain the node-level candidate simplified model. Then, perform hydraulic simulation on the dual drainage model working condition data through the node-level candidate simplified model to obtain the second candidate simulation result. The hydraulic error constraint satisfaction status of the node-level candidate simplified model is determined based on the benchmark simulation results and the second candidate simulation results. When the node-level candidate simplified model satisfies the hydraulic error constraint, the second candidate simulation result is converted into a second candidate hint data packet; Determine whether the second candidate prompt data packet satisfies the context word capacity constraint. If so, use the second candidate prompt data packet as the input context of the target large language model. Otherwise, aggregate the second candidate simulation results to obtain an aggregate prompt data packet, and determine whether the aggregate prompt data packet satisfies the context word capacity constraint. When the aggregate prompt data packet satisfies the context word capacity constraint, use the aggregate prompt data packet as the input context of the target large language model. Otherwise, the output capacity is exceeded. The target large language model obtains the urban flooding simulation analysis results based on the first candidate cue data packet, the second candidate cue data packet, or the aggregated cue data packet.

2. The dual-drainage model topology simplification method for context optimization of large language models according to claim 1, characterized in that, The steps for constructing a segment-level candidate simplified model based on the dual drainage model include: Candidate underground pipe segments to be deleted were selected based on the dual drainage model; Candidate underground pipe segments are deleted, and the water storage volume to be compensated is calculated based on the geometric parameters of the deleted underground pipe segments. Obtain the node allocation weights corresponding to the shared nodes at the endpoints of the deleted underground pipe segment, and calculate the water storage volume at the endpoints of the deleted underground pipe segment based on the node allocation weights. Based on the updated water storage parameters of the shared nodes at the endpoints of the deleted underground pipe segments, a candidate simplified model is generated.

3. The dual-drainage model topology simplification method for context optimization of large language models according to claim 2, characterized in that, The step of screening candidate underground pipe segments for deletion based on the dual drainage model includes: Determine if the diameter of the underground pipe segment is greater than or equal to a preset diameter threshold. If so, do not consider the underground pipe segment as a candidate for deletion; otherwise: If the two endpoints of the underground pipe segment are both shared nodes that can participate in the surface road confluence calculation, and if the two shared nodes can still be connected to each other through the surface road edge in the surface road network after the underground pipe segment is deleted, and if deleting the underground pipe segment will not cause the preset protection node to lose the hydraulic path to the outlet or drainage facility, then the underground pipe segment is identified as a candidate for deletion; otherwise, the underground pipe segment is not considered as a candidate for deletion.

4. The dual-drainage model topology simplification method for context optimization of large language models according to claim 1, characterized in that, The step of simplifying the segment-level candidate simplified model using a common node-level simplification method to obtain the node-level candidate simplified model includes: Based on the shared node set and connectivity condition of the pipe segment-level candidate simplified model, one or more shared nodes to be judged are obtained. Determine whether the shared nodes to be judged meet the joint deletion conditions, and obtain candidate shared nodes to be deleted based on the satisfaction of the shared nodes to be judged with the joint deletion conditions; Reconstruct the underground drainage network topology and surface road network topology based on candidate deletion of shared nodes; Calculate the water storage parameters of the adjacent retained shared nodes of the deleted shared node based on the candidate deleted shared node; Based on the reconstructed underground drainage network topology, surface road network topology, and water storage parameters of adjacent retained shared nodes, a node-level candidate simplified model is generated.

5. The dual-drainage model topology simplification method for context optimization of large language models according to claim 4, characterized in that, The joint deletion conditions include groundwater gradient smoothness constraints, underground pipe segment physical property consistency constraints, road slope smoothness constraints, surface roadside physical property consistency constraints, and traffic water-related semantic interval consistency constraints. When the shared node to be judged satisfies all the constraints in the joint deletion conditions, the shared node to be judged is determined as a candidate for deletion.

6. The dual-drainage model topology simplification method for context optimization of large language models according to claim 4, characterized in that, The steps for reconstructing the underground drainage network topology and the surface road network topology based on candidate deletion of shared nodes include: Remove the candidate deleted common node from the set of common nodes in the candidate simplified model of the pipe segment, and remove the two underground pipe segments connected to the candidate deleted common node from the set of underground pipe segments in the candidate simplified model of the pipe segment. Establish a merged underground pipe segment where the candidate deleted common node connects to the adjacent common node on the underground side. Remove two surface road edges connected to the candidate deletion shared node from the set of surface road edges in the segment-level candidate simplified model, and establish a merged surface road edge connecting two adjacent shared nodes on the surface road side of the candidate deletion shared node.

7. The dual-drainage model topology simplification method for context optimization of large language models according to claim 1, characterized in that, The step of aggregating the second candidate simulation results to obtain the aggregated prompt data packet includes: The second candidate simulation results are traversed to obtain at least one result object, and candidate waterlogged corridors are obtained based on the result objects. Based on the traffic water-related semantic interval of the result object, the topological relationship of the surface road network, the surface drainage boundary and / or the protection set, one or more aggregate boundaries are determined; the judgment conditions of the aggregate boundary include at least one of the following: the location where the traffic water-related semantic interval of the result object changes, the location of road intersection or road branch, the location of surface drainage boundary, the node in the protection set and the location of road topological discontinuity; Candidate water accumulation corridors are segmented based on adjacent aggregation boundaries, and multiple result objects continuously distributed between adjacent aggregation boundaries in the same candidate water accumulation corridor are aggregated to obtain a macro water accumulation corridor object. Generate aggregated prompt data packets based on the macroscopic water-filled corridor object.

8. The dual-drainage model topology simplification method for context optimization of large language models according to any one of claims 1-7, characterized in that, After determining the hydraulic error constraint satisfaction status of the segment-level candidate simplified model and / or the node-level candidate simplified model, the following steps are also included: When the hydraulic error constraint of the segment-level candidate simplified model is satisfied and the hydraulic error verification is passed, the first candidate simulation result is converted into the first candidate prompt data packet; otherwise, the segment-level candidate simplified model is restored to the model state before simplification, the screening threshold corresponding to the segment-level simplification is reduced and / or the number of candidate underground pipe segments selected in the next batch is reduced, and the segment-level simplification, hydraulic simulation and hydraulic error verification are re-executed. If the simulation results of the hydraulic error verification of the node-level candidate simplified model meet the hydraulic error constraints, the second candidate simulation results are converted into a second candidate prompt data packet; otherwise, the node-level candidate simplified model is restored to the model state before the shared node-level simplification in this batch, at least one of the hydraulic gradient smoothing threshold, road slope smoothing threshold and physical property consistency tolerance is reduced, and / or the number of shared nodes to be deleted in the next batch is reduced, and the shared node-level simplification, hydraulic simulation and hydraulic error verification are re-executed.

9. A dual-drainage model topology simplification system for large language model context optimization, used to implement the dual-drainage model topology simplification method for large language model context optimization as described in any one of claims 1-8, characterized in that, include: The dual-drainage model working condition data acquisition module is used to acquire dual-drainage model working condition data; The benchmark simulation module is used to perform benchmark hydraulic simulations on the dual-drainage model operating data through a pre-built dual-drainage model to obtain benchmark simulation results. The dual-drainage model topology simplification module is used to simplify the dual-drainage model to obtain segment-level candidate simplified models and / or node-level candidate simplified models; The hydraulic verification module is used to verify whether the candidate simplified models at the pipe segment level and / or node level meet the hydraulic error constraints. The first candidate suggestion data packet generation module is used to generate the first candidate suggestion data packet based on the simulation results of the pipe section-level candidate simplified model that meets the hydraulic error constraints. The second candidate suggestion data packet generation module is used to generate a second candidate suggestion data packet based on the simulation results of the node-level candidate simplified model that satisfies the hydraulic error constraints. The aggregated hint data packet generation module is used to generate aggregated hint data packets based on the simulation results of node-level candidate simplified models that satisfy hydraulic error constraints; The lexical verification module is used to verify whether the first candidate prompt data packet, the second candidate prompt data packet, and the aggregate prompt data packet meet the context lexical capacity constraint. The output module is used to output the first candidate prompt data packet, the second candidate prompt data packet, or the aggregated prompt data packet that meets the context lexical capacity constraint to the target large language model. The output module is also used to output the capacity over-limit status when the aggregated prompt data packet does not meet the context lexical capacity constraint. The urban flooding simulation analysis result acquisition module is used to acquire the urban flooding simulation analysis results obtained by the target large language model based on the first candidate prompt data packet, the second candidate prompt data packet, or the aggregated prompt data packet.

10. A dual-drainage model topology simplification apparatus for large language model context optimization, 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 steps of the dual-drainage model topology simplification method for large language model context optimization as described in any one of claims 1-8.