Method and system for packaging and displaying river basin water quality prediction model

By constructing a water quality prediction model and combining multi-threaded digitization, water quality evolution timing rendering and visual rendering technology, two-dimensional and three-dimensional scene model applications of river basins are generated, which solves the problem of poor results in the packaging and display of existing water quality prediction models, and realizes intuitive display of water quality prediction results and a wider application scenario.

CN119625094AActive Publication Date: 2025-03-14重庆市生态环境大数据应用中心

Patent Information

Application Number
CN202411610442.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-03-14
Estimated Expiration
2044-11-12

AI Technical Summary

Technical Problem

During the packaging and display process of existing water quality prediction models, the inversion calculation results are not intuitive, and it is difficult to directly use in decision support systems or environmental management tools, and it is impossible to visually display the changing trends of water quality in two- and three-dimensional scenarios, which limits its application value in actual scenarios such as environmental planning and emergency response.

Method used

A method for packaging and displaying the water quality prediction model of river basin is proposed. By constructing a water quality prediction model, multi-threaded digital operation, water quality evolution timing rendering data template, visual rendering basic map services and two- and three-dimensional scene resource data, two-dimensional and three-dimensional scene model applications of river basin are generated to realize real-time dynamic rendering of water quality evolution.

Benefits of technology

The user-friendliness and practicality of the water quality prediction model has been improved, so that the water quality inversion results can be directly applied to two- and three-dimensional scenarios, thereby better serving the work in the fields of water resource management, pollution control and environmental protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119625094A_ABST
    Figure CN119625094A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of water quality model packaging, and particularly relates to a river basin water quality prediction model packaging display method and system, and the method comprises the steps: firstly carrying out the multi-thread digitalization of a water quality prediction model, and outputting water quality prediction result analysis; the data template is used for storing water quality prediction result analysis data, and a storage result is output; then configuring a visual rendering basic map service, and calling a data source of the visual rendering basic map service to perform real-time dynamic rendering of water quality evolution according to a prediction result of the water quality prediction model; and finally configuring resource data of a two-dimensional scene and a three-dimensional scene of the target river basin, superposing a water quality evolution real-time dynamic rendering service in the resource data of the two-dimensional scene and the three-dimensional scene, and generating a river basin two-dimensional scene model application and a river basin three-dimensional scene model application. According to the invention, the problem of poor effect in the packaging and displaying process of the water quality prediction model in the prior art can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of water quality model packaging, and in particular relates to a packaging and display method and system for a river basin water quality prediction model. Background Art

[0002] With the rapid development of industrialization and urbanization, the water quality of river basins has been challenged unprecedentedly. In order to effectively manage and protect water resources, establishing accurate and reliable water quality prediction models has become one of the research hotspots in the field of environmental science and technology. These models can help us predict the spread of pollutants in water bodies, evaluate the effectiveness of governance measures, and provide a scientific basis for policy making.

[0003] Water quality prediction models are usually based on a series of complex mathematical algorithms to predict water quality changes by simulating physical, chemical and biological processes. These models can be based on physics (such as using fluid mechanics equations) or empirical or statistical methods (such as machine learning models). With the improvement of computing power and the advancement of data acquisition methods, more and more data-driven models are being developed to improve prediction accuracy.

[0004] However, despite the significant improvement in accuracy of modern water quality prediction models, there are still some shortcomings in practical applications. In particular, for those encapsulated water quality prediction models, their inversion results are often not intuitive enough and difficult to be directly used in decision support systems or environmental management tools. In addition, digitalized water quality prediction models can usually only provide abstract data outputs, and cannot directly visualize the changing trends of water quality conditions in two or three-dimensional scenes, which limits their application value in practical scenarios such as environmental planning and emergency response.

[0005] Most current technical solutions rely on secondary development, that is, adding additional functional modules to the original model to meet specific application requirements. This approach not only increases development costs, but may also lead to compatibility issues between different platforms. Therefore, a new method or framework is urgently needed to simplify the application process of water quality prediction models, make their results more intuitive and easy to understand, and seamlessly integrate into existing geographic information systems (GIS) or other related software environments.

[0006] In view of the above problems, the present invention aims to propose an improved water quality prediction model packaging and display method, aiming to improve the user-friendliness and practicality of the model, so that the results of water quality inversion can be directly applied to two- and three-dimensional scenes, so as to better serve the work in the fields of water resources management, pollution control and environmental protection. Summary of the invention

[0007] The technical problem solved by the present invention is to provide a method and system for packaging and displaying a river basin water quality prediction model, so as to solve the problem of poor effect in the packaging and display process of the water quality prediction model in the prior art.

[0008] The basic solution provided by the present invention is a packaging and display method of a river basin water quality prediction model, comprising:

[0009] S1: Construct a water quality prediction model for the target river basin, train and verify the water quality prediction model, obtain a water quality prediction model that meets the verification requirements, perform multi-threaded digitization on the water quality prediction model, and output water quality prediction result analysis;

[0010] S2: Construct a data template for rendering the water quality evolution time series, use the data template to store the data of the water quality prediction result analysis, and output the stored results;

[0011] S3: Configure the visualization rendering basic map service, match the corresponding water quality prediction model prediction results according to the stored results and the user input parameters, and call the data source of the visualization rendering basic map service according to the matching results to perform real-time dynamic rendering of water quality evolution;

