A method and system for automatically extracting upstream and downstream relationships of monitoring points in a watershed based on GIS spatial topology
By constructing the upstream and downstream relationships of watershed monitoring points using GIS spatial topology methods, inserting virtual nodes to mark the connection between tributaries and main streams, and generating a directed graph structure, the problem of missing upstream and downstream structures of monitoring points in the water environment monitoring network is solved, and efficient and accurate pollution source tracing and dynamic updates are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA NAT ENVIRONMENTAL MONITORING CENT
- Filing Date
- 2025-09-02
- Publication Date
- 2026-06-23
AI Technical Summary
In existing water environment monitoring networks, the lack of upstream and downstream structural information between monitoring points makes it difficult to trace pollution sources. Manual judgment is time-consuming and prone to errors. The topology is not coherent, and the influence of tributaries is not considered, resulting in inaccurate pollution source tracing results.
Using a GIS-based spatial topology approach, the association between monitoring points and river sections is determined, a watershed flow direction network topology is constructed, virtual nodes are inserted to mark the connection between tributaries and the main stream, and a directed graph structure is generated to extract upstream and downstream relationships and support dynamic incremental updates.
It enables efficient and automated extraction of upstream and downstream relationships of watershed monitoring points, improves the accuracy and efficiency of pollution source tracing, supports real-time response to river channel changes, reduces maintenance costs, and meets emergency monitoring needs.
Smart Images

