Methods for Generating Hydraulic Characteristic Prediction Models
By preprocessing data from long-distance open water conveyance channels and training neural networks, a hydraulic characteristic prediction model is generated, which solves the limitations of the monitoring system and enables rapid and reliable prediction of hydraulic characteristics, supporting water conservancy scheduling and flood warning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HOHAI UNIV
- Filing Date
- 2026-04-22
- Publication Date
- 2026-05-26
AI Technical Summary
Existing technologies for monitoring and analyzing the hydraulic characteristics of long-distance open water conveyance channels have limitations in monitoring systems, which makes it easy to miss hydraulic abrupt changes, and are costly and difficult to cover the whole situation.
By acquiring static parameters, meteorological monitoring data, and gate scheduling data of the training open channel, a hydraulic characteristic prediction model is trained after data preprocessing. The initial hydraulic characteristic prediction network is used to predict hydraulic characteristic data, including data standardization, filtering, completion, and expansion. The model is then trained by combining neural networks and physical constraints.
It enables rapid and reliable prediction of the hydraulic characteristics of various sections of long-distance water conveyance open channels, provides real-time data support, and improves the accuracy of water conservancy scheduling and flood warning.
Smart Images

Figure CN122087458A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hydraulic characteristic prediction technology, and more specifically to a method for generating hydraulic characteristic prediction models. Background Technology
[0002] Long-distance open water conveyance channels are crucial hubs connecting water sources and water-demanding areas, undertaking the core function of inter-regional water resource transportation to alleviate problems such as agricultural irrigation, industrial production, and domestic water shortages caused by regional water supply and demand imbalances. However, their hydraulic characteristics are significantly affected by factors such as gate scheduling, structural operation, and extreme weather, easily leading to safety and operational problems such as sudden water level changes, overtopping, siltation, and reduced water conveyance efficiency.
[0003] Existing technologies still face the following challenges in monitoring and analysis: limitations of monitoring systems; traditional hydrological monitoring relies on densely deployed sensors, which is costly and difficult to cover the entire area; and hydraulic abrupt changes in unmonitored areas are easily missed.
[0004] Therefore, training a hydraulic characteristic prediction model to predict the hydraulic characteristic data of each cross-section in a long-distance water conveyance open channel has become an urgent problem to be solved. Summary of the Invention
[0005] This invention provides a method for generating a hydraulic characteristic prediction model to solve the problem of training a hydraulic characteristic prediction model to predict the hydraulic characteristic data corresponding to each cross-section in a long-distance water conveyance open channel.
[0006] In a first aspect, the present invention provides a method for generating a hydraulic characteristic prediction model, the method comprising: acquiring training static parameter data, training meteorological monitoring data, training gate scheduling data, and training hydraulic characteristic data corresponding to multiple training cross-sections in at least one training open channel; performing data preprocessing on the training static parameter data, training meteorological monitoring data, training gate scheduling data, and training hydraulic characteristic data to generate a target training dataset; wherein, the training hydraulic characteristic data is the label data in the target training dataset; training an initial hydraulic characteristic prediction network based on the target training dataset to obtain a target hydraulic characteristic prediction model; the target hydraulic characteristic prediction model is used to predict the hydraulic characteristic data of at least one target cross-section in the target open channel.
[0007] In one optional implementation, data preprocessing is performed on training static parameter data, training meteorological monitoring data, training gate scheduling data, and training hydraulic characteristic data to generate a target training dataset. This includes: standardizing the training static parameter data, training meteorological monitoring data, training gate scheduling data, and training hydraulic characteristic data, and generating an initial training data matrix based on the standardized data; identifying the initial training data matrix, and filtering and completing it according to the identification results to obtain a candidate training data matrix; determining the hydraulic characteristic elements corresponding to the training hydraulic characteristic data in the candidate training data matrix, as well as other elements besides the hydraulic characteristic elements; identifying each other element and determining the target influence weight of each other element on the hydraulic characteristic element; generating a backup training data matrix based on the target influence weight; expanding the backup training data matrix to generate the target training data matrix; and generating the target training dataset based on the target training data matrix.
[0008] In one optional implementation, identifying each other element and determining the target influence weight of each other element on the hydraulic characteristic element includes: obtaining the initial influence weight of each other element on the hydraulic characteristic element; calculating the correlation coefficient between each other element and the hydraulic characteristic element; adjusting the initial influence weight according to the correlation coefficient to obtain the backup influence weight corresponding to each other element; obtaining the data acquisition time corresponding to each other element; determining the time decay coefficient based on the data acquisition time; and adjusting the backup influence weight corresponding to each other element based on the time decay coefficient to obtain the target influence weight corresponding to each other element.
[0009] In one optional implementation, expanding the backup training data matrix to generate a target training data matrix includes: inputting the backup training data matrix into a preset generator to output a virtual training data matrix; inputting the virtual training data matrix into a preset discriminator to discriminate the virtual training data matrix based on a preset discriminant loss function; determining the expanded training data matrix from the virtual training data matrix based on the discriminant result; and generating the target training data matrix based on the backup training data matrix and the expanded training data matrix.
[0010] In one optional implementation, the initial hydraulic characteristic prediction network includes an input layer, a hidden layer, and an output layer. The initial hydraulic characteristic prediction network is trained based on a target training dataset to obtain a target hydraulic characteristic prediction model. This includes: determining the structure of the hidden layer in the initial hydraulic characteristic prediction network based on the size and complexity of the target training dataset; splitting the target training dataset into spatiotemporal coordinate data, training ensemble data, and label data; the training ensemble data includes training static parameter data, training meteorological monitoring data, and training gate scheduling data; inputting the spatiotemporal coordinate data into the input layer, and transmitting the training ensemble data through the independent parameter channels of the initial hydraulic characteristic prediction network; the hidden layer receiving the spatiotemporal coordinate data transmitted from the input layer and the training ensemble data transmitted through the independent parameter channels; the hidden layer extracting features from the spatiotemporal coordinate data and the training ensemble data to obtain target training features; the output layer outputting predicted hydraulic characteristic data based on the target training features; substituting the predicted hydraulic characteristic data and the training hydraulic characteristic data into a target loss function to obtain a target loss function value; and training the initial hydraulic characteristic prediction network based on the target loss function value to obtain the target hydraulic characteristic prediction model.
[0011] In one optional implementation, the hidden layer extracts features from the spatiotemporal coordinate data and the training integration data to obtain target training features. This includes: the first layer in the hidden layer performing a linear transformation on the spatiotemporal coordinate data and activating it using a first activation function to obtain primary training features; the second layer in the hidden layer performing a linear transformation on the primary training features and activating it using the first activation function to obtain secondary training features; the third layer in the hidden layer performing a linear transformation on the secondary training features and activating it using the first activation function to obtain intermediate training features; the fourth and higher layers in the hidden layer receiving the training features transmitted from the previous layer; performing a linear transformation on the previous layer's training features and using a second activation function to perform a non-linear transformation on the linear transformation result to obtain the current layer's training features; and the last layer in the hidden layer performing a weighted calculation on the training features corresponding to each layer to obtain the target training features.
[0012] In one optional implementation, the predicted hydraulic characteristic data includes predicted flow rate data and predicted water depth data. The target loss function includes observation data loss, physical information loss, and parameter regularization constraint loss. Substituting the predicted hydraulic characteristic data and training hydraulic characteristic data into the target loss function yields the target loss function value, including: calculating the observation data loss and physical information loss based on the predicted hydraulic characteristic data and training hydraulic characteristic data; wherein, the physical information loss includes the continuity equation residual and the momentum equation residual; the continuity equation residual reflects the conservation relationship between flow rate change and water depth change; the momentum equation residual reflects the water flow balance relationship; calculating the parameter regularization constraint loss based on each unknown parameter in the initial hydraulic characteristic prediction network; and determining the target loss function value based on the observation data loss and physical information loss.
[0013] In one optional implementation, determining the target loss function value based on the observation data loss value and the physical information loss value includes: obtaining the initial weights corresponding to the physical information loss values respectively; calculating the first gradient value corresponding to the observation data loss value and the second gradient value corresponding to the physical information loss value; adjusting the initial weights according to the first gradient value and the second gradient value to obtain the target weights corresponding to the physical information loss values respectively; multiplying the target weights by the physical information loss value and then adding the observation data loss value to obtain the target loss function value.
[0014] In one optional implementation, the initial hydraulic characteristic prediction network is trained based on the target loss function value to obtain the target hydraulic characteristic prediction model. This includes: calculating the gradient values of the target loss function value with respect to the weights and biases of each layer from the output layer to the input layer using a backpropagation algorithm; updating the network parameters of the initial hydraulic characteristic prediction network based on the gradient values with respect to the weights and biases of each layer to obtain the initial network parameters; optimizing the initial network parameters to obtain the target network parameters; and obtaining the target hydraulic characteristic prediction model based on the target network parameters.
[0015] In one optional implementation, optimizing the initial network parameters to obtain the target network parameters includes: for each training iteration, calculating the first derivative of the target loss function based on the initial network parameters, and calculating the Hessian matrix using the limited-memory BFGS algorithm; adjusting the iteration step size according to the eigenvalues of the Hessian matrix; iteratively optimizing the initial network parameters based on the iteration step size; until the absolute difference between the current target loss function value corresponding to the current iteration number and the historical target loss function value corresponding to the previous iteration number is less than a preset difference threshold, thereby obtaining the target network parameters.
[0016] The hydraulic characteristic prediction model generation method provided in this embodiment acquires training static parameter data, training meteorological monitoring data, training gate scheduling data, and training hydraulic characteristic data corresponding to multiple training sections in at least one training open channel. This covers the core influencing factors of hydraulic changes in the open channel, enabling the model to learn the complete correlation logic of "geometric constraints - natural driving forces - human regulation - hydraulic response." The training hydraulic characteristic data serves as labels, providing a clear reference standard for subsequent parameter optimization, transforming the model's learning objective from "aiming without a target" to "accurately fitting real hydraulic laws." Data preprocessing is performed on the training static parameter data, training meteorological monitoring data, training gate scheduling data, and training hydraulic characteristic data to generate a target training dataset. Static, meteorological, and scheduling data are explicitly set as input features, and hydraulic characteristic data as prediction labels, allowing the network to directly learn the mapping relationship between input and output, simplifying the training logic and improving training efficiency. An initial hydraulic characteristic prediction network is trained based on the target training dataset to obtain the target hydraulic characteristic prediction model. A well-trained target hydraulic characteristic prediction model can quickly output the predicted water depth and flow rate of the target cross-section, providing real-time and reliable data support for engineering decisions such as water conservancy scheduling, flood warning, and channel operation and maintenance, thus realizing the transformation from a theoretical model to a practical tool. This solves the problem of training a hydraulic characteristic prediction model to predict the hydraulic characteristic data corresponding to various cross-sections in long-distance open water conveyance channels. Attached Figure Description
[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of the first process of generating a hydraulic characteristic prediction model according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the second process of generating a hydraulic characteristic prediction model according to an embodiment of the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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.
[0020] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.
[0021] According to an embodiment of the present invention, a method for generating a hydraulic characteristic prediction model is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0022] This embodiment provides a method for generating a hydraulic characteristic prediction model, which can be used in electronic devices. Figure 1 This is a flowchart of a hydraulic characteristic prediction model generation method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S101: Obtain training static parameter data, training meteorological monitoring data, training gate scheduling data, and training hydraulic characteristic data corresponding to multiple training sections in at least one training open channel.
[0023] The training hydraulic characteristic data may include at least one of the training water level data and the training flow rate data.
[0024] Specifically, electronic equipment can use drones for panoramic mapping combined with laser rangefinders to measure the total length of the training open channel, the bottom width, height, and slope coefficient (trapezoidal section) of each training section, and obtain static parameter data for training. In addition, electronic equipment can use a level to measure the channel bed slope (S0) and combine it with engineering design data to obtain the initial comprehensive roughness coefficient (n); if design data is lacking, empirical values can be used (n=0.012-0.018 for concrete-lined open channels).
[0025] The electronic equipment can acquire training meteorological monitoring data corresponding to multiple training sections in at least one training open channel transmitted by a meteorological station via a wireless transmission module. The electronic equipment can automatically record the gate opening value through the gate control system, or manually record the opening value at regular intervals (every 5 minutes), to obtain training gate scheduling data, ensuring that the scheduling data is synchronized with the hydraulic data in time.
[0026] Electronic devices can also collect training water level data and training flow data corresponding to multiple training sections in the training open channel through water level gauges and flow meters.
[0027] Step S102 involves preprocessing the training static parameter data, training meteorological monitoring data, training gate scheduling data, and training hydraulic characteristic data to generate the target training dataset.
[0028] The training hydraulic characteristics data are the labeled data in the target training dataset.
[0029] Specifically, electronic devices can perform data removal and completion operations on training static parameter data, training meteorological monitoring data, training gate scheduling data, and training hydraulic characteristic data to generate a target training dataset.
[0030] This step will be explained in detail below.
[0031] Step S103: Train the initial hydraulic property prediction network based on the target training dataset to obtain the target hydraulic property prediction model.
[0032] Among them, the target hydraulic characteristic prediction model is used to predict the hydraulic characteristic data of at least one target section in the target open channel.
[0033] Specifically, the target training dataset is input into the initial hydraulic property prediction network, and then the parameters of the initial hydraulic property prediction network are updated to obtain the target hydraulic property prediction model.
[0034] This step will be explained in detail below.
[0035] The hydraulic characteristic prediction model generation method provided in this embodiment acquires training static parameter data, training meteorological monitoring data, training gate scheduling data, and training hydraulic characteristic data corresponding to multiple training sections in at least one training open channel. This covers the core influencing factors of hydraulic changes in the open channel, enabling the model to learn the complete correlation logic of "geometric constraints - natural driving forces - human regulation - hydraulic response." The training hydraulic characteristic data serves as labels, providing a clear reference standard for subsequent parameter optimization, transforming the model's learning objective from "aiming without a target" to "accurately fitting real hydraulic laws." Data preprocessing is performed on the training static parameter data, training meteorological monitoring data, training gate scheduling data, and training hydraulic characteristic data to generate a target training dataset. Static, meteorological, and scheduling data are explicitly set as input features, and hydraulic characteristic data as prediction labels, allowing the network to directly learn the mapping relationship between input and output, simplifying the training logic and improving training efficiency. An initial hydraulic characteristic prediction network is trained based on the target training dataset to obtain the target hydraulic characteristic prediction model. A well-trained target hydraulic characteristic prediction model can quickly output the predicted water depth and flow rate of the target cross-section, providing real-time and reliable data support for engineering decisions such as water conservancy scheduling, flood warning, and channel operation and maintenance, thus realizing the transformation from a theoretical model to a practical tool. This solves the problem of training a hydraulic characteristic prediction model to predict the hydraulic characteristic data corresponding to various cross-sections in long-distance open water conveyance channels.
[0036] This embodiment provides a method for generating a hydraulic characteristic prediction model, which can be used in electronic devices. Figure 2 This is a flowchart of a hydraulic characteristic prediction model generation method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps: Step S201: Obtain training static parameter data, training meteorological monitoring data, training gate scheduling data, and training hydraulic characteristic data corresponding to multiple training sections in at least one training open channel.
[0037] Please refer to the above description of step S101 for details on this step, which will not be repeated here.
[0038] Step S202 involves preprocessing the training static parameter data, training meteorological monitoring data, training gate scheduling data, and training hydraulic characteristic data to generate the target training dataset.
[0039] The training hydraulic characteristics data are the labeled data in the target training dataset.
[0040] Specifically, step S202 above may include the following steps: Step S2021 involves standardizing the training static parameter data, training meteorological monitoring data, training gate scheduling data, and training hydraulic characteristic data, and generating an initial training data matrix based on the standardized data.
[0041] Specifically, the electronic equipment can classify training static parameter data according to the structure "training open channel number - training section number - parameter type - measurement time - accuracy level". The parameter type covers core geometric parameters such as open channel length, section bottom width, section height, and slope coefficient. For example: "Q01-D05-bottom width-20240101-±0.01m". The electronic equipment can uniformly encapsulate training meteorological monitoring data according to the format "timestamp-rainfall intensity (mm / h)-wind speed (m / s)-temperature (°C)", for example: "202401010800-0.2-2.5-15.3". The electronic equipment can uniformly encapsulate training gate scheduling data according to the format "timestamp-gate number-opening degree (%)-scheduling instruction-execution duration (min)", for example: "202401010805-Z01-50-maintained opening degree-30". The electronic testing equipment can standardize the training hydraulic characteristic data according to the format of "training open channel number-training section number-time stamp-water depth-flow".
[0042] Then, the electronic equipment associates and binds the standardized training static parameter data, training image monitoring data, training gate scheduling data and training hydraulic characteristic data one-to-one to generate an initial training data matrix of "one-dimensional time axis + multi-dimensional data items". The columns of the initial training data matrix include open channel number, cross-section number, static parameters (bottom width, slope coefficient, etc.), meteorological parameters (rainfall intensity, etc.), gate scheduling parameters (opening degree, command code, etc.), and hydraulic characteristic data (water depth, flow rate).
[0043] Step S2022: Identify the initial training data matrix, and based on the identification results, filter and complete the initial training data matrix to obtain the candidate training data matrix.
[0044] Specifically, the electronic equipment can identify outliers in the initial training data matrix and directly remove those that do not conform to common engineering sense, such as obviously erroneous data like bottom width < 1m, slope coefficient < 0, and open channel length < 100m. Then, the electronic equipment uses the 3σ criterion to filter core dynamic parameters in the initial training data matrix, such as rainfall intensity, wind speed, gate opening, water depth, and flow rate, removing extreme values that exceed "mean ± 3 times standard deviation" (such as abnormal rainfall data of 100mm / h or data with a sudden change in flow rate of more than 30% within 5 minutes without a reasonable cause).
[0045] Furthermore, electronic devices can construct isolated forest models, using the associated "meteorological-gate-hydraulic" data as input features (including rainfall intensity, gate opening change rate, water depth change rate, etc.) to specifically identify hidden outliers. For example, when there is no rainfall and the gate opening remains unchanged, a sudden increase of 0.5m in water depth within 5 minutes (exceeding the normal fluctuation range) is identified as sensor malfunction data; a sudden drop in gate opening from 50% to 0% without a significant decrease in flow rate is identified as abnormal data transmission. If training static parameter data for some training sections are missing (e.g., slope coefficient not measured), the missing data is supplemented based on the statistical regularity of parameters in similar open channels (e.g., the slope coefficient of rectangular open channels is mostly 1.5-2.0) and the mean values of parameters from adjacent sections. After supplementation, the data is labeled "Statistical Supplement - Confidence Level 90%" to clearly indicate the data source.
[0046] If dynamic data such as training meteorological monitoring data, training gate scheduling data, and training hydraulic characteristic data are missing, and the missing period is short (e.g., ≤3 sampling points, i.e., 15 minutes), an attention-based LSTM interpolation model is used to focus on the "meteorological-gate-hydraulic" correlation features before and after the missing period (e.g., the logical chain of increased rainfall intensity → gate opening adjustment → water depth increase) to accurately fill in the missing values. If the missing period is long (e.g., >3 sampling points), the electronic equipment adopts a "physical law + historical similarity" fusion completion method. First, the theoretical range of hydraulic parameters for the missing period is derived based on the Saint-Venant equation, and then valid data from the same historical period (same season, same meteorological conditions, same gate scheduling mode) is matched for interpolation to ensure that the completion error is controlled within 5%.
[0047] The data, after double filtering and hierarchical completion, is reorganized according to the original matrix structure to ensure data integrity (core parameter missing rate ≤ 0.5%) and physical consistency (contradictory data rate ≤ 0.3%), ultimately forming a candidate training data matrix.
[0048] Step S2023: Determine the hydraulic characteristic elements corresponding to the training hydraulic characteristic data in the candidate training data matrix, as well as other elements besides the hydraulic characteristic elements.
[0049] Specifically, the electronic device can determine the hydraulic characteristic elements corresponding to the training hydraulic characteristic data from the candidate training data matrix, namely the water level element and the water depth element, and determine other elements besides the hydraulic characteristic elements. The electronic device can classify other elements, such as static parameters including: open channel bottom width, slope coefficient, and length; meteorological monitoring parameters including: rainfall intensity, air temperature, and wind speed; and gate scheduling parameters including: gate opening degree and opening change rate.
[0050] Step S2024: Identify other elements and determine the target influence weight of each other element on the hydraulic characteristic element.
[0051] Specifically, step S2024 above may include the following steps: Step a1: Obtain the initial influence weights of each other element on the hydraulic property element.
[0052] Specifically, the electronic device can receive the initial influence weights of other elements on the hydraulic characteristic elements input by the user; it can also receive the initial influence weights of other elements on the hydraulic characteristic elements sent by other devices; and it can determine the initial influence weights of other elements on the hydraulic characteristic elements based on engineering experience and physical laws.
[0053] For example, the initial influence weight of gate opening on flow element Q is 0.8, and the initial influence weight of water level element h is 0.8; the initial influence weight of rainfall intensity on flow element Q is 0.8, and the initial influence weight of water level element h is 0.8; the initial influence weight of air temperature on flow element Q is 0.3, and the initial influence weight of water level element h is 0.3; the initial influence weight of wind speed on flow element Q is 0.3, and the initial influence weight of water level element h is 0.3; the initial influence weights of bottom width, slope coefficient, and length on flow element Q are 0.3, and the initial influence weights of water level element h are 0.3.
[0054] Step a2: Calculate the correlation coefficients between each of the other elements and the hydraulic characteristic elements.
[0055] Specifically, for each other element and each hydraulic characteristic element, an independent binary data set of "other element - hydraulic characteristic element" is formed, such as "gate opening - water depth", "rainfall intensity - flow rate", "bottom width - water depth", etc.
[0056] Electronic devices use the following formula to calculate the correlation coefficient r of each binary data set, quantifying the strength of the linear association: ,in, This is the i-th time series data of other elements; This is the mean of the time series data corresponding to the other elements; The i-th time series data of the hydraulic characteristic element; is the mean of the time series data of hydraulic characteristic elements; n is the number of samples in the binary data set (number of time series data points).
[0057] Step a3: Adjust the initial influence weights according to the correlation coefficients to obtain the alternative influence weights for each of the other elements.
[0058] Specifically, electronic devices can adjust the initial influence weights based on the correlation coefficient to obtain the alternative influence weights for each of the other elements. For example, the corrected alternative influence weight = initial base weight × correlation coefficient.
[0059] Step a4: Obtain the data collection time for each of the other elements.
[0060] Specifically, for dynamic data among other elements (gate opening, rainfall intensity, temperature, wind speed, water depth, flow rate), the electronic equipment can extract the timestamp (accurate to the day) of each data point as the data acquisition time. For static data (bottom width, slope coefficient, length), the electronic equipment can uniformly record the acquisition time as the first measurement time; if multiple measurements are taken, the latest measurement time will be used.
[0061] Step a5: Determine the time decay coefficient based on the data acquisition time.
[0062] Specifically, electronic devices can use the "current time" as a reference and subtract the data acquisition time from the current time to obtain the time interval Δt. The formula is Δt = current time - data acquisition time (unit: days). When Δt ≤ 0 (if the data acquisition time is in the future or the present, it has no practical significance), it is treated as Δt = 0.
[0063] Then, based on the time interval, the attenuation coefficient is calculated using the following formula: ,in, This is the critical period of decay. A value greater than 0 can be 60 days, 30 days, or other durations. This application specifies... No specific limitations are specified. Δt is in the range of 0- Within this range, the attenuation coefficient α decreases linearly with Δt, reflecting the attenuation of data timeliness.
[0064] Step a6: Based on the time decay coefficient, adjust the backup influence weights corresponding to each other element to obtain the target influence weights corresponding to each other element.
[0065] Specifically, electronic devices can multiply the backup influence weight by the time decay coefficient to obtain the target influence weight corresponding to each other element.
[0066] Step S2025: Generate a backup training data matrix based on the target influence weights.
[0067] Specifically, the electronic device can perform a weighted calculation on each element in the candidate training data matrix, excluding the hydraulic characteristic element, according to its corresponding target influence weight: the weighted element = original other elements × target influence weight, thereby generating a backup training data matrix. For example, if the target influence weight of the gate opening is 0.96 and the original opening data is 50%, then the weighted data = 50% × 0.96 = 48%; if the original rainfall intensity data is 25 mm / h and the target influence weight is 1.0, then the weighted data = 25 mm / h × 1.0 = 25 mm / h.
[0068] Step S2026: Expand the backup training data matrix to generate the target training data matrix.
[0069] Specifically, step S2026 above may include the following steps:
[0070] Step b1: Input the backup training data matrix into the preset generator and output the virtual training data matrix;
[0071] Specifically, the input layer of the preset generator receives two parts of input: a 100-dimensional random noise vector (generated using different seed values to ensure virtual sample diversity) and a backup training data matrix. The hidden layer of the preset generator consists of a 3-layer LSTM network (64 neurons per layer) + a 2-layer fully connected network (32 neurons per layer). The LSTM layers specifically capture the dependencies in time-series data, such as the temporal correlation between changes in rainfall intensity and subsequent water depth changes, and the lag relationship between gate opening adjustments and flow rate changes. The fully connected layers perform non-linear mapping on the temporal features extracted by the LSTM layers, enhancing feature representation capabilities. The LSTM layers have no activation function, the fully connected layers use the LeakyReLU activation function (to avoid gradient vanishing and improve model training stability), and the output layer uses the Sigmoid activation function (to ensure that the output value is in the [0,1] interval, consistent with the normalized real data format). The output layer outputs a virtual time-series data sequence that is completely consistent with the structure of the real data vector, containing "static parameters + dynamic parameters of 20 sampling points (rainfall intensity, gate opening, water depth, flow rate)", forming the basic unit of the virtual training data matrix.
[0072] Step b2: Input the virtual training data matrix into the preset discriminator, discriminate the virtual training data matrix based on the preset discriminant loss function, and determine the expanded training data matrix from the virtual training data matrix according to the discriminant result; Specifically, the input layer of the preset discriminator receives real data time-series segments (i.e., the backup training data matrix) or a virtual training data matrix output by the generator (the dimensions are completely consistent with the real data to ensure the fairness of the discrimination).
[0073] The preset discriminator's feature extraction layer consists of two CNN layers (3×1 kernel size, stride 1) and one attention mechanism layer. The CNN layers extract local features from the time-series data, such as sudden changes in flow rate at a sampling point or the increasing trend of rainfall intensity across several consecutive sampling points. The attention mechanism layer focuses on key time-series nodes (such as the moment of sudden changes in gate opening or the moment of peak rainfall intensity), strengthening the feature weights of these core nodes and improving discrimination accuracy. The preset discriminator's classification layer consists of two fully connected layers, with outputs of a single value between 0 and 1, used to determine whether the input data is "real data (label 1)" or "virtual training data matrix (label 0)".
[0074] The loss function of the pre-defined discriminator is "binary cross-entropy + physical constraint loss term", and the formula is: Loss disc =Loss ce +Loss phys Among them, the binary cross-entropy (Loss) ceThe goal is to quantify the classification accuracy of the pre-defined discriminator on real data and virtual training data matrices, aiming to enable the discriminator to accurately distinguish between the two types of data; the physical constraint loss term (Loss) phys To ensure the virtual training data matrix satisfies the basic laws of open channel hydraulics, the formula is: Where: Q is the flow rate, A is the cross-sectional area of the water passage (calculated from the bottom width, slope coefficient, and water depth), and v is the flow velocity (based on Manning's formula). The derivation is as follows: R is the hydraulic radius, and S0 is the riverbed slope. (The specific details of the Manning formula are common knowledge and not protected by this application, therefore they will not be described in detail.) Δh is the change in water depth (difference in water depth between adjacent sampling points), and ΔP is the change in rainfall intensity (difference in rainfall intensity between adjacent sampling points). α and β are weighting coefficients (both set to 0.3) to balance the contributions of physical information loss and classification loss.
[0075] Specifically, the discriminator and generator are trained alternately. In each training round, the generator is first fixed, and the discriminator parameters are updated to improve classification accuracy; then the discriminator is fixed again, and the generator parameters are updated to reduce the discriminator's recognition accuracy, and this process is repeated iteratively. Training stops when the discriminator's recognition accuracy on the virtual training data matrix approaches 50% (48%-52%), and the physical constraint loss term Lossphys ≤ 0.1 (physical consistency meets the standard). The electronic device inputs the generated virtual training data matrix into the trained discriminator, filtering out two types of high-quality virtual training data matrices: those misclassified as "real data" by the discriminator (output value ≥ 0.5); and those with a physical constraint loss term Lossphys ≤ 0.1. phys A virtual training data matrix with a value ≤0.1. The electronic device integrates virtual training data matrices that simultaneously meet both of the above conditions to form an expanded training data matrix, ensuring that its quality is comparable to that of the real data.
[0076] Step b3: Generate the target training data matrix based on the backup training data matrix and the expanded training data matrix.
[0077] Specifically, the electronic device mixes the backup training data matrix and the augmented training data matrix to generate the target training data matrix.
[0078] Step S2027: Generate the target training dataset based on the target training data matrix.
[0079] Specifically, the electronic device can divide the target training data matrix into three parts in a 7:2:1 ratio: training set (70%): used for updating the parameters of the target hydraulic characteristic prediction model; validation set (20%): used for monitoring the training process (such as early stopping mechanism and generalization ability evaluation); and test set (10%): used for the final performance evaluation of the model. During the partitioning, it is ensured that all three datasets cover all scenarios to avoid data skew, thus obtaining the target training dataset.
[0080] Step S203: Train the initial hydraulic property prediction network based on the target training dataset to obtain the target hydraulic property prediction model.
[0081] Among them, the target hydraulic characteristic prediction model is used to predict the hydraulic characteristic data of at least one target section in the target open channel.
[0082] Specifically, step S203 above may include the following steps: Step S2031: Based on the size and complexity of the target training dataset, determine the structure of the hidden layer in the initial hydraulic property prediction network.
[0083] Specifically, the electronic device can determine the number of hidden layers and neurons based on the size and complexity of the target training dataset using a Bayesian optimization algorithm: if the length of each training channel is <1km and the number of data samples is <5000, use 3 hidden layers (16 neurons per layer); if the length of each training channel is 1-3km and the number of data samples is 5000-10000, use 5 hidden layers (24 neurons per layer); if the length of each training channel is >3km and the number of data samples is >10000, use 8 hidden layers (32 neurons per layer).
[0084] Step S2032: Split the target training dataset into spatiotemporal coordinate data, training integration data, and label data.
[0085] The training integration data includes training static parameter data, training meteorological monitoring data, and training gate scheduling data.
[0086] Specifically, the electronic device can extract the spatial coordinate x (distance from the open channel cross-section to the starting point, in km) and time coordinate t (data acquisition time, in min) of each sample from the target training dataset. Then, it can organize the data in the format of "sample number-spatial coordinate x-time coordinate t" to form a two-dimensional spatiotemporal coordinate data matrix (each row corresponds to the spatiotemporal information of one sample) and perform normalization processing.
[0087] Then, the electronic equipment organizes the training static parameter data, training meteorological monitoring data, and training gate scheduling data into the format of "sample number-static parameter-meteorological parameter-gate scheduling parameter" to obtain the integrated training data.
[0088] In addition, the electronic device extracts the training hydraulic characteristic data corresponding to each sample from the target training dataset, namely water depth h (in meters) and flow rate Q (in cubic meters per second). 3 / s). Organize the samples according to the format "sample number-water depth h-flow rate Q" to ensure a one-to-one correspondence with the spatiotemporal coordinate data and the training and integration data, and avoid data misalignment.
[0089] Step S2033: Input the spatiotemporal coordinate data into the input layer, and input the training and integration data through the independent parameter channels of the initial hydraulic property prediction network.
[0090] Specifically, the input layer of the initial hydraulic property prediction network has 2 neurons (corresponding to x and t), which directly receive the normalized spatiotemporal coordinate data. The input layer only performs data reading and format verification. After confirming that the data is normal in the range [-1,1], the data is transmitted completely to the first hidden layer. The initial hydraulic characteristic prediction network has an additional independent parameter channel (running in parallel with the input layer and not occupying input layer neuron resources) dedicated to transmitting training and integration data. The training and integration data is fed into the channel in the order of "static parameters → meteorological parameters → gate scheduling parameters". After being standardized and validated (e.g., the reasonableness of parameter ranges), it is synchronously transmitted to the hidden layer.
[0091] In step S2034, the hidden layer receives the spatiotemporal coordinate data transmitted from the input layer and the training integrated data passed in from the independent parameter channels.
[0092] Specifically, the hidden layer receives spatiotemporal coordinate data transmitted from the input layer and training integration data passed in from independent parameter channels.
[0093] In step S2035, the hidden layer extracts features from the spatiotemporal coordinate data and the integrated training data to obtain the target training features.
[0094] Specifically, step S2035 above may include the following steps: In step c1, the first layer in the hidden layer performs a linear transformation operation on the spatiotemporal coordinate data and performs activation processing based on the first activation function to obtain the primary training features.
[0095] Specifically, the first hidden layer in the hidden layer receives the normalized spatiotemporal coordinate data (x,t) transmitted from the input layer, and at the same time obtains the training static parameter data in the training integration data through the independent parameter channel.
[0096] Then, the electronic device performs a linear transformation on the spatiotemporal coordinate data using a dedicated weight matrix w1 and a bias b1, with the formula: y1 = w1·(x,t) + b1. Here, the weight w1 adapts to the constraints of the static parameter data during training: for example, in a wide-bottomed open channel with a bottom width b = 10m, the weight corresponding to x (spatial coordinate) will be higher than in a narrow-bottomed open channel, highlighting the influence of spatial location on flow capacity; in hydraulically sensitive areas (such as near a gate at x = 0.5km), the weight of x is automatically increased to enhance local feature capture. The bias b1 is used to adjust the neuron activation threshold, preventing the initial feature output from concentrating in a certain interval and accelerating gradient propagation.
[0097] Then, the linear transformation result y1 is activated using the first activation function tanh, with the formula: a1=tanh(y1). The output range of the tanh function is [-1,1], which effectively enhances the stability of gradient propagation and avoids gradient vanishing in the initial stage. This step initially extracts the linear correlation features between "spatiotemporal and static parameters", such as the basic patterns of "a certain spatial cross-section of a wide-bottom open channel → higher foundation water depth" and "time over time + fixed bottom width → gradual change in flow rate". Finally, the activated primary training feature a1 (integrating spatiotemporal and static parameter constraints) is completely passed to the second hidden layer.
[0098] In step c2, the second layer in the hidden layer performs a linear transformation operation on the primary training features and performs activation processing based on the first activation function to obtain secondary training features.
[0099] Specifically, the second layer in the hidden layer receives the primary training features a1 output by the first hidden layer, and accesses the training meteorological monitoring data (rainfall intensity P, temperature T, wind speed V) through an independent parameter channel, injecting external driving factors of hydraulic changes.
[0100] Then, the electronic device performs a quadratic linear transformation on the primary training feature a1 through the weight matrix w2 and the bias b2, with the formula: y2=w2·a1+b2; where the weight w2 strengthens the "meteorological-spatiotemporal" correlation: for example, when the rainfall intensity P>20mm / h (rainstorm condition), the correlation weight of "t (time)-a1 (primary spatiotemporal feature)" in w2 is amplified to highlight the interactive logic of "rainfall period → water depth rise"; when the temperature is high (T>35℃), the correlation weight of "t-flow loss" is appropriately increased to reflect the influence of evaporation on hydraulic characteristics.
[0101] The electronic device continues to use the first activation function, tanh, with the formula: a2 = tanh(y2), to further enhance gradient stability and avoid feature distortion caused by dynamic fluctuations introduced by meteorological data. Finally, a secondary training feature a2 is generated, which already contains the "spatiotemporal interaction + meteorological driving" pattern (such as "heavy rain period + downstream section → rapid rise in water depth"), and is passed to the third hidden layer.
[0102] In step c3, the third layer in the hidden layer performs a linear transformation operation on the secondary training features and performs activation processing based on the first activation function to obtain the intermediate training features.
[0103] Specifically, the third layer in the hidden layer receives the secondary training features a2 output by the second hidden layer, and accesses the training gate scheduling data (opening degree θ, opening degree change rate Δθ / Δt, scheduling instruction code C) through an independent parameter channel, incorporating human intervention logic.
[0104] Then, the secondary training feature a2 is linearly transformed by the weight matrix w3 and the bias b3, with the formula: y3=w3·a2+b3; where the weight w3 focuses on the synergistic relationship between "schedule-spatial-meteorological": for example, when the gate opening change rate Δθ / Δt>50% / 5min (emergency scheduling), w3 amplifies the weight of "t-a2 (secondary training feature)" to capture the interaction pattern of "sudden gate adjustment → sudden flow change"; when the opening is stable (Δθ / Δt<5%), the relationship between "x-a2" is strengthened to reflect the role of scheduling in maintaining hydraulic balance.
[0105] The electronic device continues to use the first activation function tanh for activation processing, with the formula: a3=tanh(y3), to ensure that the gradient continues to propagate stably and avoid feature interference caused by multi-data fusion.
[0106] Finally, the electronic device generates intermediate training features a3, which at this point cover the basic laws of "spatiotemporal coordination + meteorological drive + scheduling intervention" (such as "moderate rain + stable opening + midstream section → gradual rise in water depth"), laying the foundation for subsequent nonlinear feature extraction.
[0107] Step c4: The fourth and higher layers in the hidden layer receive the training features transmitted from the previous layer.
[0108] Specifically, the fourth hidden layer in the hidden layer receives the intermediate training feature a3 output by the third layer, and subsequent layers receive the features from the previous layer in turn (such as the fifth layer receiving a4); at the same time, independent parameter channels continuously transmit training static parameter data, training meteorological monitoring data, and training gate scheduling data to ensure multi-dimensional support for complex feature extraction.
[0109] Step c5 involves performing a linear transformation on the training features of the previous level, and then using the second activation function to perform a nonlinear transformation on the linear transformation result to obtain the current level training features corresponding to each level.
[0110] Specifically, each hidden layer undergoes a linear transformation (k≥4) through the weight matrix wk and the bias bk of the corresponding layer, with the formula: yk=wk·a k-1+bk. Among them, weight wk is optimized for complex scenarios. For example, in extreme conditions such as "heavy rain (P=30mm / h) + emergency gate closure (Δθ / Δt=-60% / 5min)," wk strengthens the synergistic weights of "meteorological parameters + scheduling parameters + spatiotemporal characteristics" to accurately capture the logic of sudden hydraulic changes. For example, in static parameter fusion: the larger the bottom width b, the higher the weight of flow-related features; the larger the slope coefficient m (steep slope open channel), the higher the weight of the water depth's sensitivity to rainfall response, reflecting the correlation between "geometric parameters and hydraulic nonlinearity"; in meteorological-scheduling synergistic fusion: for example, in the case of "heavy rain + increased gate opening," the fused features highlight the pattern of "nonlinear surge in flow"; in the case of "high temperature and strong winds + stable opening," the evaporation impact feature of "slow flow decay" is strengthened.
[0111] Next, the electronic device uses the second activation function, the Swish activation function, for nonlinear transformation, with the formula: ak = yk·sigmoid(yk). The Swish function accurately captures complex nonlinear patterns by adaptively adjusting the gradient: for example, in the frequent scheduling of gate opening from 50%→70%→50%, it fits the lag response of "flow first surges and then gradually decreases"; in the rainstorm scenario, it captures the abrupt change characteristics of "nonlinear surge in water depth", solving the problem of insufficient fitting of traditional activation functions for complex working conditions.
[0112] The training features ak of the current layer output by each layer are fully passed to the next layer, realizing the layer-by-layer deepening of "multi-data fusion + non-linear features".
[0113] In step c6, the last layer in the hidden layer performs a weighted calculation on the training features corresponding to each layer to obtain the target training features.
[0114] Specifically, the last layer in the hidden layer receives the training features output from the previous layer (e.g., the eighth layer receives a7), and at the same time summarizes the static parameters, meteorological, and scheduling data features fused throughout the process.
[0115] Then, the importance of all preceding features is weighted using a global weight matrix. For example, the weight allocation rule is that nonlinear features have higher weights than linear features (complex working conditions have higher priority); the weights of static parameter fusion features are dynamically adjusted according to the open channel type (the slope coefficient of trapezoidal open channels has higher weights than that of rectangular open channels); and the weights of meteorological and scheduling features are dynamically adjusted according to the working conditions (extreme working conditions have higher weights than normal working conditions).
[0116] Then, the integrated multi-dimensional features are converted into 2-dimensional feature vectors F, which correspond to "water depth prediction feature Fh" and "flow prediction feature FQ" respectively, and are precisely matched with the two neurons in the output layer.
[0117] Finally, the 2D target training features F(Fh,FQ) are transmitted to the output layer to complete the full-process feature extraction of multi-data fusion.
[0118] Step S2036: The output layer outputs predicted hydraulic property data based on the target training features.
[0119] Specifically, the output layer employs a linear activation function to avoid nonlinear transformations disrupting the continuity of hydraulic parameters, and performs a linear mapping based on the target training features F: Water depth prediction formula: ; Traffic flow prediction formula: Among them, the weight w h w Q With bias b h b Q Through continuous model training and optimization, the model adapts to the patterns of multi-data fusion features. For example, wh will enhance the positive contribution of the features "heavy rain + wide bottom + high opening" to water depth. Q It will highlight the adaptation relationship of "steep slope + high flow rate" characteristics. Each batch of data corresponds to a set of predicted values ( , ), which corresponds one-to-one with the training hydraulic characteristic labels (real h, Q) in the input data.
[0120] Step S2037: Substitute the predicted hydraulic characteristic data and the training hydraulic characteristic data into the target loss function to obtain the target loss function value.
[0121] Specifically, the predicted hydraulic characteristic data includes predicted flow rate data and predicted water depth data, and the target loss function includes observation data loss value, physical information loss value, and parameter regularization constraint loss value. The above step S2037 may include the following steps: Step d1: Calculate the observation data loss value and physical information loss value based on the predicted hydraulic characteristic data and the training hydraulic characteristic data.
[0122] Among them, the physical information loss values include the residuals of the continuity equation and the residuals of the momentum equation; the residuals of the continuity equation reflect the conservation relationship between the changes in flow rate and the changes in water depth; the residuals of the momentum equation reflect the balance relationship of water flow.
[0123] Specifically, the electronic device can use the following formula to calculate the observation data loss value based on the predicted hydraulic characteristic data and the training hydraulic characteristic data:
[0124] in, To predict the predicted water depth data in the hydraulic characteristic data, To predict the predicted flow rate data in the hydraulic characteristic data, To train the real water depth data in the hydraulic characteristic data, To train the real flow data in the hydraulic characteristic data.
[0125] Specifically, the electronic device can calculate the continuity equation residual (Fc) based on predicted hydraulic characteristic data and training hydraulic characteristic data, using the following formula: Where A is the cross-sectional area of the water passage (based on the type of open channel section, from...). Derivation of rectangular cross-section Trapezoidal cross section ); It is possible Derivation.
[0126] Electronic devices can calculate the momentum equation residual (Fm) based on predicted hydraulic characteristic data and training hydraulic characteristic data, using the following formula: in, For the riverbed slope, For friction slope, , where n is the Manning roughness coefficient of the river channel and R is the hydraulic radius.
[0127] Electronic devices can be based on calculation formulas: The physical information loss value is calculated.
[0128] Step d2: Determine the target loss function value based on the observation data loss value and the physical information loss value.
[0129] Specifically, step d2 above may include the following steps: Step d21: Obtain the initial weights corresponding to the physical information loss values.
[0130] Specifically, the electronic device can receive initial weights corresponding to the physical information loss values input by the user, and it can also receive initial weights corresponding to the physical information loss values sent by other devices. These initial weights only apply to the physical information loss values; the weight of the observed data loss values is 1 by default (no additional setting is required, it serves as a baseline). The initial weight of the physical information loss values is set to w. f The default initial value is 0.01. This initial weight is chosen to balance L during the early stages of training. data (Data fitting) and L pde The impact of (physical information loss value) should be considered to prevent any single loss factor from excessively dominating the model optimization direction in the initial stage. Therefore, the initial form of the objective loss function is: Loss = L data +w f ·L pde .
[0131] Step d22: Calculate the first gradient value corresponding to the observation data loss value and the second gradient value corresponding to the physical information loss value.
[0132] Specifically, electronic devices can adjust the observed data loss value L. dataCalculate the partial derivatives with respect to all unknown parameters in the initial hydraulic characteristic prediction network to obtain the first gradient value (gdata), which reflects L. data The rate of change of the model parameters as they are updated.
[0133] Electronic devices can compensate for the loss of physical information value L pde Taking the partial derivatives with respect to the model parameters yields the second gradient value (gpde), which reflects L. pde The rate of change of the model parameters as they are updated.
[0134] Step d23: Adjust the initial weights according to the first gradient value and the second gradient value to obtain the target weights corresponding to the physical information loss values.
[0135] Specifically, if g pde ≤g data (The second gradient value is much smaller than the first gradient value): This indicates that Lpde is decreasing slowly or increasing, and the physical information loss value is not fully satisfied; if g data ≤g pde (The first gradient value is much smaller than the second gradient value): This indicates that L data A slow decline or rise indicates a large data fitting deviation; if g data ≈g pde (The gradient values of the two are similar): This indicates that the rates of change of the two types of loss are balanced, and no weight adjustment is required.
[0136] Electronic devices can be set to adjust the frequency, for example, triggering a weight adjustment once every 1000 iterations (1000 model parameter updates), to avoid excessively frequent adjustments that could cause model training oscillations.
[0137] For example, scenario 1: The physical information loss value is not sufficiently satisfied (g pde ≤g data ), it is necessary to strengthen the weight of the physical information loss value, and to increase w f Increase L by 0.005 (e.g., from initial value 0.01 to 0.015). pde The increased proportion of composite loss prompts the model to prioritize optimizing the fit to physical laws. Scenario 2: Large data fitting bias (g data ≤g pde ): We need to strengthen the weights of data fitting, and increase w f Decrease by 0.003 (e.g., 0.015 → 0.012), reduce L. pde The proportion of gradient values allows the model to prioritize correcting data fitting biases. Scenario 3: Gradient value balancing (g data ≈g pde ): Keep the current w f The balance between the two types of losses remains unchanged.
[0138] When the fluctuation value of the target loss function Loss is less than 0.0001 for 5000 consecutive steps, it indicates that the model has stabilized. At this point, w can be fixed. f The value will not be adjusted further to avoid oscillations caused by weight changes during later training, ensuring that the model converges to the optimal solution.
[0139] Step d24: Multiply the target weight by the physical information loss value, and then add the observation data loss value to obtain the target loss function value.
[0140] Specifically, the electronic device will adjust the w in step d23. f The target weight (denoted as w) is used as the physical information loss value. ftarget Then, according to the formula for the target loss function, the observed data loss value is added to the weighted physical information loss value to obtain the target loss function value. The formula is: Loss target =L data +w ftarget ·L pde .
[0141] Step S2038: Based on the target loss function value, train the initial hydraulic characteristic prediction network to obtain the target hydraulic characteristic prediction model.
[0142] Specifically, step S2038 above may include the following steps: Step e1 involves using the backpropagation algorithm to calculate the gradient values of the target loss function with respect to the weights and biases of each layer from the output layer back to the input layer.
[0143] Specifically, the electronic device can start from the output layer and work backwards layer by layer to the input layer, processing all parameters of the hidden layers (eighth layer → seventh layer → … → first layer) and the input layer in sequence. The electronic device calculates the partial derivatives of the target loss function value with respect to the weights (w) and biases (b) of each layer, i.e., the gradient values, denoted as . (The gradient of the loss with respect to the weights) (The gradient of the loss with respect to the bias). For example, the electronic device computes the output layer depth prediction weights w. h gradient The gradient of the weight w1 in the first hidden layer gradient of bias b1 wait.
[0144] Step e2: Update the network parameters of the initial hydraulic property prediction network based on the gradient values of the weights and biases of each layer to obtain the initial network parameters.
[0145] Specifically, the electronic device can update the network parameters using the Adam optimizer (a classic optimizer combining momentum and adaptive learning rate) based on the gradient values obtained in step e1, thus obtaining the initial network parameters. This process is divided into two stages: initialization and batch update.
[0146] During the initialization phase, before training begins, the first-order momentum parameter and second-order momentum of the Adam optimizer are initialized to 0, where the first-order momentum m t Used to smooth gradients and reduce oscillations during training; second-order momentum v t Used to adaptively adjust the learning rate and adapt the gradient scale to different parameters.
[0147] Then, for the weights w and biases b of each layer, perform the following three updates in sequence: Step 1: Update the first-order momentum m t (Gradient smoothing): ;in, (Momentum decay coefficient, empirical value); m t-1 This is the first-order momentum from the previous iteration; The gradient value for the current batch ( or This allows for the fusion of current and historical gradients, reducing drastic gradient fluctuations and making parameter updates smoother.
[0148] Step 2: Update the second-order momentum vt (adaptive learning rate): ; in, Second-order momentum decay coefficient (empirical value from engineering experience). This is the second-order momentum from the previous iteration; This represents the square of the current gradient. The accumulated squared value of the gradient is then recorded, allowing for the generation of adaptive learning rates for different parameters (smaller learning rates for parameters with larger gradients, and larger learning rates for parameters with smaller gradients), thus resolving the issue of inconsistent gradient scales for different parameters.
[0149] Step 3: Update weights w t With bias b t (Core parameters updated): ; Where η is the initial learning rate (default 0.001); To achieve the minimum value, avoid the denominator (vt) being 0; and These are the weights and biases from the previous iteration, respectively.
[0150] Optionally, the electronic device can decay the learning rate η by 50% every 30,000 iterations. For example, η = 0.0005 at 30,000 steps, η = 0.00025 at 60,000 steps, and η = 0.000125 at 90,000 steps. This allows for rapid approximation of the optimal solution with a larger learning rate in the early stages of training, followed by fine-tuning of the parameters with a smaller learning rate in the later stages, avoiding oscillations around the optimal solution. After completing the above steps, the initial network parameters (updated weights and biases of each layer) are obtained, preparing for subsequent higher-order optimizations.
[0151] Step e3: Optimize the initial network parameters to obtain the target network parameters.
[0152] Specifically, step e3 above may include the following steps: Step e31: For each training iteration, calculate the first derivative of the target loss function based on the initial network parameters, and calculate the Hessian matrix using the limited-memory BFGS algorithm.
[0153] Specifically, in each iteration, the electronic device can calculate the first derivative of the target loss function (i.e., the gradient value in step e1) based on the current initial network parameters. Then, the Hessian matrix (a second-order derivative matrix reflecting the rate of change of the gradient) is approximated using historical gradient information through the L-BFGS algorithm. Compared to directly calculating the Hessian matrix (which consumes a lot of memory and is computationally slow), L-BFGS only stores a small amount of historical gradient information, reducing memory usage while maintaining accuracy, making it suitable for large-scale networks. The Hessian matrix can accurately reflect the shape of local optima in the parameter space (such as flat regions and steep regions), making the parameter update direction more closely match the optimal solution trajectory and preventing the Adam optimizer from getting trapped in local optima.
[0154] Step e32: Adjust the iteration step size based on the eigenvalues of the Hessian matrix.
[0155] Specifically, the magnitude of the eigenvalues of the Hessian matrix reflects the curvature of the parameter space in that direction (large eigenvalues indicate large curvature and a steep region; small eigenvalues indicate small curvature and a flat region). For directions with large eigenvalues (steep regions): reduce the iteration step size to avoid excessive parameter updates that exceed the optimal solution; for directions with small eigenvalues (flat regions): increase the iteration step size to accelerate parameter convergence towards the optimal solution. This adaptive adjustment of the step size makes parameter updates more efficient and accurate.
[0156] Step e33: Based on the iteration step size, iteratively optimize the initial network parameters.
[0157] Specifically, the electronic device can update its parameters using the inverse (approximate) of the Hessian matrix as the direction and the adjusted step size as the step size. The formula simplifies to: Where θ represents the network parameters (weights + biases), and α represents the adjusted iteration step size. Let be the approximate inverse of the Hessian matrix. In each iteration, recalculate the first derivative and the Hessian matrix, adjust the step size, and update the parameters until the convergence condition is met.
[0158] Step e34 continues until the absolute difference between the current target loss function value corresponding to the current iteration number and the historical target loss function value corresponding to the previous iteration number is less than a preset difference threshold, thus obtaining the target network parameters.
[0159] Specifically, the target loss function value Loss for the current iteration number. t Loss compared to the historical loss value of the previous iteration t-1 The absolute difference is less than the preset difference threshold, i.e.: |Loss t -Loss t-1 | < 0.0001 and this condition is satisfied for 5000 consecutive steps (to avoid misjudgments caused by random fluctuations). When the convergence condition is met, the iteration stops, and the network parameters at this point are the target network parameters.
[0160] Step e4: Based on the target network parameters, obtain the target hydraulic characteristic prediction model.
[0161] Specifically, the electronic device loads the target network parameters, including the target weights and target biases, into the corresponding positions of the input layer, hidden layer, and output layer of the network, fixes the network structure and parameters, and obtains the target hydraulic characteristic prediction model. This target hydraulic characteristic prediction model can be directly used to input new spatiotemporal coordinates, static parameters, meteorological monitoring, and gate scheduling data, and output the predicted values of water depth and flow.
[0162] The hydraulic characteristic prediction model generation method provided in this embodiment performs data standardization processing on training static parameter data, training meteorological monitoring data, training gate scheduling data, and training hydraulic characteristic data, and generates an initial training data matrix based on the standardized data. This eliminates dimensional differences and unifies the data scale, laying a stable foundation for subsequent calculations. The initial training data matrix is filtered and completed to generate a candidate training data matrix. Abnormal noise is removed, and missing values are filled to purify data quality and reduce model fitting bias. Hydraulic characteristic elements are distinguished from other elements to clarify the correspondence between the model prediction target and input features, simplifying the training logic. The initial influence weights of each other element on the hydraulic characteristic element are obtained. Initial importance is assigned to different features, initially distinguishing between core and secondary influencing factors. The correlation coefficients between each other element and the hydraulic characteristic element are calculated. The degree of correlation between features and hydraulic characteristics is quantified, providing objective data basis for weight adjustment. Based on the correlation coefficients, the initial influence weights are adjusted to obtain the alternative influence weights corresponding to each other element. The influence of highly correlated features is strengthened, and the interference of low-correlation features is weakened, improving feature effectiveness. The data acquisition time is obtained to provide basic information for weight optimization with a time dimension. A time decay coefficient is determined, assigning higher weights to recent data to align with the time-dependent changes in hydraulic characteristics. The backup influence weights are adjusted according to the time decay coefficient to obtain the target influence weights: ensuring feature weights balance relevance and timeliness, optimizing feature input quality. A backup training matrix is generated based on the target influence weights. The role of core features is highlighted, constructing a high-quality foundational training data carrier. The generator outputs a virtual training matrix. This expands the training data scale, mitigating overfitting caused by insufficient real data. The discriminator selects the expanded training matrix, ensuring the virtual data conforms to real hydraulic laws and improving the effectiveness of the expanded data. Based on the backup and expanded training data matrices, a target training data matrix is generated. Balancing data authenticity and richness, a uniformly distributed training data carrier is constructed. A target training dataset is generated based on the target matrix, providing a data source with both scale and quality for model training.
[0163] Next, the hidden layer structure is determined based on the dataset size and complexity to match the network structure with the data characteristics, avoiding underfitting or overfitting. The dataset is split into spatiotemporal, integrated, and labeled data to clarify the functional positioning of different input modules in the network and improve training targeting. Spatiotemporal coordinate data is input into the input layer, and the integrated training data is passed in through the independent parameter channels of the initial hydraulic property prediction network. Separating different types of input information allows the network to learn different patterns specifically. The hidden layer receives two types of input data. Integrating spatiotemporal location and multi-factor influence information provides complete input for feature extraction. The first layer of the hidden layer undergoes a linear transformation + the first activation function to obtain primary training features. Basic features are extracted from the spatiotemporal data, initiating the feature abstraction process. The second layer of the hidden layer undergoes a linear transformation + the first activation function to obtain secondary training features. The primary training features are further abstracted to uncover deeper correlations. The third layer of the hidden layer undergoes a linear transformation + the first activation function to obtain intermediate training features, continuously deepening feature abstraction and gradually approaching the core correlations of hydraulic properties. The fourth layer and above receive features from the upper layers. They inherit the abstraction results of the previous layers and prepare for higher-order feature extraction. A higher-level linear transformation combined with a second activation function yields the current-level features, capturing more complex nonlinear hydraulic laws and overcoming the limitations of linear models. The last hidden layer performs a weighted calculation to obtain the target training features: integrating feature information from different levels to form a comprehensive representation of hydraulic laws. The output layer outputs predicted hydraulic data based on the target features, mapping abstract features to specific predicted values for water depth and flow rate, completing the forward propagation.
[0164] The observation data loss and physical information loss are calculated based on predicted and training hydraulic characteristic data. This ensures both data fitting accuracy and compliance with hydraulic physics laws, achieving a dual constraint of "data + physics." Initial weights corresponding to the physical information loss values are obtained, providing an initial weight allocation benchmark for the target loss function. The first gradient of the observation loss plus the second gradient of the physical loss are calculated to quantify the rate of change of the two types of losses, providing a basis for dynamic weight adjustment. The physical loss target influence weights are adjusted according to the gradients, adaptively balancing the priority of data fitting and physical constraints to avoid loss imbalance. The target loss function value is calculated using weighted averages, generating an optimization objective that considers both objectives and guides the direction of model parameter updates. Backpropagation calculates the gradient of the loss with respect to the weight bias, providing a quantitative basis for the adjustment direction and magnitude of network parameter updates. Initial network parameters are updated according to the gradients, and initial parameter iterations are achieved based on first-order optimization, allowing the model to optimize towards loss reduction. The first derivative is calculated, and the Hessian matrix is calculated using L-BFGS, introducing second-order derivative information to accurately characterize the optimal region morphology of the parameter space. The iteration step size is adjusted based on the eigenvalues of the Hessian matrix, and the parameter update step size is adaptively optimized to improve iteration efficiency and accuracy. Initial network parameters are iteratively optimized according to the step size, and second-order optimization is used to overcome the local optima limitations of first-order optimization, improving model fitting accuracy. The target network parameters are determined based on the loss difference threshold to ensure that the model parameters converge to a stable optimal state and avoid underfitting. A target prediction model is generated based on the target parameters, outputting a practical model that balances accuracy and physical plausibility, achieving efficient prediction of open channel hydraulic characteristics.
[0165] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for generating a hydraulic characteristic prediction model, characterized in that, The method includes: Acquire training static parameter data, training meteorological monitoring data, training gate scheduling data, and training hydraulic characteristic data corresponding to multiple training sections in at least one training open channel; The training static parameter data, the training meteorological monitoring data, the training gate scheduling data, and the training hydraulic characteristic data are preprocessed to generate a target training dataset; wherein, the training hydraulic characteristic data is the label data in the target training dataset. An initial hydraulic characteristic prediction network is trained based on the target training dataset to obtain a target hydraulic characteristic prediction model; the target hydraulic characteristic prediction model is used to predict the hydraulic characteristic data of at least one target section in the target open channel.
2. The method according to claim 1, characterized in that, The step of preprocessing the training static parameter data, the training meteorological monitoring data, the training gate scheduling data, and the training hydraulic characteristic data to generate the target training dataset includes: The training static parameter data, the training meteorological monitoring data, the training gate scheduling data, and the training hydraulic characteristic data are standardized, and an initial training data matrix is generated based on the standardized data. The initial training data matrix is identified, and based on the identification results, the initial training data matrix is filtered and completed to obtain a candidate training data matrix. Determine the hydraulic characteristic elements corresponding to the training hydraulic characteristic data in the candidate training data matrix, as well as other elements besides the hydraulic characteristic elements; Identify each of the other elements and determine the target influence weight of each of the other elements on the hydraulic characteristic element; Based on the target influence weights, a backup training data matrix is generated; The backup training data matrix is expanded to generate the target training data matrix; The target training dataset is generated based on the target training data matrix.
3. The method according to claim 2, characterized in that, The step of identifying each of the other elements and determining the target influence weight of each of the other elements on the hydraulic characteristic element includes: Obtain the initial influence weights of each of the other elements on the hydraulic characteristic element; Calculate the correlation coefficients between each of the other elements and the hydraulic characteristic elements; Based on the correlation coefficient, the initial influence weights are adjusted to obtain the alternative influence weights corresponding to each of the other elements; Obtain the data acquisition time corresponding to each of the other elements; Based on the data acquisition time, determine the time decay coefficient; Based on the time decay coefficient, the backup influence weights corresponding to each of the other elements are adjusted to obtain the target influence weights corresponding to each of the other elements.
4. The method according to claim 2, characterized in that, The step of expanding the backup training data matrix to generate the target training data matrix includes: The backup training data matrix is input into a preset generator, which outputs a virtual training data matrix. The virtual training data matrix is input into a preset discriminator, and the virtual training data matrix is discriminated based on a preset discriminant loss function. Based on the discriminant result, an expanded training data matrix is determined from the virtual training data matrix. The target training data matrix is generated based on the backup training data matrix and the expanded training data matrix.
5. The method according to claim 1, characterized in that, The initial hydraulic property prediction network includes an input layer, a hidden layer, and an output layer. Training the initial hydraulic property prediction network based on the target training dataset to obtain the target hydraulic property prediction model includes: Based on the size and complexity of the target training dataset, the structure of the hidden layer in the initial hydraulic property prediction network is determined; The target training dataset is split into spatiotemporal coordinate data, training integration data, and label data; the training integration data includes the training static parameter data, the training meteorological monitoring data, and the training gate scheduling data. The spatiotemporal coordinate data is input into the input layer, and the training and integration data is passed in through the independent parameter channel of the initial hydraulic characteristic prediction network; The hidden layer receives the spatiotemporal coordinate data transmitted from the input layer and the training integration data transmitted from the independent parameter channels; The hidden layer extracts features from the spatiotemporal coordinate data and the training integrated data to obtain target training features; The output layer outputs predicted hydraulic property data based on the target training features; Substitute the predicted hydraulic characteristic data and the training hydraulic characteristic data into the target loss function to obtain the target loss function value; Based on the target loss function value, the initial hydraulic characteristic prediction network is trained to obtain the target hydraulic characteristic prediction model.
6. The method according to claim 5, characterized in that, The hidden layer extracts features from the spatiotemporal coordinate data and the integrated training data to obtain target training features, including: The first layer in the hidden layer performs a linear transformation operation on the spatiotemporal coordinate data and performs activation processing based on the first activation function to obtain primary training features; The second layer in the hidden layer performs a linear transformation operation on the primary training features and performs activation processing based on the first activation function to obtain secondary training features. The third layer in the hidden layer performs a linear transformation operation on the secondary training features and performs activation processing based on the first activation function to obtain intermediate training features; The fourth and higher layers in the hidden layer receive the training features transmitted from the previous layer. The training features of the previous level are subjected to linear transformation, and the results of the linear transformation are subjected to nonlinear transformation using a second activation function to obtain the training features of the current level corresponding to each level. The last layer in the hidden layer performs a weighted calculation on the training features corresponding to each layer to obtain the target training features.
7. The method according to claim 5, characterized in that, The predicted hydraulic characteristic data includes predicted flow rate data and predicted water depth data. The target loss function includes observation data loss value, physical information loss value, and parameter regularization constraint loss value. Substituting the predicted hydraulic characteristic data and the training hydraulic characteristic data into the target loss function to obtain the target loss function value includes: The observed data loss value and the physical information loss value are calculated based on the predicted hydraulic characteristic data and the training hydraulic characteristic data; wherein, the physical information loss value includes the continuity equation residual and the momentum equation residual; the continuity equation residual reflects the conservation relationship between flow rate change and water depth change; the momentum equation residual reflects the water flow balance relationship; The target loss function value is determined based on the observed data loss value and the physical information loss value.
8. The method according to claim 7, characterized in that, Determining the target loss function value based on the observed data loss value and the physical information loss value includes: Obtain the initial weights corresponding to the physical information loss values; Calculate the first gradient value corresponding to the observed data loss value and the second gradient value corresponding to the physical information loss value; The initial weights are adjusted based on the first gradient value and the second gradient value to obtain the target weights corresponding to the physical information loss values respectively; The target loss function value is obtained by multiplying the target weight by the physical information loss value and then adding the observation data loss value.
9. The method according to claim 7, characterized in that, The step of training the initial hydraulic characteristic prediction network based on the target loss function value to obtain the target hydraulic characteristic prediction model includes: The gradient values of the target loss function with respect to the weights and biases of each layer are calculated from the output layer back to the input layer using the backpropagation algorithm. The network parameters of the initial hydraulic property prediction network are updated based on the gradient values of the weights and biases of each layer to obtain the initial network parameters. The initial network parameters are optimized to obtain the target network parameters; Based on the target network parameters, the target hydraulic characteristic prediction model is obtained.
10. The method according to claim 9, characterized in that, The optimization of the initial network parameters to obtain the target network parameters includes: For each training iteration, the first derivative of the target loss function is calculated based on the initial network parameters, and the Hessian matrix is calculated using the limited-memory BFGS algorithm; Adjust the iteration step size according to the eigenvalues of the Hessian matrix; Based on the iteration step size, the initial network parameters are iteratively optimized; The target network parameters are obtained when the absolute difference between the current target loss function value corresponding to the current iteration number and the historical target loss function value corresponding to the previous iteration number is less than a preset difference threshold.