River and lake state evaluation method and system based on digital twinning
By calculating the similarity between environmental parameters and dissolved oxygen errors and performing cluster analysis, selecting or retraining the time series model, the problem that environmental parameters impact in the prior art is not considered is solved, and the accuracy of dissolved oxygen prediction and the credibility of river and lake state evaluation are improved.
Patent Information
- Application Number
- CN202510874176.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-06-27
AI Technical Summary
The prior art fails to effectively consider the impact of different environmental parameters on the prediction accuracy in dissolved oxygen prediction, resulting in low prediction accuracy of model.
By constructing a time series model, the similarity between environmental parameters and dissolved oxygen error is calculated, cluster analysis is performed, and the model is selected or retrained based on the clustering results to improve prediction accuracy.
It improves the accuracy of dissolved oxygen prediction, enhances the credibility of river and lake state evaluation, and ensures the effectiveness of the model under different environmental conditions.
Smart Images

Figure CN120373674A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of river and lake status evaluation, and particularly to a river and lake status evaluation method and system based on digital twin. Background Art
[0002] The water quality of rivers and lakes is crucial for the development of the ecological environment, and it greatly affects aspects such as ecological environment balance, human physical and mental health, and sustainable social and economic development. However, with the acceleration of the urbanization and industrialization processes, river and lake pollution has become increasingly serious. Therefore, river and lake water quality prediction has become an important means to ensure the health of river and lake water bodies. In river and lake status evaluation, dissolved oxygen is a key ecological indicator in the aquatic ecosystem, which directly reflects the self-purification ability of the water body, the ecological health status, and the living conditions of organisms. Through dissolved oxygen prediction, the ecological status of rivers and lakes can be understood in advance, providing a scientific basis for river and lake management, ecological protection, and pollution control.
[0003] In the patent of the dissolved oxygen prediction method and device with the publication number CN112215412A, a dissolved oxygen prediction method based on LSTM is disclosed. This method uses relevant monitoring data as the input of the model, outputs the dissolved oxygen content, and uses an intelligent optimization algorithm to obtain the optimal hyperparameter combination of the model.
[0004] However, when this method predicts dissolved oxygen, it does not consider the influence of different environmental parameters on the prediction accuracy, nor does it consider the influence of historical dissolved oxygen on the current dissolved oxygen. Therefore, how to obtain the best time series prediction model under the influence of different environmental parameters and improve the prediction accuracy of the model is an urgent problem to be solved. Summary of the Invention
[0005] In order to solve the problem that the existing time series prediction model does not consider the influence of environmental parameters at different times on the error, resulting in low prediction accuracy, this application provides a river and lake status evaluation method and system based on digital twin.
[0006] In the first aspect, this application provides a river and lake status evaluation method based on digital twin, adopting the following technical solution: The river and lake status evaluation method based on digital twin includes the following steps: Construct a data sequence about time and river and lake status evaluation parameters according to the historical data of rivers and lakes, and upload the data sequence to the digital twin platform; the river and lake status evaluation parameters include the dissolved oxygen of the water body and environmental parameters, and the environmental parameters include water temperature, water salinity, and water flow velocity, and one environmental parameter corresponds to one environmental parameter sequence; Set up a time series model, output the predicted value of dissolved oxygen according to the time series model, obtain the dissolved oxygen error sequence based on the absolute value of the difference between the true value and the predicted value of dissolved oxygen, calculate the similarity sequence between the dissolved oxygen error sequence and each environmental parameter sequence, and obtain the influence degree vector of each environmental parameter on the prediction result at each moment; Cluster the influence degree vectors. After clustering, each cluster represents an environmental impact. In response to the dissolved oxygen error corresponding to the cluster being less than the set threshold, the time series model is used as the prediction model for the cluster. In response to the dissolved oxygen error corresponding to the cluster being greater than or equal to the set threshold, a new time series model is retrained as the prediction model corresponding to the cluster; Obtain the types of environmental impacts at the current moment according to the clustering result, use the prediction model to output the predicted value of dissolved oxygen at the next moment, and evaluate the river and lake state according to the predicted value of dissolved oxygen.
[0007] The beneficial effects are as follows: By calculating the similarity between each environmental parameter and the error, the influence degree of each environmental parameter on the error is reflected. The greater the similarity, the more consistent the change of the error and the environmental parameter, indicating that the time series model is more affected by the environmental parameter. Cluster the influence degree of each error on the model at each moment. After clustering, each cluster represents a situation of environmental parameter influence. Then, train the time series prediction model under each environmental parameter influence, calculate the current cluster, and use the corresponding time series model for prediction, which improves the prediction accuracy of dissolved oxygen and thus also improves the credibility of the river and lake state evaluation.
[0008] Optionally, the time series model is ARIMA, SARIMA or LSTM.
[0009] Optionally, the calculation method of the similarity sequence is as follows: The similarity sequence is composed of similarities at multiple moments sorted in chronological order. The similarity is the similarity between the environmental parameter sequence and the dissolved oxygen error sequence before the target moment.
[0010] The beneficial effects are as follows: Only the target environmental parameter sequence and the error sequence before any moment need to be obtained, and the similarity sequence can be quickly calculated.
[0011] Optionally, the calculation method of the similarity sequence is as follows: The similarity sequence is composed of similarities at multiple moments sorted in chronological order. The similarity is the similarity between the environmental parameter sequence and the dissolved oxygen error sequence within a preset time length centered on the target moment.
[0012] The beneficial effects are as follows: With a preset time length centered on the target moment, calculate the similarity between the target environmental parameter sequence and the error sequence within the preset time length, which can better reflect the similarity between the two sequences at the target moment.
[0013] Optionally, the calculation of the similarity is the ratio of the covariance of the environmental parameter sequence and the dissolved oxygen error sequence to the product of the standard deviations of the two sequences respectively.
[0014] The beneficial effects are as follows: It reflects the strength and direction (-1 to 1) of the linear relationship between the two sequences, and is suitable for analyzing whether the errors increase or decrease synchronously. If the Pearson coefficient between water temperature and dissolved oxygen error is 0.9, it indicates a high positive correlation between the two.
[0015] Optionally, the calculation of the similarity is the ratio of the dot product of the environmental parameter sequence and the dissolved oxygen error sequence to the norms of the two sequences respectively.
[0016] Optionally, the influence degree vector includes the influence degree of temperature, the influence degree of salinity, and the influence degree of flow velocity, and the influence degree of the target environmental parameter at the target moment is the result after normalizing the similarity at the target moment.
[0017] Optionally, the clustering algorithm adopts ordered sample clustering or density-based clustering.
[0018] The beneficial effects are as follows: The clustering method is used to cluster the same environmental impact situations into one cluster without affecting subsequent time series analysis.
[0019] In the second aspect, the present application provides a digital twin-based river and lake state evaluation system, adopting the following technical solution: It includes: a processor and a memory, and the memory stores computer program instructions, which, when executed by the processor, implement the digital twin-based river and lake state evaluation method according to the above.
[0020] The beneficial effects are as follows: The digital twin-based river and lake state evaluation method described above is generated into a computer program and stored in the memory to be loaded and executed by the processor. Thus, a system is made according to the memory and the processor, which is convenient to use.
[0021] The present application has the following technical effects: constructing a time series model for the collected historical dissolved oxygen, obtaining an error sequence based on the prediction results of the time series model, obtaining the influence degree of each environmental parameter on the error according to the similarity between each environmental parameter sequence and the error sequence, calculating the influence degree of the next error at each moment, obtaining the influence degree vector at each moment, clustering the influence degree vectors, and after clustering, each cluster represents an environmental influence. In response to the dissolved oxygen error corresponding to the cluster being less than the set threshold, the above time series model is used for this cluster. In response to the dissolved oxygen error corresponding to the cluster being greater than or equal to the set threshold, a new time series model needs to be trained for this cluster. According to the environmental influence to which the current dissolved oxygen belongs, the corresponding time series model is used to predict the dissolved oxygen. When the dissolved oxygen content and each environmental parameter at the next moment are collected, the same method can be used to continue predicting the subsequent dissolved oxygen. Description of the Drawings
[0022] By referring to the detailed description below with reference to the accompanying drawings, the above and other objects, features, and advantages of the exemplary embodiments of the present application will become readily understood. In the drawings, several embodiments of the present application are shown in an exemplary rather than restrictive manner, and the same or corresponding reference numerals represent the same or corresponding parts.
[0023] Figure 1 It is a flowchart showing steps S1 - S4 in the method for evaluating the state of rivers and lakes based on digital twins of the present application.
[0024] Figure 2 It is a block diagram of the structure of the system for evaluating the state of rivers and lakes based on digital twins of the present application. Detailed Embodiments
[0025] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative efforts fall within the protection scope of the present application.
[0026] It should be understood that when the claims, specifications, and drawings of the present application use terms such as "first" and "second", they are only used to distinguish different objects and not to describe a specific order. The terms "including" and "comprising" used in the specifications and claims of the present application indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0027] The embodiments of the present application disclose a method for evaluating the state of rivers and lakes based on digital twins, referring to Figure 1, including the following steps: S1: Collect historical river and lake status evaluation parameters including dissolved oxygen and environmental parameters of the water body. The environmental parameters include water temperature, water salinity, and water flow velocity.
[0028] It should be noted that the specific scenario targeted by this application can be: predicting future evaluation parameters based on historical river and lake status evaluation parameters, and obtaining a predicted river and lake status evaluation result based on the predicted evaluation parameters.
[0029] In an embodiment of this application, the electrode method is used to collect the dissolved oxygen of the water body, a temperature sensor is used to collect the water temperature, the conductivity method is used to collect the water salinity, and an electromagnetic flowmeter or a buoy tracking method is used to collect the water flow velocity. Preprocessing operations such as outlier deletion and normalization are performed on the collected data. One environmental parameter obtains an environmental parameter sequence, and the environmental parameter sequence includes a temperature sequence, a salinity sequence, and a flow velocity sequence.
[0030] S2: Use the dissolved oxygen sequence to construct a time series model. Obtain a dissolved oxygen error sequence based on the predicted value and the true value of the model. Calculate the similarity sequence between each environmental parameter sequence and the dissolved oxygen error sequence, and obtain the influence degree vector at each moment according to the similarity sequence.
[0031] In an embodiment of this application, when using a time series model to predict dissolved oxygen, since the model does not consider the influence of environmental parameters on dissolved oxygen, the model cannot learn the degree of influence on dissolved oxygen under different environmental parameters. When the degree of influence of environmental parameters on dissolved oxygen changes greatly, the model cannot learn the change in dissolved oxygen caused by environmental changes, and at this time, the prediction result error of the time series model will be relatively large. Therefore, in this embodiment, calculate the degree of influence of environmental parameters on dissolved oxygen prediction at different moments. Specifically: Construct a time series model to predict dissolved oxygen. The input of the time series model is historical dissolved oxygen, and the output is the predicted value of dissolved oxygen at the next moment. When the time series model is an ARIMA or SARIMA model, the grid method is used to set different parameters, and the best model is selected according to the AIC criterion; when the time series model is an LSTM, the mean squared error loss is used as the loss function of the model, and the gradient descent algorithm is used to update the model parameters. When the model reaches the preset maximum number of training times, or the loss of the model is less than the set threshold, the model stops training. Exemplarily, the maximum number of training times of the model is 1000, and the threshold of the loss is 0.001. After the model training is completed, the best model is selected according to the evaluation index accuracy of the model.
[0032] The predicted error is obtained based on the absolute value of the difference between the true dissolved oxygen and the predicted dissolved oxygen, and the similarity between the dissolved oxygen error sequence and the environmental parameter sequence at the target time is calculated. The greater the similarity, the more consistent the changes in the dissolved oxygen error and the environmental parameters, and the greater the impact of the environmental parameters on the dissolved oxygen prediction. The specific similarity calculation formula for the dissolved oxygen error sequence and the environmental parameter sequence at the target time is as follows: Wherein, represents the similarity between the dissolved oxygen error sequence at the th moment and the th environmental parameter sequence, represents the covariance, represents the dissolved oxygen error sequence at the th moment, represents the th moment and the th environmental parameter sequence, represents the standard deviation of the dissolved oxygen error sequence at the th moment, represents the th moment and the th environmental parameter sequence standard deviation.
[0033] In another embodiment of the present application, the similarity calculation formula for the dissolved oxygen error sequence and the environmental parameter sequence at the target time is as follows: Wherein, represents the similarity between the dissolved oxygen error sequence at the th moment and the th environmental parameter sequence, represents the dissolved oxygen error sequence at the th moment, represents the th moment and the th environmental parameter sequence, represents the dot product of the dissolved oxygen error sequence at the th moment and the th moment and the th environmental parameter sequence, represents the norm of the dissolved oxygen error sequence at the th moment, represents the th moment and the th environmental parameter sequence norm.
[0034] Among them, the method for obtaining the target time sequence is: using the sequence composed of all times before the target time (including the target time) as the target time sequence. Exemplarily: when the target time is th moment, the dissolved oxygen sequence is , where represents the dissolved oxygen at the first moment, represents the dissolved oxygen at the second moment, represents the dissolved oxygen at the
[0035] In another embodiment of the present application, the method for obtaining the target time sequence is: preset a time length with the target time as the center point, and the time length is the target time sequence. Exemplarily: the target time is moment, the preset time length is 5, then the dissolved oxygen sequence is , where represents the dissolved oxygen at the represents the dissolved oxygen at the represents the dissolved oxygen at the represents the dissolved oxygen at the represents the dissolved oxygen at the
[0036] After normalizing the above similarity, the influence degree of the environmental parameters on the dissolved oxygen error is obtained. After calculating the influence degree of the environmental parameters on the dissolved oxygen error at each moment, the influence degree of each environmental parameter on the dissolved oxygen error at each moment is obtained. The influence degree of each environmental parameter on the dissolved oxygen error at each moment constitutes the influence degree vector at each moment. The exemplary normalization formula is as follows: where represents the influence degree of the th environmental parameter on the dissolved oxygen error at the th moment, represents the similarity between the dissolved oxygen error sequence at the th moment and the th environmental parameter sequence, represents taking the maximum value, represents taking the minimum value.
[0037] Thus, the influence degree vector at each moment is obtained.
[0038] S3: Cluster the influence degree vectors at each moment to obtain clustering clusters of different environmental influences. In response to the dissolved oxygen error corresponding to the clustering cluster being less than the set threshold, the clustering cluster uses the above time series model as the prediction model. In response to the dissolved oxygen error corresponding to the clustering cluster being greater than or equal to the set threshold, retrain to obtain a new time series model as the prediction model corresponding to the clustering cluster.
[0039] In one embodiment of the present application, the influence degrees at different moments are clustered. During clustering, ordered sample clustering is used. Ordered sample clustering forcibly preserves the original order of the samples (such as chronological order or spatial continuity) during the clustering process, avoiding the situation where the results caused by traditional clustering (such as K-means) disrupting the sequence are not applicable to the subsequent time series analysis of the present application. After clustering, one clustering cluster represents an environmental influence. For example, it indicates that the temperature influence is large, while the salinity and flow velocity influences are small; or the salinity influence is large, while the temperature and flow velocity influences are small; or the flow velocity influence is large, while the temperature and salinity influences are small.
[0040] For each clustering cluster after clustering, calculate the error of its corresponding dissolved oxygen prediction. Use the average value of the absolute value of the difference between the true dissolved oxygen and the predicted dissolved oxygen at all moments in the clustering cluster as the dissolved oxygen error corresponding to the clustering cluster. The dissolved oxygen error corresponding to the clustering cluster reflects the influence of the environment represented by the clustering cluster on the dissolved oxygen prediction. The larger the dissolved oxygen error, the greater the influence of the environment represented by the clustering cluster on the dissolved oxygen prediction, and a new time series model needs to be retrained to obtain a prediction model that better fits the environment. The smaller the dissolved oxygen error, the smaller the influence of the environment represented by the clustering cluster on the dissolved oxygen prediction, indicating that the time series model obtained in S2 already fits this environment and there is no need to retrain a new time series model.
[0041] In response to the dissolved oxygen error being less than the set threshold, the above time series model is used as the prediction model for the clustering cluster. In response to the dissolved oxygen error corresponding to the clustering cluster being greater than or equal to the set threshold, a new time series model is retrained as the prediction model corresponding to the clustering cluster. Exemplarily, the threshold is set to 0.1. When the dissolved oxygen error is less than 0.1, it indicates that the predicted value and the true value are already very close, and within this error range, it will not cause a large impact on the subsequent evaluation of the river and lake state.
[0042] In another embodiment of the present application, the clustering algorithm uses density-based clustering. When calculating the density-based distance, the moments at which the influence degree vectors are located are taken into account. When determining whether two influence degree vectors belong to the same clustering cluster, it is required that the time difference between them is less than the set threshold. Exemplarily, the threshold is 5. When the time interval is greater than or equal to 5, at this time, the distance between them in time series is relatively far, and it is considered that they do not belong to the same clustering cluster.
[0043] S4: Obtain the environmental influence clustering cluster to which the current moment belongs, use the corresponding time series model to predict the dissolved oxygen, and use the same steps to predict the subsequent dissolved oxygen.
[0044] In an embodiment of the present application, after clustering is completed, the cluster to which the current moment belongs is obtained. The time series model corresponding to the cluster to which the current moment belongs is used to predict the dissolved oxygen at the next moment. The state of the river and lake is evaluated according to the prediction result, and the dissolved oxygen prediction result and the evaluation result are displayed on the digital twin platform. When the true value of the dissolved oxygen at the next moment is obtained, the error at the next moment is calculated. A new error sequence is obtained based on the error at the next moment and the error sequence. The most suitable time series model can be obtained for the new error sequence according to the above steps. The dissolved oxygen is predicted according to the most suitable time series model.
[0045] An embodiment of the present application also discloses a river and lake state evaluation system based on digital twins, as Figure 2 shown, which includes a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are executed by the processor, the digital twin-based river and lake state evaluation method according to the present application is implemented.
[0046] The above system also includes other components well known to those skilled in the art such as a communication bus and a communication interface. Their settings and functions are known in the art, so they will not be described in detail here.
[0047] In the present application, the aforementioned memory can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, device, or device. For example, a computer-readable storage medium can be any suitable magnetic storage medium or magneto-optical storage medium, such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high bandwidth memory (HBM), hybrid memory cube (HMC), and so on, or any other medium that can be used to store the required information and can be accessed by an application program, module, or both. Any such computer storage medium can be part of the device or accessible or connectable to the device.
[0048] Although this specification has shown and described multiple embodiments of the present application, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will think of many changes, alterations, and alternative ways without departing from the spirit and concept of the present application. It should be understood that various alternatives to the embodiments of the present application described herein may be employed in the practice of the present application.
[0049] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereby. Therefore, all equivalent changes made according to the structure, shape, and principle of the present application shall be covered within the protection scope of the present application.
Claims
1. A method for evaluating the state of rivers and lakes based on digital twins, characterized in that, It includes the following steps: Construct a data sequence of time and river-lake state evaluation parameters based on historical data of rivers and lakes, and upload the data sequence to the digital twin platform; the river-lake state evaluation parameters include dissolved oxygen and environmental parameters of the water body, the environmental parameters include water temperature, water salinity and water flow velocity, and one environmental parameter corresponds to one environmental parameter sequence; Set a time series model, output the predicted value of dissolved oxygen according to the time series model, obtain the dissolved oxygen error sequence according to the absolute value of the difference between the true value and the predicted value of dissolved oxygen, calculate the similarity sequence between the dissolved oxygen error sequence and each environmental parameter sequence, and obtain the influence degree vector of each environmental parameter on the prediction result at each moment; Cluster the influence degree vectors. After clustering, each cluster represents an environmental impact. In response to the dissolved oxygen error corresponding to the cluster being less than the set threshold, the time series model is used as the prediction model for the cluster. In response to the dissolved oxygen error corresponding to the cluster being greater than or equal to the set threshold, a new time series model is retrained as the prediction model corresponding to the cluster; Obtain the types of environmental impacts at the current moment according to the clustering result, use the prediction model to output the predicted value of dissolved oxygen at the next moment, and evaluate the river-lake state according to the predicted value of dissolved oxygen.
2. The method according to claim 1, wherein The time series model is ARIMA, SARIMA or LSTM.
3. The method according to claim 1, characterized in that, The calculation method of the similarity sequence is as follows: The similarity sequence is composed of similarities at multiple moments sorted in chronological order, and the similarity is the similarity between the environmental parameter sequence and the dissolved oxygen error sequence before the target moment.
4. The method according to claim 1, wherein The calculation method of the similarity sequence is as follows: The similarity sequence is composed of similarities at multiple moments sorted in chronological order, and the similarity is the similarity between the environmental parameter sequence and the dissolved oxygen error sequence within a preset time length centered on the target moment.
5. The method according to claim 3 or 4, characterized in that The calculation of the similarity is the ratio of the covariance of the environmental parameter sequence and the dissolved oxygen error sequence to the product of the standard deviations of the two sequences.
6. The method according to claim 3 or 4, characterized in that The calculation of the similarity is the ratio of the dot product of the environmental parameter sequence and the dissolved oxygen error sequence to the norms of the two sequences.
7. The method according to claim 1, characterized in that, The influence degree vector includes the influence degree of temperature, the influence degree of salinity and the influence degree of flow velocity, and the influence degree of the target environmental parameter at the target moment is the result after normalization of the similarity at the target moment.
8. The method according to claim 1, characterized in that The clustering algorithm adopts ordered sample clustering or density-based clustering.
9. The river and lake state evaluation system based on digital twin is characterized in that It includes: A processor and a memory, the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the digital twin-based river-lake state evaluation method according to any one of claims 1-8 is implemented.
Citation Information
Patent Citations
Dissolved oxygen prediction method and device
CN112215412A
Prediction method and apparatus for dissolved oxygen in water
CN107169621A
Prediction method and system of dissolved oxygen in cultivation water
CN107609718A
Aquaculture environment dissolved oxygen prediction method based on long short-term memory network
CN108717586A
River water environment quality prediction method
CN112966891A