[0012] S4: Configure the resource data of the two-dimensional scene and the three-dimensional scene of the target river basin, superimpose the real-time dynamic rendering service of water quality evolution on the resource data of the two-dimensional scene and the three-dimensional scene, and generate the river basin two-dimensional scene model application and the river basin three-dimensional scene model application.

[0013] Further, the S1 includes:

[0014] S1-1: Based on the water system gridding technology, the target river basin is gridded according to the river centerline to generate multiple basin grids;

[0015] S1-2: Construct a water quality prediction model based on multi-model fusion technology, and train and verify it based on the historical water quality monitoring data and meteorological data of the target river basin to generate and verify a water quality prediction model that meets the needs;

[0016] S1-3: Perform digital operations on the water quality prediction model, automatically call the bat file through the batch file script, and use the concurrent asynchronous future technology to complete the automatic multi-threaded operation of the water quality prediction model;

[0017] S1-4: Parse the water quality prediction results of the water quality prediction model into a preset file format.

[0018] Further, the S2 includes:

[0019] S2-1: Based on the watershed grid divided in S1-1, a data template for time series rendering of water quality evolution in the target river basin is constructed;

[0020] S2-2: Read the parsing file of the water quality prediction result, extract the water quality index and extract the prediction result mark time according to the preset custom calculation example parameters;

[0021] S2-3: Import the water quality indicators and prediction result marker moments into the data template and associate them with the target river basin grid.

[0022] Further, the S3 includes:

[0023] S3-1: Based on the water quality prediction results, a color table is prepared according to the water quality category color standard and stretched into a gradient color band;

[0024] S3-2: Make the target river basin grid into a segmented thematic map, preset the segmentation index, set the style of the segmented thematic map based on the basin grid data and gradient color band, save the completed workspace; and publish the REST map service based on the completed workspace;

[0025] S3-3: Obtain user input parameters, determine the prediction result mark time required by the user, call the corresponding custom example, match the corresponding water quality prediction model calculation result, and call the REST map service resource according to the matching result, and switch to the real-time dynamic rendering effect of water quality evolution.

[0026] Further, the S4 includes:

[0027] S4-1: Obtain the plan layout data, high-precision DEM data, high-resolution image data, basic water system data, elevation information, and meteorological data of the target river basin;

[0028] S4-2: Construct two-dimensional scene resource data of the target river basin based on the plane layout data;

[0029] S4-3: Construct a 3D base map scene of the target river basin based on high-precision DEM data and high-resolution image data;

[0030] S4-4: Simulate the target river basin based on basic water system data to construct a real water system effect;

[0031] S4-5: Extract water catchment elements based on the surface geomorphic information in the elevation information, construct the water catchment process of the target river basin catchment area, and construct the building model, sewage outlet model and drainage network model connected by the pipeline model based on the building vector point data, sewage outlet vector point data, drainage network vector line data and pipeline elevation information in the elevation information;

[0032] S4-6: Access meteorological data based on webgl technology to build dynamic meteorological simulation of target river basin;

[0033] S4-7: Build the digital twin base of the target river basin based on the three-dimensional base map scene of the target river basin, the real water system effect, the building model connected by the pipeline model, the sewage outlet model and the drainage network model, and the meteorological dynamic simulation, and generate the three-dimensional scene resource data of the target river basin;

[0034] S4-8: Based on the generated two-dimensional scene resource data and three-dimensional scene resource data, access the real-time dynamic rendering effect of water quality evolution to generate a two-dimensional scene model application and a three-dimensional scene model application of the target river basin.

[0035] Furthermore, the water quality prediction model in S1 includes a water quality prediction deep learning model and a water quality index prediction mechanism model, wherein the water quality prediction deep learning model is a fusion of a water quality prediction deep learning model based on a spatiotemporal graph convolutional network, a water quality prediction deep learning model based on a multi-layer attention mechanism network, and a water quality prediction deep learning model based on a long short-term memory network;

[0036] The water quality index prediction mechanism model is a water quality index prediction mechanism model that integrates a water quality model and a hydrodynamic model.

[0037] A packaging and display system for a river basin water quality prediction model, applied to the packaging and display method for the above-mentioned river basin water quality prediction model, comprises:

[0038] Model digitization and analysis module: used to perform multi-threaded digitization operations on the water quality prediction model and analyze the output water quality prediction results;

[0039] Data template storage module: stores the data analyzed by water quality prediction results according to the constructed data template rendered in the water quality evolution time series, and outputs the stored results;

[0040] Water quality evolution rendering module: It is equipped with a visualization rendering basic map service, which is used to match the corresponding water quality prediction model prediction results according to the stored results and user input parameters, and retrieve the data source of the visualization rendering basic map service according to the matching results to perform real-time dynamic rendering of water quality evolution;

[0041] Scenario application module: It is configured with the resource data of the two-dimensional scene and three-dimensional scene of the target river basin, and is used to superimpose the real-time dynamic rendering service of water quality evolution on the resource data of the two-dimensional scene and three-dimensional scene, and generate the two-dimensional scene model application of the target river basin and the three-dimensional scene model application of the river basin.

[0042] An electronic device includes a processor and a memory, wherein the memory stores programs or instructions, and the processor executes the packaging and display method of a river basin water quality prediction model as described above by calling the programs or instructions stored in the memory.

