Small hydropower group output prediction method and device, computer equipment and storage medium
By classifying and building models for the power output prediction technology of small hydropower groups, and establishing runoff prediction models for different watersheds, the problem of declining prediction performance caused by the lack of historical data for some hydropower stations has been solved, and power output prediction with high accuracy and reliability has been achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-13
- Publication Date
- 2026-03-24
AI Technical Summary
Existing small hydropower group output prediction technologies fail to effectively address the lack of historical data for some hydropower stations, resulting in decreased prediction performance and accuracy, and thus failing to meet actual needs.
By classifying watersheds and establishing different runoff prediction models for different watersheds, the model is trained using a time-series fusion transformer. Combined with cluster analysis and dimensionality reduction techniques, a target watershed feature dataset is constructed. The runoff prediction model is then used for prediction or fitting to ensure accurate prediction for each watershed.
It maintains high prediction accuracy over a longer period of time, and through the Nash efficiency coefficient test, it significantly improves the reliability and accuracy of predictions, especially performing well in multi-step predictions.
Smart Images

Figure CN115270915B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, computer equipment, and storage medium for predicting the output of a small hydropower group. Background Technology
[0002] Currently, power output prediction for small hydropower groups remains a challenge. In practical applications, due to historical reasons, some hydropower stations often lack historical data. Existing power output prediction technologies for small hydropower groups do not specifically consider the situation where some hydropower stations in a group lack historical data. For hydropower stations lacking historical data, because there is insufficient historical data to train the prediction model, the prediction model of other hydropower stations with sufficient historical data is often directly applied. This prediction method will result in a significant decrease in prediction performance and accuracy, failing to meet practical needs. Summary of the Invention
[0003] The main objective of this invention is to provide a method, apparatus, computer equipment, and storage medium for predicting the output of small hydropower groups. This invention aims to address the technical problem that existing small hydropower group output prediction technologies do not consider the lack of historical data for some hydropower stations within a small hydropower group, resulting in a significant decrease in prediction performance and accuracy, and thus failing to meet practical needs.
[0004] Based on this, it is necessary to propose a method, device, computer equipment, and storage medium for predicting the output of small hydropower groups to address the above problems.
[0005] A method for predicting the output of a small hydropower group, the method comprising:
[0006] Obtain the target data corresponding to each target single watershed in the target watershed class;
[0007] Search for the runoff prediction model corresponding to the target single watershed from the set of target runoff prediction models corresponding to the target watershed class, and obtain the search results;
[0008] If the search result is successful, the target data corresponding to the target single watershed is input into the runoff prediction model corresponding to the search result to make a prediction of the single watershed runoff.
[0009] If the search result is unsuccessful, the target data corresponding to the target single watershed is input into each of the runoff prediction models in the target runoff prediction model set to obtain the runoff volume set to be analyzed. The runoff volume set to be analyzed is then input into the runoff fitting model corresponding to the target single watershed to obtain the runoff prediction result of the single watershed.
[0010] Based on the predicted runoff of each individual watershed, the power output of small hydropower stations is converted to obtain the predicted power output of small hydropower stations.
[0011] Optionally, before the step of obtaining the target data corresponding to each target single watershed in the target watershed class, the following steps are included:
[0012] Obtain the original static watershed feature dataset and preprocess the original static watershed feature dataset to obtain the target watershed feature dataset;
[0013] Cluster analysis is performed on the target watershed feature dataset according to a preset number of categories to obtain various cluster sets;
[0014] Each cluster set is assigned a category as a watershed class.
[0015] Take any one of the watershed classes as the target watershed class, and take each watershed in the target watershed class as the target single watershed.
[0016] Optionally, the step of obtaining the original static watershed feature dataset and preprocessing the original static watershed feature dataset to obtain the target watershed feature dataset specifically includes:
[0017] The original static watershed feature dataset is normalized to obtain the first watershed feature dataset;
[0018] A preset nonlinear dimensionality reduction algorithm is used to reduce the dimensionality of the first watershed feature dataset to obtain the target watershed feature dataset.
[0019] Optionally, before the step of searching for a runoff prediction model corresponding to the target single watershed from the set of target runoff prediction models corresponding to the target watershed class and obtaining the search result, the method further includes:
[0020] Take any one of the target single watersheds in the target watershed class as the watershed to be trained;
[0021] Obtain the training sample set corresponding to the watershed to be trained;
[0022] Using the training sample set, a preset initial model is trained to predict runoff volume, and the trained initial model is used as the runoff prediction model corresponding to the target single watershed; wherein, the initial model is a model obtained based on a time-series fusion transformer;
[0023] Repeat the step of taking any one of the target single watersheds in the target watershed class as the watershed to be trained until the acquisition of each target single watershed in the target watershed class is completed;
[0024] Each runoff prediction model corresponding to each target single watershed in the target watershed class is used as the target runoff prediction model set.
[0025] Optionally, the step of using any one of the target single watersheds in the target watershed class as the watershed to be trained includes:
[0026] Take any one of the target single watersheds in the target watershed class as the watershed to be analyzed;
[0027] Determine whether the data sample of the watershed to be analyzed is sufficient;
[0028] If so, the watershed to be analyzed will be used as the watershed to be trained.
[0029] Optionally, before the step of fitting the set of runoff volumes to be analyzed to the runoff volume fitting model corresponding to the target single watershed to obtain the single watershed runoff prediction result, the method further includes:
[0030] A preset enhancement algorithm is used to combine and superimpose the outputs of each runoff prediction model in the target runoff prediction model set to form a composite model, which is then used as the runoff fitting model.
[0031] Optionally, the step of converting the small hydropower output based on the runoff prediction results of each of the individual watersheds to obtain the small hydropower group output prediction results includes:
[0032] Based on the single-basin runoff prediction results and the corresponding generator flow rate threshold ranges, the working range of each generator flow rate is determined.
[0033] Based on the generator water flow rate operating range and the corresponding number of generators, the single-range output result prediction range is calculated.
[0034] The power output prediction results of the small hydropower group are determined based on the single-range power output prediction interval corresponding to each target single watershed.
[0035] A device for predicting the output of a small hydropower group, the device comprising:
[0036] The acquisition module is used to acquire the target data corresponding to each target single watershed in the target watershed class.
[0037] The search module is used to search for a runoff prediction model corresponding to the target single watershed from the set of target runoff prediction models corresponding to the target watershed class, and obtain the search results;
[0038] The first runoff prediction module is used to input the target data corresponding to the target single watershed into the runoff prediction model corresponding to the search result when the search result is successful, so as to obtain the single watershed runoff prediction result.
[0039] The second runoff prediction module is used to input the target data corresponding to the target single watershed into each of the runoff prediction models in the target runoff prediction model set when the search result is unsuccessful, to obtain the runoff set to be analyzed, and to input the runoff set to be analyzed into the runoff fitting model corresponding to the target single watershed to fit it, so as to obtain the runoff prediction result of the single watershed.
[0040] The power output prediction module is used to convert the power output of small hydropower stations based on the runoff prediction results of each single watershed to obtain the power output prediction results of the small hydropower group.
[0041] A computer device includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the following steps:
[0042] Obtain the target data corresponding to each target single watershed in the target watershed class;
[0043] Search for the runoff prediction model corresponding to the target single watershed from the set of target runoff prediction models corresponding to the target watershed class, and obtain the search results;
[0044] If the search result is successful, the target data corresponding to the target single watershed is input into the runoff prediction model corresponding to the search result to make a prediction of the single watershed runoff.
[0045] If the search result is unsuccessful, the target data corresponding to the target single watershed is input into each of the runoff prediction models in the target runoff prediction model set to obtain the runoff volume set to be analyzed. The runoff volume set to be analyzed is then input into the runoff fitting model corresponding to the target single watershed to obtain the runoff prediction result of the single watershed.
[0046] Based on the predicted runoff of each individual watershed, the power output of small hydropower stations is converted to obtain the predicted power output of small hydropower stations.
[0047] A computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the following steps:
[0048] Obtain the target data corresponding to each target single watershed in the target watershed class;
[0049] Search for the runoff prediction model corresponding to the target single watershed from the set of target runoff prediction models corresponding to the target watershed class, and obtain the search results;
[0050] If the search result is successful, the target data corresponding to the target single watershed is input into the runoff prediction model corresponding to the search result to make a prediction of the single watershed runoff.
[0051] If the search result is unsuccessful, the target data corresponding to the target single watershed is input into each of the runoff prediction models in the target runoff prediction model set to obtain the runoff volume set to be analyzed. The runoff volume set to be analyzed is then input into the runoff fitting model corresponding to the target single watershed to obtain the runoff prediction result of the single watershed.
[0052] Based on the predicted runoff of each individual watershed, the power output of small hydropower stations is converted to obtain the predicted power output of small hydropower stations.
[0053] This invention classifies watersheds and establishes different runoff prediction models for different watersheds. When a corresponding runoff prediction model exists for a target single watershed, the model corresponding to the target single watershed is used for prediction to obtain the single watershed runoff prediction result. When no corresponding runoff prediction model exists for the target single watershed, the target data corresponding to the target single watershed is input into each of the runoff prediction models in the target runoff prediction model set to obtain the runoff set to be analyzed. The runoff set to be analyzed is then input into the runoff fitting model corresponding to the target single watershed for fitting to obtain the single watershed runoff prediction result. This achieves accurate prediction for each watershed. Testing has shown that the prediction accuracy remains above excellent over a relatively long period, meeting practical needs. The Nash efficiency coefficient test also shows that this method greatly improves the reliability of prediction and performs excellently in multi-step prediction. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] in:
[0056] Figure 1 This is a flowchart of a method for predicting the output of a small hydropower group in one embodiment;
[0057] Figure 2This is a block diagram of a small hydropower group output prediction device in one embodiment;
[0058] Figure 3 This is a structural block diagram of a computer device in one embodiment. Detailed Implementation
[0059] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0060] For clarity, not all features of the actual embodiments are described. In the following description, well-known functions and structures are not detailed in detail, as they would obscure the invention with unnecessary detail. It should be understood that in the development of any actual embodiment, numerous implementation details must be made to achieve the developer's specific objectives, such as changes from one embodiment to another according to limitations related to the system or business. Such development work should be considered complex and time-consuming, but is merely routine work for those skilled in the art.
[0061] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are intended to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0062] The following section will introduce the small hydropower group output prediction method of this invention. Please refer to [link / reference]. Figure 1 One embodiment of the small hydropower group output prediction method in this invention includes:
[0063] 101. Obtain the target data corresponding to each target single watershed in the target watershed class;
[0064] In this embodiment, the target watershed class can be any watershed category classified according to watershed characteristics within the city, the target single watershed can be any watershed in the target watershed class, and the target data is the watershed data corresponding to the target single watershed.
[0065] The target data is a sequence of data ordered by date, which can be specifically divided into historical target data before the prediction date and target data for the prediction date. Specific data types of historical target data include, but are not limited to: date, daylight hours (s), hourly time points, hourly precipitation (mm / day), hourly shortwave radiation (W / m²), hourly average temperature (°C), hourly average vapor pressure (Pa), and hourly runoff (m³). 3 / s); the target data source for the predicted date is weather forecasts and other forecast information. The specific data types include, but are not limited to: date, daytime (s), hourly time point, hourly precipitation (mm / day), hourly shortwave radiation (W / m2), hourly average temperature (C), and hourly average vapor pressure (Pa).
[0066] Understandably, an hourly time point can be the end of an hour, the start of an hour, or even a point in the middle of an hour.
[0067] A river basin is the area through which the main stream and tributaries of a water system flow above the location of a small hydropower station.
[0068] 102. Search for the runoff prediction model corresponding to the target single watershed from the set of target runoff prediction models corresponding to the target watershed class, and obtain the search results;
[0069] The target runoff prediction model set is a collection of runoff prediction models corresponding to each target single watershed within the target watershed class; the runoff prediction model is the prediction model for the target single watershed; the search result indicates whether a runoff prediction model corresponding to the target single watershed has been found. A successful search result means that the target single watershed for which the search result is successful already has a trained runoff prediction model; a failed search result means that the target single watershed for which the search result is failed does not have a trained runoff prediction model.
[0070] The runoff prediction model is a model trained based on Temporal Fusion Transformers (TFTs).
[0071] It is understood that the runoff prediction model can be a single-step prediction model or a multi-step prediction model. A single-step prediction model predicts data for one hour at a time. A multi-step prediction model predicts data for multiple consecutive hours at a time, such as predicting data for 24 hours in one day, or predicting data for each hour of n consecutive days.
[0072] 103. If the search result is successful, the target data corresponding to the target single watershed is input into the runoff prediction model corresponding to the search result to make a prediction of the single watershed runoff.
[0073] If the search result is successful, the target data corresponding to the target single watershed is input into the runoff prediction model corresponding to the search result for prediction, and the predicted data is used as the single watershed runoff prediction result.
[0074] The single-basin runoff prediction result is the runoff interval prediction result of the single-basin obtained by inputting the above target data into the corresponding runoff prediction model. The runoff interval prediction result consists of three prediction results output by the runoff prediction model. The three prediction results are: the first prediction result, the second prediction result, and the third prediction result. The first prediction result is the upper limit of the interval, the second prediction result is the lower limit of the interval, and the third prediction result is the midpoint of the interval. Among them, the first prediction result is the prediction result of the 90th quantile of the model, the second prediction result is the prediction result of the 10th quantile of the model, and the third prediction result is the prediction result of the 50th quantile of the model.
[0075] Quantile is a statistical term for the range of distribution of a variable. If a set of data is sorted from smallest to largest and the corresponding cumulative percentile is calculated, the value of the data corresponding to a certain percentile is called the percentile of that percentile.
[0076] 104. If the search result is unsuccessful, the target data corresponding to the target single watershed is input into each of the runoff prediction models in the target runoff prediction model set to obtain the runoff volume set to be analyzed. The runoff volume set to be analyzed is then input into the runoff fitting model corresponding to the target single watershed for fitting to obtain the single watershed runoff prediction result.
[0077] If the search result fails, the single-basin runoff prediction result needs to be determined based on the target runoff prediction model set and the runoff fitting model.
[0078] The set of flows to be analyzed is the set of prediction results obtained by inputting the target data corresponding to the watershed into each of the runoff prediction models; the runoff fitting model is a fitting model established for a single target watershed where the data sample is scarce and a runoff prediction model cannot be established.
[0079] The runoff fitting model is a model trained based on the boosting algorithm.
[0080] 105. Based on the predicted runoff of each single watershed, the power output of small hydropower stations is converted to obtain the predicted power output of small hydropower stations.
[0081] Based on the runoff prediction results of each individual watershed, the power generation of small hydropower stations is predicted, and finally the total power generation of the entire small hydropower group corresponding to the target watershed is obtained, thereby determining the power output prediction result of the small hydropower group.
[0082] By verifying the power output prediction results of small hydropower groups, when predicting the power output of small hydropower groups for two months, the Nash efficiency coefficient of this small hydropower group power output prediction method reached 70% in the first month and could maintain a high accuracy rate of over 40% after the second month. Compared with existing prediction techniques, the accuracy rate drops significantly after ten days and the Nash efficiency coefficient becomes negative, this small hydropower group power output prediction method greatly improves the reliability of the prediction.
[0083] The Nash efficiency coefficient is a common evaluation coefficient used in hydrological models to judge the quality of simulation results. Its value ranges from negative infinity to 1. The closer the coefficient is to 1, the better the model quality and the higher the model reliability. The closer the coefficient is to 0, the closer the simulation results are to the average level of the observed values, that is, the overall results are reliable, but the process simulation error is large. If the coefficient is much less than 0, it means that the model is unreliable.
[0084] This invention classifies watersheds and establishes different runoff prediction models for different watersheds. When a corresponding runoff prediction model exists for a target single watershed, the model corresponding to the target single watershed is used for prediction to obtain the single watershed runoff prediction result. When no corresponding runoff prediction model exists for the target single watershed, the target data corresponding to the target single watershed is input into each of the runoff prediction models in the target runoff prediction model set to obtain the runoff set to be analyzed. The runoff set to be analyzed is then input into the runoff fitting model corresponding to the target single watershed for fitting to obtain the single watershed runoff prediction result. This achieves accurate prediction for each watershed. Testing has shown that the prediction accuracy remains above excellent over a relatively long period, meeting practical needs. The Nash efficiency coefficient test also shows that this method greatly improves the reliability of prediction and performs excellently in multi-step prediction.
[0085] Optionally, in the above Figure 1 Based on the corresponding embodiments, in the first optional embodiment of the small hydropower group output prediction method provided by the present invention, obtaining the target data corresponding to each target single watershed in the target watershed class may further include:
[0086] 1001. Obtain the original static watershed feature dataset and preprocess the original static watershed feature dataset to obtain the target watershed feature dataset;
[0087] 1002. Perform cluster analysis on the target watershed feature dataset according to a preset number of categories to obtain various cluster sets;
[0088] 1003. Each category corresponding to each cluster set is treated as a watershed class;
[0089] 1004. Take any one of the watershed classes as the target watershed class, and take each watershed in the target watershed class as the target single watershed.
[0090] In this embodiment, the original static watershed feature dataset can be a collection of static watershed feature data for various watersheds within the city. The static watershed feature data may include: daily average precipitation, daily average potential evapotranspiration, drought degree (evapotranspiration / precipitation), precipitation seasonality and timing, snowfall frequency, heavy rain frequency, heavy rain duration, drought rate (ratio of days with little precipitation), duration of dry days, forest coverage, watershed latitude and longitude, soil sediment content ratio, soil silt content ratio, soil clay content ratio, and groundwater permeability.
[0091] The target watershed feature dataset is a collection of data obtained by processing the original static watershed feature dataset. This processing can include normalization, dimensionality reduction, etc. Each set of target watershed feature data in the target watershed feature dataset corresponds to one watershed.
[0092] Cluster analysis is an analytical process that groups a collection of physical or abstract objects into multiple classes composed of similar objects. The goal is to classify data based on similarity. The clustering analysis algorithm used in this embodiment can be k-means clustering, binary k-means clustering, kernel k-means clustering, etc., without further limitation. This embodiment uses k-means clustering as an example to illustrate how k-means clustering classifies the target watershed feature dataset according to a preset number of classes. As a representative of unsupervised clustering algorithms, k-means' main function is to automatically group similar samples into one class. The algorithm's execution logic is as follows: first, calculate the distance from each object to the cluster center; second, calculate the new cluster center based on the objects within the cluster.
[0093] After cluster analysis, the same number of cluster sets as the preset number are obtained. Each cluster set is used as a different watershed classification. One cluster set corresponds to one watershed category. Each set of target watershed feature data in a cluster set corresponds to one watershed. The target watershed class can be any cluster set, and each watershed in the target watershed class can be a target single watershed.
[0094] This embodiment preprocesses the original static watershed feature dataset, preserving the original features of the data while removing invalid data. This facilitates the subsequent classification of the target watershed feature dataset. Classifying the watershed according to the static watershed feature data can fully consider the static watershed features of the watershed where the small hydropower station is located, and further explore the regional correlation of the small hydropower station, laying the foundation for achieving accurate multi-step prediction.
[0095] Optionally, based on the above embodiments, in the second embodiment of the small hydropower group output prediction method provided by the present invention, the process of obtaining the original static watershed feature dataset and preprocessing the original static watershed feature dataset to obtain the target watershed feature dataset may specifically include:
[0096] 10011. Normalize the original static watershed feature dataset to obtain the first watershed feature dataset;
[0097] Normalization is a data processing technique used in the field of data processing to eliminate the influence of different dimensions between indicators, thereby addressing the comparability issues between data indicators. After data normalization, the original data is at the same order of magnitude, making it suitable for comprehensive comparative evaluation. Its purpose is to limit the preprocessed data to a certain range, thus eliminating the adverse effects caused by outlier data, which refers to sample vectors that are significantly larger or smaller than other input samples. In this embodiment, the normalization method can be linear function normalization, zero-mean normalization, or neural network normalization; no specific limitation is made here.
[0098] The first watershed feature dataset is the original static watershed feature dataset after normalization.
[0099] 10012. Using a preset nonlinear dimensionality reduction algorithm, the first watershed feature dataset is dimensionality reduced to obtain the target watershed feature dataset.
[0100] Dimensionality reduction is an operation that transforms a single image into a high-dimensional data set by increasing the dimensionality of the image. Nonlinear dimensionality reduction, on the other hand, uses a nonlinear approach to reduce dimensionality while preserving local structure. The nonlinear dimensionality reduction algorithm used in this embodiment can be Isomap (iso-mapping algorithm), local linear embedding algorithm, kernelized linear dimensionality reduction, etc., without specific limitations.
[0101] This embodiment uses Isomap as an example. First, the nearest neighbor algorithm is used to find the k nearest neighbors of each data point. Here, "k" is the number of neighbors that can be specified in the model hyperparameters. After finding the neighbors, if the points are neighbors of each other, a neighborhood graph is constructed, in which the points are connected to each other; data points that are not neighbors remain unconnected. The shortest path between each pair of data points (nodes) is calculated, that is, the geodesic distance between the points is found. Finally, multidimensional scaling is used to calculate the low-dimensional embedding in order to preserve the distance between the points as much as possible.
[0102] Isomap is a non-linear dimensionality reduction algorithm, a non-iterative global optimization algorithm, and an isometric mapping algorithm. This means that after dimensionality reduction, the distance between any two points remains unchanged; this distance is the geodesic distance. Taking the distance from the South Pole to the North Pole as an example, Euclidean distance is the shortest distance between two points if a straight line is used, while geodesic distance is the length of a curve, which is more realistic.
[0103] This embodiment preprocesses the original static watershed feature dataset, preserving its original features while removing invalid data. It also employs a dimensionality reduction algorithm to reduce the dimensionality of the dataset, preserving its local structure. This facilitates subsequent classification of the target watershed feature dataset. Classifying watersheds according to static watershed feature data fully considers the static watershed characteristics of the watersheds where small hydropower stations are located, allowing for a deeper exploration of the regional correlation of small hydropower stations and laying the foundation for accurate multi-step prediction.
[0104] Optionally, based on the above embodiments, in the first embodiment of the small hydropower group output prediction method provided by the present invention, before the step of searching for the runoff prediction model corresponding to the target single watershed from the target runoff prediction model set corresponding to the target watershed class and obtaining the search result, the method may further include:
[0105] 1011. Select any one of the target single watersheds in the target watershed class as the watershed to be trained;
[0106] 1012. Obtain the training sample set corresponding to the watershed to be trained;
[0107] 1013. Using the training sample set, a preset initial model is trained to predict runoff, and the trained initial model is used as the runoff prediction model corresponding to the target single watershed; wherein, the initial model is a model obtained based on a time-series fusion transformer;
[0108] 1014. Repeat the step of taking any one of the target single watersheds in the target watershed class as the watershed to be trained until the acquisition of each target single watershed in the target watershed class is completed;
[0109] 1015. The runoff prediction models corresponding to each target single watershed in the target watershed class are taken as the target runoff prediction model set.
[0110] The watershed to be trained is the watershed where the corresponding runoff prediction model will be established. The training sample set includes multiple training samples, which are historical runoff data of the watershed to be trained, used to train the prediction model. The data types of the training samples include: date, daytime (s), hourly time point, hourly precipitation (mm / day), hourly shortwave radiation (W / m2), hourly average temperature (C), hourly average vapor pressure (Pa), and hourly runoff (m³). 3 / s).
[0111] The initial model can be a Temporal Fusion Transformer (TFT), a novel attention-based architecture that combines high-performance multi-level prediction with interpretable temporal dynamics insights. To learn temporal relationships at different scales, TFT uses recurrent layers with local processing and long-term dependent interpretable self-attention layers. TFT leverages specialized components to select relevant features and a series of gating layers to suppress unnecessary components, achieving high performance across a wide range of scenarios. Specifically, it includes five components: a sequence-to-sequence and attention-based temporal processing component to capture time-varying relationships at different time scales; a static covariate encoder that allows the network to constrain temporal predictions on static metadata; a gating component that allows skipping unnecessary parts of the network; variable selection that selects relevant input features at each time step; and quantile prediction that obtains the output range of all prediction horizons. Quantile prediction, by intentionally introducing bias to correct for above- and below-predicted probabilities, represents a fundamental improvement over traditional prediction methods in many vertical domains.
[0112] The TFT is trained using a training sample set. After training, a runoff prediction model for the watershed corresponding to the training sample set data is obtained. This runoff prediction model outputs the 90th quantile, 10th quantile, and 50th quantile prediction results through a quantile prediction component. The 90th quantile forms the upper limit of the prediction interval, the 10th quantile forms the lower limit, and the 50th quantile forms the midpoint, resulting in higher prediction accuracy. A quantile is a numerical point that divides the probability distribution range of a random variable into several equal parts. Commonly used quantiles include the median (i.e., quartile), quartile, and percentile; here, the percentile is used.
[0113] Specifically, the step of taking any one of the target single watersheds in the target watershed class as the watershed to be trained is repeated, that is, steps 1011-1013 are repeated until all target single watersheds in the target watershed class are obtained; when all target single watersheds in the target watershed class are obtained, it means that a runoff prediction model has been established for each target single watershed in the target watershed class, and the runoff prediction model corresponding to each target single watershed is taken as the target runoff prediction model set corresponding to the target watershed class.
[0114] This embodiment ensures the effectiveness of the prediction by establishing corresponding runoff prediction models for each target single watershed. It also employs the latest TFT model to construct the runoff prediction model, using quantile prediction to obtain the prediction interval, thus improving the accuracy of the model prediction and leaving more reference space for practical applications. The results of small hydropower group output prediction were verified. When predicting the output of small hydropower groups for two months, the Nash efficiency coefficient of this small hydropower group output prediction method reached 70% in the first month and maintained a high accuracy rate of over 40% after the second month. Compared to existing prediction techniques where the accuracy drops significantly after ten days and the Nash efficiency coefficient becomes negative, this small hydropower group output prediction method greatly improves the reliability of the prediction. In this invention, by classifying watersheds by characteristics and establishing corresponding runoff prediction models for each watershed, the prediction accuracy remains excellent even as the prediction time range increases, meeting practical needs. The Nash efficiency coefficient verification also shows that this method greatly improves the reliability of the prediction and performs excellently in multi-step prediction.
[0115] Optionally, based on the above embodiments, in the fourth embodiment of the small hydropower group output prediction method provided by the present invention, the step of taking any one of the target single watersheds in the target watershed class as the watershed to be trained may further include:
[0116] 10111. Take any one of the target single watersheds in the target watershed class as the watershed to be analyzed;
[0117] 10112. Determine whether the data sample of the watershed to be analyzed is sufficient;
[0118] 10113. If so, then the watershed to be analyzed shall be the watershed to be trained.
[0119] The watershed to be analyzed is any of the target single watersheds. The historical data samples of the watershed to be analyzed are judged. If the historical data samples of the watershed to be analyzed lack historical power output data or historical runoff data of the watershed, or both, then the data samples of the watershed to be analyzed are judged to be insufficient. Only when both are available are the data samples of the watershed to be analyzed judged to be sufficient, and the watershed to be analyzed is used as the watershed to be trained.
[0120] This embodiment separates watersheds with sufficient and insufficient data samples, ensuring the predictive effectiveness of watersheds with sufficient data samples while simultaneously fitting data to watersheds with insufficient data samples to maintain the same high predictive effectiveness. This increases the reliability of practical applications and provides a contingency plan for situations where some power plants lack data. It also leaves more room for maneuver in practical applications. Verification of small hydropower group output prediction results shows that when predicting the output of small hydropower groups for two months, the Nash efficiency coefficient of this small hydropower group output prediction method reaches 70% in the first month and maintains a high accuracy rate of over 40% in the second month. Compared to existing prediction techniques where the accuracy drops significantly after ten days and the Nash efficiency coefficient becomes negative, this small hydropower group output prediction method greatly improves the reliability of predictions and meets practical needs.
[0121] Optionally, based on the above embodiments, in the first embodiment of the small hydropower group output prediction method provided by the present invention, before the step of fitting the set of runoff to be analyzed to the runoff fitting model corresponding to the target single watershed to obtain the single watershed runoff prediction result, the method may further include:
[0122] 1031. Using a preset enhancement algorithm, the output results of each runoff prediction model in the target runoff prediction model set are combined and superimposed to form a composite model, and the composite model is used as the runoff fitting model.
[0123] Boosting algorithms are machine learning techniques used for regression and classification problems. At each step, they generate a weak predictive model (such as a decision tree), which is then weighted and accumulated into the overall model. This process strengthens weak learners with slightly higher prediction accuracy than randomness into strong learners with higher prediction accuracy. The boosting algorithm used in this method can be Gradient Boosting Decision Tree (GBDT), Adaptive Boosting Algorithm (AdaBoost), Light Gradient Boosting Machine (LightGBM), etc., without specific limitations. The runoff prediction model is the prediction model corresponding to the target single watershed after TFT training; the composite model is the overall model obtained by weighted combination using boosting algorithms; and the runoff fitting model is a prediction model for watersheds with insufficient data samples.
[0124] This embodiment uses the Light Gradient Boosting Machine (LightGBM) algorithm as an example. The LightGBM algorithm employs leaf-wise learning as its growth method. Each time, it selects all leaves from the already built tree, finds the leaf with the largest splitting gain, and then splits it, repeating this process continuously, thus reducing computational cost. Simultaneously, the LightGBM algorithm uses a histogram algorithm, dividing feature values into many small buckets and directly searching for classification within these buckets. This reduces storage and computational costs, resulting in better performance.
[0125] This embodiment separates watersheds with sufficient and insufficient data samples, ensuring the predictive effectiveness of watersheds with sufficient data samples while simultaneously fitting data to watersheds with insufficient data samples to maintain the same high predictive effectiveness. This increases the reliability of practical applications and provides a contingency plan for situations where some power plants lack data. It also leaves more room for maneuver in practical applications. Verification of small hydropower group output prediction results shows that when predicting the output of small hydropower groups for two months, the Nash efficiency coefficient of this small hydropower group output prediction method reaches 70% in the first month and maintains a high accuracy rate of over 40% in the second month. Compared to existing prediction techniques where the accuracy drops significantly after ten days and the Nash efficiency coefficient becomes negative, this small hydropower group output prediction method greatly improves the reliability of predictions and meets practical needs.
[0126] Optionally, based on the above embodiments, in the first embodiment of the small hydropower group output prediction method provided by the present invention, the step of converting the small hydropower output based on the runoff prediction results of each single basin to obtain the small hydropower group output prediction results includes:
[0127] 1051. Based on the single-basin runoff prediction results and the corresponding generator flow rate threshold ranges, determine the operating range of each generator flow rate.
[0128] 1052. Based on the generator water flow rate operating range and the corresponding number of generators, the single-range output result prediction range is calculated;
[0129] 1053. Determine the power output prediction result of the small hydropower group based on the single-range power output prediction interval corresponding to each target single watershed.
[0130] The generator's water flow threshold range is its operating range. This range has a minimum threshold (the minimum flow rate required for the generator to operate) and a maximum threshold (the flow rate required for maximum output power). When the watershed flow rate is less than the minimum threshold, the generator does not operate. When the watershed flow rate is greater than the minimum threshold but less than the maximum threshold, the generator operates using the watershed flow rate passing through it. When the watershed flow rate is greater than the maximum threshold, the generator operates using the maximum threshold. The water flow operating interval is the effective flow rate range for each generator's operation, obtained by comparing the watershed flow rate with the individual generator's water flow threshold range.
[0131] The single-range output prediction interval is the sum of the operating intervals of the water flow of all generators of the same type in a single river basin (i.e., a single river basin); the output prediction result of a small hydropower group is the sum of the output predictions of all power stations in that hydropower group, obtained from all single-range output prediction intervals according to the power generation conversion formula, which is: P = μ(Q T )γQ T H n (Q T ), where μ is the power plant efficiency, which is a function of water flow rate; γ is the specific gravity of water (9.81 kN / m³); Q T It is the total effective water flow (m3 / s) through the generator; H n It is the net water head, which is obtained by summing the predicted ranges of the single-range output results corresponding to each of the target single watersheds. T Substituting into the above formula yields the predicted output of the small hydropower group.
[0132] This embodiment ensures the effectiveness of the prediction by establishing corresponding runoff prediction models for each target single watershed. The prediction results for small hydropower group output are verified. When predicting the output of small hydropower groups for two months, the Nash efficiency coefficient of this prediction method reaches 70% in the first month and maintains a high accuracy rate of over 40% in the second month. Compared to existing prediction techniques where accuracy drops significantly after ten days and the Nash efficiency coefficient becomes negative, this small hydropower group output prediction method greatly improves the reliability of the prediction. Furthermore, by classifying watersheds by characteristics and establishing corresponding runoff prediction models for each watershed, the prediction accuracy remains excellent even as the prediction time range increases, meeting practical needs. The Nash efficiency coefficient verification also demonstrates that this method significantly improves the reliability of the prediction and performs excellently in multi-step prediction.
[0133] In one embodiment, refer to Figure 2 A device for predicting the output of a small hydropower group is proposed, the device comprising:
[0134] The acquisition module 201 is used to acquire the target data corresponding to each target single watershed in the target watershed class;
[0135] The search module 202 is used to search for the runoff prediction model corresponding to the target single watershed from the set of target runoff prediction models corresponding to the target watershed class, and obtain the search result;
[0136] The first runoff prediction module 203 is used to input the target data corresponding to the target single watershed into the runoff prediction model corresponding to the search result when the search result is successful, so as to obtain the single watershed runoff prediction result.
[0137] The second runoff prediction module 204 is used to input the target data corresponding to the target single watershed into each of the runoff prediction models in the target runoff prediction model set when the search result is unsuccessful, to obtain a runoff set to be analyzed, and to input the runoff set to be analyzed into the runoff fitting model corresponding to the target single watershed to fit it, so as to obtain the single watershed runoff prediction result.
[0138] The output prediction result module 205 is used to convert the output of small hydropower stations based on the runoff prediction results of each single watershed to obtain the output prediction results of the small hydropower group.
[0139] This invention classifies watersheds and establishes different runoff prediction models for different watersheds. When a corresponding runoff prediction model exists for a target single watershed, the model corresponding to the target single watershed is used for prediction to obtain the single watershed runoff prediction result. When no corresponding runoff prediction model exists for the target single watershed, the target data corresponding to the target single watershed is input into each of the runoff prediction models in the target runoff prediction model set to obtain the runoff set to be analyzed. The runoff set to be analyzed is then input into the runoff fitting model corresponding to the target single watershed for fitting to obtain the single watershed runoff prediction result. This achieves accurate prediction for each watershed. Testing has shown that the prediction accuracy remains above excellent over a relatively long period, meeting practical needs. The Nash efficiency coefficient test also shows that this method greatly improves the reliability of prediction and performs excellently in multi-step prediction.
[0140] Figure 3 An internal structural diagram of a computer device in one embodiment is shown. This computer device can specifically be a terminal or a server. Figure 3As shown, the computer device includes a processor, memory, and network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program. When executed by the processor, this computer program enables the processor to implement a method for predicting the output of small hydropower stations. The internal memory may also store a computer program. When executed by the processor, this computer program enables the processor to implement an age recognition method. Those skilled in the art will understand that... Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0141] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the following steps:
[0142] Obtain the target data corresponding to each target single watershed in the target watershed class;
[0143] Search for the runoff prediction model corresponding to the target single watershed from the set of target runoff prediction models corresponding to the target watershed class, and obtain the search results;
[0144] If the search result is successful, the target data corresponding to the target single watershed is input into the runoff prediction model corresponding to the search result to make a prediction of the single watershed runoff.
[0145] If the search result is unsuccessful, the target data corresponding to the target single watershed is input into each of the runoff prediction models in the target runoff prediction model set to obtain the runoff volume set to be analyzed. The runoff volume set to be analyzed is then input into the runoff fitting model corresponding to the target single watershed to obtain the runoff prediction result of the single watershed.
[0146] Based on the predicted runoff of each individual watershed, the power output of small hydropower stations is converted to obtain the predicted power output of small hydropower stations.
[0147] This invention classifies watersheds and establishes different runoff prediction models for different watersheds. When a corresponding runoff prediction model exists for a target single watershed, the model corresponding to the target single watershed is used for prediction to obtain the single watershed runoff prediction result. When no corresponding runoff prediction model exists for the target single watershed, the target data corresponding to the target single watershed is input into each of the runoff prediction models in the target runoff prediction model set to obtain the runoff set to be analyzed. The runoff set to be analyzed is then input into the runoff fitting model corresponding to the target single watershed for fitting to obtain the single watershed runoff prediction result. This achieves accurate prediction for each watershed. Testing has shown that the prediction accuracy remains above excellent over a relatively long period, meeting practical needs. The Nash efficiency coefficient test also shows that this method greatly improves the reliability of prediction and performs excellently in multi-step prediction.
[0148] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, causes the processor to perform the following steps:
[0149] Obtain the target data corresponding to each target single watershed in the target watershed class;
[0150] Search for the runoff prediction model corresponding to the target single watershed from the set of target runoff prediction models corresponding to the target watershed class, and obtain the search results;
[0151] If the search result is successful, the target data corresponding to the target single watershed is input into the runoff prediction model corresponding to the search result to make a prediction of the single watershed runoff.
[0152] If the search result is unsuccessful, the target data corresponding to the target single watershed is input into each of the runoff prediction models in the target runoff prediction model set to obtain the runoff volume set to be analyzed. The runoff volume set to be analyzed is then input into the runoff fitting model corresponding to the target single watershed to obtain the runoff prediction result of the single watershed.
[0153] Based on the predicted runoff of each individual watershed, the power output of small hydropower stations is converted to obtain the predicted power output of small hydropower stations.
[0154] This invention classifies watersheds and establishes different runoff prediction models for different watersheds. When a corresponding runoff prediction model exists for a target single watershed, the model corresponding to the target single watershed is used for prediction to obtain the single watershed runoff prediction result. When no corresponding runoff prediction model exists for the target single watershed, the target data corresponding to the target single watershed is input into each of the runoff prediction models in the target runoff prediction model set to obtain the runoff set to be analyzed. The runoff set to be analyzed is then input into the runoff fitting model corresponding to the target single watershed for fitting to obtain the single watershed runoff prediction result. This achieves accurate prediction for each watershed. Testing has shown that the prediction accuracy remains above excellent over a relatively long period, meeting practical needs. The Nash efficiency coefficient test also shows that this method greatly improves the reliability of prediction and performs excellently in multi-step prediction.
[0155] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0156] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0157] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for predicting the output of a small hydropower group, characterized in that, include: Obtain the target data corresponding to each target single watershed in the target watershed class; Search for the runoff prediction model corresponding to the target single watershed from the set of target runoff prediction models corresponding to the target watershed class, and obtain the search results; If the search result is successful, the target data corresponding to the target single watershed is input into the runoff prediction model corresponding to the search result to make a prediction of the single watershed runoff. If the search result is unsuccessful, the target data corresponding to the target single watershed is input into each of the runoff prediction models in the target runoff prediction model set to obtain the runoff volume set to be analyzed. The runoff volume set to be analyzed is then input into the runoff fitting model corresponding to the target single watershed to obtain the runoff prediction result of the single watershed. Based on the runoff prediction results of each individual watershed, the power output of small hydropower stations is converted to obtain the power output prediction results of small hydropower groups. Prior to the step of obtaining the target data corresponding to each target single watershed in the target watershed class, the following steps are included: Obtain the original static watershed feature dataset and preprocess the original static watershed feature dataset to obtain the target watershed feature dataset; Cluster analysis is performed on the target watershed feature dataset according to a preset number of categories to obtain various cluster sets; Each cluster set is assigned a category as a watershed class. Take any one of the watershed classes as the target watershed class, and take each watershed in the target watershed class as the target single watershed.
2. The method for predicting the output of small hydropower groups according to claim 1, characterized in that, The steps of obtaining the original static watershed feature dataset and preprocessing the original static watershed feature dataset to obtain the target watershed feature dataset specifically include: The original static watershed feature dataset is normalized to obtain the first watershed feature dataset; A preset nonlinear dimensionality reduction algorithm is used to reduce the dimensionality of the first watershed feature dataset to obtain the target watershed feature dataset.
3. The method for predicting the output of small hydropower groups according to claim 1, characterized in that, Before the step of searching for the runoff prediction model corresponding to the target single watershed from the set of target runoff prediction models corresponding to the target watershed class and obtaining the search result, the method further includes: Take any one of the target single watersheds in the target watershed class as the watershed to be trained; Obtain the training sample set corresponding to the watershed to be trained; Using the training sample set, a preset initial model is trained to predict runoff volume, and the trained initial model is used as the runoff prediction model corresponding to the target single watershed; wherein, the initial model is a model obtained based on a time-series fusion transformer; Repeat the step of taking any one of the target single watersheds in the target watershed class as the watershed to be trained until the acquisition of each target single watershed in the target watershed class is completed; Each runoff prediction model corresponding to each target single watershed in the target watershed class is used as the target runoff prediction model set.
4. The method for predicting the output of small hydropower groups according to claim 3, characterized in that, The step of using any one of the target single watersheds in the target watershed class as the watershed to be trained includes: Take any one of the target single watersheds in the target watershed class as the watershed to be analyzed; Determine whether the data sample of the watershed to be analyzed is sufficient; If so, the watershed to be analyzed will be used as the watershed to be trained.
5. The method for predicting the output of small hydropower groups according to claim 1, characterized in that, Before the step of fitting the set of runoff volumes to be analyzed to the runoff volume fitting model corresponding to the target single watershed to obtain the single watershed runoff prediction result, the method further includes: A preset enhancement algorithm is used to combine and superimpose the outputs of each runoff prediction model in the target runoff prediction model set to form a composite model, which is then used as the runoff fitting model.
6. The method for predicting the output of small hydropower groups according to claim 1, characterized in that, The step of converting the small hydropower output based on the runoff prediction results of each individual watershed to obtain the small hydropower group output prediction results includes: Based on the single-basin runoff prediction results and the corresponding generator flow rate threshold ranges, the working range of each generator flow rate is determined. Based on the generator water flow rate operating range and the corresponding number of generators, the single-range output result prediction range is calculated. The power output prediction results of the small hydropower group are determined based on the single-range power output prediction interval corresponding to each target single watershed.
7. A device for predicting the output of a small hydropower group, characterized in that, The apparatus for predicting the output of small hydropower groups according to any one of claims 1 to 6, the apparatus comprising: The acquisition module is used to acquire the target data corresponding to each target single watershed in the target watershed class. The search module is used to search for a runoff prediction model corresponding to the target single watershed from the set of target runoff prediction models corresponding to the target watershed class, and obtain the search results; The first runoff prediction module is used to input the target data corresponding to the target single watershed into the runoff prediction model corresponding to the search result when the search result is successful, so as to obtain the single watershed runoff prediction result. The second runoff prediction module is used to input the target data corresponding to the target single watershed into each of the runoff prediction models in the target runoff prediction model set when the search result is unsuccessful, to obtain the runoff set to be analyzed, and to input the runoff set to be analyzed into the runoff fitting model corresponding to the target single watershed to fit it, so as to obtain the runoff prediction result of the single watershed. The power output prediction module is used to convert the power output of small hydropower stations based on the runoff prediction results of each single watershed to obtain the power output prediction results of the small hydropower group.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Medium- and long-term runoff ensemble forecast method and system based on rainfall forecast
CN113592143A