Ecological flow prediction method, device, electronic device and storage medium
By obtaining the characteristic parameters and maximum mutual information coefficient of the runoff sequence, screening the forecast factor and training the long and short-term memory network, the accuracy of ecological flow prediction in the existing technology is solved, and accurate prediction of runoff during dry period is achieved, and water resource management is achieved. Provides effective data support.
Patent Information
- Application Number
- CN202410731705.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-06-06
AI Technical Summary
The existing ecological flow prediction technology has low accuracy for small flow forecasts for low flows in dry seasons, complex hydrological and hydrodynamic models and large calculations, and the data mining-based methods do not consider the representativeness of the runoff process, resulting in low accuracy.
By obtaining the peak value, peak appearance time and peak shape coefficient of the runoff sequence as characteristic parameters, the runoff sequence during the dry period is selected, the maximum mutual information coefficient is calculated, the forecast factor is screened, and the long-term memory network is used to train to predict ecological flow.
Accurate learning and prediction of runoff characteristics during dry periods is achieved, the accuracy and accuracy of ecological flow prediction is improved, and effective data support is provided for water resource development and management.
Smart Images

Figure CN118709831B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an ecological flow prediction method, device, electronic device and storage medium. Background Art
[0002] The ecological flow of rivers and lakes (referred to as "ecological flow") is one of the basic bases for the development, control and optimization of water resources, ecological restoration of rivers and lakes, and coordination of water-related affairs among regions. Ensuring ecological flow is of great significance to maintaining water security. At the same time, ensuring ecological flow is a basic requirement for strengthening the development and utilization of water resources and promoting the protection and restoration of river and lake ecology. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to propose an ecological flow prediction method, device, electronic device and storage medium to accurately predict the ecological flow.
[0004] To achieve the above object, an embodiment of the present application provides an ecological flow prediction method, which includes the following steps:
[0005] Acquire peak values, peak occurrence times, and peak shape coefficients of a plurality of first runoff sequences as a characteristic parameter set corresponding to the first runoff sequence;
[0006] Selecting the first runoff sequence corresponding to the dry season from each of the first runoff sequences according to each of the characteristic parameter sets as the second runoff sequence;
[0007] Calculating the maximum mutual information coefficient between a plurality of preset first prediction factors and each of the second runoff sequences;
[0008] Selecting a plurality of second predictor factors from the plurality of first predictor factors according to the maximum mutual information coefficient;
[0009] Using each of the second prediction factors as training samples and each of the second runoff sequences as training labels, training a long short-term memory network to obtain the trained long short-term memory network;
[0010] The third predictor is input into the trained long short-term memory network to obtain a third runoff sequence as the ecological flow.
[0011] In some embodiments, the step of obtaining peak values, peak occurrence times, and peak shape coefficients of a plurality of first runoff sequences as a characteristic parameter set corresponding to the first runoff sequence comprises the following steps:
[0012] Acquire a plurality of the first runoff sequences; wherein each of the first runoff sequences includes a plurality of runoff amounts;
[0013] Determine the maximum runoff amount in each of the first runoff sequences as the corresponding peak value;
[0014] Determine the time when each peak value appears as the corresponding peak appearance time;
[0015] The peak shape coefficient corresponding to each first runoff sequence is calculated using the following formula:
[0016] m i =|p i+1 -p i |;
[0017]
[0018] Where x=(x1,x2,K,x i ,K,x n ), x represents each of the first runoff sequences, x i represents the runoff volume, p i Represents x i The normalized value of , E represents the peak shape coefficient.
[0019] In some embodiments, the step of selecting the first runoff sequence corresponding to the dry season from each of the first runoff sequences according to each of the characteristic parameter sets as the second runoff sequence comprises the following steps:
[0020] Convert each of the characteristic parameter sets into data points in three-dimensional space;
[0021] Clustering each of the data points to obtain a plurality of the first runoff sequences corresponding to each category;
[0022] Calculate the average flow of a plurality of the first runoff sequences corresponding to each of the categories;
[0023] A plurality of the first runoff sequences of the category with the smallest average flow are selected as the second runoff sequences in the dry season.
[0024] In some embodiments, clustering the data points to obtain a plurality of the first runoff sequences corresponding to the categories includes the following steps:
[0025] Determine any data point that has not been visited as the current data point;
[0026] Determine whether there are a set number of other data points within a set distance of the current data point, and mark the current data point as visited;
[0027] If there are other data points reaching the set number within the set distance of the current data point, clustering the current data point and the other data points within the set distance into the same cluster;
[0028] Returning any one of the data points that has not been visited as the current data point until all the data points are marked as visited, and then clustering to obtain multiple clusters of the data points; one cluster of the data points corresponds to multiple first runoff sequences of one category.
[0029] In some embodiments, the step of calculating the maximum mutual information coefficient between a plurality of preset first prediction factors and each of the second runoff sequences comprises the following steps:
[0030] Grouping a plurality of the first prediction factors and each of the second runoff sequences into a plurality of sets;
[0031] Mapping each of the sets to a two-dimensional space to obtain a scatter plot;
[0032] Dividing the scatter plot into grids of various specifications; wherein the area ranges of the grids of different specifications are different;
[0033] Calculate the frequency distribution of points of each set in the grids of different specifications as the mutual information coefficient;
[0034] The maximum mutual information coefficient between a plurality of the first prediction factors and each of the second runoff sequences is determined according to each of the mutual information coefficients.
[0035] In some embodiments, the determining the maximum mutual information coefficient between a plurality of the first prediction factors and each of the second runoff sequences according to each of the mutual information coefficients comprises the following steps:
[0036] Determine the maximum probability distribution under various specifications as the target mutual information coefficient;
[0037] Normalizing each of the target mutual information coefficients;
[0038] The target mutual information coefficient with the largest normalized value is selected as the maximum mutual information coefficient.
[0039] In some embodiments, the method further comprises the following steps:
[0040] Generate early warning information corresponding to the ecological flow.
[0041] To achieve the above object, another aspect of the embodiment of the present application provides an ecological flow prediction device, the device comprising:
[0042] A characteristic parameter set acquisition unit, used to acquire peak values, peak appearance times and peak shape coefficients of a plurality of first runoff sequences as a characteristic parameter set corresponding to the first runoff sequence;
[0043] A runoff sequence selection unit, configured to select, from each of the first runoff sequences according to each of the characteristic parameter sets, the first runoff sequence corresponding to the dry season as a second runoff sequence;
[0044] A maximum mutual information coefficient calculation unit, used to calculate the maximum mutual information coefficient between a plurality of preset first prediction factors and each of the second runoff sequences;
[0045] A prediction factor selection unit, configured to select a plurality of second prediction factors from the plurality of first prediction factors according to the maximum mutual information coefficient;
[0046] A network training unit, configured to train a long short-term memory network using each of the second prediction factors as a training sample and each of the second runoff sequences as a training label to obtain the trained long short-term memory network;
[0047] The ecological flow prediction unit is used to input the third prediction factor into the trained long short-term memory network to obtain a third runoff sequence as the ecological flow.
[0048] To achieve the above objective, another aspect of an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above method when executing the computer program.
[0049] To achieve the above objective, another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the above method when executed by a processor.
[0050] The embodiments of the present application include at least the following beneficial effects:
[0051] The present application can obtain the peak values, peak appearance times and peak shape coefficients of multiple first runoff sequences as the characteristic parameter sets corresponding to the first runoff sequences; select the first runoff sequence corresponding to the dry season from each first runoff sequence according to each characteristic parameter set as the second runoff sequence; calculate the maximum mutual information coefficient between multiple preset first prediction factors and each second runoff sequence; select multiple second prediction factors from the multiple first prediction factors according to the maximum mutual information coefficient; use each second prediction factor as a training sample and each second runoff sequence as a training label to train a long short-term memory network to obtain a trained long short-term memory network; input the third prediction factor into the trained long short-term memory network to obtain a third runoff sequence as the ecological flow. The present application first selects the runoff sequence that conforms to the dry season based on the peak value, peak time and peak shape coefficient of the runoff sequence, and then selects the various prediction factors that have the greatest correlation with the dry season according to the maximum mutual information coefficient, and then trains the long short-term memory network with the prediction factors and the runoff sequence of the dry season, so that the long short-term memory network can accurately learn the runoff characteristics of the dry season, and then after the prediction factors to be predicted are input into the trained long short-term memory network, an accurate runoff sequence can be predicted as the ecological flow, which can provide effective and accurate ecological flow for the development and management of water resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0053] Figure 1 A schematic diagram of a flow chart of an ecological flow prediction method provided in an embodiment of the present application;
[0054] Figure 2 A three-dimensional graph of data points corresponding to a characteristic parameter set provided in an embodiment of the present application;
[0055] Figure 3 An example diagram of clustering results of a data point provided in an embodiment of the present application;
[0056] Figure 4 An example diagram of calculation results of a maximum mutual information coefficient provided in an embodiment of the present application;
[0057] Figure 5 A schematic diagram of the structure of an ecological flow prediction device provided in an embodiment of the present application;
[0058] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.
[0060] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".
[0061] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0063] Before describing the embodiments of the present application in detail, some nouns and terms that may be involved in the embodiments of the present application are first described. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations:
[0064] Reservoir: A hydraulic engineering structure that prevents floods, stores water and regulates water flow. It can regulate runoff downstream by controlling sluice gates.
[0065] Hydropower station: It is composed of hydraulic system, mechanical system and power generation device. It is a key water conservancy project that realizes the conversion of water energy into electrical energy. It can regulate the runoff downstream by controlling the power generation flow.
[0066] Ecological flow: The amount of water passing through a certain section of a river per unit time required to maintain the structure and function of the river ecology and environmental system within a certain time and space range.
[0067] Control section: A monitoring section set up to evaluate the water quantity and quality of water bodies on both sides of the monitored river section.
[0068] Data mining: The process of searching for hidden information in large amounts of data using algorithms.
[0069] Density-Based Spatial Clustering of Applications with Noise (DBSCAN): A density-based clustering algorithm that can identify clusters of arbitrary shapes while being robust to noise and outliers.
[0070] Maximum Information Coefficient (MIC): An indicator based on mutual information to measure the correlation between two-dimensional variables.
[0071] Long Short-Term Memory Network (LSTM) Convolutional Neural Network (CNN): is a deep learning model commonly used in fields such as feature recognition. It extracts data features through convolution operations to achieve tasks such as data classification and recognition.
[0072] In the field of ecological flow prediction and early warning technology, the existing technology mainly has the following problems:
[0073] 1. Existing forecasting technologies are mainly based on hydrological and hydrodynamic models, and the forecast accuracy of low and small flows during the dry season is low. The hydrological model is difficult to simulate the flow generation and confluence process of river flows, especially the flow of rivers regulated by upstream reservoirs. The hydrodynamic model is relatively complex and requires a large amount of calculation. As the simulation accuracy increases, the calculation complexity increases geometrically.
[0074] 2. Existing methods have high requirements for basic data and generally need to be combined with river topography. For departments and units that need to carry out ecological flow forecasting, it is generally difficult to directly obtain high-precision terrain data.
[0075] 3. The existing ecological flow prediction method based on data mining uses the entire historical runoff to train the prediction model, without taking into account the representativeness of the runoff process. The effects of different categories of historical runoff, such as wet, dry, and normal, are different when used for data mining, resulting in a low accuracy rate.
[0076] To solve at least one of the above problems, the embodiments of the present application provide an ecological flow prediction method, device, electronic device and storage medium. The technical solution of the present application includes: obtaining the peak value, peak appearance time and peak shape coefficient of multiple first runoff sequences as the characteristic parameter set corresponding to the first runoff sequence; selecting the first runoff sequence corresponding to the dry season from each first runoff sequence according to each characteristic parameter set as the second runoff sequence; calculating the maximum mutual information coefficient between the preset multiple first prediction factors and each second runoff sequence; selecting multiple second prediction factors from the multiple first prediction factors according to the maximum mutual information coefficient; using each second prediction factor as a training sample and each second runoff sequence as a training label, training a long short-term memory network to obtain a trained long short-term memory network; inputting a third prediction factor into the trained long short-term memory network to obtain a third runoff sequence as the ecological flow. The present application first selects the runoff sequence that conforms to the dry season based on the peak value, peak time and peak shape coefficient of the runoff sequence, and then selects the various prediction factors that have the greatest correlation with the dry season according to the maximum mutual information coefficient, and then trains the long short-term memory network with the prediction factors and the runoff sequence of the dry season, so that the long short-term memory network can accurately learn the runoff characteristics of the dry season, and then after the prediction factors to be predicted are input into the trained long short-term memory network, an accurate runoff sequence can be predicted as the ecological flow, which can provide effective and accurate ecological flow for the development and management of water resources.
[0077] The embodiment of the present application provides an ecological flow prediction method, which relates to the field of data processing technology. The ecological flow prediction method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server, and can also be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or it can be configured as a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in the blockchain network; the software can be an application that implements the ecological flow prediction method, etc., but is not limited to the above forms.
[0078] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0079] Reference Figure 1 The present application embodiment provides an ecological flow prediction method, which may include but is not limited to S100 to S150, as follows:
[0080] S100: Acquire peak values, peak occurrence times, and peak shape coefficients of a plurality of first runoff sequences as a characteristic parameter set corresponding to the first runoff sequences.
[0081] Specifically, since the existing classification methods mainly divide different categories of runoff odor breaks by sorting the peak values, the existing methods cannot fully describe the runoff characteristics. In particular, when predicting the runoff sequence, it is necessary to consider the runoff characteristics in all aspects. Compared with the existing technology that only considers "peak" and "quantity", the present embodiment can obtain the peak values, peak appearance times and peak shape coefficients of multiple first runoff sequences as the characteristic parameter set corresponding to the first runoff sequence, that is, obtain the characteristic parameters reflecting all the runoff processes, thereby achieving the purpose of taking all the characteristics into consideration.
[0082] Assume that the runoff sequence is x = (x1, x2, K, x i ,K,x n ), x i Indicates runoff; the peak value is the maximum runoff in a runoff sequence, which can be expressed as Q max = max(x); peak time refers to the time when the peak value appears, which can be expressed as T max =f(Q max ) The peak shape coefficient can describe the uniformity of the runoff sequence fluctuation and reflect the steepness of the runoff sequence. It is represented by E and is an indicator between 0 and 1. The closer E is to 1, the more uniform the runoff sequence fluctuation is, and the less obvious the steep rise and fall is.
[0083] As a further implementation, S100 may include S101 to S104:
[0084] S101: Acquire a plurality of the first runoff sequences; wherein each of the first runoff sequences includes a plurality of runoff amounts;
[0085] S102: determining the maximum runoff amount in each of the first runoff sequences as the corresponding peak value;
[0086] S103: Determine the time when each peak value appears as the corresponding peak appearance time;
[0087] S104: Calculate the peak shape coefficient corresponding to each first runoff sequence using the following calculation formula:
[0088] m i =|p i+1 -p i |;
[0089]
[0090] Where x=(x1,x2,K,x i ,K,x n ), x represents each of the first runoff sequences, x i represents the runoff volume, p i Represents x i The normalized value of , E represents the peak shape coefficient.
[0091] It can be understood that the approximate shape of the runoff process line can be basically outlined by the peak value, peak time and peak shape coefficient.
[0092] S110: Selecting, from each of the first runoff sequences according to each of the characteristic parameter sets, the first runoff sequence corresponding to the dry season as the second runoff sequence.
[0093] It can be understood that this embodiment can classify each first runoff sequence according to the peak value, peak appearance time and peak shape coefficient corresponding to each first runoff sequence, and then determine the runoff sequence in the dry season as the second runoff sequence from the classified first runoff sequences.
[0094] As a further implementation, S110 may include S111 to S114:
[0095] S111: converting each of the characteristic parameter sets into data points in three-dimensional space;
[0096] S112: clustering the data points to obtain a plurality of the first runoff sequences corresponding to the categories;
[0097] S113: Calculating the average flow of a plurality of the first runoff sequences corresponding to each of the categories;
[0098] S114: Selecting a plurality of the first runoff sequences of the category with the smallest average flow as the second runoff sequences in the dry season.
[0099] Specifically, this embodiment can convert the peak value, peak appearance time and peak shape coefficient of each first runoff sequence into data points in three-dimensional space, and then cluster each data point to obtain data points of each category. Exemplarily, this embodiment can cluster to obtain three categories of data points: flood season, normal water season and dry season, and then calculate the average flow corresponding to each category of data points, and sort them from high to low according to the average flow into flood season, normal water season and dry season.
[0100] Furthermore, S112, clustering each of the data points to obtain a plurality of the first runoff sequences corresponding to each category includes the following steps:
[0101] S1121: Determine any data point that has not been visited as the current data point;
[0102] S1122: Determine whether there are a set number of other data points within a set distance of the current data point, and mark the current data point as visited;
[0103] S1123: If there are other data points reaching the set number within the set distance of the current data point, clustering the current data point and the other data points within the set distance into the same cluster;
[0104] S1124: returning any one of the data points that has not been visited as the current data point until all the data points are marked as visited, and then clustering to obtain multiple clusters of the data points; one cluster of the data points corresponds to multiple first runoff sequences of one category.
[0105] It should be noted that if there are no other data points that reach the set number within the set distance of the current data point, the current data point will be marked as a noise data point, and the noise data point may be clustered into another cluster in the subsequent clustering process.
[0106] Specifically, this embodiment can use the DBSCAN clustering algorithm to cluster each data point, and the specific steps include:
[0107] (1) Extract the peak value, peak appearance time and peak shape coefficient of each first runoff sequence as the corresponding feature parameter set Characters = {Q max ,T max ,E}, convert each feature parameter set into data points in three-dimensional space.
[0108] (2) The DBSCAN clustering algorithm starts clustering from any unvisited data point. The neighborhood of this data point is defined by a set distance epsilon, that is, all data points within the epsilon distance range of this data point are neighborhood data points.
[0109] (3) If there are a set number of data points in the neighborhood, clustering begins and the current data point becomes a data point of a cluster; otherwise, the data point is marked as noise, and the noise data point may become part of other clusters obtained by clustering. In both cases, the current data point will be marked as visited.
[0110] (4) For the first data point in the new cluster, the data points in the ε distance neighborhood will also become part of the same cluster. The above steps make all data points in the ε neighborhood clustered into the same cluster, and then repeat steps (3) and (4) for all data points newly added to the cluster.
[0111] (5) Repeat steps (3) and (4) until all data points are marked as visited, that is, all data points in the ε neighborhood of the cluster are visited and marked.
[0112] (6) For a large number of historical measured runoff sequences, after clustering using the DBSCAN clustering algorithm, the category with the smallest statistical average flow value is the runoff sequence during the dry season.
[0113] Compared with other clustering algorithms, the advantage of DBSCAN clustering algorithm is that it does not need to determine the number of clusters. When the data points are very different, the data points can be simply introduced into the cluster. DBSCAN clustering algorithm can mark abnormal data points as noise data points. In addition, DBSCAN clustering algorithm can efficiently find clusters of any size and shape.
[0114] S120: Calculate the maximum mutual information coefficient between a plurality of preset first prediction factors and each of the second runoff sequences.
[0115] The maximum mutual information coefficient (MIC) is an indicator for measuring the correlation between two-dimensional variables based on mutual information. This embodiment can be based on the maximum mutual information coefficient through unequal interval optimization and correction processing. Compared with the existing correlation measurement indicators (Pearson correlation coefficient, Spearman correlation, mutual information, etc.), the maximum mutual information coefficient is used to calculate the correlation relationship, which has the following advantages:
[0116] 1. Universality. The MIC method can always find a grid division, search for the optimal segmentation point and calculate its mutual information value, so that it can effectively reflect any functional relationship between variables (including linear or nonlinear relationship), and also has excellent performance in measuring non-functional relationships such as function superposition.
[0117] 2. Robustness. The MIC method is not easily affected by outliers in the observed samples. Hydrological data generally have long sequences and often contain outliers. Therefore, MIC is suitable for analyzing the correlation of hydrological data.
[0118] 3. Fairness. For two sets of variables with the same amount of information, their corresponding MIC values are also the same, and they can be treated fairly at the same level. When two random variables satisfy a function or function superposition relationship, MIC converges to 1 by probability; when two random variables are independent of each other, MIC converges to 0 by probability. Theoretically, the MIC value is between [0,1], and the degree of correlation is clear at a glance, making it comparable in different relationships.
[0119] Therefore, MIC has a wider application range in correlation identification, feature selection, etc. Using MIC to calculate the maximum mutual information coefficient of multiple preset first prediction factors and each second runoff sequence can more accurately mine the prediction factors related to the second runoff.
[0120] As a further optional implementation, S120 may include S121 to S125:
[0121] S121: Grouping a plurality of the first prediction factors and each of the second runoff sequences into a plurality of sets;
[0122] S122: Mapping each of the sets to a two-dimensional space to obtain a scatter plot;
[0123] S123: Dividing the scatter plot into grids of various specifications; wherein the area ranges of the grids of different specifications are different;
[0124] S124: Calculate the frequency distribution of the points of each set in the grids of different specifications as the mutual information coefficient;
[0125] S125: Determine the maximum mutual information coefficient between a plurality of the first prediction factors and each of the second runoff sequences according to each of the mutual information coefficients.
[0126] Specifically, the set of preset first prediction factors is X = {X1, X2, ..., X n}, represents the reservoir discharge sequence before different time periods starting from time t; the forecast object is Y, which represents the runoff sequence of the reservoir downstream during the dry season starting from time t. Calculate each first forecast factor X1...X nThe MIC value between the prediction object Y and the prediction object Y is taken as the first N prediction factors with the largest MIC value as the prediction factor with strong correlation (ie, the second prediction factor).
[0127] The scatter plot is X i The two-dimensional scatter plot composed of and Y, set D = {X i , Y}.
[0128] Furthermore, S125, determining the maximum mutual information coefficient between the plurality of first prediction factors and each of the second runoff sequences according to each of the mutual information coefficients, may include S1251 to S1253:
[0129] S1251: Determine the maximum probability distribution under various specifications as the target mutual information coefficient;
[0130] S1252: Normalizing each target mutual information coefficient;
[0131] S1253: Select the target mutual information coefficient with the largest normalized value as the maximum mutual information coefficient.
[0132] Exemplarily, the step of calculating the maximum mutual information coefficient between each first prediction factor and the second runoff sequence may include:
[0133] (1) The set of first prediction factors is X = {X1, X2, ..., X n Each first predictor X in i and the forecast object Y respectively form a set D, that is, a scatter plot in two-dimensional space. For a set D, a×b grids of various specifications are divided on the scatter plot (a and b are different under different specifications). i ,Y} are divided into a grids according to the horizontal coordinate value and into b grids according to the vertical coordinate value.
[0134] (2) Calculate the frequency distribution D obtained when the points of set D fall on the given grid G. G , (allowing some grids to have points that do not fall into the set D). In order to achieve the goal of not having each point fall into a separate grid due to the grid being too fine, resulting in MIC≠0 even for random data, and not having the grid be too sparse to accurately reflect the information of the set D, it is necessary to reasonably select the upper bound B(n) of the grid G, ω(1) <B(n)≤ο(n 1-ε ), which holds for any 0<ε<1.
[0135] (3) Calculate different grid sizes G to determine different probability distributions, i.e., I(D| G ), indicating that the set D is based on the distribution D| GThe mutual information coefficient of .
[0136] (4) In all possible distributions D based on the a×b grid G| G Determine the maximum mutual information coefficient maxI(D| G ) is denoted as I * (D, a, b). Then the maximum mutual information coefficients on the grids G of different specifications are normalized so that each maximum mutual information coefficient is within (0, 1), ensuring fairness, and obtaining the characteristic matrix M(D) of the set D:
[0137]
[0138] (5) Find the maximum mutual information coefficient from the results obtained in step (4), which is the maximum mutual information coefficient:
[0139] MIC(D)=max ab<B(n) {M(D) a,b};
[0140] (6) Execute steps (2) to (5) to calculate each first prediction factor X i The maximum mutual information coefficient MIC(X i ,Y), and arrange them in descending order, select the top-ranked first prediction factors to form a new prediction factor set (i.e., each second prediction factor) X' = {X1, X2, ..., X m}, m≤n.
[0141] S130: Select a plurality of second predictor factors from the plurality of first predictor factors according to the maximum mutual information coefficient.
[0142] For example, this embodiment can sort the first prediction factors from high to low according to the maximum mutual information coefficient, and then select the first prediction factors with the highest ranking as the second prediction factors. It can be understood that the second prediction factors obtained after screening in this embodiment have a strong correlation with the second runoff sequence and can be used to more accurately predict the second runoff sequence.
[0143] S140: Using each of the second prediction factors as training samples and each of the second runoff sequences as training labels, training a long short-term memory network to obtain the trained long short-term memory network.
[0144] Long Short-Term Memory (LSTM) is a recurrent neural network used to process sequence data. It can better handle long-term dependencies and gradient vanishing problems through the control of input gates, forget gates, and output gates. It is suitable for processing sequence data containing long-term dependencies.
[0145] Specifically, the working steps of the long short-term memory network of this embodiment may include:
[0146] (1) Initialization: Set the dimensions of the input data (predictors) and hidden states, and initialize the weights and bias terms.
[0147] (2) Input gate calculation: The input of the current time step and the hidden state of the previous time step are taken as input, and the output of the input gate is obtained after linear transformation and activation function (such as sigmoid).
[0148] (3) Forget gate calculation: The input of the current time step and the hidden state of the previous time step are taken as input, and after linear transformation and activation function (such as sigmoid), the output of the forget gate is obtained.
[0149] (4) Candidate value calculation: The input of the current time step and the hidden state of the previous time step are taken as input, and the candidate value is obtained after linear transformation and activation function (such as tanh).
[0150] (5) Cell state update: Multiply the output of the input gate with the output of the forget gate to forget part of the cell state, and then multiply the candidate value with the output of the input gate to update the cell state.
[0151] (6) Output gate calculation: The input of the current time step and the hidden state of the previous time step are taken as input, and after linear transformation and activation function (such as sigmoid), the output of the output gate is obtained.
[0152] (7) Calculation of the hidden state of the current time step: The cell state is processed by an activation function (such as tanh) and multiplied by the output of the output gate to obtain the hidden state of the current time step.
[0153] (8) Repeat steps (2) to (7) until all time steps are processed.
[0154] (9) Output layer: Use the hidden state of the last time step to calculate the final output result (runoff sequence).
[0155] S150: Inputting the third prediction factor into the trained long short-term memory network to obtain a third runoff sequence as ecological flow.
[0156] It can be understood that in this embodiment, the prediction factor to be predicted can be used as the third prediction factor, and then the trained long short-term memory network can be used to predict the runoff sequence corresponding to the third prediction factor as the third runoff sequence. The predicted third runoff sequence is the ecological flow corresponding to the prediction factor to be predicted.
[0157] Considering that the rapid development of the hydropower industry in recent years has brought about serious ecological problems: some hydropower stations have caused water reduction, dehydration or even drying up of some river sections due to insufficient downstream ecological flow, which has affected the normal ecological functions of rivers and lakes to a certain extent. In order to protect the ecological environment of rivers and lakes and promote the scientific and rational development and utilization of water resources, it is necessary to predict the ecological flow downstream of the hydropower station and issue an early warning according to the set ecological flow threshold. Therefore, the embodiment of the present application may also include:
[0158] S160: Generate warning information corresponding to the ecological flow.
[0159] Exemplarily, if the predicted ecological flow is lower than an ecological flow threshold of a certain warning level, warning information corresponding to the warning level is generated and released.
[0160] Next, the solution of the embodiment of the present application will be introduced and explained in conjunction with specific application examples:
[0161] Specifically, this embodiment may include the following steps:
[0162] (1) Obtain the long-term runoff series (56) of the target river sections, count the peak value, peak time, and peak shape coefficient of each runoff series as a characteristic parameter set, convert each characteristic parameter set into a data point in three-dimensional space, and draw a three-dimensional graph based on each data point (such as Figure 2 ). Figure 2 From the distribution of data points in the middle, it can be found that the peak shape coefficients of the 56 measured runoff sequences are relatively concentrated. From the actual data, most of them are close to 1, indicating that the runoff sequence is relatively uniform, and the steep rise and fall are not obvious; while the peak value and peak time are distributed more dispersedly, indicating that the runoff sequence has a more obvious change in wet and dry seasons, and the time when the peak value appears also varies greatly.
[0163] (2) The data points corresponding to each characteristic parameter set are normalized, and the normalized data points are clustered using the DBSCAN clustering algorithm. According to the average flow value of each cluster in the clustering result, the runoff series is divided into three categories: flood season, normal water season and dry season. The data point with the smallest average flow value in each cluster is the dry season data point. Figure 3 This is an example of the clustering result of a data point. Figure 3 According to the clustering results, 17 of the 56 runoff sequences belong to the dry season.
[0164] (3) Based on the 17 runoff sequences belonging to the dry season, the 17 outflow sequences corresponding to the target reservoirs upstream of the target river in the same time range are collected, and the above two types of sequences are merged into one sequence. For the outflow sequence of the target reservoir, the measured flow data from 1 hour before to 14 hours before are selected as the candidate prediction factor set: X = {Q t-1 ,Q t-2 ,…,Q t-14}, taking the runoff sequence of the target river section t as the forecast object Y, the MIC method is used to screen the forecast factors, and the maximum mutual information coefficient MIC (X i ,Y), the calculation results are as follows Figure 4 The MIC value of the reservoir outflow process starting at time t-8 and the measured flood process of the target river section starting at time t downstream is the largest, reaching 0.8836, and the correlation is the strongest, so the target prediction factor X={Q t-8}.
[0165] (4) With X = {Q t-8} is used as the input layer of the LSTM network, and the forecast object Y is used as the output layer. The LSTM network is trained (70% of the total data) and tested (30% of the total data).
[0166] The prediction results of the long short-term memory network were evaluated using mean absolute error (MAE), root mean square error (RMSE), and coefficient of certainty (R 2 ) and prediction qualification rate (QR) and other indicators are used to evaluate the trained LSTM network. The evaluation results can be found in Table 1.
[0167] Table 1
[0168]
[0169]
[0170] This embodiment can achieve a performance of a certainty coefficient of nearly 97% and a prediction qualification rate of nearly 90% by using the trained long short-term memory network. The simulation prediction accuracy is relatively high and can meet the ecological flow prediction and early warning needs in the dry season.
[0171] (5) The real-time monitoring of the outflow of the target reservoir during the dry season is used as a prediction factor and input into the trained long short-term memory network to predict the flow of the target river section. The input prediction factor can be a sequence of different lengths or a single value. For example, the input reservoir outflow of 20m 3 / s, the output is the predicted flow rate of the target river section after 8 hours is 40m 3 / s, close to the ecological base flow of 35m 3 / s, initiate and issue corresponding early warning information according to the ecological flow protection plan for the target river section.
[0172] This embodiment has the following beneficial effects:
[0173] (1) The existing peak flow-frequency analysis method selects the year of the peak flow corresponding to a certain frequency as the typical year, which makes it difficult to clearly give the category to which each runoff sequence belongs, and it is difficult to comprehensively reflect all the characteristics of the runoff sequence based on only a certain feature of the runoff sequence. The mean peak flow in the runoff sequence clustering result based on the DBSCAN clustering algorithm in this embodiment is close to the peak flow corresponding to the 90% frequency selected by the frequency analysis method, and the three indicators have obvious differentiation, indicating that the clustering result based on the DBSCAN clustering algorithm can consider the runoff sequence characteristics more comprehensively, and the clustering result is reasonable.
[0174] (2) The requirements for basic data are low. Only the runoff sequence of the reservoir outflow and the ecological flow control section is needed to achieve high-precision prediction of the ecological flow control section.
[0175] (3) Based on the MIC screening predictor factors, the predictor factors with the highest correlation with the runoff sequence of the ecological flow control section were screened out, which effectively identified the potential predictability sources of reservoir outflow changes and improved the accuracy of the LSTM network input data and prediction accuracy.
[0176] (4) Based on DBSCAN-MIC-LSTM, the existing long short-term memory network is improved and trained. The trained long short-term memory network can accurately predict the ecological flow of the river downstream of the hydropower station during the dry season.
[0177] Reference Figure 5 The embodiment of the present application also provides an ecological flow prediction device, which can implement the above-mentioned ecological flow prediction method, and the device includes:
[0178] A characteristic parameter set acquisition unit, used to acquire peak values, peak appearance times and peak shape coefficients of a plurality of first runoff sequences as a characteristic parameter set corresponding to the first runoff sequence;
[0179] A runoff sequence selection unit, configured to select, from each of the first runoff sequences according to each of the characteristic parameter sets, the first runoff sequence corresponding to the dry season as a second runoff sequence;
[0180] A maximum mutual information coefficient calculation unit, used to calculate the maximum mutual information coefficient between a plurality of preset first prediction factors and each of the second runoff sequences;
[0181] A prediction factor selection unit, configured to select a plurality of second prediction factors from the plurality of first prediction factors according to the maximum mutual information coefficient;
[0182] A network training unit, configured to train a long short-term memory network using each of the second prediction factors as a training sample and each of the second runoff sequences as a training label to obtain the trained long short-term memory network;
[0183] The ecological flow prediction unit is used to input the third prediction factor into the trained long short-term memory network to obtain a third runoff sequence as the ecological flow.
[0184] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0185] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above ecological flow prediction method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, a car computer, etc.
[0186] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0187] See also Figure 6 , Figure 6 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0188] The processor 601 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0189] The memory 602 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 602 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 602, and the processor 601 calls and executes the ecological flow prediction method of the embodiment of this application;
[0190] Input / output interface 603, used to implement information input and output;
[0191] Communication interface 604, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0192] Bus 605 , which transmits information between various components of the device (e.g., processor 601 , memory 602 , input / output interface 603 , and communication interface 604 );
[0193] The processor 601 , the memory 602 , the input / output interface 603 and the communication interface 604 are connected to each other in communication within the device via a bus 605 .
[0194] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned ecological flow prediction method is implemented.
[0195] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0196] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0197] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0198] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0199] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0200] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0201] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0202] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0203] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0204] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0205] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0206] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0207] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. An ecological flow prediction method, characterized in that: The method comprises the following steps: Acquire peak values, peak occurrence times, and peak shape coefficients of a plurality of first runoff sequences as a characteristic parameter set corresponding to the first runoff sequence; Selecting the first runoff sequence corresponding to the dry season from each of the first runoff sequences according to each of the characteristic parameter sets as the second runoff sequence; Calculating the maximum mutual information coefficient between a plurality of preset first prediction factors and each of the second runoff sequences; Selecting a plurality of second predictor factors from the plurality of first predictor factors according to the maximum mutual information coefficient; Using each of the second prediction factors as training samples and each of the second runoff sequences as training labels, training a long short-term memory network to obtain the trained long short-term memory network; Inputting the third prediction factor into the trained long short-term memory network to obtain a third runoff sequence as ecological flow; The step of obtaining peak values, peak occurrence times, and peak shape coefficients of a plurality of first runoff sequences as a characteristic parameter set corresponding to the first runoff sequence comprises the following steps: Acquire a plurality of the first runoff sequences; wherein each of the first runoff sequences includes a plurality of runoff amounts; Determine the maximum runoff amount in each of the first runoff sequences as the corresponding peak value; Determine the time when each peak value appears as the corresponding peak appearance time; The peak shape coefficient corresponding to each first runoff sequence is calculated using the following formula: ; ; in, , x represents each of the first runoff sequences, x i represents each of the runoff amounts, p i express x i The normalized value of E represents the peak shape coefficient; The step of selecting the first runoff sequence corresponding to the dry season from each of the first runoff sequences according to each of the characteristic parameter sets as the second runoff sequence comprises the following steps: Convert each of the characteristic parameter sets into data points in three-dimensional space; Clustering each of the data points to obtain a plurality of the first runoff sequences corresponding to each category; Calculate the average flow of a plurality of the first runoff sequences corresponding to each of the categories; Selecting a plurality of the first runoff sequences of the category with the smallest average flow as the second runoff sequences in the dry season; The clustering of the data points to obtain a plurality of the first runoff sequences corresponding to the categories comprises the following steps: Determine any data point that has not been visited as the current data point; Determine whether there are a set number of other data points within a set distance of the current data point, and mark the current data point as visited; If there are other data points reaching the set number within the set distance of the current data point, clustering the current data point and the other data points within the set distance into the same cluster; Returning any one of the data points that has not been visited as the current data point until all the data points are marked as visited, and then clustering to obtain multiple clusters of the data points; one cluster of the data points corresponds to multiple first runoff sequences of one category; The step of calculating the maximum mutual information coefficient between a plurality of preset first prediction factors and each of the second runoff sequences comprises the following steps: Grouping a plurality of the first prediction factors and each of the second runoff sequences into a plurality of sets; Mapping each of the sets to a two-dimensional space to obtain a scatter plot; Dividing the scatter plot into grids of various specifications; wherein the area ranges of the grids of different specifications are different; Calculate the frequency distribution of points of each set in the grids of different specifications as the mutual information coefficient; Determine the maximum mutual information coefficient between a plurality of the first prediction factors and each of the second runoff sequences according to each of the mutual information coefficients; The step of determining the maximum mutual information coefficient between a plurality of the first prediction factors and each of the second runoff sequences according to each of the mutual information coefficients comprises the following steps: Determine the maximum probability distribution under various specifications as the target mutual information coefficient; Normalizing each of the target mutual information coefficients; The target mutual information coefficient with the largest normalized value is selected as the maximum mutual information coefficient.
2. The ecological flow prediction method according to claim 1, characterized in that: The method further comprises the following steps: Generate early warning information corresponding to the ecological flow.
3. An ecological flow prediction device, characterized in that: For implementing an ecological flow prediction method as claimed in claim 1, the device comprises: A characteristic parameter set acquisition unit, used to acquire peak values, peak appearance times and peak shape coefficients of a plurality of first runoff sequences as a characteristic parameter set corresponding to the first runoff sequence; A runoff sequence selection unit, configured to select, from each of the first runoff sequences according to each of the characteristic parameter sets, the first runoff sequence corresponding to the dry season as a second runoff sequence; A maximum mutual information coefficient calculation unit, used to calculate the maximum mutual information coefficient between a plurality of preset first prediction factors and each of the second runoff sequences; A prediction factor selection unit, configured to select a plurality of second prediction factors from the plurality of first prediction factors according to the maximum mutual information coefficient; A network training unit, configured to train a long short-term memory network using each of the second prediction factors as a training sample and each of the second runoff sequences as a training label to obtain the trained long short-term memory network; The ecological flow prediction unit is used to input the third prediction factor into the trained long short-term memory network to obtain a third runoff sequence as the ecological flow.
4. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 2 when executing the computer program.
5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 2 is implemented.