[0043] A computer-readable storage medium stores a program or instruction, wherein the program or instruction enables a computer to execute the packaging and display method of a river basin water quality prediction model as described above.

[0044] The principles and advantages of the present invention are as follows: in the technical solution of the present application, for the water quality prediction model used for water quality prediction, in the process of digital packaging, a multi-threaded parallel technology is built to support users to run water quality evolution operations concurrently. When performing real-time dynamic rendering of water quality evolution, based on the constructed data template, the prediction result data of the water quality prediction model is stored, and a segmented thematic map of a unique style of the target river basin is generated based on a gradient color band. The user input parameters are automatically analyzed, so that the water quality evolution operation results can be visualized in the form of a dynamic rendering map service and applied to two- and three-dimensional scenes, thereby realizing the foundation of a model operation result service that integrates structured data and two- and three-dimensional, and opening up more application scenarios for the water quality prediction model.

[0045] Therefore, the technical solution of the present application can solve the problem of poor dynamic rendering of water quality evolution during the packaging and display process of the water quality prediction model for the river basin. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 is a flowchart of an embodiment of the present invention;

[0047] Figure 2 A schematic diagram of a target river basin grid according to an embodiment of the present invention;

[0048] Figure 3 This is an architecture diagram of a water quality prediction deep learning model based on a spatiotemporal graph convolutional network according to an embodiment of the present invention;

[0049] Figure 4 is an undirected graph according to an embodiment of the present invention;

[0050] Figure 5 A schematic diagram of the spatiotemporal dependence of different monitoring sections in the monitoring data of an embodiment of the present invention;

[0051] Figure 6 It is a structural diagram of a water quality prediction deep learning model based on a multi-layer attention mechanism network according to an embodiment of the present invention;

[0052] Figure 7 This is a structural diagram of a water quality prediction deep learning model based on a long short-term memory network according to an embodiment of the present invention;

[0053] Figure 8 A schematic diagram of a gradient color band according to an embodiment of the present invention;

[0054] Fig. 9 A schematic diagram of a two-dimensional scene of a river basin according to an embodiment of the present invention;

[0055] Fig.10 A schematic diagram of a three-dimensional scene of a river basin according to an embodiment of the present invention;

[0056] Fig.11 The figure is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0057] The following is further described in detail through specific implementation methods:

[0058] The symbols in the drawings of the specification include: electronic device 400 , processor 401 , memory 402 , input device 403 , and output device 404 .

[0059] The embodiment is basically as shown in the attached Figure 1 As shown: A packaging and display method for a river basin water quality prediction model, including:

[0060] S1: Build a water quality prediction model for the target river basin, train and verify the water quality prediction model, obtain a water quality prediction model that meets the verification requirements, perform multi-threaded digitization on the water quality prediction model and output water quality prediction result analysis; S1 includes:

[0061] S1-1: Based on the water system gridding technology, the target river basin is gridded according to the river centerline to generate multiple basin grids;

[0062] S1-2: Construct a water quality prediction model based on multi-model fusion technology, and train and verify it based on the historical monitoring data and meteorological data of the target river basin to generate and verify a water quality prediction model that meets the needs;

[0063] S1-3: Perform digital operations on the water quality prediction model, automatically call the bat file through the batch file script, and use the concurrent asynchronous future technology to complete the automatic multi-threaded operation of the water quality prediction model;

[0064] S1-4: Parse the water quality prediction results of the water quality prediction model into a preset file format.

[0065] In this embodiment, in order to better analyze the water quality of the target river basin, the target river basin is divided into grids by a uniform grid method, and the river basin is divided into grids according to the center line of the river using the water system gridding technology. Figure 2 As shown, the target river basin is composed of multiple uniform grids, which are used to divide the river basin for water quality prediction and analysis, which helps to obtain the temporal correlation and spatial dependence between each basin grid in the target river basin.

[0066] Then, a water quality prediction model is constructed based on the multi-model fusion technology. In the present embodiment, the water quality prediction model includes a water quality prediction deep learning model and a water quality index prediction mechanism model. The water quality prediction deep learning model is a fusion of a water quality prediction deep learning model based on a spatiotemporal graph convolutional network, a water quality prediction deep learning model based on a multi-layer attention mechanism network, and a water quality prediction deep learning model based on a long short-term memory network. Among them, the fusion of the water quality prediction model based on the spatiotemporal graph convolutional network and the water quality prediction deep learning model based on the multi-layer attention mechanism network can obtain the complex spatial dependency of the monitoring data of the monitoring sites, while the fusion of the water quality prediction model based on the spatiotemporal graph convolutional network and the water quality prediction deep learning model based on the long short-term memory network can characterize the complex temporal dependency of the monitoring data.

[0067] For the water quality prediction model based on spatiotemporal graph convolutional network, although the traditional deep learning method has been applied to extract the features of Euclidean space data with great success, the water environment monitoring data is generated from non-Euclidean space, and the performance of traditional deep learning methods in processing non-Euclidean space data is difficult to satisfy people. In this context, in view of the extremely high complexity and nonlinear characteristics of water quality data, this application takes into account the spatial and temporal dependencies between water quality monitoring sections, and proposes a water quality prediction model based on spatiotemporal graph convolutional network to solve the problem of water quality prediction. Specifically:

[0068] The temporal and spatial information contained in the data is used to predict the water quality indicators of different monitoring sections in the future. The water quality monitoring network is defined as an undirected graph, and the spatiotemporal dependency of water quality monitoring sections is modeled using spatiotemporal convolution blocks, which can effectively capture spatiotemporal correlation.

[0069] In the spatial dimension, the graph convolution formula after Chebyshev approximation and first-order approximation is used to capture spatial correlation. In the convolution process, not only the state of neighboring nodes but also the state of the node itself is considered. In the time dimension, gated convolution is used to capture time dependency. Different from the traditional convolution method, the model considers the problem of time series and uses causal convolution to perform parallel calculations on data, which makes the model training faster. The above graph convolution and gated convolution are combined into Figure 3 The structure shown uses a bottleneck strategy to achieve scale compression and feature compression, and a normalization layer is connected after each layer to prevent overfitting. The final model is a stack of two St-Conv Blocks followed by an output layer, in which the output layer first uses a time dimension convolution to merge the time dimension of the previous output data, and then outputs the final predicted data after a convolution. The predicted data is a picture of the next time dimension.

[0070] Undirected graphs such as Figure 4As shown in the figure, the undirected graph G = (V, E, A), each point on G detects water quality at the same frequency F, and the water quality prediction problem is defined as: given all historical variable values ​​of all nodes on the spatiotemporal graph G in the past period of time, predict the water quality parameters of all nodes in the future period of time.

[0071] The water quality prediction deep learning model based on deep learning network also adopts a water quality prediction deep learning model based on multi-layer attention mechanism network, specifically:

[0072] The deep learning model for water quality prediction based on a multi-layer attention mechanism network is based on an encoder-decoder structure. It introduces a multi-layer attention mechanism to the spatiotemporal prediction of water quality parameters, models the dynamic spatiotemporal correlation between sensors, and improves the performance of the model by fusing external factors such as rainfall data corresponding to the sensors in the decoder stage. The challenges of spatiotemporal prediction of water quality parameters are mainly reflected in the following two aspects: (1) dynamic spatiotemporal correlation; (2) external factors.

[0073] The dynamic spatiotemporal correlation is reflected in the following two aspects.

[0074] 1. Complex spatial correlations between different sensor devices, such as Figure 5 As shown, the spatial correlation between sensors is highly dynamic over time, and the geographical locations are nonlinearly related;

[0075] 2. Dynamic correlation within the same sensor. Water quality time series data often follows a periodic pattern, but sometimes (such as sudden extreme weather) the sensor data will fluctuate greatly, so how to select the appropriate time interval is also a challenge.

[0076] As for external factors, the sensor data will be affected by the surrounding environment and the time (whether it is the emission peak period or not).

[0077] Therefore, the water quality prediction deep learning model based on the multi-layer attention mechanism network in this embodiment consists of the following two main parts. The model structure is as follows: Figure 6 As shown:

[0078] 1. Multi-layer attention mechanism: The multi-layer attention mechanism mainly consists of an encoder containing two spatial attention mechanisms (local spatial attention and global spatial attention) and a decoder containing temporal attention. In the encoder, two different spatial attention mechanisms are proposed to capture the complex spatial relationship between sensors using the implicit state of the encoder at the previous moment, the time series value of the sensor observation at the previous moment, and the spatial context (such as sensor network information). In the decoder, a temporal attention mechanism is used to adaptively select relevant time slices in the past for prediction.

[0079] Second, external factor fusion, this module is designed in this embodiment to handle the impact of external factors on the time series of geographic sensors, including meteorological data, time-related features, geographic-related features, etc. In other words, this module integrates these external factors, and then uses the output of this module as part of the input of the decoder mentioned above into the calculation of the network.

[0080] The water quality prediction deep learning model based on the long short-term memory network is specifically a water quality prediction AI model architecture based on the long short-term memory network model (LSTM). The long short-term memory network model (LSTM) is a deep learning model used to process sequence data with time dependencies, such as natural language. It is a network composed of multiple memory units, each of which has three gates (input gate, output gate, and forget gate) that can control the information stored and transmitted in the memory unit. The LSTM network uses these gates to balance short-term memory and long-term memory, thereby retaining long-term dependencies in sequence data while still effectively processing complex sequence data.

[0081] Each time step of the LSTM network contains multiple gates, including input gate, output gate and forget gate. In the input gate, the LSTM network selects important information from the input sequence and outputs it to the next time step. In the output gate, the LSTM network will select the information to be passed to the next time step and output it to the output part of the sequence. In the forget gate, the LSTM network controls which information is saved in the memory cell and which information should be forgotten. The LSTM network stores and operates sequence data through memory cells. The memory cell is controlled by three gates, which can store important information in the input sequence in its local state and pass it to the next time step when needed. In each time step, the memory cell will update its state to better reflect the important information in the input sequence.

[0082] The model structure and main parameters are as follows: Figure 7 As shown in the figure, the first layer is an LSTM training model with 300 neurons. According to the above principle, the model learns based on past fitting results and uses the memory characteristics of LSTM to optimize the water quality prediction ability. The purpose of the second layer is to prevent overfitting and allow all neurons to learn better. It is then connected to the third layer to fully connect the neurons in the previous layer, and finally output after the activation function in the fourth layer.

[0083] The water quality index prediction mechanism model is a water quality index prediction mechanism model that integrates the water quality model and the hydrodynamic model. The construction process is:

