Cross-section flow deduction method based on multi-station cooperation and machine learning integrated algorithm
Patent Information
- Application Number
- CN202611209360.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-11
- Publication Date
- 2026-10-23
AI Technical Summary
[0005]针对现有技术的不足,本发明提供了基于多站协同与机器学习集成算法的断面流量推演方法,解决了针对缺乏历史实测流量数据的无资料河段,现有纯数据驱动模型由于脱离物理汇流机制导致推演得出的断面流量不符合水流演进逻辑且多预见期下预测稳定性差的问题
[0031]1、本发明通过将待预测时刻的上游流量数据结合平均波速进行滞后平移对齐以提取区间总产流量,并基于目标断面与上下游水文控制站的总集水面积差值计算面积权重比例进而将其叠加至上游边界下泄流量总和中,从而弥补了纯数据驱动模型缺乏物理机制的缺陷,使得无历史资料断面的流量推演结果严格遵循河道水流演进的质量守恒逻辑,有效提高了推演数据的物理合理性。
Smart Images

Figure CN122965359A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hydrological forecasting and water resources information technology, specifically to a method for cross-sectional flow estimation based on multi-station collaboration and machine learning integrated algorithms. Background Technology
[0002] Cross-sectional flow projection is a crucial foundation for hydrological forecasting and watershed water resource allocation. In actual watershed station network layouts, hydrological stations are typically established only at key control nodes, resulting in a lack of historical measured flow data for many intermediate physical river sections located between upstream and downstream hydrological control stations—forming data-free sections. For such data-free sections, traditional distributed hydrological models are difficult to apply directly due to the absence of measured time series data for parameter calibration.
[0003] In recent years, data-driven machine learning models have been introduced into the field of hydrological forecasting, using data mapping relationships between known upstream and downstream stations to infer cross-sectional discharge. However, this purely data-driven approach has revealed significant limitations in practical applications. Conventional data models, when constructing input-output relationships, disregard the physical mechanisms of river flow evolution, failing to incorporate the wave velocity lag effect and the inter-regional runoff distribution characteristics of the physical watershed into the computational constraints. This results in the inferred intermediate cross-sectional discharge failing to meet basic hydrological requirements such as the conservation of river mass.
[0004] Meanwhile, current machine learning ensemble algorithms generally employ static, fixed model weight allocation strategies when processing hydrological time series data. This static mechanism cannot adaptively adjust to changes in real-time data distribution under hydrological conditions such as high-water seasons, low-water seasons, or sudden rainstorms. This leads to performance degradation in individual base models under specific conditions, directly interfering with the overall prediction results and causing a decrease in the robustness of the system's extrapolation in scenarios with multiple forecast periods. Furthermore, in attempts to combine traditional area analogy methods for spatial flow conversion, existing methods typically lack underlying constraint verification mechanisms for complex river system topologies. When the catchment areas of upstream and downstream hydrological stations are highly similar, the lack of a corresponding discrimination mechanism can cause small area differences to lead to numerical overflow or abnormally amplified errors in the division operation, thereby compromising the overall computational stability of the extrapolation algorithm under various watershed conditions. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a method for extrapolating cross-sectional flow based on multi-station collaboration and machine learning integration algorithms. This method solves the problem that for data-free river sections lacking historical measured flow data, existing pure data-driven models, due to their detachment from physical confluence mechanisms, result in cross-sectional flow extrapolations that do not conform to the logic of water flow evolution and exhibit poor prediction stability over multiple forecast periods.
[0006] To achieve the above objectives, the present invention provides a method for cross-sectional flow estimation based on multi-station collaboration and machine learning ensemble algorithms, comprising the following steps:
[0007] Acquire upstream flow data from the upstream hydrological control station of the target cross section, and downstream flow data from the downstream hydrological control station of the target cross section;
[0008] Construct a prediction model group containing multiple base models; use upstream traffic data as input and downstream traffic data as output to train each base model in the prediction model group;
[0009] The upstream flow data at the time to be predicted is input into each trained base model, and the output results of each base model are integrated and weighted to obtain the downstream predicted flow.
[0010] Obtain the total catchment area of the target cross section, the total catchment area of the upstream hydrological control station, and the total catchment area of the downstream hydrological control station;
[0011] Based on the total catchment area of the target section, the total catchment area of the upstream hydrological control station, and the total catchment area of the downstream hydrological control station, the predicted downstream flow is numerically converted using the area analogy method to obtain the projected flow of the target section.
[0012] This includes preprocessing the traffic data after acquiring upstream and downstream traffic data, and before training the base model. Specifically, this preprocessing includes:
[0013] Remove abnormal jump values from upstream and downstream traffic data;
[0014] For data segments with a continuous missing time not exceeding a preset time threshold, a linear interpolation method is used to fill in the missing data segments using adjacent valid observations before and after the missing data segments.
[0015] For data segments with consecutive missing durations exceeding a preset time threshold, the entire consecutive time series containing the missing data segments will be removed.
[0016] The upstream and downstream traffic data, after being removed and completed, are resampled to the same time resolution to form a dataset with a unified time resolution.
[0017] In terms of physical spatial attributes, the target section is located within the physical river segment between the upstream and downstream hydrological control stations, and historical measured flow time series are lacking for the target section. Multiple hydrological control stations located on the main stream and major confluence tributaries upstream of the target section are identified as upstream hydrological control stations, and their flow data are obtained.
[0018] Simultaneously, flow data from a single hydrological control station located downstream of the target section is acquired.
[0019] Furthermore, the prediction model set includes a Long Short-Term Memory (LSTM) network model, a Random Forest model, a Gradient Boosting Regression Tree model, and a Support Vector Regression model. Upstream flow data is independently input into each of these base models, and the corresponding downstream flow data is used as the target label for model training.
[0020] In the integrated weighted processing stage, the specific implementation method is as follows:
[0021] The upstream flow data at the time to be predicted is input into each trained base model to obtain the preliminary predicted flow output by each base model at the time to be predicted. Using the time to be predicted as the time reference, a dynamic sliding data window of a preset duration is extracted from the history. The historical prediction sequences issued by each base model within the dynamic sliding data window are extracted, and the real downstream flow sequences corresponding to the time of the historical prediction sequences are extracted from the downstream flow data to form an online validation set.
[0022] Calculate the coefficient of determination of each base model on the online validation set;
[0023] Based on the coefficient of determination, anomaly prevention truncation and dynamic weight normalization are performed to obtain the dynamic weights corresponding to each base model. The preliminary predicted flow output by each base model is multiplied by the corresponding dynamic weight and then summed to obtain the downstream predicted flow.
[0024] For multi-forecast period extrapolation, multiple forecast periods are set, consisting of discrete time-scale sequences, specifically 1h, 3h, 6h, 12h, 18h, and 24h. For each forecast period, a dedicated set of prediction models is independently constructed.
[0025] The downstream predicted flow is obtained by using a set of prediction models specific to each forecast period. Then, the downstream predicted flow for each forecast period is numerically converted using the area analogy method to obtain the projected flow of the target section under each forecast period.
[0026] In the stage of numerical conversion using the area analogy method, the specific process includes:
[0027] The upstream flow data at the time to be predicted is combined with the preset average wave velocity of the main stream of the basin and then shifted with lag to obtain the total downstream flow of the upstream boundary after the confluence lag reverse shift and alignment.
[0028] Calculate the difference between the downstream predicted flow and the total discharge at the upstream boundary, and use it as the total flow of the interval; divide the difference between the total catchment area of the target section and the total catchment area of the upstream hydrological control station by the difference between the total catchment area of the downstream hydrological control station and the total catchment area of the upstream hydrological control station to obtain the area weight ratio.
[0029] The total runoff of the interval is multiplied by the area weight ratio and added to the total discharge at the upstream boundary to obtain the projected discharge at the target section. Simultaneously, when the difference between the total catchment area of the downstream hydrological control station and the total catchment area of the upstream hydrological control station is less than a preset area threshold, the interval between the upstream and downstream hydrological control stations is determined to be in a zero-runoff overlap region. Area simulation is then stopped, and the projected discharge at the target section is directly equated to the total discharge at the upstream boundary.
[0030] This invention provides a method for cross-sectional flow estimation based on a multi-station collaborative and machine learning integrated algorithm. It has the following beneficial effects:
[0031] 1. This invention extracts the total flow rate of the interval by combining the upstream flow data at the time to be predicted with the average wave velocity and performing a lag shift alignment. Based on the difference in the total catchment area between the target section and the upstream and downstream hydrological control stations, the area weight ratio is calculated and then superimposed on the total discharge flow at the upstream boundary. This makes up for the lack of physical mechanism in the pure data-driven model, so that the flow prediction results of sections without historical data strictly follow the mass conservation logic of river flow evolution, effectively improving the physical rationality of the prediction data.
[0032] 2. This invention, by extracting a dynamic sliding data window from the historical data during the model integration stage to form an online validation set, and by updating the dynamic weights in real time based on the determination coefficients of each base model on the validation set to perform weighted processing on the preliminary predicted flow of each base model, can adapt to the changes in data distribution under different hydrological conditions in the watershed. This avoids the problem of model performance degradation caused by static weights under specific working conditions and improves the prediction robustness of the system under multiple forecast periods.
[0033] 3. This invention monitors the difference in catchment area between upstream and downstream stations based on a set area threshold. When the area difference is less than the preset area threshold, it determines that the interval is in a zero-flow overlap region and directly equates the estimated flow of the target section to the total outflow from the upstream boundary. Therefore, it prevents numerical overflow or abnormal error amplification caused by small area differences in division conversion, and ensures the stability of numerical calculation under complex water system topology conditions. Attached Figure Description
[0034] Figure 1 A flowchart of the method provided in an embodiment of the present invention;
[0035] Figure 2 A schematic diagram illustrating the multi-source hydrological data acquisition and preprocessing process provided in an embodiment of the present invention;
[0036] Figure 3 This is a schematic diagram of the physical spatial topology and feature mapping relationship of a watershed provided in an embodiment of the present invention;
[0037] Figure 4 A flowchart of hierarchical independent modeling and base model training based on multiple forecast periods provided in this embodiment of the invention;
[0038] Figure 5 A flowchart of integrated prediction based on dynamic weighting of determination coefficients provided in an embodiment of the present invention;
[0039] Figure 6 A flowchart for the simulation and output of target cross-sectional flow area provided in this embodiment of the invention. Detailed Implementation
[0040] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0041] The method provided in this embodiment of the invention can be executed by a computer device, which includes a processor and a memory. The memory stores a computer program, and the processor executes the computer program to implement the following method steps.
[0042] See attached document Figure 1 The cross-sectional flow estimation method provided by this invention includes the following steps:
[0043] Step S101: Obtain upstream flow data from the upstream hydrological control station of the target section, and downstream flow data from the downstream hydrological control station of the target section. In the physical process of watershed runoff formation and evolution, the hydrological state of the target section is inevitably driven by its upstream inflow and eventually flows into the downstream control section.
[0044] Based on the aforementioned physical causal relationship, and addressing the technical obstacle of lacking historical measured flow time series for the target section, the system extracts historical data from upstream and downstream stations with long-sequence observation conditions, thereby providing a basic data source for the subsequent construction of spatial indirect extrapolation models.
[0045] In this embodiment, the upstream hydrological control stations used as input need to cover the main stream and major runoff-producing tributaries to ensure the completeness of the input of watershed runoff information.
[0046] Step S102 involves preprocessing the acquired upstream and downstream flow data to generate upstream and downstream flow time series with a unified time resolution. Due to limitations in real-world observation conditions, the original observation data contains jumps and missing data.
[0047] To ensure the data input to the computational model possesses temporal alignment and continuity of hydrological and physical processes, the system performs outlier detection, segmented interpolation, and removal operations on the raw flow data. As a specific implementation method, addressing the asynchronous acquisition issue of multi-source data, the system uses the set forecast task timeline as a global benchmark to synchronously extract and resample the raw sequences from all upstream and downstream stations, ensuring strict alignment of data conditions at the same timestamp.
[0048] The preset time threshold for determining whether to interpolate or remove data segments is determined by historical statistical characteristics such as the response time of typical flood peaks in the basin, thereby outputting a standardized and structurally consistent time series.
[0049] Step S103: For the set multiple discrete forecast periods, construct prediction model groups corresponding to each forecast period. Considering that the dynamic response characteristics of hydrological events differ at different forecast period scales, the system independently establishes dedicated prediction model groups for different time scales.
[0050] Each prediction model group contains multiple base models with different operational principles. These base models include recurrent neural network structures that are good at capturing temporal memory features, and ensemble tree structures that are good at handling high-dimensional nonlinear mappings, thereby avoiding error accumulation and one-sided fitting caused by single model prediction across time scales.
[0051] Step S104: Use the upstream flow time series as the model input and the downstream flow time series as the model output, and train each base model in each prediction model group independently.
[0052] The system uses upstream data from multiple sites as the input feature matrix and downstream single-site data as the target label for supervised learning. To reflect the forecasting ability of each model for a specific forecast period, the system shifts the time window of the upstream feature matrix and the time node of the downstream target label according to the corresponding forecast period length when constructing training sample pairs.
[0053] By defining a loss function that minimizes the prediction residuals, the system drives the computational model to implicitly fit the confluence calculation logic within the river segment from multiple upstream stations to a single downstream station, thereby optimizing and updating the weight parameters within each base model.
[0054] Step S105: Input the upstream flow data at the time to be predicted into each trained base model, and perform integrated weighted processing on the output results of each base model to obtain the downstream predicted flow corresponding to each prediction period.
[0055] To improve the system's predictive robustness under different runoff input conditions, the system calculates dynamic weights based on the performance of each base model in independent validation tests. Based on the calculated dynamic weights, the system performs a weighted summation of the preliminary prediction values from multiple base models for the same forecast period, outputting the downstream predicted flow.
[0056] To prevent anomalies in the division denominator caused by the base model's determination coefficients approaching zero under extreme conditions of the validation set, the system introduces a minimum value smoothing term constraint in the weight normalization algorithm. This weighted logic based on multi-dimensional validation results avoids the one-sided judgment that relies solely on a single extreme value model for the final result.
[0057] Step S106: Obtain the catchment area of the target section and the catchment area of the downstream hydrological control station. Use the area analogy method to numerically calculate the downstream predicted flow for each forecast period to obtain the projected flow for the target section. The results output by the machine learning model spatially belong to downstream stations, and the system further obtains the physical spatial attribute parameters of the relevant watershed.
[0058] Based on the spatial similarity logic of hydrology and the theoretical foundation that the meteorological and hydrological characteristics of a watershed are homogeneous within a certain spatial range, the system combines the proportional relationship of catchment area to spatially reverse the downstream forecast results to the target cross-section where no data is available. The conversion factor used in the area analogy method is directly calculated based on the ratio of upstream and downstream areas, and finally outputs the flow projection sequence for each forecast period for the target cross-section.
[0059] In this embodiment, high-quality and time-aligned hydrological time series data are the foundation for driving machine learning algorithms to effectively fit complex nonlinear mapping relationships. Based on this, the system needs to acquire multi-source hydrological data according to rigorous physical topology logic and perform standardized time series preprocessing operations.
[0060] See attached document Figure 2 The data acquisition and time series standardization preprocessing involved in this invention include the following key operational steps.
[0061] Based on the physical causal relationship of runoff generation and confluence in a watershed, the runoff response at any cross section of a specific river segment is directly driven by the input conditions at its upstream boundary and the hydrological conditions of the interval.
[0062] Based on the above principles, the system executes a data acquisition mechanism to acquire flow data from multiple hydrological control stations located upstream of the target section as upstream flow data, and simultaneously acquires flow data from a single hydrological control station located downstream of the target section as downstream flow data.
[0063] Since the target cross-section itself belongs to a proposed or non-controlling river section lacking historical measured data, it is objectively impossible to directly extract the target data of this cross-section. Based on the spatial confluence topology of the river network in the basin, the system extracts the observation sequence of the upstream Bakou station of the target cross-section.
[0064] As a preferred implementation method, the target section is the Guxian Dam site section. Multiple upstream hydrological control stations are distributed along the main stream and major confluence tributaries, specifically including Wubu Hydrological Station, Houdacheng Hydrological Station, Peigou Hydrological Station, Baijiachuan Hydrological Station, Yanchuan Hydrological Station, Daning Hydrological Station, and Ganguyi Hydrological Station. The dynamic and coordinated changes in flow at these multiple stations comprehensively characterize the overall hydrophysical boundary conditions upstream of the target section.
[0065] In this embodiment, the selection criterion for the aforementioned multi-source stations is that their spatial monitoring distribution network completely covers and surrounds the upstream catchment area of the target section, thereby avoiding the omission of physical information of the confluence input. Combined with the aforementioned spatial mapping logic, the system simultaneously selects the Longmen hydrological station downstream of the target section, which has a long sequence of complete records, as a single control station, and extracts its flow sequence as the target output source for subsequent supervised learning.
[0066] The objective differences in the instrument attributes and maintenance status of different hydrological stations lead to issues such as inconsistent recording scales, numerical anomalies, and temporal sequence failures in the raw multi-source station data extracted by the system. To avoid gradient divergence or non-convergence in the subsequent machine learning model training process caused by such noisy sequences, the system performs data cleaning and resampling preprocessing operations on the aforementioned upstream and downstream flow data. This preprocessing process specifically includes the following sub-steps.
[0067] Step S201: Remove abnormal jump values from upstream and downstream flow data. Due to sensor malfunctions or external instantaneous physical interference, the original time series often contains jump values that violate hydrodynamic laws. The system iterates through the time series, calculates the gradient of numerical changes between adjacent data points, and identifies data with gradients exceeding a preset threshold as abnormal jump values and forcibly removes them.
[0068] In this embodiment, the value of the preset change threshold is determined based on the statistical upper limit of the maximum normal rise and fall rate in the historical long-sequence measured flow process line of the target watershed. For the statistical algorithm of extreme value detection, those skilled in the art can set it based on conventional hydrological principles.
[0069] Step S202 involves performing stratified processing on consecutive missing segments objectively present in the data sequence. The aforementioned anomaly removal operations and power outages of the station instruments can cause consecutive missing flow observation data. The system sets segmentation rules based on the time span of consecutive missing data and presets time thresholds.
[0070] Because the confluence evolution and wave propagation of hydrological floods have specific response time characteristics, the preset time threshold in this embodiment is set to 3 hours. This time threshold is selected based on the average flood duration of typical runoff-generating tributaries in the target watershed, to ensure that the time division conforms to the objective physical mechanism of hydrological evolution.
[0071] For short-time data segments with consecutive missing periods not exceeding a preset time threshold, the system employs a linear interpolation method, using adjacent valid observations before and after the missing data segment to complete the data. This short-timescale numerical interpolation maintains the physical continuity of an independent flood event at the mathematical level, avoiding distortion of the runoff hydrograph caused by artificial truncation.
[0072] For long-term data segments with consecutive missing periods exceeding a preset time threshold, the system will remove the entire continuous time series containing the missing data segment. Forcibly interpolating long periods of missing data using numerical methods will introduce large-scale computational errors, severely distorting the actual rainfall-runoff response mechanism of the watershed. If such artificially distorted samples enter the subsequent training process, they will cause irreversible interference with the optimization of the internal parameters of the ensemble learning algorithm.
[0073] Step S203 involves resampling the data after the elimination and completion operations to the same time resolution, forming upstream and downstream traffic time series with a unified time resolution. To meet the requirement of matrix dimension consistency when inputting multi-source data into the algorithm architecture, the system uses a unified absolute time axis as a benchmark to synchronously extract and align the processed data of all upstream and downstream sites with frequencies. In the specific data structure transformation process, the system uniformly resamples the data of each site to a time resolution of 0.5h based on a linear mapping relationship.
[0074] This resampling operation ensures that at any given timestamp, all upstream feature vectors of the inputs and downstream target scalars of the outputs are on the same temporal reference plane, thereby constructing a multidimensional feature input matrix with fully aligned time steps. This lays a standard data foundation for the construction of feature tensors and the fitting of spatial mapping relationships in subsequent neural network models.
[0075] See attached document Figure 3 , Figure 3 This invention illustrates the physical spatial topology and feature mapping relationship of a watershed according to an embodiment of the present invention, and the feature engineering settings before the system performs model calculations based on this spatial topology relationship.
[0076] In this embodiment, the system needs to define the physical spatial attributes of the study watershed. In terms of physical spatial attributes, the target section is located within the physical river segment between the upstream and downstream hydrological control stations. Due to objective limitations, this target section lacks historical measured flow time series. This lack of data means that conventional hydrological prediction models based on single-point historical series autoregression cannot extract target supervision labels, thus failing at this section.
[0077] Based on the principle of continuity in hydrological runoff, the downstream runoff from the upstream hydrological control station must pass through the target section and eventually converge with the runoff generated along the route to the downstream hydrological control station. The dynamic water input from multiple upstream control stations determines the hydrological output state of the downstream control station, and the hydrophysical processes at the target section are the intermediate link in this runoff evolution.
[0078] Based on the aforementioned physical causal relationships, the system constructs a feature mapping strategy that transforms spatial topology into data-driven logic. This strategy replaces the traditional approach of directly modeling the target cross-section by establishing indirect mapping relationships between upstream and downstream sites. The specific feature engineering settings include the following operational steps.
[0079] Step S301: Set the input feature space and output target label for the machine learning computing architecture. The system extracts the upstream multi-station flow time series after standardization and preprocessing. Considering the difference in flow magnitude between the main stream and each tributary, direct input will lead to the gradient descent direction being dominated by large numerical features during subsequent training, and may even cause ill-conditioned calculation of the feature matrix.
[0080] Therefore, the system performs minimax normalization on the traffic sequences of each station, linearly mapping their values to the [0,1] interval to eliminate the dimensional influence between multi-source features. After processing, the system combines the above sequences in parallel to construct a multi-dimensional input feature matrix.
[0081] Simultaneously, the system extracts the standardized preprocessed downstream single-station flow time series and sets it as the target output label for the model's supervised learning. In this setup, the joint input of data from multiple upstream control stations provides the algorithm with complete hydrological boundary conditions covering the main stream and major tributaries; while the observation results from a single downstream control station provide a highly deterministic comprehensive physical state benchmark after the confluence evolution.
[0082] Step S302: Construct a temporal feature tensor for model training. To accommodate the computational requirements of various heterogeneous machine learning algorithms on the input data structure, the system needs to reconstruct the dimensions of the input feature matrix.
[0083] As a preferred approach, the system uses discrete timestamps on a unified time series as a benchmark, and horizontally splices together the traffic observation values of each upstream station at the same moment to form a one-dimensional feature vector for the current moment. The feature dimension of this vector is equal to the total number of selected upstream stations.
[0084] As the preset timeline advances, the system uses a fixed time step to extract one-dimensional feature vectors from multiple consecutive time steps, forming a three-dimensional temporal feature tensor suitable for capturing dynamic temporal changes. Specifically, the shape of this temporal feature tensor is defined as (number of samples, time step, feature dimension), where the time step represents the time span of the model's back-to-historical observations, and the value of this span is determined by the measured convergence time of the study watershed.
[0085] The reconstructed 3D tensor serves as an independent feature sample for each calculation of the model. Those skilled in the art can design the underlying logic for the sliding window segmentation of the data sequence and the basic transformation of feature dimensions based on the conventional machine learning data flow structure.
[0086] Through the aforementioned feature engineering settings, the system defines the complete data flow direction and tensor structure. Without directly relying on measured data from the target cross-section, the system forces subsequent machine learning models to implicitly learn the interval convergence evolution pattern from multi-point distributed inputs upstream to single-point integrated inputs downstream during the training phase. The construction of this feature mapping relationship provides underlying data support for the independent training of subsequent multi-prediction-period models and spatial numerical analogies between stations.
[0087] In this embodiment, the evolution of watershed runoff exhibits complex dynamic nonlinear responses at different time scales. To avoid forecast failure due to error accumulation in long-term cross-scale predictions using a single model, the system establishes a hierarchical independent modeling and training mechanism based on multiple forecast periods.
[0088] See attached document Figure 4 The modeling and base model training involved in this invention specifically include the following operational steps.
[0089] Step S401: Set multiple different forecast periods and independently construct a set of dedicated prediction models for each forecast period. Based on the evolution patterns of meteorological and hydrological events and the actual operational needs of flood control engineering scheduling, the system sets the multiple different forecast periods as discrete time scale sequences. As a preferred approach, this time scale sequence specifically includes 1h, 3h, 6h, 12h, 18h, and 24h.
[0090] For each of the aforementioned time scales, the system initializes a set of prediction models with independent parameter structures. This independent setup method severs the feature coupling between different forecast periods, ensuring that the model can specifically extract only the confluence lag features at the corresponding time scale.
[0091] Step S402: Within each prediction model group, a base model containing multiple heterogeneous algorithms is instantiated. Given that a single algorithm is prone to getting trapped in local optima or overfitting when processing high-dimensional hydrological data, the system employs a heterogeneous ensemble strategy.
[0092] Specifically, the base models include Long Short-Term Memory (LSTM) networks, Random Forests, Gradient Boosting Regression Trees, and Support Vector Regression. In this architecture, the LTM network model relies on its internal gating unit structure to extract long-range dependencies in time series data.
[0093] Random forest models reduce prediction variance by constructing multiple decision trees in parallel; gradient boosting regression tree models use residual progressive fitting logic to reduce prediction bias.
[0094] Support vector regression models, based on the principle of minimizing structural risk, maintain the stability of the prediction boundary under small sample conditions. The four algorithms complement each other in feature space fitting, thus providing a subset of predictions with differentiated performance for subsequent weighted ensemble.
[0095] Step S403: Based on the corresponding forecast period, construct supervised learning sample pairs with temporal misalignment. To predict future states, the system shifts downstream flow data backward on the time axis with a set forecast period duration as the step size.
[0096] After the translation operation, the upstream feature tensor at the current moment and the downstream real flow data after translation and alignment form a one-to-one correspondence between training samples and target labels. This temporal misalignment operation is physically and logically equivalent to forcing the water volume information contained in the input matrix to precisely correspond to the actual hydrological state of the downstream section at that moment after evolving over a specified forecast period.
[0097] Step S404: Using the upstream flow time series as input and the downstream flow time series as the target label, differentiated independent training is performed on each base model within the prediction model group. During this computation phase, to ensure that model training does not overfit, the system pre-selects the last 20% of the data in chronological order from the overall training samples as an offline training and validation set. Since the underlying mathematical principles of each base model are fundamentally different, the system assigns corresponding parameter update logic based on the model type.
[0098] For the Long Short-Term Memory (LSTM) network model, the system inputs the reconstructed 3D feature tensor into the network's input layer. Structurally, the network is configured to contain multiple cascaded LSM hidden layers, with Dropout layers with a preset dropout rate inserted between the hidden layers to suppress node co-adaptation.
[0099] After data flows into the hidden layer containing forget gates, input gates, and output gates, the final temporal hidden state vector output by the last hidden layer is input to the fully connected layer. The fully connected layer directly maps this high-dimensional vector to a real value through a linear transformation. This real value represents the downstream predicted flow under a specific forecast period. The mean squared error loss between the predicted value output by the network and the actual downstream label is calculated.
[0100] The calculated error is propagated backward along the network topology using a time-based backpropagation algorithm, and combined with a gradient descent optimizer to dynamically update the weight parameters and bias terms between network nodes.
[0101] For random forest models, gradient boosting regression tree models, and support vector regression models, since their underlying algorithm interfaces cannot directly parse the time step dimension, the system performs flattening and dimensionality reduction processing on the input three-dimensional feature tensor.
[0102] Specifically, the system multiplies and fuses the time step dimension and the feature dimension in the matrix structure, reshaping the original three-dimensional feature tensor into a standard two-dimensional feature matrix. After flattening, historical multi-step traffic data within the same time window are concatenated into independent and parallel static input features.
[0103] When processing the flattened data, the random forest model uses bootstrapping to construct independent sample subsets, and then splits and grows each decision tree node according to the principle of minimizing feature variance. The gradient boosting regression tree model, on the other hand, uses a serial generation logic, where each newly added decision tree splits its nodes with the negative gradient generated by the previous model as the target, thus completing the iteration of the ensemble tree weights.
[0104] The system uses a pre-defined radial basis function to map the input features to a high-dimensional space. Within this space, the system solves a quadratic convex programming problem using the actual downstream flow as the constraint boundary, seeking the optimal hyperplane parameters that maximize the margin while keeping the prediction error within the tolerance pipe.
[0105] To further ensure the effectiveness of the model training, the system calculates the loss function performance of each model on the offline training and validation set after each round of iteration. When the monitoring loss on the validation set no longer decreases for a preset number of consecutive rounds, the system triggers an early stopping mechanism, terminates the iteration, and saves the current weight parameters to determine that the training has converged.
[0106] For the mathematical derivation and kernel function calculation of the above-mentioned basic machine learning algorithms, those skilled in the art can carry out engineering implementation based on conventional statistical learning theory.
[0107] Through the above steps, the system completed the parallel training of all prediction model groups for all forecast periods. The trained base models fully fit the nonlinear mapping relationship between input features and output labels, possessing the fundamental ability to output downstream predicted flow for a specific forecast period at independent time scales.
[0108] In this embodiment, due to differences in their underlying mathematical principles, the predictive performance of each base model exhibits objective fluctuations when facing the same hydrological input conditions. To avoid local extremum bias caused by relying on a single algorithm, the system establishes a dynamic ensemble evaluation mechanism based on the historical performance of each model on the offline training and validation set. This mechanism extracts historical error features and bases the determination of the output results on a multi-dimensional comprehensive evaluation.
[0109] See attached document Figure 5 The integrated prediction mechanism involved in this invention specifically includes the following operational steps.
[0110] Step S501: Obtain the preliminary prediction values of each base model under the predicted operating condition, and simultaneously extract the online verification and comparison sequence for real-time evaluation. The system inputs the real-time upstream traffic time series at the time to be predicted into each of the trained heterogeneous base models in parallel, driving the models to propagate forward and output their respective preliminary predicted traffic.
[0111] To ensure that the performance evaluation is highly correlated with the current hydrological input conditions, the system does not retrieve a static historical validation set, but instead uses the time to be predicted as the time reference and extracts a dynamic sliding data window of a preset duration from the historical data.
[0112] The system extracts the historical prediction sequences issued by each base model within the dynamic window at past times (i.e., for a specific historical moment within the window). Extracting the base model in Foresight Period The corresponding predicted values issued, along with the corresponding actual downstream traffic sequences, serve as the numerical basis for subsequent performance evaluation.
[0113] The above operations rigorously ensure that the target time of the model prediction is completely aligned with the evolution time of the real observations within the validation window, eliminating the time series paradox caused by directly introducing future unknown real data for comparison from the underlying logic.
[0114] Step S502: Calculate the determination coefficients of each base model on the aforementioned online validation set. Before performing specific numerical calculations, the system needs to comprehensively assess the dispersion between predicted and observed values. The system statistically compares the predicted sequences of each base model with the true labels to quantify the current predictive reliability of the model.
[0115] The coefficient of determination directly measures the extent to which a regression model explains the variance of the actual data. It characterizes the proportional relationship between the degree to which the model's fitted output deviates from the population mean and the degree to which the actual observed values deviate from the mean. The mathematical expression corresponding to the calculation logic of this step is as follows:
[0116] ;
[0117] in, For the first The coefficients of determination of each basis model; This represents the total number of samples in the online validation set. For the verification set The actual downstream flow observation values for each sample; For the first The base model for the first The predicted flow value output for each sample; To verify the statistical average of all real downstream flows within the set, the system synchronously monitors the variance of the real sequence during this calculation.
[0118] When the system detects extremely stable flow within a short-term validation window, causing the total sum of squares in the denominator of the formula to approach zero, it determines that there are no physical fluctuations available for evaluation during that period, thus triggering an abnormal takeover mechanism. The system directly forces the determination coefficients of all base models within that interval to the same constant zero, thereby avoiding the risk of division-by-zero overflow at the underlying level. By calculating the ratio of the residual sum of squares to the total sum of squares, the system completes the evaluation of the fitting accuracy of a single base model from a global perspective.
[0119] Step S503 involves performing anomaly truncation and dynamic weight normalization based on the coefficients of determination. Under certain extreme hydrological conditions, the predictive performance of some base models may drop sharply, resulting in negative values for their calculated coefficients of determination. Directly introducing negative or zero values into subsequent matrix normalization would disrupt the weighting ratios and could even lead to a fatal system error where the denominator approaches zero during division calculations.
[0120] Based on the aforementioned algorithm completeness risk, the system performs truncation and smoothing on each determination coefficient and calculates the dynamic weights corresponding to each model. The corresponding calculation logic is as follows:
[0121] ;
[0122] in, Indicates assignment to the first Dynamic weights of each base model; The technical logic of the maximum value function is to forcibly truncate all invalid determination coefficients less than zero to zero, thereby stripping the original weights of the poorly performing model. This is a preset local minimum smoothing constant; This represents the total number of base models contained within the prediction model group. As a preferred approach, this smoothing constant... The value range is set to .
[0123] The determination of this interval is based on two factors: firstly, the minimum recognition tolerance of single-precision floating-point numbers in computer systems; and secondly, to prevent the weights from becoming homogenized by assigning too high a proportion to inferior models during the smoothing process.
[0124] In this embodiment, the parameter is precisely set to 10. -5 The aim is to ensure that, in extreme divergent scenarios where all model determination coefficients are truncated to zero, the denominator remains always greater than zero.
[0125] This normalization logic, which introduces truncation and minimum value smoothing terms, ensures the underlying robustness of division operations under various complex boundary conditions.
[0126] Step S504: The preliminary prediction results of the multiple models are weighted and fused using the calculated dynamic weights. After obtaining the dynamic weight distribution of each base model, the system performs a dot product summation of the preliminary predicted flow output of each base model at the time to be predicted with the corresponding dynamic weights, and outputs the final downstream predicted flow. The corresponding calculation logic is as follows:
[0127] ;
[0128] in, This represents the downstream forecast flow corresponding to this forecast period, obtained after weighted fusion. For the first The initial predicted flow values output by each basic model at the time to be predicted.
[0129] By implementing the weighted summation mechanism described above, the system dynamically allocates the decision-making power for the prediction trend. Base models that perform well in the validation set are given higher weights to dominate the prediction results, while the influence of poorly performing models is forcibly weakened.
[0130] This output result determination method avoids the one-sided determination defects of conventional methods that rely solely on a single extreme value or arithmetic mean, and improves the overall reliability of model prediction under unknown conditions.
[0131] In this embodiment, through the aforementioned hierarchical independent modeling and dynamic weighted integration mechanism based on multiple forecast periods, the system has obtained high-precision predicted flow rates for downstream control stations under various specific forecast periods. Based on this highly deterministic comprehensive physical state benchmark, the system needs to further map the prediction results to target sections lacking measured data in order to complete the final hydrological forecasting task for data-free areas.
[0132] See attached document Figure 6 The area comparison deduction and output involved in this invention specifically includes the following operation steps.
[0133] Step S601: Obtain the catchment area parameters of each hydrological control node and target section within the study watershed. Based on the principle of watershed hydrological similarity, in a closed watershed with relatively uniform meteorological input conditions, the total runoff generated by a river section and its controlled catchment area show a physical positive correlation.
[0134] The system extracts the total catchment area of multiple upstream control stations, the total catchment area of a single downstream control station, and the total catchment area of the target cross section. For the watershed boundary delineation and catchment area extraction operations in the digital elevation model, those skilled in the art can utilize conventional geographic information system spatial analysis tools; the underlying topology extraction calculation logic is well-known in the field and will not be elaborated upon here.
[0135] Step S602: Based on the proportional weight of the catchment area of the interval, a spatial downscaling simulation is performed on the predicted flow of the target section. Since the target section is located within the physical interval between the upstream and downstream control stations, the system uses the known flow difference between the upstream and downstream nodes to define the total runoff of this interval. To ensure the timeliness and rigor of the interval runoff calculation, when extracting the upstream flow, the system performs a hysteresis shift on the upstream observation sequence in conjunction with the average wave velocity of the main stream of the basin, so that it is on the same evolution profile as the downstream predicted flow on the hydrodynamic wave surface.
[0136] After time-series alignment, the system allocates the total runoff of this interval to the upstream watershed of the target section according to the area weight ratio, and superimposes it on the downstream discharge at the upstream boundary. The mathematical expression corresponding to the calculation logic of this area analogy is as follows:
[0137] ;
[0138] in, The predicted flow rate of the target cross-section in the corresponding forecast period is obtained through deduction; The weighted integrated predicted flow rate of the downstream control station output by the system in the forecast period; This is the sum of the boundary flows input from multiple upstream control stations after the confluence delay reverse translation and alignment; The total catchment area of the target cross section; It is the sum of the total catchment areas of multiple upstream control stations; This refers to the total catchment area of a single downstream control station.
[0139] In actual operational deployment, to prevent the abnormal situation where the area difference between upstream and downstream hydrological stations approaches zero due to their extremely close physical locations, the system introduces a lower limit constraint on the denominator before calculating the above formula. As a preferred method, when the calculated total catchment area of the interval... When the area is less than the preset area threshold, the system determines that the interval is in the zero flow overlap area, directly stops the area comparison and simulation, and equates the target cross-sectional flow to the total upstream discharge flow.
[0140] In this embodiment, the preset area threshold is determined based on the base pixel resolution of the digital elevation model, and is set to a value of 0.1 km. 2 This avoids the risk of division-by-zero overflow in the underlying code.
[0141] In addition, for calculation items Under conditions of extreme drought or large-scale water diversion along the river, the calculated result is negative. This negative value objectively represents, at the physical level, the net consumption by evaporation, infiltration, and human activities along the river channel. The system retains this value and distributes it to the target cross-section with equal area weights, thereby ensuring that the water balance formula conforms to the actual loss distribution mechanism under all operating conditions.
[0142] Through the above spatial analogy and conversion, the system strictly follows the physical distribution principle of interval runoff mass conservation at the mathematical level, effectively bypassing the technical bottleneck that makes it impossible to directly model the target section due to the lack of measured labels.
[0143] Step S603: Compile the target cross-sectional flow prediction sequence under multiple forecast periods, and execute operational early warning and output. The system traverses each of the aforementioned discrete forecast periods, iteratively executing the above-mentioned independent prediction, dynamic weighted integration, and area analogy steps, thereby generating a target cross-sectional flood evolution process line covering short, medium, and long-term time scales.
[0144] As a specific engineering implementation approach, the system formats and encapsulates the multi-foresight-period prediction results generated through the simulation and writes them into a relational database or time-series database for persistent storage. Based on a front-end visualization component, the system synchronously renders and compares the generated target predicted flow sequence with the preset engineering flood control warning threshold, thereby providing a data interface and decision-making basis with clear physical spatial support for the flood control scheduling planning, reservoir spillway gate control, and disaster early warning response of the proposed water conservancy project.
Claims
1. A method for cross-sectional flow estimation based on multi-station collaboration and machine learning ensemble algorithms, characterized in that, Includes the following steps: Acquire upstream flow data from the upstream hydrological control station of the target cross section, and downstream flow data from the downstream hydrological control station of the target cross section; Construct a predictive model group that includes multiple base models; The upstream flow data is used as input, and the downstream flow data is used as output to train each base model in the prediction model group; The upstream flow data at the time to be predicted is input into each of the trained base models, and the output results of each base model are integrated and weighted to obtain the downstream predicted flow. Obtain the total catchment area of the target cross section, the total catchment area of the upstream hydrological control station, and the total catchment area of the downstream hydrological control station; Based on the total catchment area of the target cross section, the total catchment area of the upstream hydrological control station, and the total catchment area of the downstream hydrological control station, the predicted downstream flow is numerically calculated using the area analogy method to obtain the projected flow of the target cross section.
2. The method for cross-sectional flow estimation based on multi-station collaboration and machine learning ensemble algorithm as described in claim 1, characterized in that, After acquiring the upstream flow data from the upstream hydrological control station of the target cross-section and the downstream flow data from the downstream hydrological control station of the target cross-section, and before training the various base models within the prediction model group using the upstream flow data as input and the downstream flow data as output, the method further includes: Remove abnormal jump values from the upstream and downstream flow data; For data segments in the upstream and downstream flow data where the continuous missing time is no greater than a preset time threshold, a linear interpolation method is used to interpolate and complete the missing data segments using adjacent valid observations before and after the missing data segments. For data segments in the upstream and downstream traffic data where the consecutive missing time exceeds the preset time threshold, the entire continuous time series containing the missing data segments will be removed. The upstream and downstream traffic data, after being processed by elimination and completion, are resampled to the same time resolution to form upstream and downstream traffic data with a unified time resolution.
3. The method for cross-sectional flow estimation based on multi-station collaboration and machine learning ensemble algorithm as described in claim 1, characterized in that, The acquisition of upstream flow data from the upstream hydrological control station of the target cross-section and downstream flow data from the downstream hydrological control station of the target cross-section includes: Multiple hydrological control stations located upstream of the target cross section are identified as the upstream hydrological control stations, wherein the multiple hydrological control stations are distributed on the main stream and major confluence tributaries; The flow data from the multiple hydrological control stations is obtained as the upstream flow data; The flow data of a single hydrological control station located downstream of the target cross section is obtained as the downstream flow data.
4. The method for cross-sectional flow estimation based on multi-station collaboration and machine learning ensemble algorithm according to claim 1, characterized in that, The multiple base models include the Long Short-Term Memory Network model, the Random Forest model, the Gradient Boosting Regression Tree model, and the Support Vector Regression model; The step of training each base model within the prediction model group by taking the upstream flow data as input and the downstream flow data as output includes: The upstream flow data is independently input into the Long Short-Term Memory Network model, the Random Forest model, the Gradient Boosting Regression Tree model, and the Support Vector Regression model, respectively, and the corresponding downstream flow data is used as the target label for model training.
5. The method for cross-sectional flow estimation based on multi-station collaboration and machine learning ensemble algorithm according to claim 1, characterized in that, The step of inputting the upstream flow data at the time to be predicted into each of the trained base models, and integrating and weighting the outputs of each base model to obtain the downstream predicted flow, includes: The upstream flow data at the time to be predicted is input into each of the trained base models to obtain the preliminary predicted flow output by each of the base models at the time to be predicted as the output result; Using the time to be predicted as the time reference, a dynamic sliding data window of a preset duration is extracted from the history. The historical prediction sequences issued by each base model within the dynamic sliding data window are extracted, and the real downstream traffic sequences corresponding to the time of the historical prediction sequences are extracted from the downstream traffic data to form an online validation set. Calculate the determination coefficients of each of the base models on the online validation set; Based on the determination coefficients, anomaly prevention truncation and dynamic weight normalization are performed to obtain the dynamic weights corresponding to each base model. The preliminary predicted flow output by each of the base models is multiplied by its corresponding dynamic weight and then summed to obtain the downstream predicted flow.
6. The method for cross-sectional flow estimation based on multi-station collaboration and machine learning ensemble algorithm according to claim 1, characterized in that, Multiple different forecast periods are set; The construction of a prediction model group comprising multiple base models includes: For each forecast period, an independent set of forecast models is constructed. The step of inputting the upstream flow data at the time to be predicted into each of the trained base models, and integrating and weighting the outputs of each base model to obtain the downstream predicted flow, includes: By using the prediction model set specific to each forecast period, the downstream predicted flow corresponding to each forecast period is obtained respectively; The step of numerically calculating the downstream predicted flow rate based on the total catchment area of the target cross-section, the total catchment area of the upstream hydrological control station, and the total catchment area of the downstream hydrological control station, using the area analogy method, to obtain the projected flow rate of the target cross-section, includes: The downstream predicted flow corresponding to each forecast period is numerically converted using the area analogy method to obtain the projected flow of the target section under each forecast period.
7. The method for cross-sectional flow estimation based on multi-station collaboration and machine learning ensemble algorithm according to claim 6, characterized in that, The multiple different forecast periods consist of discrete time scale sequences, specifically including 1h, 3h, 6h, 12h, 18h, and 24h.
8. The method for cross-sectional flow estimation based on multi-station collaboration and machine learning ensemble algorithm according to claim 1, characterized in that, The step of numerically calculating the downstream predicted flow rate based on the total catchment area of the target cross-section, the total catchment area of the upstream hydrological control station, and the total catchment area of the downstream hydrological control station, using the area analogy method, to obtain the projected flow rate of the target cross-section, includes: The upstream flow data at the time to be predicted is combined with the average wave velocity of the main stream of the basin and then shifted with lag to obtain the total downstream flow of the upstream boundary after the confluence lag reverse shift alignment. The difference between the predicted downstream flow and the sum of the upstream boundary discharge flows is calculated as the total flow rate of the interval. The area weight ratio is obtained by dividing the difference between the total catchment area of the target section and the total catchment area of the upstream hydrological control station by the difference between the total catchment area of the downstream hydrological control station and the total catchment area of the upstream hydrological control station. Multiply the total flow rate of the interval by the area weight ratio and add it to the total flow rate of the upstream boundary to obtain the projected flow rate of the target section.
9. The method for cross-sectional flow estimation based on multi-station collaboration and machine learning ensemble algorithm according to claim 8, characterized in that, The method further includes: When the difference between the total catchment area of the downstream hydrological control station and the total catchment area of the upstream hydrological control station is less than a preset area threshold, it is determined that the interval between the upstream hydrological control station and the downstream hydrological control station is in a zero-flow overlap region, the area simulation is stopped, and the simulated flow of the target section is equal to the sum of the downstream flow of the upstream boundary.
10. The method for cross-sectional flow estimation based on multi-station collaboration and machine learning ensemble algorithm according to claim 1, characterized in that, In terms of physical spatial attributes, the target section is located within the physical river segment between the upstream hydrological control station and the downstream hydrological control station, and the target section lacks historical measured flow time series.