Interpolation method, device and electronic equipment for missing hydrological and water quality data
Through the combination of analytic hierarchy process and interpolation model, the problem of missing values in hydrology and water quality data is solved, ensuring the integrity of the data and supporting more accurate water resources management and water environment decision-making.
Patent Information
- Application Number
- CN202410696395.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-05-31
AI Technical Summary
Missing values exist in hydrology and water quality data, causing data integrity problems and affecting water resources management and water environment protection.
The analytic hierarchy process is combined with different interpolation models to determine the appropriate interpolation model for data interpolation based on the missing information and scenarios of the missing data fragments. Through data analysis and weight value calculation, actual interpolation data is generated to ensure hydrological Integrity of water quality data.
It effectively solves the problem of missing values in hydrology and water quality data, improves the integrity and reliability of data, and supports more accurate water resources management and water environment decisions.
Smart Images

Figure CN118296311B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a method, device and electronic device for interpolating missing hydrological and water quality data. Background Art
[0002] Hydrological and water quality data are important basic conditions for water resources management. Many countries in the world have established national hydrological and water quality data monitoring networks. As the basis for systematic management of national water resources, hydrological and water quality monitoring and data management have become important decision-making supports for water resources management, water pollution control and governance, and are crucial to protecting water resources, water environment and water security. Advances in data analysis technology, improvements in computer technology and computing power, and reductions in data storage costs have enabled hydrological and water quality data management to shift from relying on the expertise of managers to systematic, data-driven artificial intelligence. However, due to historical conditions, instrument and equipment failures, manual processing errors and other reasons, hydrological and water quality data inevitably have missing values, and data missing has become a common problem in hydrological and water quality data.
[0003] Therefore, how to ensure the integrity of hydrological and water quality data has become an urgent problem to be solved. Summary of the invention
[0004] In order to solve the above technical problems, the present disclosure provides a method, device and electronic device for interpolating missing hydrological and water quality data.
[0005] In order to achieve the above objectives, the present invention adopts the following technical solutions:
[0006] In a first aspect, the present disclosure provides a method for interpolating missing data of hydrology and water quality, comprising: obtaining missing data of hydrology and water quality; wherein the missing data of hydrology and water quality includes at least one missing data segment; performing the following operations on each missing data segment: performing data analysis on the missing data segment to determine the missing information corresponding to the missing data segment; determining the missing scenario corresponding to the missing information based on the missing information; determining the interpolation model corresponding to the missing scenario based on the missing scenario; inputting the missing data segment into the corresponding interpolation model for data interpolation to obtain theoretical interpolation data corresponding to the missing data segment; wherein different missing scenarios correspond to different interpolation models; analyzing each interpolation model using a hierarchical analysis method to determine the weight value corresponding to each interpolation model; determining the actual interpolation data corresponding to the theoretical interpolation data based on the theoretical interpolation data and the weight value of the interpolation model corresponding to the theoretical interpolation data; performing data interpolation on the missing data of hydrology and water quality based on at least one actual interpolation data to obtain the interpolated missing data of hydrology and water quality.
[0007] In a second aspect, the present disclosure provides an interpolation device for missing hydrological and water quality data, comprising: an acquisition unit, used to acquire missing hydrological and water quality data; wherein the missing hydrological and water quality data includes at least one missing data segment; a processing unit, used to perform the following operations on each missing data segment acquired by the acquisition unit: perform data analysis on the missing data segment to determine the missing information corresponding to the missing data segment; determine the missing scenario corresponding to the missing information based on the missing information; determine the interpolation model corresponding to the missing scenario based on the missing scenario; input the missing data segment into the corresponding interpolation model for data interpolation to obtain theoretical interpolation data corresponding to the missing data segment; wherein different missing scenarios correspond to different interpolation models; the processing unit is further used to analyze each interpolation model using a hierarchical analysis method to determine the weight value corresponding to each interpolation model; determine the actual interpolation data corresponding to the theoretical interpolation data based on the theoretical interpolation data and the weight value of the interpolation model corresponding to the theoretical interpolation data; the processing unit is further used to perform data interpolation on the missing hydrological and water quality data acquired by the acquisition unit based on at least one actual interpolation data to obtain the interpolated missing hydrological and water quality data.
[0008] In a third aspect, the present disclosure provides an electronic device, comprising: a memory and a processor, the memory being used to store a computer program; the processor being used to enable the electronic device to implement the method for interpolating missing hydrological and water quality data as provided in the first aspect above when executing the computer program.
[0009] In a fourth aspect, the present disclosure provides a computer-readable storage medium, comprising: a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a computing device, the computing device implements the method for interpolating missing hydrological and water quality data as provided in the first aspect above.
[0010] In the present disclosure, the name of the interpolation device for missing hydrological and water quality data does not limit the device or functional module itself. In actual implementation, these devices or functional modules may appear with other names. As long as the functions of each device or functional module are similar to those of the present disclosure, they belong to the scope of the technical solution provided by the present disclosure and its equivalent technology.
[0011] These and other aspects of the present disclosure will become more apparent from the following description.
[0012] Compared with the prior art, the technical solution provided by the present invention has the following advantages:
[0013] The interpolation method for missing data of hydrology and water quality provided by the present disclosure configures different interpolation models for different missing data segments, thereby performing the following operations on each missing data segment in the missing data of hydrology and water quality: performing data analysis on the missing data segment to determine the missing information corresponding to the missing data segment; determining the missing scenario corresponding to the missing information based on the missing information; determining the interpolation model corresponding to the missing scenario based on the missing scenario; inputting the missing data segment into the corresponding interpolation model for data interpolation to obtain theoretical interpolation data corresponding to the missing data segment. Afterwards, using the hierarchical analysis method to analyze each interpolation model to determine the weight value corresponding to each interpolation model; determining the actual interpolation data corresponding to the theoretical interpolation data based on the theoretical interpolation data and the weight value of the interpolation model corresponding to the theoretical interpolation data; interpolating the missing data of hydrology and water quality based on at least one actual interpolation data to obtain the interpolated missing data of hydrology and water quality, so that the missing data of hydrology and water quality can be interpolated to ensure the integrity of the hydrology and water quality data, solving the problem of how to ensure the integrity of the hydrology and water quality data. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0016] Figure 1 One of the flow charts of a method for interpolating missing hydrological and water quality data provided in an embodiment of the present disclosure;
[0017] Figure 2 One of the scenario schematic diagrams of a method for interpolating missing hydrological and water quality data provided in an embodiment of the present disclosure;
[0018] Figure 3 A second flow chart of a method for interpolating missing hydrological and water quality data provided in an embodiment of the present disclosure;
[0019] Figure 4 A third flow chart of a method for interpolating missing hydrological and water quality data provided in an embodiment of the present disclosure;
[0020] Figure 5 A fourth flow chart of a method for interpolating missing hydrological and water quality data provided in an embodiment of the present disclosure;
[0021] Figure 6A second schematic diagram of a scenario of a method for interpolating missing hydrological and water quality data provided in an embodiment of the present disclosure;
[0022] Figure 7 A fifth flow chart of a method for interpolating missing hydrological and water quality data provided in an embodiment of the present disclosure;
[0023] Figure 8 A sixth flow chart of a method for interpolating missing hydrological and water quality data provided in an embodiment of the present disclosure;
[0024] Fig. 9 A schematic diagram of the structure of a device for interpolating missing hydrological and water quality data provided by an embodiment of the present disclosure;
[0025] Fig.10 A schematic diagram of the structure of a server provided in an embodiment of the present disclosure;
[0026] Fig.11 A schematic diagram of the structure of a computer program product for a method for interpolating missing hydrological and water quality data provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0028] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0029] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0030] like Figure 1As shown, the interpolation method for missing hydrological and water quality data provided by the embodiment of the present disclosure includes the following steps S11-S15:
[0031] S11, obtaining missing data of hydrology and water quality, wherein the missing data of hydrology and water quality includes at least one missing data segment.
[0032] In some examples, the hydrological and water quality data are usually continuous, but due to various reasons, there will be missing data in the near field, resulting in missing actual hydrological and water quality data. For example, for the rivers in the target area, data is collected every hour from November 1, 2020 to December 31, 2021 to obtain missing hydrological and water quality data. However, due to other reasons, no data was collected at 17:00:00 on November 2, 2020-18:00:00 on November 2, 2020, and 19:00:00 on November 3, 2020-20:00:00 on November 3, 2020. Among them, the missing data from 17:00:00 on November 2, 2020 to 18:00:00 on November 2, 2020 corresponds to a missing data segment, and the missing data from 19:00:00 on November 3, 2020 to 20:00:00 on November 3, 2020 corresponds to a missing data segment.
[0033] S12, performing the following operations on each missing data segment: performing data analysis on the missing data segment to determine the missing information corresponding to the missing data segment; determining the missing scenario corresponding to the missing information based on the missing information; determining the interpolation model corresponding to the missing scenario based on the missing scenario; inputting the missing data segment into the corresponding interpolation model for data interpolation to obtain theoretical interpolation data corresponding to the missing data segment. Different interpolation models correspond to different missing scenarios.
[0034] In some examples, missing information includes: missing rate, missing gap, and missing mechanism. Among them, the missing rate is the proportion of missing values in the data set, which is one of the main factors affecting the interpolation accuracy. Studies have shown that as the missing rate increases, the input accuracy tends to decrease, and the interpolation accuracy of missing values gradually decreases. As the amount of data increases, the information available for the interpolation model decreases. When the missing rate is low, simple interpolation methods such as statistical methods can be used; as the missing rate increases, advanced interpolation methods such as multiple interpolation or machine learning are required.
[0035] Exemplarily, the preset data (such as water temperature) in the missing hydrological and water quality data is collected every hour from November 1, 2020 to November 1, 2021. The resulting missing hydrological and water quality data lacks water temperature data from 17:00:00 on November 1, 2020 to 19:00:00 on November 1, 2020, and from 9:00:00 on November 1, 2020 to 10:00:00 on November 1, 2020. Among them, the missing water temperature data from 17:00:00 on November 1, 2020 to 19:00:00 on November 1, 2020 corresponds to a missing data segment (such as missing data segment 1), and the water temperature data from 9:00:00 on November 1, 2020 to 10:00:00 on November 1, 2020 corresponds to a missing data segment (such as missing data segment 2).
[0036] The total number of missing values corresponding to missing data fragment 1 is 3, which are the water temperature data corresponding to 17:00:00 on November 1, 2020, the water temperature data corresponding to 18:00:00 on November 1, 2020, and the water temperature data corresponding to 19:00:00 on November 1, 2020; since the water temperature data is collected every hour, the total number of water temperature data values contained in the missing hydrological and water quality data is 24, that is, the missing rate is 12.5%.
[0037] Missing gap refers to the length of consecutive missing values. Generally, due to power failure of monitoring equipment and other reasons, multiple sensors lose data within a period of time. The data is in a state of continuous missing, and it is relatively difficult to supplement the data set through interpolation methods.
[0038] Exemplarily, combined with the above-mentioned example of missing rate, since the total number of missing values corresponding to missing data fragment 1 is 3, namely the water temperature data corresponding to 17:00:00 on November 1, 2020, the water temperature data corresponding to 18:00:00 on November 1, 2020, and the water temperature data corresponding to 19:00:00 on November 1, 2020, the missing gap corresponding to missing data fragment 1 is equal to the total number of missing values, that is, the missing gap is 3.
[0039] Missing mechanisms are usually divided into three types: Missing Completely at Random (MCAR), Missing at Random (MAR), and Not Missing at Random (MNAR). Different missing mechanisms may lead to different missing value patterns, corresponding to different data interpolation methods. Since missingness is generally completely random, the missing data is not related to any specific features or values in the observed data set. Generally, missing mechanisms can be considered as completely random missingness, and any interpolation method that relies on observed data can be used to interpolate missing values without introducing any bias. In order to ensure unbiased results under random missing or non-random missing mechanisms, the present invention also considers random missingness as a missing mechanism.
[0040] Among them, MCAR means that the missing data is independent of both the incomplete variables and the complete variables, MAR means that the missing data only depends on the complete variables, and MNAR means that the missing data in the incomplete variables depends on the incomplete variables themselves, and this missing data cannot be ignored.
[0041] Specifically, variables (attributes) in a data set that do not contain missing values are called complete variables, and variables in a data set that contain missing values are called incomplete variables.
[0042] In some examples, the training process of the interpolation model is as follows: including S1 data collection, S2 setting missing data, and S3 interpolation model for missing data interpolation. Among them, S1 data collection includes: S101 data collection and organization and S102 missing scene identification; S2 setting missing data includes: S201 active introduction of missing values and S202 setting missing scenes. S3 interpolation model for missing data interpolation includes: S301 single model interpolation of missing data, S302 single model interpolation of missing data accuracy assessment and S303 multi-model and multi-missing scene functional relationship construction. Among them,
[0043] S101 data collection and collation, including:
[0044] Collect data from the real environment according to the work purpose and organize it into a structured data set in a time sequence format.
[0045] This paper takes a river as the research object, for example: the river length is AAA kilometers, the basin area is BBB square kilometers, and it provides water for CCC million people. Due to the rapid population growth and urbanization in the past few decades, the water quality has been seriously degraded. In order to continuously monitor the water quality and manage non-point pollution sources, a water quality monitoring system is installed along the river.
[0046] The present invention mainly collects river water quality data. The data types contained in the water quality data include water temperature, pH value, electrical conductivity (EC), dissolved oxygen (DO), turbidity, flow rate, rainfall, total nitrogen (TN), total phosphorus (TP), and total organic carbon (TOC).
[0047] In some examples, data such as water temperature, pH, electrical conductivity (EC), dissolved oxygen (DO), turbidity, flow rate and rainfall are monitored by automated monitors.
[0048] In some examples, data such as total nitrogen (TN) and total phosphorus (TP) are monitored online using automated thermal oxidation methods.
[0049] In some examples, total organic carbon (TOC) is quantified using automated standard contaminant testing methods.
[0050] Exemplarily, the data time series of water quality data collected by the present invention is from November 1, 2020 to December 31, 2021. Data is collected every hour and organized into a structured data set in a time series format. Each indicator parameter has N (e.g., 10224) data points. The water quality data is shown in Table 1.
[0051] Table 1
[0052]
[0053] S102 missing scene recognition, including:
[0054] The accuracy of the interpolation model may vary due to differences in missing information such as missing rate, missing gap length, and missing mechanism. Therefore, the appropriate interpolation method needs to be based on identifying the characteristics of the missing information of water quality data.
[0055] In order to understand the missing data information, the present invention determines the scenarios that affect the missing data according to the actual data missing situation, identifies the specific attributes or factors that affect the accuracy of data interpolation, and prepares for the subsequent selection of appropriate interpolation methods, such as actively introducing missing values, setting missing scenarios, etc.
[0056] S201 actively introduces missing values, including:
[0057] Based on the missing information identified by S102, as well as specific attributes or factors that affect the accuracy of data interpolation, some data are manually deleted to remove some data information from the data sequence in preparation for subsequent simulation of missing data.
[0058] S202 sets the missing scene, including:
[0059] The present invention mainly considers three types of data missing attributes, namely missing rate, missing gap and missing mechanism, and then sets different missing scenarios according to the combination of different missing attributes.
[0060] The missing rate of the present invention is set to different sizes such as 10%, 20%, 30%, 40%, 50%, etc., the missing gap is set to different lengths such as 10, 15, 20, 25, 30, etc., the missing mechanism is set to two types such as MCAR and MAR, and finally different missing scenarios are set according to the combination of three different missing information.
[0061] For example, taking the missing rate as 10%, the missing intervals as 10, 15, 20, 25, 30, and the missing mechanisms as MCAR and MAR, the corresponding relationships between the combinations of different missing information and the missing scenarios are shown in Table 2.
[0062] Table 2
[0063]
[0064] It can be seen that when the missing rate is 10%, the missing gaps are 10, 15, 20, 25, 30, and the missing mechanisms include MCAR and MAR, 10 missing scenarios can be simulated. Since different missing scenarios use different interpolation methods, a missing model needs to be assigned to each missing scenario.
[0065] S301 single model interpolation of missing data, including:
[0066] According to different missing scenarios set in S202, a single model is used to interpolate missing data for the missing scenarios.
[0067] By analyzing the correlation of all variables, the target variable is selected from the data collected in S101. In order to ensure the fairness of the evaluation of the interpolation effect of different interpolation methods, the present invention uses a single variable with low correlation with other variables as the target variable, and the remaining variables as input variables, so as to establish a regression relationship between the input variable and the target variable and perform data set interpolation.
[0068] According to the constructed regression relationship, the missing values actively set by S201 and the different missing scenarios of S202 are interpolated.
[0069] In the present invention, since the correlation between conductivity and other variables is the lowest, the present invention uses conductivity as the target variable for training the interpolation model proposed by us, and other parameters are used as input variables. When actively introducing missing values, the present invention introduces missing values into the conductivity dataset five times for different missing scenarios.
[0070] The present invention targets data sets with actively introduced missing values and adopts 10 methods in three categories, namely, statistical methods, recursive neural network methods and generative model methods, to perform single model interpolation, specifically including:
[0071] 1. Statistical methods
[0072] Statistical methods can effectively handle simple missing scenarios, and the present invention mainly adopts four statistical methods.
[0073] (1) Mean: replace missing values with the global mean of non-missing data.
[0074] (2) Random Forest Chain Equation Multiple Imputation: Missing data in a dataset is imputed through a series of iterative prediction models. In each iteration, other variables in the dataset are used to estimate each specified variable in the dataset, and these iterations continue until convergence is achieved.
[0075] (3) Matrix supplementation: This is achieved by finding a matrix X that is as different from the observed matrix M as possible while keeping the rank of the matrix X minimal.
[0076] (4) k-nearest neighbor algorithm: The weighted average of the k neighboring values obtained using the k-nearest neighbor algorithm is used as the missing value.
[0077] 2. Recurrent Neural Network Method
[0078] The recursive neural network method performs well in time series data analysis, especially in missing data interpolation. The recursive neural network method interpolates missing data by using the recursive neural network to capture the sequential relationship between observations in time series data. It works well for continuous data interpolation, but poorly for complex data interpolation.
[0079] (1) Multi-resolution wavelet network (MRNN): Use a multi-directional wavelet network to obtain missing values in time series data.
[0080] (2) Bidirectional recurrent time series method (BRITS): The data series is converted into a bidirectional neural network and the missing values are estimated using a bidirectional dynamic cycle.
[0081] (3) Transformer: A neural network model based on the self-attention mechanism that globally models each element in the sequence and establishes connections between elements for interpolation.
[0082] (4) Self-Attention-Based Interpolation of Time Series (SAITS): A joint optimization method is used to interpolate missing values from a weighted combination of two diagonal self-attention blocks.
[0083] (3) Generative modeling approach
[0084] At present, generative modeling methods have become an effective method for filling missing data, which can learn and generate data that reflects the inherent structure and distribution of the original data set. Generative modeling methods can capture the complex relationships between variables, especially when the missing values are not completely random, and can achieve relatively accurate interpolation.
[0085] (1) Generative Adversarial Network Imputation (GAIN): Using a generative adversarial network, missing values are estimated by learning the data distribution from the observed data and treating the missing values as latent variables.
[0086] (2) Multiple Imputation with Denoising Autoencoder (MIDAS): Using a denoising autoencoder, the dimensionality is reduced by destroying and reconstructing data subsets, while the missing values are treated as additional parts of the partial observations for imputation.
[0087] S302 Accuracy assessment of single model interpolation of missing data, including:
[0088] By simulating the interpolation of missing data using a variety of different models, the accuracy of different interpolation models in different missing situations is evaluated.
[0089] The present invention uses Nash efficiency coefficient and root mean square error to evaluate the accuracy of each interpolation model, and compares the interpolation value with the measured value to calculate the two evaluation indicators.
[0090] In some examples, the Nash efficiency coefficient satisfies the following formula:
[0091] .
[0092] in, represents the Nash efficiency coefficient, Indicates the measured value, is the analog value, is the average of the measured values.
[0093] In some examples, the root mean square error satisfies the following formula:
[0094] .
[0095] in, represents the root mean square error.
[0096] S303 Construction of functional relationships between multiple models and multiple missing scenarios, including:
[0097] Based on the accuracy evaluation results of the S302 single model for interpolating missing data, a functional relationship between different missing scenarios and the accuracy of different interpolation models was constructed.
[0098] According to the accuracy evaluation result, the present invention adopts a non-parametric method to construct a nonlinear regression function relationship, and adopts a hierarchical analysis method to determine the weight values of various missing scenarios for each interpolation model in S202.
[0099] The present invention adopts CatBoost algorithm to estimate the nonlinear regression function. The parameters of CatBoost algorithm keep default settings. The regression function is trained using the evaluation result in S302. The type of missing scenario and interpolation model is used as independent variables, and the corresponding interpolation accuracy is used as the dependent variable. After training, the accuracy of each interpolation model in a specific missing scenario can be effectively estimated.
[0100] For example, the corresponding relationship between missing scenes, interpolation models and model weights is as follows: Figure 2 shown.
[0101] S13. Analyze each interpolation model using the hierarchical analysis method to determine the weight value corresponding to each interpolation model.
[0102] In some examples, the sum of the weight values corresponding to the interpolation models of all missing data segments included in the same hydrological and water quality missing data is equal to 1.
[0103] S14. Determine whether the theoretical interpolation data corresponds to the actual interpolation data based on the theoretical interpolation data and the weight value of the interpolation model corresponding to the theoretical interpolation data.
[0104] S15. Perform data interpolation on the missing data of hydrology and water quality based on at least one actual interpolation data to obtain the interpolated missing data of hydrology and water quality.
[0105] In some examples, after obtaining the actual interpolation data corresponding to each missing data segment, the actual interpolation data is interpolated to the corresponding missing data segment, thereby obtaining the interpolated missing hydrological and water quality data.
[0106] For example, the missing data of hydrology and water quality contain two missing data segments, namely missing data segment 1 and missing data segment 2. When the actual interpolation data corresponding to missing data segment 1 is actual interpolation data 1, the actual interpolation data corresponding to missing data segment 2 is actual interpolation data 2. At this time, it is only necessary to interpolate the actual interpolation data 1 to the corresponding missing data segment 1, and interpolate the actual interpolation data 2 to the corresponding missing data segment 2, so as to obtain the interpolated missing data of hydrology and water quality.
[0107] The interpolation method for missing data of hydrology and water quality provided by the embodiment of the present disclosure configures different interpolation models for different missing data segments, thereby performing the following operations on each missing data segment in the missing data of hydrology and water quality: performing data analysis on the missing data segment to determine the missing information corresponding to the missing data segment; determining the missing scenario corresponding to the missing information based on the missing information; determining the interpolation model corresponding to the missing scenario based on the missing scenario; inputting the missing data segment into the corresponding interpolation model for data interpolation to obtain theoretical interpolation data corresponding to the missing data segment. Afterwards, using the hierarchical analysis method to analyze each interpolation model to determine the weight value corresponding to each interpolation model; determining the actual interpolation data corresponding to the theoretical interpolation data based on the theoretical interpolation data and the weight value of the interpolation model corresponding to the theoretical interpolation data; interpolating the missing data of hydrology and water quality based on at least one actual interpolation data to obtain the interpolated missing data of hydrology and water quality, so that the missing data of hydrology and water quality can be interpolated to ensure the integrity of the hydrology and water quality data.
[0108] In some feasible examples, the missing information includes: missing rate, missing gap and missing mechanism; Figure 1 ,like Figure 3 As shown, the above S12 can be specifically implemented through the following S120-122.
[0109] S120, performing the following operations on each missing data segment: performing data analysis on the missing data segment to determine a missing rate that is equal to the ratio of the total number of missing values included in the missing data segment to the total number of data values included in the missing data of hydrology and water quality.
[0110] S121. Perform data analysis on the missing data segments to determine that the missing gap is equal to the total number of missing values included in the missing data segments.
[0111] S122, perform data analysis on the missing data segments to determine the missing mechanism that causes the missing data segments; based on the missing information, determine the missing scenario corresponding to the missing information; based on the missing scenario, determine the interpolation model corresponding to the missing scenario; input the missing data segments into the corresponding interpolation model for data interpolation, and obtain theoretical interpolation data corresponding to the missing data segments. The missing mechanism includes any one of completely random missing, random missing, and non-random missing.
[0112] In some feasible examples, the missing information includes: missing rate, missing gap and missing mechanism; Figure 1 ,like Figure 4 As shown, the above S12 can be specifically implemented through the following S123.
[0113] S123, perform the following operations on each missing data segment: perform data analysis on the missing data segment to determine the missing information corresponding to the missing data segment; based on the missing rate, missing gap and missing mechanism in the missing information, query the pre-configured combination relationship to determine the missing scenario corresponding to the missing information; based on the missing scenario, determine the interpolation model corresponding to the missing scenario; input the missing data segment into the corresponding interpolation model for data interpolation, and obtain the theoretical interpolation data corresponding to the missing data segment. The combination relationship includes the corresponding relationship between the missing rate, missing gap and missing mechanism and the missing scenario.
[0114] In some possible implementation examples, combined with Figure 1 ,like Figure 5 As shown, the above S14 can be specifically implemented through the following S140-S142.
[0115] S140: Compare the weight value of the interpolation model corresponding to the theoretical interpolation data with the target threshold to obtain a comparison weight, where the comparison weight is equal to 0 or 1.
[0116] In some examples, the target threshold may be 0.6. When the weight value is greater than 0.6, the comparison weight is 0; when the weight value is less than or equal to 0.6, the comparison weight is 1.
[0117] S141. Determine a final weight of the theoretical interpolation data based on a weight value of an interpolation model corresponding to at least one theoretical interpolation data and a comparison weight corresponding to the theoretical interpolation data.
[0118] S142. Determine whether the theoretical interpolation data corresponds to the actual interpolation data based on the theoretical interpolation data and the final weight of the theoretical interpolation data.
[0119] In some examples, taking the case where the missing data of hydrology and water quality contain 10 missing data segments as an example, the missing data segments are subjected to the interpolation method of the missing data of hydrology and water quality provided by the embodiment of the present invention to obtain the corresponding actual interpolation data process as follows: Figure 6 shown.
[0120] In some possible implementation examples, combined with Figure 5 ,like Figure 7 As shown, the above S141 can be specifically implemented through the following S1410.
[0121] S1410, bringing the weight value of the interpolation model corresponding to at least one theoretical interpolation data and the comparison weight corresponding to the theoretical interpolation data into a weight formula to obtain a final weight of the theoretical interpolation data; wherein the weight formula includes:
[0122] ;
[0123] in, represents the final weight of the ith theoretical imputation data, represents the comparison weight of the ith theoretical interpolation data, Represents the weight value of the interpolation model corresponding to the i-th theoretical interpolation data.
[0124] In some possible implementation examples, combined with Figure 5 ,like Figure 8 As shown, the above S142 can be specifically implemented through the following S1420.
[0125] S1420, the theoretical interpolation data and the final weight of the theoretical interpolation data are used to determine the actual interpolation data to be brought into the interpolation formula, and the actual interpolation data corresponding to the theoretical interpolation data is determined; wherein the interpolation formula includes:
[0126] ;
[0127] in, represents the actual interpolation data corresponding to the ith theoretical interpolation data, represents the theoretical interpolation data corresponding to the ith theoretical interpolation data, Represents the final weight corresponding to the i-th theoretical imputation data.
[0128] The above mainly introduces the solution provided by the embodiment of the present disclosure from the perspective of the method. In order to achieve the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiment disclosed in this article, the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present disclosure.
[0129] The embodiments of the present disclosure can divide the functional modules of the interpolation device for missing hydrological and water quality data according to the above method examples. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiments of the present disclosure is schematic and is only a logical functional division. There may be other division methods in actual implementation.
[0130] like Fig. 9, which is a schematic diagram of the structure of a device 10 for interpolating missing hydrological and water quality data provided by an embodiment of the present disclosure, including an acquisition unit 101 and a processing unit 102 .
[0131] The acquisition unit 101 is used to acquire missing data of hydrology and water quality; wherein the missing data of hydrology and water quality includes at least one missing data segment; the processing unit 102 is used to perform the following operations on each missing data segment acquired by the acquisition unit 101: perform data analysis on the missing data segment to determine the missing information corresponding to the missing data segment; determine the missing scenario corresponding to the missing information based on the missing information; determine the interpolation model corresponding to the missing scenario based on the missing scenario; input the missing data segment into the corresponding interpolation model for data interpolation to obtain theoretical interpolation data corresponding to the missing data segment; wherein different missing scenarios correspond to different interpolation models; the processing unit 102 is also used to analyze each interpolation model using the hierarchical analysis method to determine the weight value corresponding to each interpolation model; determine the actual interpolation data corresponding to the theoretical interpolation data based on the theoretical interpolation data and the weight value of the interpolation model corresponding to the theoretical interpolation data; the processing unit 102 is also used to perform data interpolation on the missing data of hydrology and water quality acquired by the acquisition unit 101 based on at least one actual interpolation data to obtain the interpolated missing data of hydrology and water quality.
[0132] In some feasible examples, the missing information includes: missing rate, missing gap and missing mechanism; the processing unit 102 is specifically used to perform data analysis on the missing data segments acquired by the acquisition unit 101, and determine that the missing rate is equal to the ratio of the total number of missing values contained in the missing data segments to the total number of data values contained in the hydrological and water quality missing data; the processing unit 102 is specifically used to perform data analysis on the missing data segments acquired by the acquisition unit 101, and determine that the missing gap is equal to the total number of missing values contained in the missing data segments; the processing unit 102 is specifically used to perform data analysis on the missing data segments acquired by the acquisition unit 101, and determine the missing mechanism that causes the missing data segments; wherein the missing mechanism includes any one of completely random missing, random missing and non-random missing.
[0133] In some feasible examples, the missing information includes: missing rate, missing gap and missing mechanism; the processing unit 102 is specifically used to query the pre-configured combination relationship based on the missing rate, missing gap and missing mechanism in the missing information, and determine the missing scenario corresponding to the missing information; wherein the combination relationship includes the correspondence between the missing rate, missing gap and missing mechanism and the missing scenario.
[0134] In some implementable examples, the processing unit 102 is specifically used to compare the weight value of the interpolation model corresponding to the theoretical interpolation data with the target threshold to obtain a comparison weight; wherein the comparison weight is equal to 0 or 1; the processing unit 102 is specifically used to determine the final weight of the theoretical interpolation data based on the weight value of the interpolation model corresponding to at least one theoretical interpolation data and the comparison weight corresponding to the theoretical interpolation data; the processing unit 102 is specifically used to determine that the theoretical interpolation data corresponds to the actual interpolation data based on the theoretical interpolation data and the final weight of the theoretical interpolation data.
[0135] In some implementable examples, the processing unit 102 is specifically used to bring the weight value of the interpolation model corresponding to at least one theoretical interpolation data and the comparison weight corresponding to the theoretical interpolation data into the weight formula to obtain the final weight of the theoretical interpolation data; wherein the weight formula includes:
[0136] ;
[0137] in, represents the final weight of the ith theoretical imputation data, represents the comparison weight of the ith theoretical interpolation data, Represents the weight value of the interpolation model corresponding to the i-th theoretical interpolation data.
[0138] In some implementable examples, the processing unit 102 is specifically used to bring the theoretical interpolation data and the final weight of the theoretical interpolation data into the interpolation formula to determine the actual interpolation data corresponding to the theoretical interpolation data; wherein the interpolation formula includes:
[0139] ;
[0140] in, represents the actual interpolation data corresponding to the ith theoretical interpolation data, represents the theoretical interpolation data corresponding to the ith theoretical interpolation data, Represents the final weight corresponding to the i-th theoretical imputation data.
[0141] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and its role will not be repeated here.
[0142] Of course, the interpolation device 10 for missing hydrological and water quality data provided by the embodiment of the present disclosure includes but is not limited to the above modules, for example, the interpolation device 10 for missing hydrological and water quality data may also include a storage unit 103. The storage unit 103 may be used to store the program code of the interpolation device 10 for missing hydrological and water quality data, and may also be used to store data generated by the interpolation device 10 for missing hydrological and water quality data during operation, such as data in a write request, etc.
[0143] Fig.10 A schematic diagram of the structure of a server provided in an embodiment of the present disclosure is shown in FIG. Fig.10 As shown, the server may include: at least one processor 51 , a memory 52 , a communication interface 53 and a communication bus 54 .
[0144] Combine the following Fig.10 A detailed introduction to each component of the server:
[0145] The processor 51 is the control center of the server, and may be a processor or a general term for multiple processing elements. For example, the processor 51 is a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present disclosure, such as one or more DSPs, or one or more field programmable gate arrays (FPGAs).
[0146] In a specific implementation, as an embodiment, the processor 51 may include one or more CPUs, such as Fig.10 Also, as an embodiment, the electronic device may include multiple processors, such as Fig.10 51 and 55 are shown in FIG. Each of these processors may be a single-core processor (Single-CPU) or a multi-core processor (Multi-CPU). The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0147] The memory 52 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 52 may exist independently and be connected to the processor 51 via a communication bus 54. The memory 52 may also be integrated with the processor 51.
[0148] In a specific implementation, the memory 52 is used to store the data in the present disclosure and execute the software program in the present disclosure. The processor 51 can execute various functions of the air conditioner by running or executing the software program stored in the memory 52 and calling the data stored in the memory 52.
[0149] The communication interface 53 uses any transceiver or other device to communicate with other devices or communication networks, such as a Radio Access Network (RAN), a Wireless Local Area Network (WLAN), a terminal, a cloud, etc. The communication interface 53 may include an acquisition unit to implement an acquisition function.
[0150] The communication bus 54 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0151] As an example, combine Fig. 9The function of the acquisition unit 101 in the interpolation device 10 for missing hydrological and water quality data is similar to Fig.10 The function of the communication interface 53 in the apparatus 10 for interpolating missing hydrological and water quality data is the same as that of the processing unit 102 in the apparatus 10 for interpolating missing hydrological and water quality data. Fig.10 The function of the processor 51 in the apparatus 10 for interpolating missing hydrological and water quality data is the same as that of the storage unit 103 in the apparatus 10 for interpolating missing hydrological and water quality data. Fig.10 The function of the memory 52 in is the same.
[0152] Another embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a computing device, the computing device executes the mode switching method shown in the above method embodiment.
[0153] In some embodiments, the disclosed methods may be implemented as computer program instructions encoded in a machine-readable format on a computer-readable storage medium or on other non-transitory media or articles of manufacture.
[0154] Fig.11 A conceptual partial view of a computer program product provided by an embodiment of the present disclosure is schematically shown, wherein the computer program product includes a computer program for executing a computer process on a computing device.
[0155] In one embodiment, the computer program product is provided using a signal bearing medium 410. The signal bearing medium 410 may include one or more program instructions, which when executed by one or more processors may provide the above-mentioned Figure 1 Thus, for example, reference to Figure 1 In the embodiment shown in , one or more features of S11-S14 can be undertaken by one or more instructions associated with the signal bearing medium 410. In addition, Fig.11 The program instructions in also describe example instructions.
[0156] In some examples, signal bearing medium 410 may include computer readable medium 411 such as, but not limited to, a hard drive, a compact disk (CD), a digital video disk (DVD), a digital tape, a memory, a read-only memory (ROM), a random access memory (RAM), and the like.
[0157] In some implementations, signal bearing medium 410 may include computer recordable medium 412 such as, but not limited to, memory, read / write (R / W) CD, R / W DVD, and the like.
[0158] In some implementations, signal bearing medium 410 may include communication medium 413 such as, but not limited to, digital and / or analog communication media (eg, fiber optic cables, waveguides, wired communication links, wireless communication links, etc.).
[0159] Signal bearing medium 410 may be communicated by a wireless form of communication medium 413 (eg, wireless communication medium complying with IEEE 802.41 standards or other transmission protocols).The one or more program instructions may be, for example, computing device executable instructions or logic implementing instructions.
[0160] In some examples, such as for Fig.11 The described apparatus 10 for interpolating missing hydrological and water quality data may be configured to provide various operations, functions, or actions in response to one or more program instructions in a computer-readable medium 411 , a computer-recordable medium 412 , and / or a communication medium 413 .
[0161] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0162] In the several embodiments provided in the present disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0163] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0164] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0165] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks or optical disks.
[0166] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for interpolating missing hydrological and water quality data, characterized in that: include: Acquire missing data of hydrology and water quality; wherein the missing data of hydrology and water quality includes at least one missing data segment; Perform the following operations on each missing data segment: perform data analysis on the missing data segment to determine that the missing rate is equal to the ratio of the total number of missing values contained in the missing data segment to the total number of data values contained in the hydrological and water quality missing data; perform data analysis on the missing data segment to determine that the missing gap is equal to the total number of missing values contained in the missing data segment; perform data analysis on the missing data segment to determine the missing mechanism causing the missing data segment; wherein the missing mechanism includes any one of completely random missing, random missing and non-random missing; based on the missing rate, missing gap and missing mechanism in the missing information, query the pre-configured combination relationship to determine the missing scenario corresponding to the missing information; wherein the combination relationship includes the missing rate, missing gap and missing mechanism The correspondence between the three and the missing scenario; based on the missing scenario, determining the interpolation model corresponding to the missing scenario; inputting the missing data segment into the corresponding interpolation model for data interpolation, and obtaining the theoretical interpolation data corresponding to the missing data segment; wherein different missing scenarios correspond to different interpolation models, and the training process of the interpolation model is as follows: S1 collects data, S2 sets missing data, and S3 establishes an interpolation model for missing data interpolation, wherein S1 collects data including collecting data from the real environment and arranging it into a structured data set according to a time sequence format, wherein collecting data from the real environment includes collecting water quality data of rivers, and the data types contained in the water quality data include water temperature, pH value, conductivity, dissolved oxygen, turbidity, flow rate, rainfall, total nitrogen, total phosphorus, and total organic carbon; Analyzing each of the interpolation models using the hierarchical analysis method to determine a weight value corresponding to each of the interpolation models; Determining whether the theoretical interpolation data corresponds to actual interpolation data based on the theoretical interpolation data and a weight value of an interpolation model corresponding to the theoretical interpolation data; The missing hydrological and water quality data are interpolated based on at least one of the actual interpolation data to obtain the interpolated missing hydrological and water quality data.
2. The method for interpolating missing hydrological and water quality data according to claim 1, characterized in that: The step of determining whether the theoretical interpolation data corresponds to the actual interpolation data based on the theoretical interpolation data and the weight value of the interpolation model corresponding to the theoretical interpolation data comprises: Comparing the weight value of the interpolation model corresponding to the theoretical interpolation data with the target threshold to obtain a comparison weight; wherein the comparison weight is equal to 0 or 1; Determining a final weight of the theoretical interpolation data based on a weight value of an interpolation model corresponding to at least one theoretical interpolation data and a comparison weight corresponding to the theoretical interpolation data; Based on the theoretical interpolation data and the final weight of the theoretical interpolation data, it is determined whether the theoretical interpolation data corresponds to the actual interpolation data.
3. The method for interpolating missing hydrological and water quality data according to claim 2, characterized in that: The determining the final weight of the theoretical interpolation data based on a weight value of an interpolation model corresponding to at least one theoretical interpolation data and a comparison weight corresponding to the theoretical interpolation data comprises: Substitute the weight value of the interpolation model corresponding to at least one theoretical interpolation data and the comparison weight corresponding to the theoretical interpolation data into the weight formula to obtain the final weight of the theoretical interpolation data; wherein the weight formula includes: ; in, represents the final weight of the ith theoretical imputation data, represents the comparison weight of the ith theoretical interpolation data, Represents the weight value of the interpolation model corresponding to the i-th theoretical interpolation data.
4. The method for interpolating missing hydrological and water quality data according to claim 2, characterized in that: The step of determining, based on the theoretical interpolation data and the final weight of the theoretical interpolation data, that the theoretical interpolation data corresponds to the actual interpolation data comprises: The theoretical interpolation data and the final weight of the theoretical interpolation data are used to determine the actual interpolation data to be brought into the interpolation formula to determine the actual interpolation data corresponding to the theoretical interpolation data; wherein the interpolation formula includes: ; in, represents the actual interpolation data corresponding to the ith theoretical interpolation data, represents the theoretical interpolation data corresponding to the ith theoretical interpolation data, Represents the final weight corresponding to the i-th theoretical imputation data.
5. A device for interpolating missing hydrological and water quality data, characterized in that: include: An acquisition unit, used for acquiring missing data of hydrology and water quality; wherein the missing data of hydrology and water quality includes at least one missing data segment; a processing unit, configured to perform the following operations on each missing data segment acquired by the acquisition unit: performing data analysis on the missing data segment acquired by the acquisition unit to determine a missing rate equal to a ratio of a total number of missing values included in the missing data segment to a total number of data values included in the hydrological and water quality missing data; Performing data analysis on the missing data fragments acquired by the acquisition unit to determine that the missing gap is equal to the total number of missing values contained in the missing data fragments; performing data analysis on the missing data fragments acquired by the acquisition unit to determine the missing mechanism causing the missing data fragments; wherein the missing mechanism includes any one of completely random missing, random missing and non-random missing; based on the missing rate, missing gap and missing mechanism in the missing information, querying a pre-configured combination relationship to determine the missing scenario corresponding to the missing information; wherein the combination relationship includes the corresponding relationship between the missing rate, missing gap and missing mechanism and the missing scenario; based on the missing scenario, determining the missing scenario corresponding to the missing scenario interpolation model; inputting the missing data fragment into the corresponding interpolation model for data interpolation to obtain theoretical interpolation data corresponding to the missing data fragment; wherein different missing scenarios correspond to different interpolation models, and the training process of the interpolation model is as follows: S1 collects data, S2 sets missing data, and S3 establishes an interpolation model for missing data interpolation, wherein S1 collects data including collecting data from a real environment and arranging it into a structured data set in a time sequence format, wherein collecting data from a real environment includes collecting water quality data of a river, and the data types included in the water quality data include water temperature, pH value, conductivity, dissolved oxygen, turbidity, flow rate, rainfall, total nitrogen, total phosphorus, and total organic carbon; The processing unit is further used to analyze each of the interpolation models using a hierarchical analysis method to determine a weight value corresponding to each of the interpolation models; Determining whether the theoretical interpolation data corresponds to actual interpolation data based on the theoretical interpolation data and a weight value of an interpolation model corresponding to the theoretical interpolation data; The processing unit is further used to perform data interpolation on the missing hydrological and water quality data acquired by the acquisition unit based on at least one of the actual interpolation data to obtain the interpolated missing hydrological and water quality data.
6. An electronic device, characterized in that: include: A memory and a processor, wherein the memory is used to store a computer program; and the processor is used to enable the electronic device to implement the method for interpolating missing hydrological and water quality data as described in any one of claims 1 to 4 when executing the computer program.
7. A computer-readable storage medium, characterized in that: include: The computer-readable storage medium stores a computer program, and when the computer program is executed by a computing device, the computing device implements the method for interpolating missing hydrological and water quality data as described in any one of claims 1 to 4.