[0084] Step 1: Construct the control equations of the water quality index prediction mechanism model, including the two-dimensional diving control equation and the material transport equation, specifically:

[0085] The vector form of the planar two-dimensional diving control equation is:

[0086]

[0087] Where t represents time; x and y represent horizontal coordinates; U is the vector of conserved variables; F and G are the vectors of flux variables; F d and G d is the diffusion flux vector; S is the vector of the source term, h is the water depth, u and v are the flow velocities in the x and y directions respectively, η is the water level, τ bx and τ by are the bottom friction terms in the x and y directions, v t is the diffusion coefficient of the transported substance.

[0088] Material transport equation:

[0089]

[0090] C represents the material transport variable; v t is the diffusion coefficient of the transported substance, v t =αu * h,α takes values ​​between 0.3 and 1.0. S C is the source term of the transport variable.

[0091] Step 2: Discrete processing of water flow control equations, specifically:

[0092] Based on the unstructured grid, the finite volume method is used to solve the mathematical model of water flow. The formula (1) of the two-dimensional diving control equation is integrated on any triangular control volume to obtain:

[0093]

[0094] Let U i is the average value of the cell, stored at the center of the cell,

[0095] Applying Green's formula to the material transport equation, the area is decomposed into line integrals along its perimeter to obtain:

[0096]

[0097] Where L i is the perimeter of the ith control unit V, n=(n x ,n y )=(cosφ,sinφ) is the outer normal unit vector on the perimeter, φ is the angle between the outer normal vector and the positive direction of the x-axis, A i is the area of ​​calculation unit i.

[0098] The line integral of the formula obtained by integrating the two-dimensional diving control equation on any triangular control volume is discretized and sorted out to obtain:

[0099]

[0100] Where: m is the number of control volume edges. Since this paper uses a triangular control volume, m = 3; l ij is the length of each side of the unit; Represents the normal numerical flux through the jth edge of the i-th unit.

[0101] Step 3: Discretization of the transport equation, specifically:

[0102] The material transport equation is also discretized in the triangular control volume by finite volume. The integral of equation (3) on element i is:

[0103]

[0104] Green's formula is used to differentiate the area into line integrals along its perimeter, and the line integral part is discretized and sorted out to obtain:

[0105]

[0106] Q ij is the flow through the jth edge of unit i; is the gradient of the transport variable in the direction of the outer normal of the jth edge of unit i, where:

[0107]

[0108] N1 and N2 are the two vertices of the jth edge of unit i. ij is the transport variable value of the j-th edge of unit i, calculated by upwind reconstruction interpolation:

[0109] Assume that the adjacent cells of cell i on side j are m ij , and the water flows from unit i to unit m ij , then the transport variable C at edge j ij It is obtained by interpolating the transport variables at the centers of two adjacent cells:

[0110]

[0111] Φ (r) is a function of the change gradient r of the transport variable. In order to reduce numerical dissipation and improve calculation accuracy, this paper uses the van Leer function to restrict the change gradient function:

[0112] Φ (r) =max[0,(r+|r| / (1+r))]

[0113]

[0114] s i is the edge where the flow in unit i flows out of the unit; is the value of the transport variable at the center of the unit grid adjacent to edge k.

[0115] After the water quality prediction mechanism model is constructed as above, the initial conditions, boundary conditions and model parameters of the model are set according to the actual river conditions to meet the needs of the target river basin.

[0116] After the construction of the water quality prediction model and the execution of the training and verification operations are completed, the bat file is automatically called through the batch file script, and the automatic multi-threaded operation of the water quality prediction model is completed by using the concurrent asynchronous future technology. During the multi-threaded operation, the packaged Fortran component is used to parse the water quality prediction results of the model water quality prediction model into a .PLT file; in this embodiment, the detailed process of automatically calling the bat file through the batch file script is as follows:

[0117]

[0118]

[0119] Where XXX represents the user-developed name of the water quality prediction model in actual application; the specific implementation process of the copyDir() method is:

[0120]

[0121]

[0122]

[0123]

[0124]

[0125]

[0126]

[0127]

[0128] After the above process of automatic batch processing, the output results of the parsing model are as follows:

[0129]

[0130]

[0131]

[0132]

[0133] S2: Construct a data template for rendering the water quality evolution time series, use the data template to store the data of the water quality prediction result analysis, and output the stored results; S2 includes:

[0134] S2-1: Based on the watershed grid divided in S1-1, a data template for time series rendering of water quality evolution in the target river basin is constructed;

[0135] S2-2: Read the parsing file of the water quality prediction result, extract the water quality index and extract the prediction result mark time according to the preset custom calculation example parameters;

[0136] S2-3: Import the water quality indicators and prediction result marker moments into the data template and associate them with the target river basin grid.

[0137] In this embodiment, the data template is a .UDBX file-type spatial data format. In addition to storing the watershed grid data, a rendering field is added to store the water quality indicators obtained from the water quality prediction results in the water quality prediction model, such as total phosphorus, total nitrogen, ammonia nitrogen, chemical oxygen demand, etc.; then the .PLT file parsed by S1-4 is read, and the result mark time is obtained by presetting the start time, time step, number of time cycles and number of cycle outputs in the custom example; finally, the constructed data template is opened, and the watershed grid is associated with the river section based on the prediction results of the water quality prediction model, and the concentration values ​​of each pollution factor are supplemented and stored, and finally the custom example content and association relationship are automatically stored in the database.

