Real-time water level and flow data checking and correcting method based on historical water regimen
By constructing a historical hydrological sample database and a sensitive feature factor database, and utilizing the similarity weight of associated stations and comprehensive similarity calculation, abnormal data is automatically corrected, solving the problems of misjudgment and omission in water level and flow data inspection in existing technologies, and improving the adaptability and accuracy of data inspection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BUREAU OF HYDROLOGY CHANGJIANG WATER RESOURCES COMMISSION
- Filing Date
- 2026-01-12
- Publication Date
- 2026-05-08
AI Technical Summary
Existing methods for checking and correcting real-time water level and flow data rely on fixed thresholds for judgment, without considering the spatiotemporal correlation and historical similarity patterns of watershed water conditions. They have limited feature considerations, lack in-depth utilization of historical data, and lack effective means of correcting abnormal data, resulting in frequent misjudgments and omissions, and low efficiency.
A historical hydrological sample database and a sensitive feature factor database are constructed. By using the similarity weight of associated stations and the comprehensive similarity calculation, combined with the similarity-reasonableness mapping model and the nearest neighbor sample set, multi-dimensional feature extraction and screening are achieved, and abnormal data is automatically corrected.
It has improved the adaptability and accuracy of data inspection, reduced misjudgments and omissions, increased the efficiency of abnormal data processing, and enhanced the reliability and decision support capabilities of hydrological monitoring data.
Smart Images