Figure CN121147430B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, specifically to an automated method and system for extracting upstream and downstream relationships of watershed monitoring points based on GIS spatial topology. Background Technology
[0002] Currently, the surface water monitoring station information in the national water environment monitoring network is mostly based on static attributes, such as latitude and longitude, water quality parameters, and sampling frequency. Existing systems, such as the "National Surface Water Environmental Quality Monitoring Network Basic Information Database," typically lack upstream and downstream structural information between monitoring stations. This makes it difficult for regulatory authorities to quickly obtain pollution pathways and responsibility zoning through systematic means in tasks such as water pollution source tracing and water quality anomaly response. Furthermore, common river pollution source tracing methods, such as buffer zone analysis and inverse interpolation, can only establish coarse-grained geographical relationships between monitoring stations and rivers, failing to form a structured topological network. While some international systems, such as those of the EPA, emphasize the importance of monitoring station layout, they do not provide automated topology generation and updating mechanisms. Existing technologies have the following three main drawbacks: 1) High dependence on manual intervention: In tens of thousands of monitoring points across the country, manually determining the upstream and downstream relationships of points is time-consuming and prone to errors; 2) Incoherent topology: The buffer method only considers the distance between points and lines, ignoring real hydrological processes such as flow direction and confluence; 3) Significant tributary blind spots: Most systems ignore the impact of tributaries on the main water body, leading to breaks or deviations in pollution source tracing results, which is especially evident in complex river networks where multiple tributaries flow into the main stream.
[0003] Therefore, how to provide an efficient and automatic method for dynamically extracting the upstream and downstream relationships of surface water monitoring points in a watershed has become an urgent problem to be solved in this field. Summary of the Invention
[0004] To address the aforementioned issues, this application proposes an automated method for extracting upstream and downstream relationships of watershed monitoring points based on GIS spatial topology. The method includes the following steps: determining the association between monitoring points and river segments; constructing a watershed flow direction network topology based on the association between monitoring points and river segments; refining the tributary information in the watershed flow direction network topology; processing the refined watershed flow direction network topology into a directed graph structure and extracting upstream and downstream relationships from the directed graph structure; generating an interactive topology network graph based on the directed graph structure; storing the interactive topology network graph and performing a storage error check; if the storage error check passes, continuing to store and use the interactive topology network graph normally; if the storage error check fails, verifying the interactive topology network graph and re-storing it.
[0005] The above-described automated extraction method for upstream and downstream relationships of watershed monitoring points based on GIS spatial topology includes determining the association between monitoring points and river segments by emitting rays from the monitoring point in any direction; if a ray intersects with a river segment, it is a river segment associated with the monitoring point.
[0006] The above-described method for automatically extracting upstream and downstream relationships of watershed monitoring points based on GIS spatial topology includes the following sub-steps for improving tributary information in the watershed flow direction network topology: detecting tributary nodes in the watershed flow direction network topology; inserting topology markers and labeling information at the tributary node locations.
[0007] The above-described method for automatically extracting upstream and downstream relationships of watershed monitoring points based on GIS spatial topology includes inserting topological markers and labeling information at tributary nodes. This involves automatically inserting topological markers as virtual nodes at each node where a tributary flows into the main stream to mark the connection between the tributary and the main stream, and labeling the tributary ID, inflow angle, and flow percentage attributes.
[0008] The above-described automated method for extracting upstream and downstream relationships of watershed monitoring points based on GIS spatial topology involves processing the improved watershed flow direction network topology into a directed graph structure. Extracting upstream and downstream relationships from the directed graph structure includes the following sub-steps: determining a directed graph structure with river segments as edges and monitoring points and virtual nodes as nodes; and generating a list of upstream and downstream relationships for each monitoring point within the directed graph structure.
[0009] An automated system for extracting upstream and downstream relationships of watershed monitoring points based on GIS spatial topology includes: a monitoring point-to-river segment association unit, a watershed flow direction network topology determination unit, a refinement unit, a directed graph generation unit, an interactive topology network graph generation unit, a storage error checking unit, an interactive topology network graph usage unit, and an interactive topology network graph verification unit. The monitoring point-to-river segment association unit is used to determine the association between monitoring points and river segments. The watershed flow direction network topology determination unit is used to construct the watershed flow direction network topology based on the association between monitoring points and river segments. The refinement unit is used to refine the tributary information in the watershed flow direction network topology. The system includes: a directed graph generation unit, used to process the improved watershed flow direction network topology into a directed graph structure and extract upstream and downstream relationships from the directed graph structure; an interactive topology network graph generation unit, used to generate an interactive topology network graph based on the directed graph structure; a storage error checking unit, used to store the interactive topology network graph and perform storage error checks; an interactive topology network graph usage unit, used to continue storing and using the interactive topology network graph normally if the storage error check passes; and an interactive topology network graph verification unit, used to verify the interactive topology network graph and re-store the interactive topology network graph if the storage error check fails.
[0010] As described above, the automated extraction system for upstream and downstream relationships of watershed monitoring points based on GIS spatial topology determines the association between monitoring points and river segments by emitting rays from the monitoring point in any direction. If a ray intersects with a river segment, it is considered a river segment associated with the monitoring point.
[0011] The above-described automated extraction system for upstream and downstream relationships of watershed monitoring points based on GIS spatial topology includes the following sub-steps for the improvement unit to improve tributary information in the watershed flow direction network topology: tributary node detection in the watershed flow direction network topology; insertion of topology markers and information annotation at the tributary node locations.
[0012] As described above, the automated extraction system for upstream and downstream relationships of watershed monitoring points based on GIS spatial topology includes, in the improvement unit, the insertion of topological markers and information annotation at tributary node locations. This includes automatically inserting topological markers as virtual nodes at each node where a tributary flows into the main stream to mark the connection relationship between the tributary and the main stream, and annotating the tributary ID, inflow angle, and flow percentage attribute information.
[0013] The above-described automated extraction system for upstream and downstream relationships of watershed monitoring points based on GIS spatial topology includes a directed graph generation unit that processes the improved watershed flow direction network topology into a directed graph structure. Extracting upstream and downstream relationships from the directed graph structure includes the following sub-steps: determining a directed graph structure with river segments as edges and monitoring points and virtual nodes as nodes; and generating a list of upstream and downstream relationships for each monitoring point within the directed graph structure.
[0014] This application has the following beneficial effects:
[0015] (1) This application solves the problem of misjudgment of responsibility caused by topology omission by inserting virtual nodes at the tributary confluence point;
[0016] (2) This application uses a flow-driven recursive relationship extraction algorithm and hydrological directionality control path traversal to construct a real and effective upstream and downstream topology. The topology structure has a significant impact on the accuracy of pollution source tracing results and is helpful for subsequent accountability and law enforcement.
[0017] (3) This application supports dynamic topology representation of the whole basin monitoring network, providing a foundation for future functions such as pollution simulation and emergency response.
[0018] (4) This application supports dynamic incremental updates. When the location or river network structure is adjusted, there is no need for a full recalculation. The system can automatically detect and update only the relationship paths of the affected areas. It supports real-time response to river channel changes, reduces maintenance costs, and improves the efficiency of data processing and tributary analysis. At the same time, it can meet the dynamic source tracing needs in emergency monitoring scenarios. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0020] Figure 1 This is a flowchart illustrating an automated method for extracting upstream and downstream relationships of watershed monitoring points based on GIS spatial topology, according to an embodiment of this application.
[0021] Figure 2 This is a schematic diagram of the internal structure of an automated system for extracting upstream and downstream relationships of watershed monitoring points based on GIS spatial topology, provided in an embodiment of this application. Detailed Implementation
[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0023] Example 1
[0024] like Figure 1 As shown in the figure, this embodiment provides an automated method for extracting upstream and downstream relationships of watershed monitoring points based on GIS spatial topology, which specifically includes the following steps:
[0025] Step S1: Determine the relationship between the monitoring point and the river section.
[0026] The method used is the ray casting method to determine the precise projection relationship between the monitoring point and the river section, and to eliminate false adjacent points that are close in distance but not connected.
[0027] Specifically, by emitting rays from the monitoring point in any direction, any river segment that intersects with the ray is considered a river segment associated with the monitoring point. The number of intersections is counted; if the number of intersections is odd, the monitoring point is considered to be within the projection range of the river segment; otherwise, it is excluded. This method eliminates "pseudo-adjacent points" that are close in distance but not actually connected, ensuring the accuracy of spatial connections and avoiding false associations caused by relying solely on distance judgments.
[0028] Step S2: Construct a watershed flow direction network topology based on the association between monitoring points and river sections.
[0029] The DEM (Digital Elevation Model) elevation raster data was used to obtain watershed topographic elevation information.
[0030] Specifically, based on the D8 flow algorithm, the elevation difference between each grid cell and its eight neighboring grid cells is calculated. The flow direction is defined as the direction of the neighborhood with the largest elevation difference, thereby deducing the flow direction of each river segment and forming a complete directed flow network. This network clarifies the topological direction of the flow, providing a core basis for extracting upstream and downstream relationships.
[0031] Step S3: Improve the tributary information in the watershed flow direction network topology.
[0032] Step S3 includes the following sub-steps:
[0033] Step S31: Detect tributary nodes in the watershed flow direction network topology.
[0034] By analyzing the flow network, the locations of tributary nodes merging into the main stream are identified, thus completing the tributary node detection.
[0035] Step S32: Insert topological markers and label information at the tributary node locations.
[0036] At each node where a tributary merges into the main stream, a topological marker point (defined as a virtual node) is automatically inserted to mark the connection between the tributary and the main stream, and to label attribute information such as tributary ID, merging angle, and flow percentage.
[0037] Topological markers do not change the actual river network structure, but by marking the connection between tributaries and the main stream, they solve the problem of misjudgment of pollution source responsibility caused by the lack of tributary topology in traditional methods. They are especially suitable for complex river network scenarios with multiple tributaries converging.
[0038] Step S4: Process the improved watershed flow direction network topology into a directed graph structure, and extract the upstream and downstream relationships in the directed graph structure.
[0039] Step S4 specifically includes the following sub-steps:
[0040] Step S41: Determine the structure of the directed graph.
[0041] The flow network is abstracted as a directed graph structure, with river segments as edges and monitoring points and virtual nodes as nodes.
[0042] Step S42: In the directed graph structure, generate an upstream and downstream association list for each monitoring point.
[0043] Starting from each monitoring point, perform upstream recursive traversal and downstream tracking.
[0044] The upstream recursive traversal specifically involves tracing all tributaries and the main stream in the opposite direction of the water flow. The downstream traversal specifically involves traversing all subsequent river segments in the direction of the water flow.
[0045] By executing upstream recursive traversal and downstream tracking algorithms, the connection relationships of nodes in the traversal path are recorded, generating an upstream and downstream association list for each monitoring point and clarifying its topological location in the watershed. This algorithm differs from simple distance matching; it is entirely based on hydrological flow direction logic, ensuring the authenticity of the extracted relationships.
[0046] Step S5: Generate an interactive topology network graph based on the directed graph structure.
[0047] This involves using Python NetworkX and Plotly to generate interactive topology network diagrams, enabling visualization of the topology structure.
[0048] This embodiment also includes dynamic incremental updates. When the location or river network structure is adjusted, there is no need for a full recalculation; the system can automatically detect and update only the relationship paths of the affected areas. Specifically, it includes the following steps:
[0049] Step Q1: Identify the object of the change.
[0050] The changes include: moving, adding, or deleting monitoring points; modifying the spatial morphology of river sections, such as changing the length and direction of the river section; and changing the topological relationship of the river channel, such as adjusting the location of the confluence point.
[0051] This can be achieved by comparing current data with historical data to identify changed locations and river sections. Change detection can also be performed automatically or periodically.
[0052] Step Q2: Locate the affected area in the topology based on the changed object.
[0053] The watershed topology is still abstracted as a directed graph, with monitoring points and virtual nodes in the graph, and edges representing the flow direction of river segments. Spatial indexing can be used to quickly locate points and river segments within the affected area, thereby reducing the computational scope.
[0054] When a point or river segment changes, the graph is traversed from the changed location along the direction of water flow (downstream) and the opposite direction (upstream) to determine the affected topological path.
[0055] If point A is modified, all upstream tributary paths (in the opposite direction of the flow) and all downstream paths may be affected.
[0056] If the river segment is changed to B, the change in the upstream and downstream connections of B (such as flow direction and confluence point) will affect all monitoring points along its path.
[0057] Step Q3: Perform targeted updates for the affected areas.
[0058] Targeted updates include: if a river segment is modified, the D8 algorithm is re-run only for the river segments within the affected area to update the flow direction network; if the affected area includes tributary inflow points, the label attributes of virtual nodes are re-inserted or adjusted; for affected monitoring points, upstream recursive traversal and downstream tracking are re-executed to generate a new upstream and downstream association list.
[0059] In targeted updates, the correlation between time complexity and the number of affected edges is also determined. If only river segments are modified, the correlation between time complexity and the number of affected edges is T1 = O(E'), where E' represents the number of edges in the affected area (the flow direction relationship of the river segment), and O represents the time complexity. The D8 algorithm traverses the 8-neighborhood elevation differences of each river segment. The computational cost of a single edge is constant, and the total computational cost is linearly related to the number of affected edges E'.
[0060] If the affected area includes tributary inflow points, then the time complexity is related to the number of affected edges, T2 = O(k), where k represents the number of newly added or modified virtual tributary nodes.
[0061] If the affected area includes the affected monitoring points, then the time complexity is related to the number of affected edges, T3 = O(m × (V′ + E′)), where m represents the number of affected monitoring points, V′ represents the number of nodes in the affected area (including monitoring points and virtual nodes), and E′ represents the number of edges in the affected area (river flow direction relationship).
[0062] The total time complexity T of the affected region is then... 总 Represented as:
[0063] T 总 =O(E')+O(k)+O(m×(V′+E′)).
[0064] Modifying the location or river segment will lead to changes in nodes, virtual nodes, and monitoring points. Therefore, this embodiment calculates the total time complexity of the local affected area. If the total time complexity of the local affected area is less than a specified threshold, a targeted update of the affected area is performed. If the total time complexity of the local affected area is greater than the specified threshold, it indicates that too much time is required. In this case, the update parameters of the affected area are checked, specifically whether the number of variables, virtual nodes, and / or monitoring points in the affected area are correct. If errors are found, the parameters are corrected. If correct, a targeted update of the affected area is performed.
[0065] This embodiment only updates the affected areas without altering the topology of unaffected areas, significantly reducing computational load and lowering hardware resource consumption and maintenance costs. It also meets the dynamic tracing requirements in emergency monitoring scenarios.
[0066] Step S6: Store the interactive topology network diagram and perform a storage error check.
[0067] Storing interactive topology network graphs includes storing branch IDs, inflow angles, and traffic percentages.
[0068] The storage error check includes determining the storage errors of virtual nodes in the interactive topology network diagram. Storage errors include inflow angle error and traffic percentage error. By checking storage errors, it can be determined whether the storage accuracy of the virtual nodes meets the requirements.
[0069] Specifically, the inflow angle error and flow rate ratio error are directly mapped to the location deviation for pollution source tracing. The location deviation for pollution source tracing is specifically expressed as follows:
[0070] Δp=α*Δθ+β*Δr
[0071] Where α and β represent empirical coefficients, which can be obtained by fitting measured data, for example, α = 0.5 km / degree, β = 10 km; Δθ represents the inflow angle error, and Δr represents the flow rate ratio error.
[0072] By comparing the location deviation of pollution source tracing with the accuracy of environmental protection supervision, if it is less than the accuracy of environmental protection supervision, the accuracy of virtual node storage is considered to meet the requirements, the storage error check passes, and step S7 is executed. Otherwise, it indicates that the storage accuracy of virtual node does not meet the requirements, the storage error check fails, and step S8 is executed.
[0073] By combining and storing tributary ID, inflow angle, and traffic percentage, the influence of tributaries can be quantitatively expressed, thus solving the problem of misjudgment of responsibility caused by the lack of traditional topology.
[0074] Step S7: Continue to store and use the interactive topology network diagram normally.
[0075] Step S8: Verify the interactive topology network diagram and re-store the interactive topology network diagram.
[0076] The process involves verifying the virtual nodes and other labeled data in the generated interactive topology network diagram to determine if there are any labeling errors, and then regenerating and re-storing the interactive topology network diagram.
[0077] Example 2
[0078] like Figure 2As shown in the embodiment of this application, an automated extraction system for upstream and downstream relationships of watershed monitoring points based on GIS spatial topology is provided. Specifically, it includes: a monitoring point and river segment association unit 210, a watershed flow direction network topology determination unit 220, an improvement unit 230, a directed graph generation unit 240, an interactive topology network graph generation unit 250, a storage error checking unit 260, an interactive topology network graph usage unit 270, and an interactive topology network graph verification unit 280.
[0079] The monitoring point-river section association unit 210 is used to determine the association between the monitoring point and the river section.
[0080] The method used is the ray casting method to determine the precise projection relationship between the monitoring point and the river section, and to eliminate false adjacent points that are close in distance but not connected.
[0081] Specifically, by emitting rays from the monitoring point in any direction and counting the number of intersections with the river segment, if the number of intersections is odd, the monitoring point is determined to be within the projection range of the river segment; otherwise, it is excluded. This method eliminates "pseudo-adjacent points" that are close in distance but not actually connected, ensuring the accuracy of spatial connections and avoiding false associations caused by relying solely on distance judgments.
[0082] The watershed flow direction network topology determination unit 220 is used to construct the watershed flow direction network topology based on the association between monitoring points and river sections.
[0083] The DEM (Digital Elevation Model) elevation raster data was used to obtain watershed topographic elevation information.
[0084] Specifically, based on the D8 flow algorithm, the elevation difference between each grid cell and its eight neighboring grid cells is calculated. The flow direction is defined as the direction of the neighborhood with the largest elevation difference, thereby deducing the flow direction of each river segment and forming a complete directed flow network. This network clarifies the topological direction of the flow, providing a core basis for extracting upstream and downstream relationships.
[0085] Improvement unit 230 is used to improve the tributary information in the watershed flow direction network topology.
[0086] Complete Unit 230 performs the following sub-steps:
[0087] Step V1: Detect tributary nodes in the watershed flow direction network topology.
[0088] By analyzing the flow network, the locations of tributary nodes merging into the main stream are identified, thus completing the tributary node detection.
[0089] Step V2: Insert topological markers and label information at the tributary node locations.
[0090] At each node where a tributary merges into the main stream, a topological marker point (defined as a virtual node) is automatically inserted to mark the connection between the tributary and the main stream, and to label attribute information such as tributary ID, merging angle, and flow percentage.
[0091] Topological markers do not change the actual river network structure, but by marking the connection between tributaries and the main stream, they solve the problem of misjudgment of pollution source responsibility caused by the lack of tributary topology in traditional methods. They are especially suitable for complex river network scenarios with multiple tributaries converging.
[0092] The directed graph generation unit 240 is used to process the improved watershed flow direction network topology into a directed graph structure and extract the upstream and downstream relationships in the directed graph structure.
[0093] The directed graph generation unit 240 performs the following sub-steps:
[0094] Step D1: Determine the structure of the directed graph.
[0095] The flow network is abstracted as a directed graph structure, with river segments as edges and monitoring points and virtual nodes as nodes.
[0096] Step D2: In the directed graph structure, generate an upstream and downstream association list for each monitoring point.
[0097] Starting from each monitoring point, perform upstream recursive traversal and downstream tracking.
[0098] The upstream recursive traversal specifically involves tracing all tributaries and the main stream in the opposite direction of the water flow. The downstream traversal specifically involves traversing all subsequent river segments in the direction of the water flow.
[0099] By executing upstream recursive traversal and downstream tracking algorithms, the connection relationships of nodes in the traversal path are recorded, generating an upstream and downstream association list for each monitoring point and clarifying its topological location in the watershed. This algorithm differs from simple distance matching; it is entirely based on hydrological flow direction logic, ensuring the authenticity of the extracted relationships.
[0100] The interactive topology network graph generation unit 250 is used to generate an interactive topology network graph based on the directed graph structure.
[0101] This involves using Python NetworkX and Plotly to generate interactive topology network diagrams, enabling visualization of the topology structure.
[0102] After generating the interactive topology network diagram, this embodiment also includes performing dynamic incremental update verification. When the location or river network structure is adjusted, there is no need for a full recalculation; the system can automatically detect and update only the relationship paths of the affected areas. Specifically, this includes the following steps:
[0103] Step Q1: Identify the object of the change.
[0104] The changes include: moving, adding, or deleting monitoring points; modifying the spatial morphology of river sections, such as changing the length and direction of the river section; and changing the topological relationship of the river channel, such as adjusting the location of the confluence point.
[0105] This can be achieved by comparing current data with historical data to identify changed locations and river sections. Change detection can also be performed automatically or periodically.
[0106] Step Q2: Locate the affected area in the topology based on the changed object.
[0107] The watershed topology is still abstracted as a directed graph, with monitoring points and virtual nodes in the graph, and edges representing the flow direction of river segments. Spatial indexing can be used to quickly locate points and river segments within the affected area, thereby reducing the computational scope.
[0108] When a point or river segment changes, the graph is traversed from the changed location along the direction of water flow (downstream) and the opposite direction (upstream) to determine the affected topological path.
[0109] If point A is modified, all upstream tributary paths (in the opposite direction of the flow) and all downstream paths may be affected.
[0110] If the river segment is changed to B, the change in the upstream and downstream connections of B (such as flow direction and confluence point) will affect all monitoring points along its path.
[0111] Step Q3: Perform targeted updates for the affected areas.
[0112] Targeted updates include: if a river segment is modified, the D8 algorithm is re-run only for the river segments within the affected area to update the flow direction network; if the affected area includes tributary inflow points, the label attributes of virtual nodes are re-inserted or adjusted; for affected monitoring points, upstream recursive traversal and downstream tracking are re-executed to generate a new upstream and downstream association list.
[0113] In targeted updates, the correlation between time complexity and the number of affected edges is also determined. If only river segments are modified, the correlation between time complexity and the number of affected edges is T1 = O(E'), where E' represents the number of edges in the affected area (the flow direction relationship of the river segment). The D8 algorithm traverses the 8-neighborhood elevation difference of each river segment. The computational cost of a single edge is constant, and the total computational cost is linearly related to the number of affected edges E'.
[0114] If the affected area includes tributary inflow points, then the time complexity is related to the number of affected edges, T2 = O(k), where k represents the number of newly added or modified virtual tributary nodes.
[0115] If the affected area includes the affected monitoring points, then the time complexity is related to the number of affected edges, T3 = O(m × (V′ + E′)), where m represents the number of affected monitoring points, V′ represents the number of nodes in the affected area (including monitoring points and virtual nodes), and E′ represents the number of edges in the affected area (river flow direction relationship).
[0116] The total time complexity T of the affected region is then... 总 Represented as:
[0117] T 总 =O(E')+O(k)+O(m×(V′+E′)).
[0118] Modifying the location or river segment will lead to changes in nodes, virtual nodes, and monitoring points. Therefore, this embodiment calculates the total time complexity of the local affected area. If the total time complexity of the local affected area is less than a specified threshold, a targeted update of the affected area is performed. If the total time complexity of the local affected area is greater than the specified threshold, it indicates that too much time is required. In this case, the update parameters of the affected area are checked, specifically whether the number of variables, virtual nodes, and / or monitoring points in the affected area are correct. If errors are found, the parameters are corrected. If correct, a targeted update of the affected area is performed.
[0119] This embodiment only updates the affected areas without altering the topology of unaffected areas, significantly reducing computational load and lowering hardware resource consumption and maintenance costs. It also meets the dynamic tracing requirements in emergency monitoring scenarios.
[0120] The storage error checking unit 260 is used to store the interactive topology network diagram and perform storage error checks.
[0121] Storing interactive topology network graphs includes storing branch IDs, inflow angles, and traffic percentages.
[0122] The storage error check includes determining the storage errors of virtual nodes in the interactive topology network diagram. Storage errors include inflow angle error and traffic percentage error. By checking storage errors, it can be determined whether the storage accuracy of the virtual nodes meets the requirements.
[0123] Specifically, the inflow angle error and flow rate ratio error are directly mapped to the location deviation for pollution source tracing. The location deviation for pollution source tracing is specifically expressed as follows:
[0124] Δp=α*Δθ+β*Δr
[0125] Where α and β represent empirical coefficients, which can be obtained by fitting measured data, for example, α = 0.5 km / degree, β = 10 km; Δθ represents the inflow angle error, and Δr represents the flow rate ratio error.
[0126] By comparing the location deviation of pollution source tracing with the accuracy of environmental protection supervision, if it is less than the accuracy of environmental protection supervision, the accuracy of virtual node storage is considered to meet the requirements, the storage error passes the test, and the interactive topology network diagram usage unit 270 is executed. Conversely, if it is greater than the location deviation, it indicates that the storage accuracy of virtual node does not meet the requirements, the storage error fails the test, and the interactive topology network diagram verification unit 280 is executed.
[0127] By combining and storing tributary ID, inflow angle, and traffic percentage, the influence of tributaries can be quantitatively expressed, thus solving the problem of misjudgment of responsibility caused by the lack of traditional topology.
[0128] The interactive topology network diagram uses unit 270 to continue normal storage and use of the interactive topology network diagram.
[0129] The interactive topology network diagram verification unit 280 is used to verify the interactive topology network diagram and re-store the interactive topology network diagram.
[0130] The process involves verifying the virtual nodes and other labeled data in the generated interactive topology network diagram to determine if there are any labeling errors, and then regenerating and re-storing the interactive topology network diagram.
[0131] This application also provides a computer storage medium storing computer instructions, which, when invoked, are used to execute the automated extraction method for upstream and downstream relationships of watershed monitoring points based on GIS spatial topology.
[0132] The embodiments disclosed in this invention provide a computer-readable storage medium storing computer program instructions. When the computer program instructions are executed on a computer, the computer performs the above-described method for automatically extracting upstream and downstream relationships of watershed monitoring points based on GIS spatial topology.
[0133] This invention provides a processor for processing the above-described method for automatically extracting upstream and downstream relationships of watershed monitoring points based on GIS spatial topology.
[0134] In this embodiment of the invention, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0135] The various methods, steps, and logic diagrams disclosed in the embodiments of this invention can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The processor reads information from the storage medium and, in conjunction with its hardware, completes the steps of the above methods.
[0136] The storage medium can be memory, such as volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
[0137] Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate Synchronous DRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM).
[0138] This application has the following beneficial effects:
[0139] (1) This application solves the problem of misjudgment of responsibility caused by topology omission by inserting virtual nodes at the tributary confluence point.
[0140] (2) This application uses a flow-driven recursive relationship extraction algorithm and hydrological directionality control path traversal to construct a real and effective upstream and downstream topology. The topology structure has a significant impact on the accuracy of pollution source tracing results and is helpful for subsequent accountability and law enforcement.
[0141] (3) This application supports dynamic topology representation of the whole basin monitoring network, providing a foundation for future functions such as pollution simulation and emergency response.
[0142] (4) This application supports dynamic incremental updates. When the location or river network structure is adjusted, there is no need for a full recalculation. The system can automatically detect and update only the relationship paths of the affected areas. It supports real-time response to river channel changes, reduces maintenance costs, and improves the efficiency of data processing and tributary analysis. At the same time, it can meet the dynamic source tracing needs in emergency monitoring scenarios.
[0143] Although the examples referenced in this application are described for illustrative purposes only and not for limiting the scope of this application, changes, additions and / or deletions to the implementation may be made without departing from the scope of this application.
[0144] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An automated method for extracting upstream and downstream relationships of watershed monitoring points based on GIS spatial topology, characterized in that, Includes the following steps: Determine the relationship between monitoring points and river sections; Based on the association between monitoring points and river sections, a watershed flow direction network topology is constructed to clarify the topological direction of water flow. Improve the tributary information in the watershed flow direction network topology; improving the tributary information includes identifying tributary nodes and marking the tributary ID, confluence angle, and flow percentage in the tributary nodes; The improved watershed flow direction network topology is processed into a directed graph structure, and the upstream and downstream relationships are extracted from the directed graph structure. Generate interactive topology network graphs based on directed graph structures; Store the interactive topology network diagram and perform storage error checks; If the storage error check passes, continue normal storage and use the interactive topology network diagram; If the storage error check fails, the interactive topology network diagram is checked and stored again. The storage of interactive topology network diagrams includes storing branch IDs, inflow angles, and traffic percentages. The storage error check includes determining the storage error of virtual nodes in the interactive topology network diagram of the storage, including the inflow angle error and the traffic percentage error. The inflow angle error and flow rate ratio error are directly mapped to the pollution source tracing location deviation, where the pollution source tracing location deviation Δp is expressed as: Δp=α*Δθ+β*Δr Where α and β represent empirical coefficients, Δθ represents the inflow angle error, and Δr represents the flow rate percentage error; By comparing the location deviation of pollution source tracing with the accuracy of environmental protection supervision, if it is less than the accuracy of environmental protection supervision, the accuracy of virtual node storage meets the requirements, the storage error check passes, and normal storage continues and the interactive topology network diagram is used.
2. The method for automatically extracting upstream and downstream relationships of watershed monitoring points based on GIS spatial topology as described in claim 1, characterized in that, Determining the association between a monitoring point and a river segment involves emitting rays from the monitoring point in any direction; if a ray intersects with a river segment, that segment is associated with the monitoring point.
3. The method for automatically extracting upstream and downstream relationships of watershed monitoring points based on GIS spatial topology as described in claim 1, characterized in that, Improving the tributary information in the watershed flow direction network topology includes the following sub-steps: Tributary node detection is performed in the network topology of the watershed flow direction. Insert topological markers and label information at the tributary node locations.
4. The method for automatically extracting upstream and downstream relationships of watershed monitoring points based on GIS spatial topology as described in claim 3, characterized in that, The insertion of topology markers and information annotation at tributary node locations includes automatically inserting topology markers as virtual nodes at each node where a tributary merges into the main stream to mark the connection relationship between the tributary and the main stream, and annotating the tributary ID, merging angle, and flow percentage attribute information.
5. The method for automatically extracting upstream and downstream relationships of watershed monitoring points based on GIS spatial topology as described in claim 1, characterized in that, The improved watershed flow direction network topology is processed into a directed graph structure. Extracting the upstream and downstream relationships in the directed graph structure includes the following sub-steps: Determine the directed graph structure with river segments as edges and monitoring points and virtual nodes as nodes; In the directed graph structure, a list of upstream and downstream relationships for each monitoring point is generated.
6. An automated system for extracting upstream and downstream relationships of watershed monitoring points based on GIS spatial topology, characterized in that, include: The monitoring point and river section association unit, the watershed flow direction network topology determination unit, the improvement unit, the directed graph generation unit, the interactive topology network graph generation unit, the storage error check unit, the interactive topology network graph usage unit, and the interactive topology network graph verification unit are all included. The monitoring point-river section association unit is used to determine the association between the monitoring point and the river section; The watershed flow direction network topology determination unit is used to construct a watershed flow direction network topology to determine the topological direction of water flow based on the association between monitoring points and river segments. The refinement unit is used to refine the tributary information in the watershed flow direction network topology; refining the tributary information includes determining the tributary nodes and marking the tributary ID, confluence angle, and flow percentage in the tributary nodes; The directed graph generation unit is used to process the improved watershed flow direction network topology into a directed graph structure and extract the upstream and downstream relationships in the directed graph structure. An interactive topology network graph generation unit is used to generate interactive topology network graphs based on directed graph structures. The storage error checking unit is used to store the interactive topology network diagram and perform storage error checks. The interactive topology network diagram is used to ensure that if the storage error check passes, normal storage continues and the interactive topology network diagram is used. The interactive topology network diagram verification unit is used to verify the interactive topology network diagram and re-store the interactive topology network diagram if the storage error check fails. The storage error checking unit stores the interactive topology network diagram, including storing branch IDs, inflow angles, and traffic percentages. The storage error check includes determining the storage error of virtual nodes in the interactive topology network diagram of the storage, including the inflow angle error and the traffic percentage error. The inflow angle error and flow rate ratio error are directly mapped to the pollution source tracing location deviation, where the pollution source tracing location deviation Δp is expressed as: Δp=α*Δθ+β*Δr Where α and β represent empirical coefficients, Δθ represents the inflow angle error, and Δr represents the flow rate percentage error; By comparing the location deviation of pollution source tracing with the accuracy of environmental protection supervision, if it is less than the accuracy of environmental protection supervision, the accuracy of virtual node storage meets the requirements, the storage error check passes, and normal storage continues and the interactive topology network diagram is used.
7. The automated extraction system for upstream and downstream relationships of watershed monitoring points based on GIS spatial topology as described in claim 6, characterized in that, The association between a monitoring point and a river segment is determined by emitting rays from the monitoring point in any direction. If a ray intersects with a river segment, it is considered an associated river segment with the monitoring point.
8. The automated extraction system for upstream and downstream relationships of watershed monitoring points based on GIS spatial topology as described in claim 6, characterized in that, The refinement unit improves the tributary information in the watershed flow direction network topology, which includes the following sub-steps: Tributary node detection is performed in the network topology of the watershed flow direction. Insert topological markers and label information at the tributary node locations.
9. The automated extraction system for upstream and downstream relationships of watershed monitoring points based on GIS spatial topology as described in claim 8, characterized in that, In the improved unit, the insertion of topology markers and information annotation at the tributary node positions includes automatically inserting topology markers as virtual nodes at each node where a tributary flows into the main stream to mark the connection relationship between the tributary and the main stream, and annotating the tributary ID, inflow angle, and flow percentage attribute information.
10. The automated extraction system for upstream and downstream relationships of watershed monitoring points based on GIS spatial topology as described in claim 6, characterized in that, The directed graph generation unit processes the improved watershed flow direction network topology into a directed graph structure. Extracting the upstream and downstream relationships from the directed graph structure includes the following sub-steps: Determine the directed graph structure with river segments as edges and monitoring points and virtual nodes as nodes; In the directed graph structure, a list of upstream and downstream relationships for each monitoring point is generated.