[0138] S3: Configure the visualization rendering basic map service, match the corresponding water quality prediction model prediction results according to the stored results and the user input parameters, and call the data source of the visualization rendering basic map service according to the matching results to perform real-time dynamic rendering of water quality evolution; S3 includes:

[0139] S3-1: Based on the water quality prediction results, a color table is prepared according to the water quality category color standard and stretched into a gradient color band;

[0140] S3-2: Make the target river basin grid into a segmented thematic map, preset the segmentation index, set the style of the segmented thematic map based on the basin grid data and gradient color band, save the completed workspace; and publish the REST map service based on the completed workspace;

[0141] S3-3: Obtain user input parameters, determine the prediction result mark time required by the user, call the corresponding custom example, match the corresponding water quality prediction model calculation result, and call the REST map service resource according to the matching result, and switch to the real-time dynamic rendering effect of water quality evolution.

[0142] In this embodiment, according to the change of water quality index or concentration change predicted in the water quality prediction model, a color table is prepared according to the preset color standard and stretched into a gradient color band, such as Figure 8 As shown; then a segmented thematic map is made for the watershed grid data. The segmented thematic map adopts an equidistant segmentation method. In this application, the number of segments is 60, and the segmentation accuracy is 0.000001. Finally, according to the gradient color band, the style setting of the segmented thematic map is completed, and the REST map service is released.

[0143] After the configuration of the basic map service for visual rendering is completed, the user input parameters are obtained, and the prediction result mark time and water quality prediction model example required by the user are determined according to the user input parameters. The corresponding water quality prediction model prediction results are matched based on the storage results of the data template. Then the program is called to switch according to the data source of the published REST map service to force the refresh of the workspace corresponding to the map service, thereby realizing real-time dynamic rendering of water quality evolution.

[0144] S4: configure the resource data of the two-dimensional scene and the three-dimensional scene of the target river basin, superimpose the real-time dynamic rendering service of water quality evolution on the resource data of the two-dimensional scene and the three-dimensional scene, and generate the river basin two-dimensional scene model application and the river basin three-dimensional scene model application, wherein S4 includes:

[0145] S4-1: Obtain the plan layout data, high-precision DEM data, high-resolution image data, basic water system data, elevation information, and meteorological data of the target river basin;

[0146] S4-2: Construct two-dimensional scene resource data of the target river basin based on the plane layout data;

[0147] S4-3: Construct a 3D base map scene of the target river basin based on high-precision DEM data and high-resolution image data;

[0148] S4-4: Simulate the target river basin based on basic water system data to construct a real water system effect;

[0149] S4-5: Extract water catchment elements based on the surface geomorphic information in the elevation information, construct the water catchment process of the target river basin catchment area, and construct the building model, sewage outlet model and drainage network model connected by the pipeline model based on the building vector point data, sewage outlet vector point data, drainage network vector line data and pipeline elevation information in the elevation information;

[0150] S4-6: Access meteorological data based on webgl technology to build dynamic meteorological simulation of target river basin;

[0151] S4-7: Build the digital twin base of the target river basin based on the three-dimensional base map scene of the target river basin, the real water system effect, the building model connected by the pipeline model, the sewage outlet model and the drainage network model, and the meteorological dynamic simulation, and generate the three-dimensional scene resource data of the target river basin;

[0152] S4-8: Based on the generated two-dimensional scene resource data and three-dimensional scene resource data, access the real-time dynamic rendering effect of water quality evolution to generate a two-dimensional scene model application and a three-dimensional scene model application of the target river basin.

[0153] In this embodiment, a two-dimensional scene is constructed based on the plane layout data of the target river basin, such as Fig. 9 As shown; for the three-dimensional scene, specifically:

[0154] 1. Create a surface model, plan the terrain, slice it to roughly show the range, and create a road segmentation model based on the road vector line data within the scene pilot range, and create a river segmentation model based on the river water system vector surface data within the scene pilot range. Use different materials to represent the road, sidewalk, pedestrian road surface, grass, and river to show the functional distribution of the scene terrain.

[0155] 2. Extract contour lines based on DEM data. Create a flat plate in 3Dmax, use different brushes to brush out the trend of the mountain on the plate, further optimize the 0.2-meter high-definition orthophoto in Photoshop software, and use it as a texture material to map the mountain model. Create tree and grass assets in 3Dmax, copy the assets, and place individual trees and grass along both sides of the river bank on the surface model.

[0156] 3. Based on the building vector surface data and building elevation attribute information within the scope of the scene pilot, complete the preliminary construction of the building through modeling in 3Dmax. Select some buildings on both sides of the river bank for mapping, and use the plane map material to map the front, back, left, right, and top surfaces of the building. Place the processed building model on the surface model.

[0157] 4. Based on the vector point data of suspected sewage outlets along the river within the scope of the scenario pilot, holes are dug in the river model in 3Dmax to connect the underground pipeline network.

[0158] 5. Based on the drainage network vector line data within the scope of the scene pilot, the underground network modeling is carried out in 3Dmax. After the modeling is completed, the location of the network is checked and corrected so that the network model can be connected to the sewage outlet model.

