Intelligent prediction method of ecological water demand of plateau river basin for ecological regulation of reservoir
Patent Information
- Application Number
- CN202611208458.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-11
- Publication Date
- 2026-10-30
AI Technical Summary
[0003]鱼类产卵期、湿地生长期、植被生长期三类生态需水在时间轴上存在明显错峰特征,鱼类产卵期(3~5月)需要短期脉冲流量,湿地和植被生长期(5~9月)需要持续稳定的供水,越冬期需要保障基流,传统生态需水计算方法难以精细刻画这种时间窗约束,无法实现三类生态需水的动态协调,且如强化学习等现有的人工智能预测方法大多将河道内生态需水(鱼类)与河道外生态需水(湿地、植被)分开计算,再通过环境反馈优化,导致预测周期长,精度低,严重依赖长序列的地面监测数据,不适用于西藏高原环境
[0013]如此,通过采集目标高原河流流域的静态地形数据、当前决策日的气象预报数据、历史实测水文气象数据和历史遥感影像数据等多源数据,避免了现有方法中对密集地面水文监测站网和长序列实测数据的依赖,使方案适用于高原高寒缺资料地区;通过场景原型嵌入层将三个可学习调度向量与第二特征向量进行拼接,能够将三类生态需水场景的全局调度策略以可训练原型的形式嵌入网络结构,使模型在单日决策时具备全局视野;由于生态情境特征包括从第一特征向量中提取的生态变量,以及三类生态需水场景分别对应的二值时间窗指示变量,因此通过将超网络动态偏置生成器根据当前决策日的生态情境特征生成的动态偏置矩阵注入各Transformer编码器层内各自注意力头的注意力分数中,使注意力调制同时具备物理情境响应和日历先验约束的双重驱动力,从而实现对三类生态需水场景关注强度的定向调节,且生态情境特征中的三个时间窗指示变量为超网络动态偏置生成器提供先验时间信息,使其能够根据当前决策日所处的生态需水时段,驱动超网络动态偏置生成器生成相应的动态偏置,从而实现三类生态需水场景在时间轴上的错峰统筹与重叠期平滑过渡。此外,训练好的基于Transformer与动态偏置注入的水库下泄流量预测模型基于多源数据构建的第一特征向量进行一次毫秒级前向传播便可以得到水库下泄流量预测值,解决了现有技术中预测周期长的问题,使得高原河流流域生态需水的实时调度成为可能。
Smart Images