Figure CN121997066A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hydrological monitoring data processing technology, and in particular to a method for checking and correcting real-time water level and flow data based on historical hydrological conditions. Background Technology
[0002] Hydrological monitoring data (especially water level and flow data) are core foundational data for flood and drought disaster prevention, water resource allocation, water ecological protection, and water conservancy project operation and management. During real-time monitoring, the data is susceptible to factors such as monitoring equipment failure, insufficient equipment stability, extreme environmental interference, and human operational errors, resulting in abnormal deviations from the true water situation. Abnormal data not only affects the use of real-time water level and flow data but also impacts the scientific validity of hydrological analysis and water conservancy decision-making.
[0003] The existing methods for checking and correcting the rationality of real-time water level and flow data mainly have the following problems: First, it relies heavily on fixed thresholds for judgment, identifying anomalies solely by setting upper and lower limits or change rate thresholds for water levels and flow rates. It fails to consider the spatiotemporal correlation and historical similarity patterns of watershed hydrological conditions, making it prone to misjudging reasonable fluctuations under complex hydrological conditions and missing slowly changing anomalies.
[0004] Second, the characteristics considered are too simplistic, often focusing only on isolated data such as water level or flow rate without taking into account key influencing factors such as previous water conditions, resulting in insufficient basis for judgment.
[0005] Third, there is a lack of in-depth utilization of historical data, and no deep correlation has been established between real-time hydrological conditions and similar historical hydrological conditions. It is difficult to distinguish between reasonable extreme values and abnormal data, resulting in insufficient adaptability and accuracy.
[0006] Fourth, there is a lack of effective means to correct abnormal data. Abnormal data still needs to be corrected manually based on experience, which is inefficient. Summary of the Invention
[0007] Therefore, it is necessary for the present invention to provide a method for checking and correcting real-time water level and flow data based on historical water conditions, in order to solve at least one of the above-mentioned technical problems.
[0008] To achieve the above objectives, a method for checking and correcting real-time water level and flow rate data based on historical hydrological conditions includes the following steps: Step S1: Obtain historical hydrological monitoring data of the target watershed and construct a historical hydrological sample database; extract multi-dimensional feature factors for each sample based on the historical hydrological sample database and construct a sensitive feature factor database; Step S2: Extract historical hydrological feature vectors based on the sensitive feature factor library to form a set of associated station data; calculate the similarity weight set between each associated station and the target station based on the set of associated station data; Step S3: Obtain real-time hydrological monitoring data for the target station; Step S4: Calculate the comprehensive similarity between real-time hydrological monitoring data and historical samples based on the similarity weight set and the associated station data set; Step S5: Construct a similarity-reasonableness mapping model, input the comprehensive similarity, output the reasonableness label, and determine the reasonableness threshold; Step S6: Calculate the reasonable probability of all samples in the historical water situation sample database, and sort them in descending order according to the comprehensive similarity to form a nearest neighbor sample set; calculate the comprehensive reasonable probability of the nearest neighbor sample set, and compare it with the reasonableness threshold to generate a reasonableness judgment result.
[0009] This invention, by constructing a historical hydrological sample database and a sensitive feature factor database, achieves the systematic extraction and screening of multi-dimensional, high-order features of hydrological processes. This overcomes the problem of traditional methods considering only one feature, fully integrating water level, flow, rainfall, and their spatiotemporal variations, providing a more comprehensive and explanatory basis for rationality judgment. The introduction of associated station similarity weights and a comprehensive similarity calculation mechanism effectively utilizes the spatiotemporal correlation and historical similarity patterns of watershed hydrological conditions, avoiding misjudgments of reasonable fluctuations in complex hydrological conditions and omissions of slowly changing anomalies, thus improving the adaptability and accuracy of data inspection. By constructing a similarity-rationality mapping model and combining it with the comprehensive rationality probability judgment of nearest neighbor sample sets, deep intelligent discrimination based on historically similar hydrological conditions is achieved, distinguishing reasonable extreme values from real anomalies and reducing reliance on human experience. An automatic iterative correction process based on historically similar samples and a manual review prompt mechanism are designed, enabling automatic and efficient data repair when anomalies are identified, significantly improving the efficiency and systematic nature of anomaly data processing, and enhancing the reliability and decision support capabilities of hydrological monitoring data. Attached Figure Description
[0010] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a flowchart illustrating the steps of a method for checking and correcting real-time water level and flow data based on historical hydrological conditions according to the present invention. Figure 2 This is a schematic diagram of the similarity-reasonableness mapping model; Figure 3 Flowchart for the abnormal data correction and review mechanism. Detailed Implementation
[0011] The technical method of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0012] Furthermore, the accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor methods and / or microcontroller methods.
[0013] It should be understood that although the terms "first," "second," etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are used merely to distinguish one unit from another. For example, without departing from the scope of the exemplary embodiments, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0014] To achieve the above objectives, please refer to Figures 1 to 3 This invention provides a method for checking and correcting real-time water level and flow data based on historical hydrological conditions. The method includes the following steps: Step S1: Obtain historical hydrological monitoring data of the target watershed and construct a historical hydrological sample database; extract multi-dimensional feature factors for each sample based on the historical hydrological sample database and construct a sensitive feature factor database; Step S2: Extract historical hydrological feature vectors based on the sensitive feature factor library to form a set of associated station data; calculate the similarity weight set between each associated station and the target station based on the set of associated station data; Step S3: Obtain real-time hydrological monitoring data for the target station; Step S4: Calculate the comprehensive similarity between real-time hydrological monitoring data and historical samples based on the similarity weight set and the associated station data set; Step S5: Construct a similarity-reasonableness mapping model, input the comprehensive similarity, output the reasonableness label, and determine the reasonableness threshold; Step S6: Calculate the reasonable probability of all samples in the historical hydrological sample database, and sort them in descending order according to comprehensive similarity to form a nearest neighbor sample set; calculate the comprehensive reasonable probability of the nearest neighbor sample set and compare it with the reasonableness threshold to generate a reasonableness judgment result. Particularly important is that constructing the historical hydrological sample database includes: Acquire multi-year integrated water level, flow and rainfall monitoring data of the target watershed to form historical hydrological monitoring data. The hydrological year type in the historical hydrological monitoring data includes high water years, normal water years and low water years. Valid historical hydrological information was screened from historical hydrological monitoring data. For missing data segments, a constrained interpolation method based on the upstream and downstream water balance relationship was used to repair the data. For random missing data, linear interpolation was performed at a preset frequency. The repaired and interpolated historical hydrological monitoring data are compiled into a historical hydrological sample database. Each historical hydrological sample includes time series data of water level for a given period, time series data of flow for a given period, the time range corresponding to the sample, watershed zoning information, and the time of occurrence of the sample.
[0015] In this embodiment of the invention, a fixed-site water level monitoring instrument (with high accuracy) is deployed in the target watershed. 0.01m), ultrasonic flow measuring device (accuracy) 2%), tipping bucket rain gauges (accuracy not less than 0.5 mm), were used to collect water level, flow, and rainfall sequences for a continuous period of ten to twelve years with a uniform sampling cycle of 10 minutes. All monitoring data were divided by calendar year. To ensure consistency in hydrological year classification, each calendar year in the historical hydrological monitoring data was labeled as a wet year, a normal year, or a dry year. The classification method used the multi-year average runoff of the basin as the benchmark: years with a runoff of more than 1.2 times the multi-year average runoff were classified as wet years, those between 0.8 and 1.2 times were classified as normal years, and those below 0.8 times were classified as dry years.
[0016] When historical hydrological monitoring data contains persistently missing periods, the missing data is repaired using a water volume constraint method that links upstream and downstream. This repair method relies on the water balance relationship, where the difference between the cumulative upstream and downstream flow rates within the missing section is considered the change in water storage in that section. A time-period difference allocation method is used to reconstruct the water level and flow curves for the missing section: if the missing length is N sampling periods, the change in water storage is distributed into N equal parts within the missing section, and the reconstructed curve is constrained according to the slope direction of the upstream and downstream sequences of the original time period, ensuring seamless connection with valid monitoring points at both endpoints. This repair method guarantees that the repaired water level and flow process lines maintain continuity in both trend and gradient.
[0017] In single-point data with random missing information, a linear interpolation method is used. Random missing information consists of single- or double-period missing data points. The interpolation method involves constructing a single linear connection between the monitoring point preceding and following the missing point, and then linearly segmenting the data according to the number of missing periods. This method eliminates discrete jumps, ensuring that single-point missing information does not cause a break in the statistical characteristics of subsequent historical hydrological samples. All interpolated data are then reordered and strictly aligned according to the sampling period.
[0018] After completing the missing segment repair and random imputation, all continuous water level data sequences, flow data sequences, and corresponding time period rainfall data are segmented into usable historical hydrological samples by day. Each historical hydrological sample contains four types of elements: (1) Complete time series data of water level for a given period (e.g., 144 10-minute data points from 08:00 to 08:00 the next day). (2) Complete time-series data of traffic flow during the period (also 144 10-minute data points); (3) The actual time range of the sample (e.g., 08:00 on July 14, 2020 to 08:00 on July 15, 2020) serves as a time index for extracting historical event background in subsequent steps; (4) Watershed partition information (coded according to the fixed partition of the target watershed, such as A1, A2, A3). This information is used to filter out irrelevant samples from different partitions in the subsequent similarity calculation. (5) The occurrence time of the sample is used to introduce time decay weights later.
[0019] Of particular importance is the construction of a sensitive feature factor library, which includes: Based on the historical hydrological sample database, multi-dimensional feature factors affecting hydrological conditions are extracted for each historical hydrological sample. These multi-dimensional feature factors include the average water level over the time period, the average flow rate over the time period, the rate of change of water level, the rate of change of flow rate, the peak water level, the peak flow rate, and the rainfall over the time period. Extract high-order statistical features of multi-dimensional feature factors, including skewness and kurtosis of water level process lines, baseflow index of flow processes, and spatiotemporal concentration of rainfall; Sensitivity indices for each factor are calculated based on multi-dimensional feature factors and higher-order statistical features. Based on the sensitivity index of each factor, insensitive factors are removed from the multi-dimensional feature factors and standardized to form a sensitive feature factor library. The factors in the sensitive feature factor library are arranged in descending order of sensitivity index and associated with the corresponding hydrological year type and water potential feature scenarios.
[0020] In this embodiment of the invention, after the historical hydrological sample database is constructed, multi-dimensional feature factors influencing hydrological conditions are extracted for each historical hydrological sample in the database. Each feature factor is based on the sample's time-series water level data, flow rate data, and rainfall data. The mean water level is calculated using the formula for the entire water level sequence of the sample. Calculation, where Indicates the first Water level values for each sampling period This indicates the number of sampling points in the sample. The mean flow rate is averaged from the flow rate series in the same manner. The rate of change of water level is calculated point-by-point, i.e., a rate of change series is constructed using the numerical differences between adjacent sampling points, only the absolute values are taken, and then a representative value is extracted using the average. The rate of change of flow rate is processed in the same way. The peak water level is selected from the maximum value in the entire water level series of the sample; the peak flow rate is selected from the maximum value in the entire flow rate series. The time-period rainfall is the cumulative amount of all rainfall values included in the sample. The cumulative period of rainfall must completely cover the sample time period, and a point-by-point summation method is used.
[0021] After extracting the basic feature factors mentioned above, higher-order statistical features are further extracted from the water level and flow rates of the sample. The skewness of the water level hydrograph is determined using the formula... Calculation, where The standard deviation of a water level series is expressed by... Calculation. The kurtosis of water level is calculated using the fourth-order center-distance ratio. The baseflow index of a flow process is calculated by dividing the minimum flow rate by the average flow rate within the sample, and is used... It means that among them The minimum flow rate in the sample. This represents the average flow rate of the sample. The spatiotemporal concentration of rainfall is calculated as the ratio of the maximum hourly rainfall to the total rainfall during the rainfall period, using... It means that among them The maximum rainfall value for any sampling period within the sample. This represents the cumulative rainfall of the sample. The aforementioned higher-order statistical features, together with the basic feature factors, constitute the complete set of feature factors for this sample.
[0022] After extracting the complete set of characteristic factors from all historical hydrological samples, a sensitivity index is constructed for each characteristic factor. The construction method of the sensitivity index is based on the degree of correlation between the characteristic factor and the dominant change trends of water level and flow within the sample. Specifically, the following steps are taken: First, a sample-by-sample numerical sequence is constructed for each characteristic factor, for example, the mean value of water level is arranged in the order of all samples; then, a sample-by-sample difference correspondence is constructed between this sequence and the target influencing factor (such as water level change or flow change); then, the differences are arranged by absolute value, with a larger difference indicating a more significant correlation between the characteristic factor and the dominant change. Finally, the sorted differences are mapped to a sensitivity index using interval numbering, with the sensitivity index value limited to the range of 0 to 1, where 1 represents the highest sensitivity level and 0 represents the lowest sensitivity level.
[0023] After the sensitivity index is formed, feature factors with a sensitivity index below 0.2 are removed from the entire set. The removed feature factors are then recombined according to their sample numbers to form a set of sensitive feature factors. Since different feature factors have different dimensions, a unified scale is needed in the subsequent similarity construction. Therefore, standard deviation normalization is used to standardize each retained feature factor.
[0024] After standardization, the sensitivity factors are sorted from high to low according to their sensitivity index to obtain the final sensitive feature factor library. This sensitive feature factor library needs to strictly label the hydrological year type (high water year, normal water year, low water year) and water potential characteristic scenario (rapid rise, rapid fall, slow rise, slow fall) corresponding to each factor.
[0025] Preferably, step S2 includes: Extract sensitive feature factors from the sensitive feature factor library that are associated with the target site to form a set of associated site feature factors; The feature factor set of associated stations is mapped to the historical hydrological sample database to form a set of historical hydrological feature vectors of associated stations. Cluster analysis is performed on the set of historical hydrological feature vectors to form the similarity of hydrological features between stations; Based on the similarity of hydrological characteristics, the target watershed is divided into several sets of hydrological associated stations, forming a set of associated station data; Calculate the similarity score between the target site and each associated site based on the associated site data set, and generate a site similarity set; Assign weights to each associated site in the site similarity set to determine the similarity weight set; The weight value of each associated site is positively correlated with its corresponding similarity, and the sum of the weights of all associated sites is 1.
[0026] In this embodiment of the invention, the sensitive feature factor library constructed in step S1 stores a corresponding sensitive feature factor sequence for each station. To extract the sensitive feature factors of associated stations of the target station, the station numbers in the sensitive feature factor library that are in the same or adjacent zones as the target station are first screened out according to the watershed zoning code. This screening method uses the "zoning code field" in the station attribute table to extract the station list by full matching and adjacent zone matching. The obtained station list is used to extract all sensitive feature factors of the corresponding station from the sensitive feature factor library to form a set of associated station feature factors. The set of associated station feature factors is combined in the form of data columns, with each column representing a sensitive factor and each row corresponding to a historical sample number.
[0027] To map the feature factor set of associated stations to the historical hydrological sample database, the sample number table in the database is used as the mapping index. The mapping method is as follows: traverse each feature factor sequence in the feature factor set of the associated stations, and insert the feature value into the corresponding feature vector position of the sample by referring to the sample number table. Each historical hydrological sample ultimately forms a historical hydrological feature vector of the associated station, which contains all extracted sensitive feature factors. All feature vectors constitute the historical hydrological feature vector set of the associated stations.
[0028] After constructing the feature vector set, cluster analysis is performed on this set to determine the similarity of hydrological features among stations. The cluster analysis adopts the K-means grouping process: first, the number of clusters K is set to 3, 4, or 5, with the upper limit of K not exceeding 5 to avoid excessive dispersion of hydrological samples; then, several features are randomly selected from the historical hydrological feature vector set as initial centroids; finally, the Euclidean distance formula is used. Measure the distance between each feature vector and the center point, where and These represent the values of different feature factors in the sample. This represents the number of feature factors. A smaller Euclidean distance indicates a more similar hydrological pattern. The feature vectors with the smallest distance are grouped into the same group, and the center point is updated. This distance measurement process is repeated until each group stabilizes. Finally, the similarity of hydrological features between stations is generated, represented by the group number and the average distance between groups.
[0029] Based on the aforementioned similarity of hydrological characteristics, the target watershed is divided into multiple sets of hydrologically associated stations. The division method is as follows: stations are classified according to the group number to which their historical feature vectors belong, ensuring that stations within the same group have similar hydrological response patterns. Each group forms a set of hydrologically associated stations, and all sets together constitute the associated station dataset.
[0030] After the associated site data set is formed, a similarity score is calculated between the target site and each associated site. The similarity score uses a reciprocal distance method: first, a distance score is constructed based on the average Euclidean distance between the target site and an associated site in the historical hydrological feature vector set; then, the reciprocal of this distance is taken as the similarity score. To avoid meaningless infinity when the distance is zero, the minimum distance is set to 0.001. When the average distance between the target site and an associated site is... When, similarity is defined as ,in This is the distance value. This represents the similarity value. All similarities constitute the site similarity set.
[0031] To construct a similarity weight set, each similarity in the site similarity set is assigned a weight proportional to its ratio to the total similarity of all related sites. Let the sum of the similarities of all related sites be... ,in For the first Similarity between related sites Let be the number of associated sites. Then the weight of each associated site is: ,in The weights for each site are all within the range of 0 to 1, and all weights satisfy the following conditions. This set of weights is used as the final set of similarity weights.
[0032] In another embodiment, this can also be achieved using historical samples across multiple time scales. The sensitive feature factor library is used to filter out station numbers within the same river system as the target station by hourly-scale feature factors, forming an initial list of associated stations. Subsequently, all sensitive feature factors are extracted for each station in the initial list and stored in a three-dimensional table structure, where the dimensions represent the station number, sample number, and factor number, respectively, thus forming a set of associated station feature factors.
[0033] Using the historical hydrological sample database as a mapping index, the above table structure is mapped into feature vector form according to the sample number, thus forming a set of historical hydrological feature vectors.
[0034] After the construction is complete, the feature vector set is grouped using the DBSCAN density grouping process, based on a distance threshold. Limit the grouping range. The value is set to no more than 0.5 on an hourly scale. After grouping, the similarity of hydrological characteristics among stations within the same group is expressed as the average distance within the group.
[0035] A set of hydrological associated stations is constructed based on the grouping results. Then, the similarity of each associated station is calculated using a reciprocal distance array. Subsequently, weights are constructed proportionally so that the sum of all weights is strictly 1.
[0036] Preferably, step S3 further includes: Outliers in real-time hydrological monitoring data are removed, and linear interpolation is performed to generate a real-time continuous sequence. Based on the factor dimensions in the sensitive feature factor library, the real-time mean water level, water level change rate, and water level peak value of the real-time continuous sequence are extracted to form a real-time water level feature factor set; Based on the factor dimensions in the sensitive feature factor library, extract the real-time flow mean, flow change rate, and flow peak of the real-time continuous sequence to form a real-time flow feature factor set; Extract the corresponding time period rainfall from the real-time continuous sequence to form a set of real-time rainfall feature factors; Real-time hydrological characteristic factors are constructed using real-time water level characteristic factor set, real-time flow characteristic factor set, and real-time rainfall characteristic factor set.
[0037] In this embodiment of the invention, real-time hydrological monitoring data has been acquired in step S3, forming real-time water level, real-time flow, and real-time rainfall sequences with timestamps. Since abnormal jumps, noise pulses, and short-term loss of measurement points may occur during real-time acquisition, outliers in the real-time hydrological monitoring data need to be removed and a continuous sequence constructed to ensure the accuracy of subsequent feature factor extraction. Outlier removal employs a threshold boundary method: the highest and lowest values of the real-time water level sequence are extracted using a 30-minute window. When the deviation of the water level value at a sampling point from the window average exceeds 1.5 times the window standard deviation, that point is marked as an outlier. The flow sequence is treated in the same way. For the rainfall sequence, due to its significant numerical dispersion, points with a difference exceeding 10 mm between consecutive periods are marked as outliers. After outlier removal, their positions are repaired using linear interpolation, i.e., a linear interval between the previous and next valid point values is constructed, and the sampled values of missing points are inserted proportionally to this linear interval. This method ensures that all real-time sequences are continuous and gap-free in the time dimension, forming a real-time continuous sequence.
[0038] Based on the factor dimensions of the sensitive feature factor library, the real-time average water level, water level change rate, and peak water level are extracted from the real-time continuous sequence. The real-time average water level is calculated using the formula... Calculation, where For the real-time continuous sequence Real-time water level values for each sampling period. This represents the number of real-time sampling periods. The water level change rate is calculated using a point-by-point difference method, that is, the difference sequence of adjacent sampling points in the real-time continuous sequence is calculated by averaging the absolute values to obtain the representative value of the real-time change rate. The peak water level is the maximum value of all water level values in the real-time continuous sequence. These three indicators together constitute the real-time water level characteristic factor set.
[0039] The extraction methods for real-time average flow, real-time flow rate of change, and real-time peak flow are exactly the same as those for water level. The real-time average flow is obtained using... ,in This is a real-time continuous sequence of flow rate values. The flow rate change is calculated by averaging the absolute values of the differences between adjacent sampling points, and the peak flow rate is the maximum value in the sequence. These three indicators together constitute the set of real-time flow rate characteristic factors.
[0040] Rainfall characteristics in real-time continuous sequences are expressed as time-period rainfall amounts, which are obtained by accumulating the real-time rainfall sequences one by one according to the sampling period. ,in This represents each rainfall value in a real-time continuous sequence. This accumulated amount constitutes a set of real-time rainfall feature factors.
[0041] Real-time hydrological feature factors are constructed using real-time water level feature factor sets, real-time flow feature factor sets, and real-time rainfall feature factor sets. The construction method involves arranging all factors involved in the three feature factor sets into a unified vector structure, with each factor occupying a fixed position, ensuring that it maintains dimensionality consistency with the sensitive feature factor library.
[0042] Preferably, step S4 includes: The multidimensional gap between real-time hydrological monitoring data and historical samples is calculated based on the similarity weight set and the associated site data set; The results of the multi-dimensional gap calculation are normalized. Based on the negative exponential decay mapping relationship, the difference normalization result is converted into a similarity index, and all similarity indices are integrated to form a similarity index vector. Identify the types of hydrological events corresponding to real-time hydrological monitoring data. Hydrological event types include peak flood events, low water events, and stable events. Extract the dynamic weight allocation scheme corresponding to the preset event type-weight mapping table based on the hydrological event type; A dynamic weighting scheme is used to weight the similarity index vector to form a similarity vector corresponding to the hydrological event. Calculate the time decay weights for historical samples; The similarity vector and time decay weight are combined into a comprehensive similarity score.
[0043] In this embodiment of the invention, in order to perform multidimensional difference calculation, the differences between the real-time sensitive feature factor and each historical sample in six categories of indicators, namely, mean water level, mean flow rate, rate of change of water level, rate of change of flow rate, peak value, and rainfall, are quantified one by one.
[0044] The formula for calculating the mean water level difference is: ,in The average water level for the real-time monitoring period is the result calculated in step S3 based on the measured time-series data. This represents the average water level over a historical sample period. The absolute difference between the real-time and historical average water levels is used to characterize the degree of difference between the two in this dimension. The formula for calculating the mean difference in flow rate is: ,in This represents the average traffic volume over a real-time period. The average flow rate over the historical sample period is... The absolute difference between the average traffic of the two; The formula for calculating the difference in water level change rate is: ,in For the real-time water level at the Rate of change over a period of time The historical water level at the 1st Rate of change over a period of time The total number of time periods in the rate of change series. The average absolute difference between the real-time and historical rates of water level change; The formula for calculating the difference in flow rate change is: ,in For real-time traffic in the first Rate of change over a period of time For historical traffic in the first Rate of change over a period of time The total number of time periods in the rate of change series. The average absolute difference between the real-time and historical traffic change rates; The formula for calculating peak difference is: , ,in In order to monitor peak water levels in real time, The peak water level is the historical sample. To monitor traffic peaks in real time, The peak traffic volume is the historical sample. The difference between peak water levels. This represents the difference in peak traffic volume. The formula for calculating the difference in rainfall is: ,in For real-time rainfall, This is the historical rainfall. This represents the highest rainfall recorded in the historical sample database. The minimum rainfall in the historical sample database, The difference is due to rainfall.
[0045] Normalize the differences across all dimensions, and let the first dimension be the first in the multidimensional difference set. The original difference value of each feature factor is The maximum difference in the historical sample set on this feature factor is The minimum difference value is The normalization formula is: ,in For the first Normalized gap index of each characteristic factor.
[0046] When converting the normalized difference index into a similarity index, a negative exponential decay method is used, so that the larger the difference, the lower the similarity, and the smaller the difference, the higher the similarity.
[0047] The similarity indices of all feature factors are combined in a fixed order to form a similarity index vector between real-time hydrological conditions and historical samples.
[0048] Based on the water level and flow characteristics extracted from real-time continuous sequences, combined with their changing trends and extreme values, the type of hydrological event for the current period is determined. Hydrological events are classified into at least three categories: peak flood events, low water events, and stable events.
[0049] The criteria for identifying a flood peak are: a continuous upward segment in the real-time flow sequence, with the peak flow exceeding 1.5 times the historical average flow for the same period, and the water level change rate remaining positive; the criteria for identifying a low-water period are: a real-time flow consistently below 1.2 times the historical lowest flow for the same period, and the water level changing slowly or showing a gradual downward trend; and the criteria for identifying a stable period are: flow and water level fluctuating slightly around the historical average for the same period, with the absolute value of the change rate both below a preset threshold.
[0050] During the construction phase of the historical hydrological sample database, based on the hydrological event type (peak flood, low water, stable water) labeled in each sample, the correlation strength between each characteristic factor (such as mean water level, rate of change of water level, peak water level, mean flow, rate of change of flow, peak flow, and periodic rainfall) and the sample's rationality label was statistically analyzed for each type of event. The correlation strength was quantified using mutual information or regression coefficients and normalized to form the initial weight vector of the characteristic factors under each event type.
[0051] The initial weight vector is then fused and corrected with expert experience rules, and finally solidified and stored as an event type-weight mapping table. This mapping table is indexed by event type, with each record corresponding to a feature factor weight allocation scheme, and the sum of all weight values is 1.
[0052] Based on the identified hydrological event type, the corresponding weight allocation scheme is dynamically retrieved from the mapping table. For example, if it is identified as a "flood peak process", the weights of the "peak water level" and "flow rate change" factors in the retrieved scheme are significantly higher than those of the "average water level"; if it is identified as a "dry season", the weights of the "average flow" and "average water level" are relatively increased.
[0053] An element-wise weighted approach is used to calculate the similarity vector for event adaptation. The similarity vector reflects the contribution of the similarity of each feature dimension to the overall similarity in the context of a specific hydrological event.
[0054] To reflect the timeliness of historical samples, a time decay weight needs to be assigned to each historical sample before calculating the overall similarity. This time decay weight is determined based on the required time decay. Calculation, where For historical samples, the time decay weights are used. The time difference between historical samples and the current monitoring time. The decay rate parameter has a value range limited to [value range missing]. between.
[0055] The similarity index vector is weighted and fused with a time decay weight to obtain a comprehensive similarity score. The comprehensive similarity score is calculated using... Calculation, where The comprehensive similarity between historical samples and real-time water conditions. This is the time decay weight for the historical sample. For the first The similarity weights of each feature factor For the first Similarity index of individual feature factors.
[0056] Preferably, the difference normalization result is converted into a similarity index based on the negative exponential decay mapping relationship, and the specific conversion formula is as follows: ; in, This is a similarity index vector. , For the first The difference normalization result of each feature factor; The larger the similarity index vector, the higher the similarity between real-time water conditions and historical samples on that factor.
[0057] In this embodiment of the invention, the multidimensional difference calculation between real-time hydrological characteristic factors and historical hydrological sample characteristic factors has been completed in the previous stage of step S4, and the differences of all factors have been normalized so that the normalized difference result of each characteristic factor is in the range of 0 to 1. Based on this, a negative exponential decay formula is used to convert the difference normalization result into a similarity index.
[0058] The mapping method follows the formula ,in For the first A similarity index formed by individual feature factors , For the first The difference normalization result of each feature factor is the standardized difference between real-time samples and historical samples. The coefficient 3.8 is a constant value used to control the decay rate, so that the larger the normalized difference, the faster the decay. The exponential operation keeps the similarity between 0 and 1.
[0059] First, a normalized difference sequence is constructed along the feature factor dimension. For example, when the sensitive feature factor library contains seven factors: mean water level, rate of change of water level, peak water level, mean flow rate, rate of change of flow rate, peak flow rate, and periodic rainfall, a normalized difference vector of length seven is generated. Substitute each difference value into the formula for exponential mapping. Taking the water level change rate factor as an example, when its normalized difference is 0.25, the mapping result is: The calculated similarity index value represents the degree of similarity between the real-time water level change rate and historical samples. All seven factors are independently mapped in this manner, and the combined values form a similarity index vector.
[0060] Preferably, step S5 includes: Extract the comprehensive similarity and corresponding reasonableness labels of each sample in the historical water information sample database as the training sample set; The weight vector of the similarity-reasonableness mapping model is solved by the SCE-UA optimization algorithm. The weight vector reflects the contribution of the similarity of each feature factor to the reasonableness judgment. Extract systematic error information from training samples to form residual correction values; By arranging the weight vector and residual correction values in a unified manner, a similarity-reasonableness mapping model is constructed. The model takes a similarity score as input and outputs a reasonableness label, which includes reasonable and abnormal labels. Based on hydrological year type and water condition type, the rationality labels are categorized and a rationality probability distribution is formed; Extract the confidence interval probability corresponding to the target hydrological year type from the reasonableness probability distribution, and determine the reasonableness threshold.
[0061] In this embodiment of the invention, two elements for each sample are first extracted from the historical hydrological sample database: comprehensive similarity and the corresponding rationality label. The rationality label is derived from the compilation and review of historical data, and the label only includes two categories: "rational" and "abnormal," and is stored on a daily scale. After extraction, a training sample set is formed, and each record contains a comprehensive similarity value and a rationality label value, for example: "0.83 - rational," "0.27 - abnormal," and "0.91 - rational."
[0062] After the training sample set is constructed, the weight vector in the similarity-reasonableness mapping structure is solved using the SCE-UA optimization method. During the solution process, the comprehensive similarity is used as input, the reasonableness label as the discrimination target, and the weight vector as the parameter to be determined. Through multiple iterations during optimization, the weight vector gradually converges, thereby gradually reducing the mapping error between the comprehensive similarity and reasonableness label in the training sample set. Each component in the weight vector is limited to the interval between 0 and 1, representing the contribution of that similarity dimension to the reasonableness judgment. Since the comprehensive similarity itself is already the result of feature association, similarity index, and time decay fusion, the weight vector has only one dimension, forming a single weight value. Its value is limited to the range of 0 to 1.
[0063] After solving for the weight vector, systematic error information is calculated from the training sample set. Specifically, the difference between the mapping result and the true reasonableness label of all training samples is averaged to form a residual correction value. The residual correction value is limited to the range of -1 to 1 and is used to compensate for the systematic bias of the mapping structure during the training process.
[0064] The weight vectors and residual correction values are then arranged in a unified manner to form a similarity-reasonableness mapping structure. The input to this structure is the comprehensive similarity. The output is the reasonableness judgment value. and through Linear relation expression, where These are the weight values in the weight vector, ranging from 0 to 1. To assess overall similarity, This is the residual correction value, used to compensate for deviations. This is a reasonable estimate.
[0065] The method for determining the rationality label is to... Compare with a threshold. When If the value is above the threshold, it is considered "reasonable"; if the value is below the threshold, it is considered "abnormal".
[0066] To construct the threshold, all historical samples need to be grouped according to hydrological year type and water condition type (high-water year, normal-water year, low-water year). The proportion of all "reasonable" labels within each category is calculated to form a probability distribution of reasonableness. For example, for high-water year samples, the proportion of all samples meeting the reasonableness label within that year is calculated and arranged in chronological order to ensure the stability of the probability sequence.
[0067] Subsequently, the probability of the target hydrological year type corresponding to the reasonableness probability distribution is extracted. Taking a 95% confidence level as an example, the probability range between 2.5% and 97.5% in the statistical distribution is used, and the lower limit is taken as the reasonableness threshold. This threshold is controlled between 0 and 1 to distinguish whether real-time data deviates from the historical reasonable range.
[0068] Finally, when the comprehensive similarity is input into the similarity-reasonableness mapping structure, a reasonableness estimate is obtained through linear calculation, and then compared with the threshold to generate the final reasonableness label.
[0069] Preferably, step S6 involves calculating the reasonable probability between real-time hydrological monitoring data and all samples in the historical hydrological sample database, and sorting them in descending order based on comprehensive similarity to form a nearest neighbor sample set, including: Extract all samples with reasonable labels from the historical water situation sample database to form a historical reasonable sample sequence; Convert the ratio of the number of samples in a historical reasonable sample sequence to the total number of samples into a reasonable probability; All historical samples are sorted in descending order based on reasonable probability and comprehensive similarity to generate a candidate sequence of nearest neighbor samples. Select the top K historical samples of the nearest neighbor candidate sequence, and denote them as the nearest neighbor sample set.
[0070] In this embodiment of the invention, the samples in the historical hydrological sample database are first screened for rationality. Each sample in the historical hydrological sample database has been labeled with a rationality tag of "rational" or "abnormal" during the initial compilation process. All samples labeled "rational" are extracted from the sample database to form a historical rational sample sequence. This sequence is arranged in order of sample number, and each sample contains all its corresponding characteristic factors, time information, and hydrological year type classification.
[0071] Subsequently, the overall reasonable probability of the historical hydrological sample database is calculated. The reasonable probability is calculated by counting the total number of samples in the historical reasonable sample sequence, then dividing it by the total number of samples in the historical hydrological sample database, resulting in a probability value between 0 and 1. This probability value reflects the prevalence of normal hydrological conditions in the target watershed during historical monitoring, serving as a background reference for subsequent reasonableness assessments.
[0072] After obtaining reasonable probabilities, for each sample in the historical hydrological sample database, its comprehensive similarity to real-time hydrological data (calculated in step S4) is used as the ranking criterion. The ranking rule adopts a descending order, meaning samples with higher comprehensive similarity rank higher. Simultaneously, the influence of reasonable probabilities is embedded in the ranking process: for samples with similar comprehensive similarity, those with a "reasonable" reasonableness label receive priority ranking weight. This rule is used to rearrange all historical samples, generating an ordered sequence of nearest neighbor candidate samples.
[0073] Finally, starting from the beginning of the nearest neighbor candidate sequence, the top K historical samples are selected and defined as the nearest neighbor sample set. The value of K is determined through an adaptive method to ensure that the selected samples are highly similar to the real-time water conditions in terms of features and have reasonable historical performance.
[0074] Preferably, the top K historical samples of the nearest neighbor candidate sequence are selected and denoted as the nearest neighbor sample set, where the number K of the nearest neighbor samples is determined by the following adaptive method: Calculate the inflection point of the comprehensive similarity sequence of the nearest neighbor candidate sequences, and define the descent gradient of the comprehensive similarity at the inflection point as exceeding a preset threshold; The initial sample size before the inflection point is determined to be k; Calculate the mean overall similarity of the first k samples. ; Calculate the dynamic time-warped distance between the real-time hydrological time-series data and the historical hydrological time-series data for the first k samples, and calculate their mean. ; Set timing matching threshold ; like and Then K = k; Otherwise, increase the number of samples sequentially, and recalculate the mean comprehensive similarity and mean dynamic time-warped distance of the current sample set after each increase, until the condition is met. and Let the current number of samples be K; in, This is the minimum acceptable mean similarity value preset based on the hydrological characteristics of the target station. This is the maximum acceptable temporal difference threshold preset based on the fluctuation characteristics of hydrological processes.
[0075] In this embodiment of the invention, to determine the number K of nearest neighbor samples, the comprehensive similarity values of all historical samples in the candidate sequence are first arranged in descending order, and all comprehensive similarities are used to form a comprehensive similarity sequence. The descent gradient of adjacent terms in the comprehensive similarity sequence is calculated sequentially, and the descent gradient is defined as the difference between adjacent comprehensive similarities. A preset descent gradient threshold is used to identify inflection point positions. When the descent gradient at a certain position exceeds the threshold, that position is considered an inflection point of comprehensive similarity, and the number of samples before the inflection point is initially set to k. After the initial setting of k, the average comprehensive similarity of the first k historical samples is calculated and denoted as . ,in The average similarity of the first k samples. For the first The overall similarity of the samples is calculated using an arithmetic mean without weight adjustment.
[0076] Subsequently, to evaluate the dynamic differences between the top k samples and the real-time hydrological data, dynamic time warping was used to calculate the minute-level or hour-level time-series distance for each sample based on the appendix content. The time-series distances of these k samples were recorded as follows: And generate dynamic time-warped distance mean based on arithmetic mean. ,in The mean of the dynamic time-warped distance of the first k samples. For the first The dynamic time warping distance for each sample is constructed based on the shortest matching path length between the real-time water level time series and the historical water level time series on the time axis.
[0077] Next, set the maximum acceptable time series difference threshold. , The maximum permissible deviation of minute-level or hourly water level sequences under the corresponding watershed hydrological conditions is limited. A minimum acceptable mean similarity value is also set. This is used to limit the overall similarity of nearest neighbor sample sets. and Perform a joint judgment based on two conditions. When the conditions are met... and If so, the current value of k is determined as the final number of nearest neighbor samples K.
[0078] If any of the above conditions are not met, the sample size is increased sequentially, i.e., the sample size is set to k+1, and the mean of the comprehensive similarity and the mean of the dynamic time-normalized distance of the first k+1 samples are recalculated. This process of calculating the two means is repeated after each increase in the sample size until the above two conditions are met for the first time, at which point the sample size is set to K. The final value of K is used to determine the nearest neighbor sample set.
[0079] Preferably, the calculation of the comprehensive reasonable probability of the nearest neighbor sample set in step S6 includes: Extract the reasonableness labels from the nearest sample set to form a nearest reasonableness label set; Weights are assigned to the nearest neighbor rationality label set based on time decay weights to generate weighted rationality parameters; The K weighted rationality parameters are integrated into a comprehensive rationality probability of the nearest neighbor sample set.
[0080] In this embodiment of the invention, the rationality label of each historical sample is first extracted from the constructed nearest neighbor sample set. These labels, marked as "rational" or "abnormal" during the historical data compilation stage, are the direct basis for determining the reliability of the historical sample itself. All labels are arranged sequentially according to the order of the samples in the set, forming a nearest neighbor rationality label set. This label set is stored in sequence, and its order strictly matches the arrangement order of the samples in the nearest neighbor sample set.
[0081] Each label in the nearest reasonableness label set is assigned a corresponding weight. The weight assignment is based on the sample's time decay weight, which was calculated in step S4 based on the time difference between the sample's occurrence time and the current time. Each sample's time decay weight is associated with its reasonableness label: if the label is "reasonable," the sample's time decay weight is directly used as the base of its weighted reasonableness parameter; if the label is "abnormal," its weighted reasonableness parameter base is set to zero. Through this process, each reasonableness label is transformed into a weighted reasonableness parameter, the value of which lies between zero and the corresponding time decay weight value.
[0082] The weighted reasonableness parameters of all K samples in the nearest neighbor sample set are integrated to generate a comprehensive reasonableness probability. The integration method uses a weighted average calculation: the weighted reasonableness parameters of all K samples are summed, and then divided by the sum of the time decay weights of the K samples. The final value is the comprehensive reasonableness probability of the nearest neighbor sample set. This probability value falls between zero and one. The higher the value, the stronger the historical reasonableness of the historical sample group that is highly similar to the real-time water situation.
[0083] Preferably, step S6 further includes: When the rationality judgment result is abnormal, the historical sample with the highest comprehensive similarity in the nearest neighbor sample set is extracted and recorded as the correction reference sample; The correlation between the real-time data of the target site and the data of the modified reference sample is constructed based on the modified reference sample, and the data is modified according to the correlation. The corrected data will be validated for reasonableness. If the rationality judgment result is reasonable, the corrected data is output; otherwise, the next most similar historical samples are extracted to construct the correlation. If the rationality judgment structure is found to be abnormal after 5 consecutive corrections, a manual review prompt will be output.
[0084] In this embodiment of the invention, after the rationality determination is completed, if the real-time hydrological monitoring data is determined to be "abnormal," the data correction process is automatically triggered. First, from the constructed nearest neighbor sample set, the historical sample with the highest comprehensive similarity is selected and marked as the "correction reference sample." This sample is not only closest to the current real-time hydrological characteristics in the historical record, but it is also marked as "rational" in the historical compilation, thus possessing the credibility to serve as a correction benchmark.
[0085] Subsequently, a data correction model is established based on the consistency relationship between the corrected reference sample and the current real-time data of the target station. Complete water level and flow process curves of the corrected reference sample within the same time period are extracted and compared with the current anomaly-existing real-time process curves of the target station in terms of time period alignment and morphology. By analyzing the differences between the two in key features such as water level amplitude, flow rate variability, and peak phase, a correction relationship function based on linear or nonlinear mapping is constructed. This function maps each data point of the real-time anomaly sequence to the corresponding morphological trajectory of the reference sample, generating a set of corrected water level and flow sequences.
[0086] After the data correction is completed, a new round of rationality verification is immediately performed on the corrected sequence. The verification process repeats the steps S4 to S6: that is, extracting the feature factors of the corrected data, calculating its comprehensive similarity with the historical hydrological sample database, and determining its rationality label through the similarity-rationality mapping model.
[0087] If the corrected data is deemed "reasonable", then the corrected data is output as the final reliable result, and the process ends.
[0088] If the corrected data is still judged as "abnormal," an iterative correction mechanism is initiated. The current correction reference sample is discarded, and a historical sample with the second highest overall similarity is selected from the nearest neighbor sample set as the new correction reference sample. The above correction relationship construction and correction calculation process is repeated. This process can be carried out continuously, with each iteration replacing it with a historical sample ranked lower in similarity.
[0089] To control the number of automatic correction attempts and avoid invalid loops, a maximum of 5 consecutive correction attempts are set. If, after 5 consecutive correction attempts using different reference samples, the correction result is still judged as "abnormal," the automatic correction process will automatically terminate, and a manual review prompt message will be generated. This prompt message will include the original sequence of the real-time abnormal data, the reference sample numbers used in each correction attempt, the corrected sequence, and its corresponding reasonableness judgment value.
[0090] Please see Figure 2This paper demonstrates the construction and workflow of the similarity-reasonableness mapping model in this invention. The model input includes a real-time feature factor set and a historical sample feature factor set (left side). A comprehensive similarity is generated through steps such as multi-dimensional difference calculation, negative exponential decay mapping, and time decay weight fusion. Simultaneously, the weight vector is obtained through SCE-UA optimization training. Extracting residual correction values through error analysis The core mapping model (middle section) is based on linear relationships. Calculate the reasonableness estimate It outputs a rationality label (rational / abnormal) and a rationality threshold dynamically determined based on hydrological year type (right side), completing the intelligent mapping judgment from feature similarity to data rationality.
[0091] Please see Figure 3 This demonstrates the automated iterative correction and manual review triggering process after real-time hydrological monitoring data is identified as anomaly. The process begins with the real-time data being marked as anomaly. It automatically selects the most similar historical sample from the nearest neighbor sample set as a correction reference and builds a correction model based on this reference sample to repair the data. After correction, the data undergoes a rationality check: if the check passes, the correction result is output; if it remains anomaly, it checks if five consecutive correction attempts have been made. If fewer than five attempts have been made, the next most similar historical sample is used for correction; if five consecutive correction attempts have failed, the automatic correction process terminates and a manual review prompt is output, containing a complete process log for professional intervention.
[0092] Therefore, the embodiments should be considered as exemplary and non-limiting in all respects, and the scope of the invention is not limited by the foregoing description. Thus, all changes falling within the meaning and scope of the equivalents of the application are intended to be included within the scope of the invention.
[0093] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily 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 invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features of the invention herein.
Claims
1. A method for checking and correcting real-time water level and flow rate data based on historical hydrological conditions, characterized in that, Includes the following steps: Step S1: Obtain historical hydrological monitoring data of the target watershed and construct a historical hydrological sample database; extract multi-dimensional feature factors for each sample based on the historical hydrological sample database and construct a sensitive feature factor database; Step S2: Extract historical hydrological feature vectors based on the sensitive feature factor library to form a set of associated station data; calculate the similarity weight set between each associated station and the target station based on the set of associated station data; Step S3: Obtain real-time hydrological monitoring data for the target station; Step S4: Calculate the comprehensive similarity between real-time hydrological monitoring data and historical samples based on the similarity weight set and the associated station data set; Step S5: Construct a similarity-reasonableness mapping model, input the comprehensive similarity, output the reasonableness label, and determine the reasonableness threshold; Step S6: Calculate the reasonable probability of all samples in the historical water situation sample database, and sort them in descending order according to the comprehensive similarity to form a nearest neighbor sample set; calculate the comprehensive reasonable probability of the nearest neighbor sample set, and compare it with the reasonableness threshold to generate a reasonableness judgment result.
2. The method for checking and correcting real-time water level and flow data based on historical hydrological conditions according to claim 1, characterized in that, Step S2 includes: Extract sensitive feature factors from the sensitive feature factor library that are associated with the target site to form a set of associated site feature factors; The feature factor set of associated stations is mapped to the historical hydrological sample database to form a set of historical hydrological feature vectors of associated stations. Cluster analysis is performed on the set of historical hydrological feature vectors to form the similarity of hydrological features between stations; Based on the similarity of hydrological characteristics, the target watershed is divided into several sets of hydrological associated stations, forming a set of associated station data; Calculate the similarity score between the target site and each associated site based on the associated site data set, and generate a site similarity set; Assign weights to each associated site in the site similarity set to determine the similarity weight set; The weight value of each associated site is positively correlated with its corresponding similarity, and the sum of the weights of all associated sites is 1.
3. The method for checking and correcting real-time water level and flow data based on historical hydrological conditions according to claim 1, characterized in that, Step S3 is followed by: Outliers in real-time hydrological monitoring data are removed, and linear interpolation is performed to generate a real-time continuous sequence. Based on the factor dimensions in the sensitive feature factor library, the real-time mean water level, water level change rate, and water level peak value of the real-time continuous sequence are extracted to form a real-time water level feature factor set; Based on the factor dimensions in the sensitive feature factor library, extract the real-time flow mean, flow change rate, and flow peak of the real-time continuous sequence to form a real-time flow feature factor set; Extract the corresponding time period rainfall from the real-time continuous sequence to form a set of real-time rainfall feature factors; Real-time hydrological characteristic factors are constructed using real-time water level characteristic factor set, real-time flow characteristic factor set, and real-time rainfall characteristic factor set.
4. The method for checking and correcting real-time water level and flow data based on historical hydrological conditions according to claim 1, characterized in that, Step S4 includes: The multidimensional gap between real-time hydrological monitoring data and historical samples is calculated based on the similarity weight set and the associated site data set; The results of the multi-dimensional gap calculation are normalized. Based on the negative exponential decay mapping relationship, the difference normalization result is converted into a similarity index, and all similarity indices are integrated to form a similarity index vector. Identify the types of hydrological events corresponding to real-time hydrological monitoring data. Hydrological event types include peak flood events, low water events, and stable events. Extract the dynamic weight allocation scheme corresponding to the preset event type-weight mapping table based on the hydrological event type; A dynamic weighting scheme is used to weight the similarity index vector to form a similarity vector corresponding to the hydrological event. Calculate the time decay weights for historical samples; The similarity vector and time decay weight are combined into a comprehensive similarity score.
5. The method for checking and correcting real-time water level and flow rate data based on historical hydrological conditions according to claim 5, characterized in that, Based on the negative exponential decay mapping relationship, the difference normalization result is converted into a similarity index. The specific conversion formula is as follows: ; in, This is a similarity index vector. , For the first The difference normalization result of each feature factor; The larger the similarity index vector, the higher the similarity between real-time water conditions and historical samples on that factor.
6. The method for checking and correcting real-time water level and flow rate data based on historical hydrological conditions according to claim 1, characterized in that, Step S5 includes: Extract the comprehensive similarity and corresponding reasonableness labels of each sample in the historical water information sample database as the training sample set; The weight vector of the similarity-reasonableness mapping model is solved by the SCE-UA optimization algorithm. The weight vector reflects the contribution of the similarity of each feature factor to the reasonableness judgment. Extract systematic error information from training samples to form residual correction values; By arranging the weight vector and residual correction values in a unified manner, a similarity-reasonableness mapping model is constructed. The model takes a similarity score as input and outputs a reasonableness label, which includes reasonable and abnormal labels. Based on hydrological year type and water condition type, the rationality labels are categorized and a rationality probability distribution is formed; Extract the confidence interval probability corresponding to the target hydrological year type from the reasonableness probability distribution, and determine the reasonableness threshold.
7. The method for checking and correcting real-time water level and flow rate data based on historical hydrological conditions according to claim 1, characterized in that, Step S6 calculates the reasonable probability between real-time hydrological monitoring data and all samples in the historical hydrological sample database, and sorts them in descending order according to comprehensive similarity to form a nearest neighbor sample set, including: Extract all samples with reasonable labels from the historical water situation sample database to form a historical reasonable sample sequence; Convert the ratio of the number of samples in a historical reasonable sample sequence to the total number of samples into a reasonable probability; All historical samples are sorted in descending order based on reasonable probability and comprehensive similarity to generate a candidate sequence of nearest neighbor samples. Select the top K historical samples of the nearest neighbor candidate sequence, and denote them as the nearest neighbor sample set.
8. The method for checking and correcting real-time water level and flow rate data based on historical hydrological conditions according to claim 7, characterized in that, The top K historical samples of the nearest neighbor candidate sequence are selected and denoted as the nearest neighbor sample set, where the number K of the nearest neighbor samples is determined by the following adaptive method: Calculate the inflection point of the comprehensive similarity sequence of the nearest neighbor candidate sequences, and define the descent gradient of the comprehensive similarity at the inflection point as exceeding a preset threshold; The initial sample size before the inflection point is determined to be k; Calculate the mean overall similarity of the first k samples. ; Calculate the dynamic time-warped distance between the real-time hydrological time-series data and the historical hydrological time-series data for the first k samples, and calculate their mean. ; Set timing matching threshold ; like and Then K = k; Otherwise, increase the number of samples sequentially, and recalculate the mean comprehensive similarity and mean dynamic time-warped distance of the current sample set after each increase, until the condition is met. and Let the current number of samples be K; in, This is the minimum acceptable mean similarity value preset based on the hydrological characteristics of the target station. This is the maximum acceptable temporal difference threshold preset based on the fluctuation characteristics of hydrological processes.
9. The method for checking and correcting real-time water level and flow data based on historical hydrological conditions according to claim 1, characterized in that, Step S6 involves calculating the comprehensive reasonable probability of the nearest neighbor sample set, including: Extract the reasonableness labels from the nearest sample set to form a nearest reasonableness label set; Weights are assigned to the nearest neighbor rationality label set based on time decay weights to generate weighted rationality parameters; The K weighted rationality parameters are integrated into a comprehensive rationality probability of the nearest neighbor sample set.
10. The method for checking and correcting real-time water level and flow data based on historical hydrological conditions according to claim 1, characterized in that, Step S6 is followed by: When the rationality judgment result is abnormal, the historical sample with the highest comprehensive similarity in the nearest neighbor sample set is extracted and recorded as the correction reference sample; The correlation between the real-time data of the target site and the data of the modified reference sample is constructed based on the modified reference sample, and the data is modified according to the correlation. The corrected data will be validated for reasonableness. If the rationality judgment result is reasonable, the corrected data is output; otherwise, the next most similar historical samples are extracted to construct the correlation. If the rationality judgment structure is found to be abnormal after 5 consecutive corrections, a manual review prompt will be output.