[0159] 6. Access real-time meteorological data and realize rain, snow, fog, clear weather and other meteorological effects based on WebGL technology. According to meteorological information such as rainfall, control the intensity and range of weather effects such as rainy days.

[0160] Finally, according to the time parameter passed by the user, the corresponding water quality evolution calculation results are obtained and the corresponding workspace of the map service is refreshed. The map service is superimposed by loading multiple subdomains to complete the efficient rendering of the water quality evolution service.

[0161] The constructed 3D scene model is used for Fig.10 shown.

[0162] In another embodiment of the present embodiment, a packaging and display system of a river basin water quality prediction model is also included, which is applied to the packaging and display method of the above-mentioned river basin water quality prediction model, including:

[0163] Model digitization and analysis module: used to perform multi-threaded digitization operations on the water quality prediction model and analyze the output water quality prediction results;

[0164] Data template storage module: stores the data analyzed by water quality prediction results according to the constructed data template rendered in the water quality evolution time series, and outputs the stored results;

[0165] Water quality evolution rendering module: It is equipped with a visualization rendering basic map service, which is used to match the corresponding water quality prediction model prediction results according to the stored results and user input parameters, and retrieve the data source of the visualization rendering basic map service according to the matching results to perform real-time dynamic rendering of water quality evolution;

[0166] Scenario application module: It is configured with the resource data of the two-dimensional scene and three-dimensional scene of the target river basin, and is used to superimpose the real-time dynamic rendering service of water quality evolution on the resource data of the two-dimensional scene and three-dimensional scene, and generate the two-dimensional scene model application of the target river basin and the three-dimensional scene model application of the river basin.

[0167] Also included is an electronic device such as Fig.11 As shown, the electronic device 400 includes one or more processors 401 and a memory 402 .

[0168] The processor 401 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 400 to perform desired functions.

[0169] The memory 402 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 401 may run the program instructions to implement a packaging and display method of a river basin water quality prediction model of any embodiment of the present invention described above and / or other desired functions. Various contents such as initial external parameters, thresholds, etc. may also be stored in the computer-readable storage medium.

[0170] In one example, the electronic device 400 may further include: an input device 403 and an output device 404, which are interconnected via a bus system and / or other forms of connection mechanisms (not shown). The input device 403 may include, for example, a keyboard, a mouse, etc. The output device 404 may output various information to the outside, including early warning information, braking force, etc. The output device 404 may include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, etc.

[0171] Of course, to simplify, Fig.11 Only some of the components related to the present invention in the electronic device 400 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application conditions, the electronic device 400 may also include any other appropriate components.

[0172] In addition to the above-mentioned methods and devices, an embodiment of the present invention may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of a method for packaging and displaying a river basin water quality prediction model provided in any embodiment of the present invention.

[0173] The computer program product may be written in any combination of one or more programming languages ​​to write program code for performing the operations of the embodiments of the present invention, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0174] In addition, an embodiment of the present invention may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of a method for packaging and displaying a river basin water quality prediction model provided by any embodiment of the present invention.

[0175] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0176] The above are only embodiments of the present invention. Common knowledge such as the known specific structures and characteristics in the scheme is not described in detail here. Ordinary technicians in the relevant field know all the common technical knowledge in the technical field to which the invention belongs before the application date or priority date, can obtain all the existing technologies in the field, and have the ability to apply conventional experimental means before that date. Ordinary technicians in the relevant field can improve and implement this scheme in combination with their own abilities under the enlightenment given by this application. Some typical known structures or known methods should not become obstacles for ordinary technicians in the relevant field to implement this application. It should be pointed out that for those skilled in the art, without departing from the structure of the present invention, several deformations and improvements can be made, which should also be regarded as the scope of protection of the present invention, and these will not affect the effect of the implementation of the present invention and the practicality of the patent. The scope of protection required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the specification can be used to interpret the content of the claims.

Claims

1. A packaging and display method for a river basin water quality prediction model, characterized in that: include: S1: Construct a water quality prediction model for the target river basin, train and verify the water quality prediction model, obtain a water quality prediction model that meets the verification requirements, perform multi-threaded digitization on the water quality prediction model, and output water quality prediction result analysis; S2: Construct a data template for rendering the water quality evolution time series, use the data template to store the data of the water quality prediction result analysis, and output the stored results; S3: Configure the visualization rendering basic map service, match the corresponding water quality prediction model prediction results according to the stored results and the user input parameters, and call the data source of the visualization rendering basic map service according to the matching results to perform real-time dynamic rendering of water quality evolution; S4: Configure the resource data of the two-dimensional scene and the three-dimensional scene of the target river basin, superimpose the real-time dynamic rendering service of water quality evolution on the resource data of the two-dimensional scene and the three-dimensional scene, and generate the river basin two-dimensional scene model application and the river basin three-dimensional scene model application.

2. The packaging and display method of a river basin water quality prediction model according to claim 1, characterized in that: The S1 includes: S1-1: Based on the water system gridding technology, the target river basin is gridded according to the river centerline to generate multiple basin grids; S1-2: Construct a water quality prediction model based on multi-model fusion technology, and train and verify it based on the historical water quality monitoring data and meteorological data of the target river basin to generate and verify a water quality prediction model that meets the needs; S1-3: Perform digital operations on the water quality prediction model, automatically call the bat file through the batch file script, and use the concurrent asynchronous future technology to complete the automatic multi-threaded operation of the water quality prediction model; S1-4: Parse the water quality prediction results of the water quality prediction model into a preset file format.