Figure CN123014308A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of water resources management and artificial intelligence technology, specifically to an intelligent prediction method for ecological water demand in plateau river basins for reservoir ecological scheduling. Background Technology
[0002] The Garzangbu River Basin in Ngari Prefecture, Tibet, is a typical high-altitude, cold region with scarce data. Surface hydrological monitoring stations are sparse, and data on the ecological water requirements of fish, wetlands, and vegetation are almost nonexistent. The medium-sized reservoir under construction upstream needs to simultaneously guarantee the hydrological needs of cold-water fish (such as schizothorax and loach) in the river channel for their three areas (spawning grounds, feeding grounds, and overwintering grounds) and breeding season (February to July), as well as the inundation water requirements of wetland nature reserves on both sides of the river channel and the evapotranspiration water requirements of grasslands and vegetation.
[0003] The water demand for the three ecological water needs—fish spawning season, wetland growth season, and vegetation growth season—exhibits a significant staggered peak characteristic on the time axis. Fish spawning season (March to May) requires short-term pulse flow, wetland and vegetation growth season (May to September) requires continuous and stable water supply, and the overwintering season requires guaranteed baseflow. Traditional ecological water demand calculation methods are difficult to accurately characterize this time window constraint and cannot achieve dynamic coordination of the three ecological water needs. Moreover, existing artificial intelligence prediction methods, such as reinforcement learning, mostly calculate the ecological water demand within the river channel (fish) and the ecological water demand outside the river channel (wetland and vegetation) separately and then optimize through environmental feedback. This results in long prediction cycles, low accuracy, and heavy reliance on long-sequence ground monitoring data, making them unsuitable for the Tibetan Plateau environment. Summary of the Invention
[0004] In view of this, embodiments of this application provide a method for intelligent prediction of ecological water demand in plateau river basins for reservoir ecological scheduling, the method comprising: Static topographic data of the target plateau river basin, meteorological forecast data for the current decision date, historical measured hydrological and meteorological data, historical remote sensing image data, and actual reservoir discharge flow for the previous decision date are collected. Based on the static topographic data, meteorological forecast data for the current decision date, historical measured hydrological and meteorological data, historical remote sensing image data, and actual reservoir discharge flow for the previous decision date, a first feature vector for the current decision date is constructed. The first feature vector is then input into a trained reservoir discharge flow prediction model based on Transformer and dynamic bias injection to obtain the predicted reservoir discharge flow for the current decision date. The reservoir discharge prediction model based on Transformer and dynamic bias injection includes a linear embedding layer, a scenario prototype embedding layer containing three learnable scheduling vectors, four Transformer encoder layers, a hypernetwork dynamic bias generator composed of MLPs, and an output layer. The first feature vector is mapped to the second feature vector through the linear embedding layer. The scenario prototype embedding layer concatenates the three learnable scheduling vectors with the second feature vector to obtain an extended feature matrix. The extended feature matrix is input into the four Transformer encoder layers for encoding, and the dynamic bias matrix generated by the hypernetwork dynamic bias generator based on the ecological context features of the current decision day is injected into the attention score of the attention head in each Transformer encoder layer. After processing by the four Transformer encoder layers, the encoded output features are obtained. The encoded output features are mapped through the output layer to obtain the predicted value of the reservoir discharge for the current decision day. The three learnable scheduling vectors are the globally trainable prototype vectors for three types of ecological water demand scenarios: fish spawning period, wetland growth period, and vegetation growth period. The ecological context features include ecological variables extracted from the first feature vector, as well as binary time window indicator variables corresponding to the three types of ecological water demand scenarios. If the current decision day falls within the time period of the reference ecological water demand scenario, the corresponding binary time window indicator variable takes a value of 1; otherwise, it takes a value of 0. The reference ecological water demand scenario is any one of the fish spawning period, wetland growth period, and vegetation growth period.
[0005] Optionally, the ecological context features include normalized vegetation index, improved normalized water index, soil moisture content, forecasted precipitation, and forecasted temperature; the hypernetwork dynamic bias generator includes three independent hypernetwork modules that do not share weights, each hypernetwork module includes two MLP layers, and each hypernetwork module corresponds to one ecological water demand scenario; each Transformer encoder includes eight self-attention heads; the extended feature matrix is input into four Transformer encoder layers for encoding, and the dynamic bias matrix generated by the hypernetwork dynamic bias generator based on the ecological context features of the current decision day is injected into the attention scores of the attention heads in each Transformer encoder layer. After processing by the four Transformer encoder layers, the encoded output features are obtained, including: mapping the 8-dimensional ecological context features to three types of ecological water demand scenarios through three independent hypernetwork modules to generate 32-dimensional dynamic modulation coefficients; generating based on the learnable basic bias matrix, dynamic modulation coefficients, and Sigmoid function. The dynamic bias matrix is used as the context-aware bias of the corresponding self-attention head in the Transformer encoder layer, with row indices corresponding to Transformer encoder layers and column indices corresponding to self-attention heads. For each Transformer encoder layer, the corresponding query matrix, key matrix, and value matrix are generated by expanding the feature matrix using the input sequence of the current Transformer encoder layer, and the original attention score for each self-attention head is generated based on the query matrix and key matrix. If the current Transformer encoder layer is the first Transformer encoder layer, the input sequence is the expanded feature matrix; if the current Transformer encoder layer is not the first Transformer encoder layer, the input sequence is the output feature of the previous Transformer encoder layer. The context-aware bias and the corresponding original attention score for each self-attention head in each Transformer encoder layer are added together to obtain the target attention score. The output feature of the corresponding Transformer encoder layer is calculated based on the target attention score and the value matrix, and the output feature of the fourth Transformer encoder layer is used as the final encoded output feature.
[0006] Optionally, the output layer includes a linear projection module, a sigmoid activation function, and a physical scaling module. The processing of the output layer includes: using the linear projection module to linearly map the encoded output features and compressing them to the (0, 1) interval using the sigmoid activation function to obtain the initial mapped features; and using the physical scaling module to linearly map the initial mapped features based on the ecological base flow and maximum discharge capacity of the target reservoir to obtain the predicted value of the reservoir discharge flow.
[0007] Optionally, the method further includes: using the maximum discharge capacity of the target reservoir to safely cut off the predicted discharge flow of the reservoir to obtain an executable discharge flow; generating a gate control command for the target reservoir from the executable discharge flow and outputting it to the gate control system of the target reservoir for execution, so as to replenish the ecological water demand of the target plateau river basin downstream of the target reservoir.
[0008] Optionally, the predicted reservoir discharge flow is safely truncated using the maximum discharge capacity of the target reservoir to obtain an executable reservoir discharge flow, including: if the predicted reservoir discharge flow is greater than the maximum discharge capacity of the target reservoir, the maximum discharge capacity of the target reservoir is used as the executable reservoir discharge flow; if the predicted reservoir discharge flow is less than or equal to the maximum discharge capacity of the target reservoir, the predicted reservoir discharge flow is used as the executable reservoir discharge flow.
[0009] Optionally, the training method for the reservoir discharge prediction model based on Transformer and dynamic bias injection includes: using the river cross-section data extracted from SRTM DEM and the measured flow to calibrate the key parameters of the SWAT distributed hydrological model to obtain the daily simulated runoff; converting the daily simulated runoff into velocity and water depth using the Manning formula to calculate the fish habitat suitability index; calculating the daily potential evapotranspiration using the Penman-Monteith formula based on the time series data of the normalized vegetation index and the improved normalized water index to obtain the theoretical evapotranspiration water demand and theoretical wetland water demand; using the historical measured inflow as boundary conditions, based on the fish habitat suitability index, theoretical evapotranspiration water demand, and theoretical wetland water demand, with the first optimization objective being maximizing the annual cumulative fish habitat suitability, the second optimization objective being maximizing the vegetation evapotranspiration recharge rate, and the third optimization objective being maximizing the wetland flooded area maintenance rate, using the NSGA-III multi-objective training method. The Pareto front is solved using a quantized algorithm, and the point with the maximum curvature is selected as the optimal solution. A 365-day daily sequence is reconstructed using cubic spline interpolation to obtain the teacher discharge flow label. The vegetation evapotranspiration replenishment rate is the ratio of the actual discharge volume available for vegetation use to the theoretical evapotranspiration demand. The wetland flooded area maintenance rate is the ratio of the actual simulated flooded area to the target flooded area corresponding to the theoretical wetland demand. Based on the teacher discharge flow label, a loss function including knowledge distillation loss, and a planned sampling strategy, the network parameters of the reservoir discharge flow prediction model based on Transformer and dynamic bias injection are continuously updated until the convergence condition is met, resulting in a trained reservoir discharge flow prediction model based on Transformer and dynamic bias injection. The network parameters include at least three learnable scheduling vectors.
[0010] Optionally, a loss function that includes knowledge distillation loss. Represented as: ; in, For knowledge distillation loss; This is a stability penalty item; For daily masking, when remote sensing variables are missing for more than 10 consecutive days... ,otherwise ; Indicates the number of days in the forecast. The model predicts the first The reservoir discharge flow rate of the day; The model predicts the first The reservoir discharge flow rate of the day; Indicates the first Teachers' leaked traffic tags; This is the balance coefficient.
[0011] Optionally, the planned sampling strategy includes: In the first 100 training rounds of the training process, the first The day corresponds to the first in the input feature vector. The actual reservoir discharge flow rate for the day is assigned as the [number]th [day]. Teachers' leaked traffic tags; During training rounds 101-150, there is a 50% probability that the [number of rounds] will be [performed / achieved]. The day corresponds to the first in the input feature vector. The actual reservoir discharge flow rate for the day is assigned as the [number]th [day]. The teacher's leaked traffic tag has a 50% probability of being the first. The day corresponds to the first in the input feature vector. The actual reservoir discharge flow rate on the first day was assigned to the model for the [number]th day. Predicted discharge flow from Tianshui Reservoir; During the 151st to 200th training rounds, there is a 20% probability that the [number]th [round] will be [achieved / determined / perfected]. The day corresponds to the first in the input feature vector. The actual reservoir discharge flow rate for the day is assigned as the [number]th [day]. The teacher's leaked traffic tag has an 80% probability of being the first. The day corresponds to the first in the input feature vector. The actual reservoir discharge flow rate on the first day was assigned to the model for the [number]th day. Predicted discharge flow from Tianshui Reservoir.
[0012] In this embodiment, static topographic data of the target plateau river basin, meteorological forecast data for the current decision day, historical measured hydrological and meteorological data, historical remote sensing image data, and actual reservoir discharge flow for the previous decision day are collected. Based on the static topographic data, meteorological forecast data for the current decision day, historical measured hydrological and meteorological data, historical remote sensing image data, and actual reservoir discharge flow for the previous decision day, a first feature vector for the current decision day is constructed. The first feature vector is input into a trained reservoir discharge flow prediction model based on Transformer and dynamic bias injection to obtain the predicted value of reservoir discharge flow for the current decision day.
[0013] Thus, by collecting multi-source data such as static topographic data of the target plateau river basin, meteorological forecast data for the current decision-making day, historical measured hydrological and meteorological data, and historical remote sensing imagery data, this approach avoids the dependence on dense ground hydrological monitoring networks and long-sequence measured data found in existing methods, making the scheme applicable to high-altitude, cold, and data-scarce regions. By concatenating three learnable scheduling vectors with the second feature vector through a scenario prototype embedding layer, the global scheduling strategies for three types of ecological water demand scenarios can be embedded into the network structure in the form of trainable prototypes, giving the model a global perspective during daily decision-making. Since the ecological context features include ecological variables extracted from the first feature vector, as well as binary time window indicator variables corresponding to the three types of ecological water demand scenarios, this approach is effective. Therefore, by injecting the dynamic bias matrix generated by the hypernetwork dynamic bias generator based on the ecological context characteristics of the current decision day into the attention scores of the attention heads in each Transformer encoder layer, attention modulation possesses a dual driving force of physical context response and calendar prior constraints. This enables targeted adjustment of the attention intensity for the three types of ecological water demand scenarios. Furthermore, the three time window indicator variables in the ecological context characteristics provide prior time information for the hypernetwork dynamic bias generator, allowing it to generate corresponding dynamic biases based on the ecological water demand period of the current decision day. This achieves staggered coordination and smooth transition of overlapping periods for the three types of ecological water demand scenarios on the time axis. In addition, the trained reservoir discharge flow prediction model based on Transformer and dynamic bias injection can obtain the reservoir discharge flow prediction value after a millisecond-level forward propagation based on the first feature vector constructed from multi-source data. This solves the problem of long prediction cycles in existing technologies, making real-time scheduling of ecological water demand in plateau river basins possible. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort, wherein: Figure 1 A flowchart illustrating an intelligent prediction method for ecological water demand in plateau river basins for reservoir ecological scheduling, provided as an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a reservoir discharge flow prediction model based on Transformer and dynamic bias injection, provided in an embodiment of this application. Detailed Implementation
[0015] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. The following embodiments are used to illustrate this application, but are not intended to limit the scope of this application. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0016] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0017] It should be noted that the terms "first, second, and third" used in the embodiments of the present invention are only used to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, and third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present invention described herein can be implemented in an order other than that illustrated or described herein.
[0018] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which the embodiments of this application pertain. It should also be understood that terms such as those defined in general dictionaries should be understood to have a meaning consistent with their meaning in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0019] This application provides a method for intelligent prediction of ecological water demand in plateau river basins for reservoir ecological management, such as... Figure 1 The diagram shown is a flowchart illustrating a method for intelligent prediction of ecological water demand in plateau river basins for reservoir ecological scheduling, as provided in this application. The method includes: S101. Collect static topographic data of the target plateau river basin, meteorological forecast data for the current decision date, historical measured hydrological and meteorological data and historical remote sensing image data, as well as the actual reservoir discharge flow on the previous decision date.
[0020] In some embodiments, the target plateau river basin is a plateau river basin requiring ecological water resource replenishment. A reservoir is constructed upstream of the target plateau river basin, and the ecological water demand of the target plateau river basin can be replenished by controlling the downstream flow of the reservoir. This application will subsequently describe the target plateau river basin as the entire Garzangbu River basin and its downstream wetland nature reserve.
[0021] In some embodiments, meteorological forecast data includes forecast temperature, forecast precipitation, forecast humidity, and sunshine duration for the current decision date; static topographic data includes the average slope and river network density of the target plateau river basin; historical measured hydro-meteorological data includes the actual daily average temperature and actual daily precipitation of the target plateau basin in the past; and historical remote sensing image data includes Sentinel 2 or Landsat images of the target plateau basin in the past. In practice, historical measured hydro-meteorological data for at least the past 30 days and historical remote sensing image data for at least the past 10 days can be obtained. The actual reservoir discharge on the previous decision date represents the actual discharge from the upstream reservoir of the target plateau river basin on the day before the current decision date. If the current decision date is the initial decision date or the first day, the actual reservoir discharge on the previous decision date is the initial reservoir discharge or the ecological baseflow value.
[0022] S102. Based on static terrain data, meteorological forecast data for the current decision day, historical measured hydrological and meteorological data, historical remote sensing image data, and the actual reservoir discharge flow on the previous decision day, construct the first feature vector for the current decision day.
[0023] In some embodiments, the daily average temperature, daily cumulative precipitation, and daily relative humidity for the current decision date can be calculated based on meteorological forecast data for the current decision date; the daily average temperature for the five days prior to the current decision date, the positive accumulated temperature for the five days prior to the current decision date, and the negative accumulated temperature for the 30 days prior to the current decision date can be calculated based on historical measured hydrometeorological data; and the normalized difference vegetation index (NDVI), improved normalized difference water index (MNDWI), and soil moisture content for the current decision date can be calculated based on the latest available cloudless remote sensing image from historical remote sensing image data.
[0024] In some embodiments, the actual outflow of the upstream reservoir of the target plateau river basin for at least 7 days prior to the current decision date can be obtained, and the average outflow for the 7 days prior to the current decision date can be calculated. The water level and water surface width of the river section of the target plateau river basin can also be obtained.
[0025] In some embodiments, the following data can be Z-score normalized: river cross-section water level, actual reservoir discharge on the previous decision date, average discharge over the 7 days prior to the current decision date, daily average temperature, daily cumulative precipitation, daily relative humidity, sunshine duration, daily average temperature over the 5 days prior to the current decision date, positive accumulated temperature over the 5 days prior to the current decision date, negative accumulated temperature over the 30 days prior to the current decision date, and NDVI, MNDWI, and soil moisture content on the current decision date. The average slope of the watershed and the river network density can then be Min-Max normalized to map them to the [0, 1] interval. Finally, the Z-score normalized and Min-Max normalized data are integrated to construct the first feature vector for the current decision date.
[0026] S103. Input the first feature vector into the trained reservoir discharge flow prediction model based on Transformer and dynamic bias injection to obtain the reservoir discharge flow prediction value for the current decision day.
[0027] Among them, such as Figure 2 As shown, the reservoir discharge flow prediction model based on Transformer and dynamic bias injection includes a linear embedding layer 201, a scene prototype embedding layer 202 containing three learnable scheduling vectors, four Transformer encoder layers 203, a hypernetwork dynamic bias generator 204 composed of MLPs, and an output layer 205. The first feature vector is mapped through the linear embedding layer 201 to obtain the second feature vector; the scene prototype embedding layer 202 concatenates the three learnable scheduling vectors with the second feature vector to obtain an extended feature matrix; the extended feature matrix is input into the four Transformer encoder layers 203 for encoding, and the dynamic bias matrix generated by the hypernetwork dynamic bias generator 204 based on the ecological context features of the current decision day is injected into the attention score of each attention head within each Transformer encoder layer. After processing by the four Transformer encoder layers 203, the encoded output features are obtained; the encoded output features are mapped through the output layer 205 to obtain the predicted reservoir discharge flow for the current decision day.
[0028] In some embodiments, the first feature vector includes 15 features, and the linear embedding layer 201 maps the first feature vector to a 128-dimensional second feature vector. The three learnable scheduling vectors are globally trainable prototype vectors for three ecological water demand scenarios: fish spawning season, wetland growth season, and vegetation growth season, respectively, and are represented by... This indicates that the three learnable scheduling vectors each have a dimension of 128. The scene prototype embedding layer 202 concatenates the three learnable scheduling vectors to the front of the second feature vector, thereby constructing an extended feature matrix. The first three rows of the extended feature matrix are three learnable scheduling vectors, and the fourth row is the second feature vector.
[0029] In some embodiments, the ecological context features include ecological variables extracted from the first feature vector, and binary time window indicator variables corresponding to the three types of ecological water demand scenarios. If the current decision date falls within the time period of the reference ecological water demand scenario, the corresponding binary time window indicator variable takes the value of 1; otherwise, it takes the value of 0. The reference ecological water demand scenario is any one of the following: fish spawning period, wetland growth period, and vegetation growth period.
[0030] In some embodiments, ecological context features include normalized vegetation index, improved normalized water index, soil moisture content, forecasted precipitation, and forecasted temperature; the hypernetwork dynamic bias generator 204 includes three independent hypernetwork modules that do not share weights, each hypernetwork module includes two MLP layers, and each hypernetwork module corresponds to an ecological water demand scenario; each Transformer encoder includes eight self-attention heads. The extended feature matrix is input into four Transformer encoder layers 203 for encoding, and the dynamic bias matrix generated by the hypernetwork dynamic bias generator 204 according to the ecological context features of the current decision day is injected into the attention scores of the attention heads in each Transformer encoder layer. After processing by the four Transformer encoder layers 203, the encoded output features are obtained, including: Three independent hypernetwork modules are used to map 8-dimensional ecological context features to three types of ecological water demand scenarios, generating 32-dimensional dynamic modulation coefficients. Based on the learnable basic bias matrix, dynamic modulation coefficients, and sigmoid function, a 32-dimensional dynamic modulation coefficient is generated. The dynamic bias matrix is used as the context-aware bias of the corresponding self-attention head in the Transformer encoder layer, with the row index corresponding to the Transformer encoder layer and the column index corresponding to the self-attention head in the Transformer encoder layer. For each Transformer encoder layer, the corresponding query matrix, key matrix, and value matrix are generated by expanding the feature matrix through the input sequence of the current Transformer encoder layer, and the original attention score corresponding to each self-attention head is generated based on the query matrix and key matrix. The context-aware bias corresponding to each self-attention head in each Transformer encoder layer is added to the corresponding original attention score to obtain the target attention score. The output features of the corresponding Transformer encoder layer are calculated based on the target attention score and the value matrix, and the output features of the fourth Transformer encoder layer 203 are used as the final encoded output features.
[0031] In some embodiments, the first layer MLP of each supernetwork module includes a fully connected unit and a ReLU activation function, and the second layer MLP includes a linear mapping layer. For each ecological water demand scenario, the fully connected unit and the ReLU activation function map the 8-dimensional ecological context features into a 16-dimensional hidden vector; the linear mapping layer maps the 16-dimensional hidden vector into the 32-dimensional dynamic modulation coefficients of the corresponding ecological water demand scenario.
[0032] In some embodiments, the basic bias matrix It is a learnable fundamental bias matrix, a dynamic bias matrix. in, Represents the fundamental bias matrix. This represents the Sigmoid function. For learnable projection vectors, Indicates transpose. This represents the 32-dimensional dynamic modulation coefficients.
[0033] In some embodiments, since each Transformer encoder layer includes eight self-attention heads, the four Transformer encoder layers 203 have a total of There are several attention heads. Therefore, the first row of the dynamic bias matrix corresponds to the first Transformer encoder layer, the second row corresponds to the second Transformer encoder layer, the third row corresponds to the third Transformer encoder layer, the fourth row corresponds to the fourth Transformer encoder layer 203, and the first column of the dynamic bias matrix corresponds to the first self-attention head in each Transformer encoder layer, the second column corresponds to the second self-attention head in each Transformer encoder layer, ..., the eighth column corresponds to the eighth self-attention head in each Transformer encoder layer. Thus, each element in the dynamic bias matrix is used as the context-aware bias of the attention head in each Transformer encoder layer.
[0034] In some embodiments, if the current Transformer encoder layer is the first Transformer encoder layer, based on the extended feature matrix and the learnable query projection matrix, key projection matrix, and value projection matrix (all with dimensions...), ), and sequentially calculate the query matrix, key matrix, and value matrix (all dimensions are...) corresponding to the current Transformer encoder layer. The query matrix, key matrix, and value matrix are then split according to the position of each attention head in the current Transformer encoder layer, resulting in the query submatrix, key matrix, and value submatrix for each attention head in the current Transformer encoder layer (all dimensions are...). Then, based on the query submatrix, key matrix and the dimension of the information processed by the self-attention head corresponding to each self-attention head (16), the original attention score corresponding to each attention head in the current Transformer encoder layer (the first Transformer encoder layer) is calculated.
[0035] In some embodiments, four Transformer encoder layers 203 are stacked together. The output of the previous Transformer encoder layer is used as the input of the next Transformer encoder layer. If the current Transformer encoder layer is not the first Transformer encoder layer, the input sequence is the output feature of the previous Transformer encoder layer. The calculation method of the original attention score corresponding to the subsequent self-attention head is the same as the calculation method of the original attention score corresponding to each self-attention head in the first Transformer encoder layer.
[0036] In some embodiments, the original attention score corresponding to each self-attention head is 1. The matrix is used to add the context-aware bias of the corresponding self-attention head (there are three context-aware biases, corresponding to three types of ecological water demand scenarios or three types of learnable scheduling vectors) to the 4th row (i.e., when the current decision day is used as a query) and the 1st to 3rd columns (i.e., the keys are three learnable scheduling vectors) of the original attention score, thereby obtaining the target attention score. (The matrix) does not add context-aware biases to other positions. For example, add the context-aware bias corresponding to the fish spawning period to the elements in the 4th row and 1st column of the original attention score, add the context-aware bias corresponding to the wetland growth period to the elements in the 4th row and 2nd column of the original attention score, and add the context-aware bias corresponding to the vegetation growth period to the elements in the 4th row and 3rd column of the original attention score.
[0037] In some embodiments, for each Transformer encoder layer, after obtaining the target attention score corresponding to each self-attention head, the target attention score and the submatrix are weighted and summed, and a linear transformation is performed to obtain the output feature of each Transformer encoder layer. Finally, the output feature of the fourth Transformer encoder layer 203 is used as the final encoded output feature. The encoded output feature is a deep embedded representation obtained after four layers of self-attention encoding with scheduling vectors and dynamic bias modulation, which integrates environmental features, historical hydrological and meteorological information, and three types of global strategies for ecological needs (fish spawning period, wetland growth period, and vegetation growth period).
[0038] In some embodiments, the output layer 205 includes a linear projection module, a Sigmoid activation function, and a physical scaling module. The processing of the output layer 205 includes: using the linear projection module to linearly map the encoded output features and compressing them to the (0, 1) interval using the Sigmoid activation function to obtain initial mapped features; and using the physical scaling module to linearly map the initial mapped features based on the ecological base flow and maximum discharge capacity of the target reservoir to obtain the predicted value of the reservoir discharge flow.
[0039] In some embodiments, the target reservoir is a reservoir upstream of the target plateau river basin, and the processing of the linear projection module, the Sigmoid activation function, and the physical scaling module is represented as follows: , These are all learnable parameters of the linear projection module. To encode output features, Indicates transpose. These are the maximum discharge capacity and the ecological base flow, respectively. This is the initial mapping feature. After this processing, the output of the Sigmoid function is linearly mapped to... Interval.
[0040] In some embodiments, the first feature vector is input into the trained reservoir discharge flow prediction model based on Transformer and dynamic bias injection to obtain the reservoir discharge flow prediction value for the current decision day. That is, after step S103, the reservoir discharge flow prediction value can be safely truncated using the maximum discharge capacity of the target reservoir to obtain an executable reservoir discharge flow. The executable reservoir discharge flow generates the gate control command of the target reservoir and outputs it to the gate control system of the target reservoir for execution to replenish the ecological water demand of the target plateau river basin downstream of the target reservoir.
[0041] In some embodiments, if the predicted reservoir discharge flow is converted into an actual control command and sent to the target reservoir gate control system, it needs to be within a safe range. Therefore, the predicted reservoir discharge flow needs to be safely truncated using the maximum discharge capacity of the target reservoir, ensuring that the resulting executable reservoir discharge flow is within the target reservoir's maximum discharge capacity. After obtaining the executable reservoir discharge flow, it can be converted into a gate control command for the target reservoir and output to the target reservoir gate control system for execution, thereby controlling the target reservoir's discharge flow to reach the executable discharge flow.
[0042] In some embodiments, after the predicted reservoir discharge flow is safely truncated to obtain the executable reservoir discharge flow, it can be further determined whether the executable reservoir discharge flow meets the minimum water demand for urban and rural domestic water supply and irrigation. If the executable reservoir discharge flow is less than the minimum water demand threshold for urban and rural domestic water supply and irrigation, the minimum water demand threshold for urban and rural domestic water supply and irrigation is used as the final executable reservoir discharge flow and converted into a gate control command for the target reservoir. If the executable reservoir discharge flow is greater than or equal to the minimum water demand threshold for urban and rural domestic water supply and irrigation, the executable discharge flow can be directly converted into a gate control command for the target reservoir.
[0043] In some embodiments, the predicted reservoir discharge flow is safely truncated using the maximum discharge capacity of the target reservoir to obtain an executable reservoir discharge flow, including: if the predicted reservoir discharge flow is greater than the maximum discharge capacity of the target reservoir, the maximum discharge capacity of the target reservoir is used as the executable reservoir discharge flow; if the predicted reservoir discharge flow is less than or equal to the maximum discharge capacity of the target reservoir, the predicted reservoir discharge flow is used as the executable reservoir discharge flow.
[0044] In some embodiments, the maximum discharge capacity of the target reservoir can be compared with the predicted discharge flow. If the predicted discharge flow is greater than the maximum discharge capacity of the target reservoir, it indicates that the predicted discharge flow output by the reservoir discharge flow prediction model based on Transformer and dynamic bias injection exceeds the upper limit of the safe discharge flow. In this case, the maximum discharge capacity of the target reservoir is used as the executable discharge flow. If the predicted discharge flow is less than or equal to the maximum discharge capacity of the target reservoir, it indicates that the predicted discharge flow output by the reservoir discharge flow prediction model based on Transformer and dynamic bias injection is within the upper limit of the safe discharge flow. In this case, the predicted discharge flow is used as the executable discharge flow, and there is no safety hazard.
[0045] In some embodiments, the training method for the reservoir discharge prediction model based on Transformer and dynamic bias injection includes: using the river cross-section data extracted from SRTM DEM and the measured flow to calibrate the key parameters of the SWAT distributed hydrological model to obtain daily simulated runoff; converting the daily simulated runoff into velocity and water depth using the Manning formula to calculate the fish habitat suitability index; calculating the daily potential evapotranspiration using the Penman-Monteith formula based on time-series data of normalized vegetation index and improved normalized water index to obtain theoretical evapotranspiration water demand and theoretical wetland water demand; using historical measured inflow as boundary conditions, and based on the fish habitat suitability index, theoretical evapotranspiration water demand, and theoretical wetland water demand, with the first optimization objective being maximizing the annual cumulative fish habitat suitability, the second optimization objective being maximizing the vegetation evapotranspiration recharge rate, and the third optimization objective being maximizing the wetland flooded area maintenance rate, using the NSGA-III multi-objective training method. The Pareto front is solved using a quantized algorithm, and the Knee point is selected as the optimal solution. A 365-day daily sequence is reconstructed using cubic spline interpolation to obtain the teacher discharge flow label. The vegetation evapotranspiration replenishment rate is the ratio of the actual discharge volume available for vegetation use to the theoretical evapotranspiration demand. The wetland flooded area maintenance rate is the ratio of the actual simulated flooded area to the target flooded area corresponding to the theoretical wetland demand. Based on the teacher discharge flow label, a loss function including knowledge distillation loss, and a planned sampling strategy, the network parameters of the reservoir discharge flow prediction model based on Transformer and dynamic bias injection are continuously updated until the convergence condition is met, resulting in a trained reservoir discharge flow prediction model based on Transformer and dynamic bias injection. The network parameters include at least three learnable scheduling vectors.
[0046] In some embodiments, firstly, daily measured data of the watershed, including river cross-section water levels, are collected from the Ali Prefecture Hydrology and Water Resources Bureau. (Unit: m) Measured flow rate (unit: m) 3 / s), water surface width (Unit: m); then, daily observation data for the same period were obtained from the Gar County National Meteorological Station, including daily precipitation. (Unit: mm) Daily average temperature (Unit: °C) Daily average relative humidity (Unit: %), Sunshine Hours (Unit: h); Simultaneously, remote sensing multispectral images covering the target watershed (the entire Garzangbu River basin and downstream wetland nature reserve) were acquired to extract the monthly Normalized Difference Vegetation Index (NDVI). and the improved normalized water quality index MNDWI Simultaneously, monthly soil moisture content was retrieved using Sentinel1 ASAR imagery. All remote sensing data were aligned to a daily scale (missing values were filled using linear interpolation or the monthly average), and together with ground-measured hydrological and meteorological data, constituted the original dataset. The original dataset contained a total of 10 variables, including... And the static variable watershed average slope extracted from the DEM (SRTM 30m). River network density (Added to the dataset as a constant static feature).
[0047] After obtaining the raw dataset, it was preprocessed. First, missing values in the ground-based measured data were interpolated using the moving average of the same day in nearby years (for consecutive missing values of 3 days or less, linear interpolation of the preceding and following 2 days was used; for missing values of more than 3 days, the average of the same day in the past 5 years was used). Then, a low-pass filter with a cutoff period of 20 days was used to interpolate the measured flow. Low-pass filtering was performed to eliminate high-frequency noise; secondly, the positive accumulated temperature for the first 5 days was calculated to characterize the snowmelt runoff process. Compared with the negative accumulated temperature of the previous 30 days As a new feature; next, monthly NDVI, MNDWI, The scale was upscaled to daily using quadratic spline interpolation with the 15th of the month as the control point, and a weighted moving average was applied to the NDVI sequence (0.4 for the current day, 0.25 for the day before and after, and 0.05 for the two days before and after) to suppress cloud noise. Simultaneously, wetland response lag characteristics were constructed, i.e., the average flow over the previous 7 days. And the vegetation response lag characteristic, namely the average temperature of the previous 5 days. Subsequently, for all non-static characteristics (water level, flow rate, precipitation, air temperature, humidity, sunshine duration, NDVI, MNDWI, soil water, accumulated temperature, negative accumulated temperature, ...), ... , Z-score standardization is performed. and Min-Max normalization was used to linearly map the data to the [0, 1] interval. Finally, for the period from late November to February of the following year in the Ali region where remote sensing variables are missing due to snow cover, the measured hydrological data for the missing dates were retained but masked (the loss weight was zero during training). If all remote sensing variables were missing for more than 10 consecutive days, that period was directly removed. Finally, the cleaned, aligned, and augmented daily dataset (the preprocessed dataset) was output.
[0048] In some embodiments, teacher discharge flow labels can be generated based on the preprocessed dataset, and a reservoir discharge flow prediction model based on Transformer and dynamic bias injection can be trained.
[0049] In some embodiments, the geometric parameters of the river cross-section extracted by the SRTM DEM, including the cross-sectional shape (U-shaped, V-shaped, or trapezoidal), cross-sectional width, cross-sectional depth, etc., can be used in conjunction with the measured flow rate. The baseflow coefficient and snowmelt factor in the SWAT model are calibrated. The baseflow coefficient and snowmelt factor together determine the complete process line of the daily simulated runoff output by SWAT (from the spring snowmelt rise, summer flood peak, to autumn and winter receding).
[0050] In some embodiments, based on the biological characteristics of the Ali Garzang Blasa schizothorax, the suitable flow velocity range during the spawning period (March to May) is 0.3–0.8 m / s, and the suitable water depth range is 0.5–1.5 m. During the overwintering period, the minimum water depth is greater than or equal to 0.8 m. The daily simulated runoff is converted into flow velocity using the Manning formula. and water depth And calculate the fish habitat suitability index. .
[0051] In some embodiments, vegetation cover area is extracted from NDVI time-series data in the preprocessed dataset, and the current inundated area of wetlands is extracted from MNDWI time-series data. The daily potential evapotranspiration is calculated using the Penman-Monteith formula by combining meteorological data in the preprocessed dataset. The actual evapotranspiration is obtained by multiplying it by the crop coefficient (obtained by inversion of vegetation cover area). The theoretical evapotranspiration water demand is calculated based on the actual evapotranspiration and vegetation cover area. The theoretical wetland water demand is inferred from the current inundated area of the wetland according to the water balance equation.
[0052] In some embodiments, using the measured inflow (upstream section) as boundary conditions, 200 individuals (i.e., 200 sets of 10-dimensional decision variables) are randomly generated as the initial population using the NSGA-III multi-objective evolutionary algorithm. The 10-dimensional variables of each individual are then converted into 365 days of outflow, which are input into the SWAT model to simulate the downstream runoff process. Based on the simulation results, four objective function values are calculated: maximizing fish habitat suitability (the first optimization objective, obtained by accumulating the fish habitat suitability index throughout the year), maximizing vegetation evapotranspiration recharge rate (the second optimization objective, assessing the degree of agreement between actual water supply and theoretical evapotranspiration demand), and maximizing wetland flooded area maintenance rate (the third optimization objective, assessing the degree of agreement between actual water supply and theoretical wetland water demand). The vegetation evapotranspiration recharge rate is the ratio of the actual outflow available for vegetation to the theoretical evapotranspiration demand, and the wetland flooded area maintenance rate is the ratio of the actual simulated flooded area to the target flooded area corresponding to the theoretical wetland water demand.
[0053] Because directly optimizing the daily flow sequence of 365-dimensional continuous variables is computationally expensive and converges poorly, this application adopts a dimensionality reduction strategy to divide the year into 5 scheduling periods (fish spawning period, early wetland vegetation growth period, late wetland vegetation growth period, transition period, and overwintering period). Each period is assigned a baseflow coefficient and a pulse amplitude coefficient, reducing the decision variable dimension to 10 dimensions. The NSGA-III algorithm sorts and filters 200 individuals based on their four objective values, generating a new generation of 200 individuals through selection, crossover, and mutation. After 500 iterations, a Pareto front is finally obtained (including multiple optimal solutions, each including 10-dimensional decision variables (5 baseflow coefficients and 5 pulse amplitude coefficients) and 4 objective function values). When there is a significant inflection point in the Pareto front, a Knee point (maximum curvature point) selection strategy is used to normalize the objective function values of each solution on the front to [0, ... [1] The interval is then used, and the curvature of each solution on the front is calculated using the projection distance method. The point with the largest curvature (i.e., the farthest vertical distance from the Utopia line) is selected as the optimal compromise solution. The 10-dimensional decision variables corresponding to this solution are restored to a 365-day daily sequence through cubic spline interpolation to obtain the teacher discharge flow label. This process requires no manual intervention and is completed automatically based on numerical calculation.
[0054] In some embodiments, after obtaining the teacher discharge flow labels, all network parameters (including three learnable scheduling vectors, learnable query projection matrix, key projection matrix, value projection matrix, etc.) of the reservoir discharge flow prediction model based on Transformer and dynamic bias injection can be jointly updated based on the teacher discharge flow labels, a loss function including knowledge distillation loss, and a planned sampling strategy. The learning rate is set to [value missing]. The training process involves a total of 200 training epochs until the convergence condition is met (e.g., the number of training epochs reaches 200 or the loss function value is less than or equal to a preset threshold). This will result in a well-trained reservoir discharge flow prediction model based on Transformer and dynamic bias injection.
[0055] In some embodiments, a loss function includes knowledge distillation loss. Represented as: (1); in, For knowledge distillation loss; This is a stability penalty item; For daily masking, when remote sensing variables are missing for more than 10 consecutive days... ,otherwise ; Indicates the number of days in the forecast. The model predicts the first The reservoir discharge flow rate of the day; The model predicts the first The reservoir discharge flow rate of the day; Indicates the first Teachers' leaked traffic tags; This is the balance coefficient.
[0056] In some embodiments, the knowledge distillation loss is used to enable the reservoir discharge prediction model based on Transformer and dynamic bias injection to mimic the staggered scheduling mode of the teacher model. For periods in winter when remote sensing variables are missing for more than 10 consecutive days due to ice and snow cover, the corresponding loss weight is reset to zero. The stationarity penalty term is used to suppress drastic fluctuations in discharge flow between adjacent days, avoid sudden changes in flow from impacting the downstream ecological environment, and ensure the stability of ecological water supply.
[0057] In some embodiments, the planned sampling strategy includes: in the first 100 training epochs, assigning the actual reservoir discharge flow on day t-1 in the input feature vector corresponding to day t as the teacher discharge flow label for day t-1; in training epochs 101-150, assigning the actual reservoir discharge flow on day t-1 in the input feature vector corresponding to day t with a 50% probability as the teacher discharge flow label for day t-1, and assigning the actual reservoir discharge flow on day t-1 in the input feature vector corresponding to day t with a 50% probability as the teacher discharge flow label for day t-1. In the feature vector, the actual reservoir discharge on day t-1 is assigned as the model's predicted discharge value for day t-1. During training epochs 151-200, with a 20% probability, the actual reservoir discharge on day t-1 in the corresponding input feature vector for day t is assigned as the teacher's discharge label for day t-1, and with an 80% probability, the actual reservoir discharge on day t-1 in the corresponding input feature vector for day t is assigned as the model's predicted discharge value for day t-1. The planned sampling strategy, by gradually increasing the probability of using the model's own predicted values as input during training, adapts the model to the input distribution during autoregressive inference during the training phase, effectively mitigating the exposure bias between teacher-forced training and autoregressive inference, and reducing the cumulative error in long-term predictions.
[0058] To verify the effectiveness of the intelligent prediction method for ecological water demand in plateau river basins for reservoir ecological management provided in this application, this application uses a medium-sized reservoir under construction upstream of the Garzangbu-Gar River Wetland Municipal Nature Reserve in Ngari Prefecture, Tibet (total capacity approximately 80.43 million m³) as an example. 3 The catchment area above the dam site is 3708 km². 2 The average annual runoff is 113.7577 million m³. 3 The maximum discharge capacity under design flood conditions is 87.28 m. 3 / s, the maximum discharge rate under the verification flood is 199.15 m³ / s. 3 / s, ecological base flow requirement (maximum demand throughout the year) 1.08 m 3 / s, and the actual discharge during non-flood seasons (January to June, October to December) can exceed 0.68 m. 3 / s, 1.08m 3 A six-month simulation comparison and verification experiment was conducted, using the watershed's digital elevation model (DEM) and historical remote sensing and meteorological data to construct a digital twin environment. A reservoir scheduling simulator and downstream ecological response models (fish habitat suitability, wetland flooding area, and vegetation evapotranspiration) were used for closed-loop evaluation. A total of 1800 Sentinel 1 / 2 images and 1095 days of ERA5 meteorological reanalysis data were processed, resulting in 1095 sets of daily feature samples (70% training set, 15% validation set, and 15% test set).
[0059] The main evaluation indicators were the proportion of days with compliant pulse flow during fish spawning season, the wetland flood area maintenance rate during the wetland growing season, the evapotranspiration recharge rate during the vegetation growing season, and the Nash-Sutcliffe efficiency coefficient (NSE) of the outflow sequence.
[0060] Two comparison groups were set up: T1 (original Transformer + external optimizer) and T2 (the scheme proposed in this application). T1 used the same input features as this application, but had no learnable scheduling vector and no hypernetwork dynamic bias generator. It used a standard Transformer encoder to predict daily outflow, and then used the NSGA-II multi-objective evolutionary algorithm to post-process and optimize the prediction results to generate a scheduling scheme. All comparison groups were run in the same digital twin environment, and the inflow runoff sequence was driven by historical remote sensing inversion data from 2018 to 2020, with consistent reservoir operation rules. The number of NSGA-II iterations for T1 was set to 500 generations, and for T2 it was a single forward inference. Each comparison group was run three times and the average value was taken.
[0061] The experiment evaluated the ecological needs of fish within the river channel, the ecological needs of wetlands / vegetation outside the channel, the engineering feasibility and economy of the scheduling scheme, and the prediction accuracy from four dimensions. The comparison of ecological scheduling effects among different treatment groups (average values from three hydrological years) is shown in Table 1. It should be noted that the proportion of days meeting the spawning season pulse flow standard is defined as the actual discharge flow from March to May being greater than or equal to the pulse threshold (35 m³) required for spawning. 3 The percentage of days with water loss per second ( / s) out of the total number of days in that period. The wetland flooding area maintenance rate is the daily average ratio of the actual flooded area of downstream wetlands to the target area (80% of the historical average) during the growing season (May to September). The vegetation evapotranspiration recharge rate is the ratio of evapotranspiration supported by the actual downstream flow to the vegetation water requirement.
[0062] Table 1 Comparison of ecological regulation effects among different treatment groups
[0063] As shown in Table 1, on the independent test set, the proportion of days meeting the fish spawning pulse target using the scheme provided in this application (T2) reached 88.6%, an increase of 5.1 percentage points compared to T1 (83.5%). This is because T2 significantly enhanced attention to fish tokens in April through scheduling tokens and a hypernetic dynamic bias generator, enabling the model to prioritize spawning pulses even when snowmelt runoff was insufficient; the wetland flooding area maintenance rate of T2 was 84.3%, 5.1 percentage points higher than T1. Especially during the overlapping period in May, the optimizer of T1 was prone to getting stuck in local optima (over-sacrificing wetlands); while the supernetwork dynamic bias generator of T2 automatically increased the wetland token attention based on the MNDWI and soil moisture of the day, achieving a smooth transition; the vegetation evapotranspiration recharge rate of T2 was 87.2%, 4.6 percentage points higher than T1, mainly due to the stationarity penalty term forcing the model to reduce drastic flow fluctuations and keep the soil moisture in the vegetation root zone stable; in terms of prediction accuracy, the NSE of the T2 discharge flow sequence with teacher labels reached 0.84, significantly higher than T1's 0.76, indicating that the end-to-end architecture avoided the accumulation of errors in the prediction + optimization stages. In terms of inference speed, T2 only takes 0.08 seconds for a single year-long scheduling, while the evolutionary optimization of T1 takes an average of 1850 seconds (about 31 minutes), which cannot meet the requirements of real-time rolling scheduling.
[0064] Through comparative verification over the above three hydrological years, it can be seen that the intelligent prediction method for ecological water demand in plateau river basins for reservoir ecological scheduling proposed in this application can achieve the following technical effects: (1) The proportion of fish spawning pulse days meeting the standard in this application scheme reached 88.6%, which is 5.1 percentage points higher than that of the original Transformer + external optimizer; the wetland flooded area maintenance rate of this application scheme was 84.3%, and the vegetation evapotranspiration replenishment rate was 87.2%, which are 5.1 and 4.6 percentage points higher, respectively. The staggered coordination of the three types of ecological water demand on the time axis has a significant effect, overcoming the problem of demand conflict during overlapping periods.
[0065] (2) The NSE of the outflow sequence of the proposed scheme is 0.84, which is better than the 0.76 of the two-stage method. The single annual scheduling inference of the proposed scheme only takes 0.08 seconds, which is more than 20,000 times faster than the evolutionary optimizer and can meet the real-time rolling scheduling requirements.
[0066] (3) All inputs to the reservoir discharge prediction model based on Transformer and dynamic bias injection in this application come from publicly available remote sensing and reanalysis data, and no ground monitoring station is required during the application phase; the limited ground-based measured data required by the teacher model are only used for the offline calibration of the SWAT hydrological model, and this process is completed once before deployment. The model is stable on three independent hydrological year test sets, proving that it has cross-year generalization ability.
[0067] Therefore, the intelligent prediction method for ecological water demand in plateau river basins for reservoir ecological scheduling provided in this application has outstanding theoretical innovation and practical value in the field of ecological scheduling of reservoirs in plateau basins with scarce data. It provides an effective technical means to solve the problems of difficulty in coordinating the staggered peak times of the three types of water demand, lack of ground data, and time-consuming traditional optimization calculations.
[0068] It should be noted that, depending on the implementation needs, the steps described in the embodiments of this application can be broken down into more steps, or two or more steps or parts of the steps can be combined into new steps to achieve the purpose of the embodiments of this application.
[0069] The methods described in the embodiments of this application can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code downloaded over a network that is originally stored in a remote recording medium or a non-transitory machine-readable medium and will be stored in a local recording medium. Thus, the methods described herein can be processed by software stored on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., RAM, ROM, flash memory, etc.) capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods described herein. Furthermore, when a general-purpose computer accesses the code used to implement the methods shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for executing the methods shown herein.
[0070] Those skilled in the art will recognize that the units and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application.
[0071] The above embodiments are only used to illustrate the embodiments of this application, and are not intended to limit the embodiments of this application. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of this application. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of this application, and the patent protection scope of the embodiments of this application should be defined by the claims.
Claims
1. A method for intelligent prediction of ecological water demand in plateau river basins for reservoir ecological management, characterized in that, include: Collect static topographic data of the target plateau river basin, meteorological forecast data for the current decision date, historical measured hydrological and meteorological data and historical remote sensing image data, as well as the actual reservoir discharge flow on the previous decision date; Based on static topographic data, meteorological forecast data for the current decision date, historical measured hydrological and meteorological data, historical remote sensing image data, and actual reservoir discharge flow for the previous decision date, the first feature vector for the current decision date is constructed. The first feature vector is input into the trained reservoir discharge flow prediction model based on Transformer and dynamic bias injection to obtain the reservoir discharge flow prediction value for the current decision day. The reservoir discharge prediction model based on Transformer and dynamic bias injection includes a linear embedding layer, a scenario prototype embedding layer containing three learnable scheduling vectors, four Transformer encoder layers, a hypernetwork dynamic bias generator composed of MLPs, and an output layer. The first feature vector is mapped to the second feature vector through the linear embedding layer. The scenario prototype embedding layer concatenates the three learnable scheduling vectors with the second feature vector to obtain an extended feature matrix. The extended feature matrix is input into the four Transformer encoder layers for encoding, and the dynamic bias matrix generated by the hypernetwork dynamic bias generator based on the ecological context features of the current decision day is injected into the attention score of the attention head in each Transformer encoder layer. After processing by the four Transformer encoder layers, the encoded output features are obtained. The encoded output features are mapped through the output layer to obtain the predicted value of the reservoir discharge for the current decision day. The three learnable scheduling vectors are the globally trainable prototype vectors for three types of ecological water demand scenarios: fish spawning period, wetland growth period, and vegetation growth period. The ecological context features include ecological variables extracted from the first feature vector, as well as binary time window indicator variables corresponding to the three types of ecological water demand scenarios. If the current decision day falls within the time period of the reference ecological water demand scenario, the corresponding binary time window indicator variable takes a value of 1; otherwise, it takes a value of 0. The reference ecological water demand scenario is any one of the fish spawning period, wetland growth period, and vegetation growth period.
2. The method according to claim 1, characterized in that, The ecological context features include normalized vegetation index, improved normalized water index, soil moisture content, forecasted precipitation, and forecasted temperature; the hypernetwork dynamic bias generator includes three independent hypernetwork modules that do not share weights, each hypernetwork module includes two layers of MLP, and each hypernetwork module corresponds to an ecological water demand scenario; each Transformer encoder includes eight self-attention heads; The extended feature matrix is input into four Transformer encoder layers for encoding. The dynamic bias matrix generated by the hypernetwork dynamic bias generator based on the ecological context features of the current decision day is injected into the attention score of each attention head within each Transformer encoder layer. After processing by the four Transformer encoder layers, the encoded output features are obtained, including: The 8-dimensional ecological context features are mapped to three types of ecological water demand scenarios through three independent hypernetwork modules, generating 32-dimensional dynamic modulation coefficients. Generate based on learnable fundamental bias matrix, dynamic modulation coefficients, and sigmoid function. The dynamic bias matrix; Based on the principle that the row index in the dynamic bias matrix corresponds to the Transformer encoder layer and the column index corresponds to the self-attention head in the Transformer encoder layer, each element in the dynamic bias matrix is used as the context-aware bias of the self-attention head in the corresponding Transformer encoder layer. For each Transformer encoder layer, the corresponding query matrix, key matrix, and value matrix are generated by expanding the feature matrix using the input sequence of the current Transformer encoder layer. The original attention score for each self-attention head is then generated based on the query matrix and key matrix. If the current Transformer encoder layer is the first Transformer encoder layer, the input sequence is the expanded feature matrix. If the current Transformer encoder layer is not the first Transformer encoder layer, the input sequence is the output feature of the previous Transformer encoder layer. The target attention score is obtained by adding the context-aware bias corresponding to each self-attention head in each Transformer encoder layer to the corresponding original attention score; The output features of the corresponding Transformer encoder layer are calculated based on the target attention score and value matrix, and the output features of the fourth Transformer encoder layer are used as the final encoded output features.
3. The method according to claim 1, characterized in that, The output layer includes a linear projection module, a sigmoid activation function, and a physical scaling module; the processing of the output layer includes: The encoded output features are linearly mapped using a linear projection module and compressed to the (0,1) interval using a Sigmoid activation function to obtain the initial mapped features. The physical scaling module performs a linear mapping on the initial mapping features based on the target reservoir's ecological base flow and maximum discharge capacity to obtain the predicted reservoir discharge flow.
4. The method according to claim 1, characterized in that, Also includes: By using the maximum discharge capacity of the target reservoir, the predicted reservoir discharge flow is safely truncated to obtain the executable reservoir discharge flow. The executable reservoir discharge flow will generate the gate control command for the target reservoir, which will be output to the gate control system of the target reservoir for execution, in order to replenish the ecological water demand of the target plateau river basin downstream of the target reservoir.
5. The method according to claim 4, characterized in that, the step of safely truncating the predicted reservoir discharge flow using the maximum discharge capacity of the target reservoir to obtain the executable reservoir discharge flow includes: If the predicted discharge flow from the reservoir is greater than the maximum discharge capacity of the target reservoir, the maximum discharge capacity of the target reservoir will be used as the executable discharge flow from the reservoir. If the predicted reservoir discharge flow is less than or equal to the maximum discharge capacity of the target reservoir, the predicted reservoir discharge flow will be used as the executable reservoir discharge flow.
6. The method according to claim 1, characterized in that, The training method for the reservoir discharge prediction model based on Transformer and dynamic bias injection includes: By using the river cross-section data extracted from the SRTM DEM and the measured flow rate to calibrate the key parameters of the SWAT distributed hydrological model, the daily simulated runoff is obtained. The daily simulated runoff was converted into flow velocity and water depth using the Manning formula, and the fish habitat suitability index was calculated. Based on time-series data of normalized vegetation index and improved normalized water index, the Penman-Monteith formula was used to calculate the daily potential evapotranspiration, and the theoretical evapotranspiration water demand and theoretical wetland water demand were obtained. Using historical measured inflow as boundary conditions, and based on the fish habitat suitability index, theoretical evapotranspiration water demand, and theoretical wetland water demand, the first optimization objective is to maximize the cumulative annual fish habitat suitability, the second is to maximize the vegetation evapotranspiration replenishment rate, and the third is to maximize the wetland flooded area maintenance rate. The NSGA-III multi-objective evolutionary algorithm is used to solve the Pareto front, and the point with the maximum curvature is selected as the optimal solution. The daily sequence of 365 days is restored by cubic spline interpolation to obtain the teacher's outflow label. The vegetation evapotranspiration replenishment rate is the ratio of the actual outflow volume available for vegetation to the theoretical evapotranspiration water demand, and the wetland flooded area maintenance rate is the ratio of the actual simulated flooded area to the target flooded area corresponding to the theoretical wetland water demand. The network parameters of the reservoir discharge flow prediction model based on Transformer and dynamic bias injection are continuously updated based on the teacher discharge flow label, the loss function including knowledge distillation loss, and the planned sampling strategy until the convergence condition is met, so as to obtain the trained reservoir discharge flow prediction model based on Transformer and dynamic bias injection; the network parameters include at least three learnable scheduling vectors.
7. The method according to claim 6, characterized in that, Loss function including knowledge distillation loss Represented as: ; in, For knowledge distillation loss; This is a stability penalty item; For daily masking, when remote sensing variables are missing for more than 10 consecutive days... ,otherwise ; Indicates the number of days in the forecast. The model predicts the first The reservoir discharge flow rate of the day; The model predicts the first The reservoir discharge flow rate of the day; Indicates the first Teachers' leaked traffic tags; This is the balance coefficient.
8. The method according to claim 7, characterized in that, The planned sampling strategy includes: In the first 100 training rounds of the training process, the first The day corresponds to the first in the input feature vector. The actual reservoir discharge flow rate for the day is assigned as the [number]th [day]. Teachers' leaked traffic tags; During training rounds 101-150, there is a 50% probability that the [number of rounds] will be [performed / achieved]. The day corresponds to the first in the input feature vector. The actual reservoir discharge flow rate for the day is assigned as the [number]th [day]. The teacher's leaked traffic tag has a 50% probability of being the first. The day corresponds to the first in the input feature vector. The actual reservoir discharge flow rate on the first day was assigned to the model for the [number]th day. Predicted discharge flow from Tianshui Reservoir; During the 151st to 200th training rounds, there is a 20% probability that the [number]th [round] will be [achieved / determined / perfected]. The day corresponds to the first in the input feature vector. The actual reservoir discharge flow rate for the day is assigned as the [number]th [day]. The teacher's leaked traffic tag has an 80% probability of being the first. The day corresponds to the first in the input feature vector. The actual reservoir discharge flow rate on the first day was assigned to the model for the [number]th day. Predicted discharge flow from Tianshui Reservoir.