3. The packaging and display method of a river basin water quality prediction model according to claim 2 is characterized by: The S2 includes: S2-1: Based on the watershed grid divided in S1-1, a data template for time series rendering of water quality evolution in the target river basin is constructed; S2-2: Read the parsing file of the water quality prediction result, extract the water quality index and extract the prediction result mark time according to the preset custom calculation example parameters; S2-3: Import the water quality indicators and prediction result marker moments into the data template and associate them with the target river basin grid.

4. The packaging and display method of a river basin water quality prediction model according to claim 3 is characterized by: The S3 includes: S3-1: Based on the water quality prediction results, a color table is prepared according to the water quality category color standard and stretched into a gradient color band; S3-2: Make the target river basin grid into a segmented thematic map, preset the segmentation index, set the style of the segmented thematic map based on the basin grid data and gradient color band, save the completed workspace; and publish the REST map service based on the completed workspace; S3-3: Obtain user input parameters, determine the prediction result mark time required by the user, call the corresponding custom example, match the corresponding water quality prediction model calculation result, and call the REST map service resource according to the matching result, and switch to the real-time dynamic rendering effect of water quality evolution.

5. The packaging and display method of a river basin water quality prediction model according to claim 4 is characterized in that: The S4 includes: S4-1: Obtain the plan layout data, high-precision DEM data, high-resolution image data, basic water system data, elevation information, and meteorological data of the target river basin; S4-2: Construct two-dimensional scene resource data of the target river basin based on the plane layout data; S4-3: Construct a 3D base map scene of the target river basin based on high-precision DEM data and high-resolution image data; S4-4: Simulate the target river basin based on basic water system data to construct a real water system effect; S4-5: Extract water catchment elements based on the surface geomorphic information in the elevation information, construct the water catchment process of the target river basin catchment area, and construct the building model, sewage outlet model and drainage network model connected by the pipeline model based on the building vector point data, sewage outlet vector point data, drainage network vector line data and pipeline elevation information in the elevation information; S4-6: Access meteorological data based on webgl technology to build dynamic meteorological simulation of target river basin; S4-7: Build the digital twin base of the target river basin based on the three-dimensional base map scene of the target river basin, the real water system effect, the building model connected by the pipeline model, the sewage outlet model and the drainage network model, and the meteorological dynamic simulation, and generate the three-dimensional scene resource data of the target river basin; S4-8: Based on the generated two-dimensional scene resource data and three-dimensional scene resource data, access the real-time dynamic rendering effect of water quality evolution to generate a two-dimensional scene model application and a three-dimensional scene model application of the target river basin.

6. The packaging and display method of a river basin water quality prediction model according to claim 5, characterized in that: The water quality prediction model in S1 includes a water quality prediction deep learning model and a water quality index prediction mechanism model, wherein the water quality prediction deep learning model is a fusion of a water quality prediction deep learning model based on a spatiotemporal graph convolutional network, a water quality prediction deep learning model based on a multi-layer attention mechanism network, and a water quality prediction deep learning model based on a long short-term memory network; The water quality index prediction mechanism model is a water quality index prediction mechanism model that integrates a water quality model and a hydrodynamic model.

7. A packaging and display system for a river basin water quality prediction model, applied to a packaging and display method for a river basin water quality prediction model as described in any one of claims 1 to 6 above, characterized in that: include: Model digitization and analysis module: used to perform multi-threaded digitization operations on the water quality prediction model and analyze the output water quality prediction results; Data template storage module: stores the data analyzed by water quality prediction results according to the constructed data template rendered in the water quality evolution time series, and outputs the stored results; Water quality evolution rendering module: It is equipped with a visualization rendering basic map service, which is used to match the corresponding water quality prediction model prediction results according to the stored results and user input parameters, and retrieve the data source of the visualization rendering basic map service according to the matching results to perform real-time dynamic rendering of water quality evolution; Scenario application module: It is configured with the resource data of the two-dimensional scene and three-dimensional scene of the target river basin, and is used to superimpose the real-time dynamic rendering service of water quality evolution on the resource data of the two-dimensional scene and three-dimensional scene, and generate the two-dimensional scene model application of the target river basin and the three-dimensional scene model application of the river basin.

8. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores programs or instructions, and the processor executes the packaging and display method of a river basin water quality prediction model as described in any one of claims 1 to 6 by calling the programs or instructions stored in the memory.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores programs or instructions, and the programs or instructions enable a computer to execute a packaging and display method for a river basin water quality prediction model as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Integration and visualization decision analysis method based on Yangtze River basin water environment model

    CN113780826A

  • River water quality prediction method based on graph convolution STG-LSTM

    CN114676887A

  • Regional river and lake water system communication combined dispatching and water quality safety guarantee method and system

    CN115375198A

  • GIS (Geographic Information System) risk management and control system and method for pollutant migration in mining area drainage basin

    CN116090219A

  • Remote-sensing-based digital twin flood inundation range verification method and remote-sensing-based digital twin flood inundation range verification system

    CN117372337A

Cited By

  • Robot operation processing method and device based on AI

    CN120430467A

  • River drain outlet pollution source tracing method and device, electronic equipment and storage medium

    CN120541447A