Hydrological forecasting method, system, equipment and medium
By using a cooperative search algorithm coupling twin extreme learning machine in hydrological forecast to build a high -precision hydrological forecast model, the problem of low hydrological forecasting accuracy in existing technology, especially when dealing with complex characteristics, achieve higher Prediction accuracy and reliability.
Patent Information
- Application Number
- CN202411168824.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2025-01-21
Smart Images

Figure CN119337332A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of hydrological prediction, and in particular to a hydrological forecasting method, system, equipment and medium. Background Art
[0002] Current hydrological forecasting technology faces many challenges in dealing with runoff prediction under complex natural conditions. Although traditional methods, such as linear programming, dynamic programming, and large system decomposition and coordination, have matured in theory, they are limited by the "curse of dimensionality" in practical applications. That is, as the complexity of the problem increases, the effectiveness and efficiency of the algorithm decrease significantly. In addition, such methods often have difficulty in achieving ideal prediction accuracy when dealing with nonlinear, volatility, and periodic characteristics. Therefore, there is a problem of low hydrological forecast accuracy in the existing technology. Summary of the invention
[0003] The embodiments of the present application provide a hydrological forecasting method, system, device and medium to at least solve the problem of low hydrological forecasting accuracy in the related art.
[0004] In a first aspect, an embodiment of the present application provides a hydrological forecasting method, comprising:
[0005] Determine the number of influencing factors according to historical runoff data, establish a runoff time series based on the number of influencing factors, and divide the runoff time series into a training set and a test set;
[0006] Based on the training set, a hydrological forecasting model is constructed by coupling a twin extreme learning machine through a cooperative search algorithm, wherein the hydrological forecasting model inputs runoff data and outputs predicted runoff data; the cooperative search algorithm includes a team communication operator that introduces individual best positions for joint search, and a reflective learning operator that introduces dynamic disturbances;
[0007] According to the current runoff data and based on the hydrological forecast model, the runoff point forecast result is obtained.
[0008] In one embodiment, the hydrological forecast model is constructed based on the training set by coupling the twin extreme learning machine through a cooperative search algorithm, including:
[0009] Setting parameters of the cooperative search algorithm, wherein the parameters include the size of individual employees, the maximum number of iterations, the dimension of variables, the upper and lower limits of variables, and the position of initializing individual employees;
[0010] According to the training set, the parameters of the cooperative search algorithm, the Lagrange multiplier and the optimization condition, an initial hydrological forecast model of the cooperative search algorithm coupled with the twin extreme learning machine is established, and the hydrological forecast model is converted into a corresponding dual optimization problem;
[0011] Using the Nash-efficiency coefficient as the objective function of the initial hydrological forecast model, and obtaining the objective function value of each individual employee;
[0012] Obtain the minimum objective function value among the multiple objective function values, take the individual employee position corresponding to the minimum objective function value as the optimal position of the current iteration, update the position of each individual employee through the team communication operator, the reflection learning operator and the internal competition operator, and obtain the optimal solution for the individual employee;
[0013] The individual optimal solution of the employee is used as the input of the initial hydrological forecasting model, and the individual optimal solution of the employee is iteratively obtained. In response to reaching a preset number of iterations, the individual optimal parameter combination of the employee is obtained, and the hydrological forecasting model is obtained based on the optimal parameter combination of the employee.
[0014] In one embodiment, the initial hydrological forecasting model of the cooperative search algorithm coupled with the twin extreme learning machine is established according to the training set, the parameters of the cooperative search algorithm, the Lagrange multiplier and the optimization condition, and the hydrological forecasting model is converted into a corresponding dual optimization problem, including:
[0015] Based on the input data set x and output data set Y of the training set, the twin extreme learning machine constructs the following two quadratic programming problems;
[0016] Quadratic programming problem 1:
[0017]
[0018] stY-Hβ1≥eε1-ξ,ξ≥0
[0019] Quadratic programming problem 2
[0020]
[0021] stHβ2-Y≥eε2-η,η≥0
[0022] Where e is a unit vector; H = (h(x1) T ,…,h(x n ) T ) T is the hidden layer of the training set; h(x)=(h1(x),…,h L (x) T is the nonlinear random feature mapping of the hidden layer relative to x, and L is the number of hidden layers; w i and b i are weights and biases respectively; G is the activation function; ξ and η are error vectors; C1 and C2 are trade-off parameters greater than 0; β1 and β2 are the weights between the hidden layer and the output layer of the two hyperplanes respectively.
[0023] By introducing Lagrange multipliers α and γ, the quadratic programming problem is transformed into:
[0024]
[0025] According to the necessary and sufficient optimality conditions, the Karush-Kuhn-Tucker optimization condition is expressed as follows:
[0026] -x T (Y-Hβ1-eε1)+x T α=0
[0027] -e T (Y-Hβ1-eε1)+e T α=0
[0028] C1e-α-γ=0
[0029] Y-Hβ1≥eε1-ξ,ξ≥0
[0030] α T (Y-Hβ1-eε1+ξ)=0,α≥0
[0031] γ T ξ=0,γ≥0
[0032] Introducing the regularization term δI, we get β1=(H T H+δI) -1 H T (f-α), and obtain the corresponding dual optimization problem:
[0033]
[0034] st0≤α≤C1e
[0035]
[0036] st0≤γ≤C2e
[0037] In the formula, δ is the regularization parameter with a preset value, and I is the unit matrix of the preset dimension. T H+δI) -1 H T (g+γ), g=Y+eε2.
[0038]
[0039] In one embodiment, the updating of the position of each individual employee through the team communication operator, the reflection learning operator and the internal competition operator to obtain the optimal solution for the individual employee includes:
[0040] The team communication operator is determined by the following formula:
[0041]
[0042] M=1+max(floor(3·α·I·(1-t / (0.7·T))),0)
[0043] In the formula, The value of the jth variable after the update of the i-th employee group for the k+1th iteration; represents the value of the jth variable of the historical optimal decision of the i-th employee in the k-th iteration; represents the value of the jth variable of the indth best historical decision of the team at the kth iteration, where ind is randomly selected from the integer set {1,2,…,M}, and M represents the number of the best historical decisions of the team; They represent the information gains obtained from the leader, decision maker, and supervisor respectively; α and β represent adjustment parameters; t and T represent the current iteration number and the global iteration number respectively; floor is the rounding function;
[0044] The reflective learning operator is determined by the following formula:
[0045]
[0046] In the formula, The value of the jth variable after the i-th employee reflects on his decision in the k+1th iteration; randn is a normal distribution random function; rand is a [0,1] random value function.
[0047] The internal competition operator is determined by the following formula:
[0048]
[0049] In the formula, F(x) is used to evaluate the work performance of employees and is the fitness value of the problem to be optimized;
[0050] By determining the team communication operator, reflective learning operator and internal competition operator, the position of each individual employee is updated to obtain the optimal solution for each individual employee.
[0051] In one embodiment, determining the number of influencing factors according to historical runoff data, and establishing a runoff time series based on the number of influencing factors includes:
[0052] normalizing the historical measured runoff data;
[0053] The normalized historical measured runoff data is subjected to partial autocorrelation analysis to determine the number of previous influencing factors;
[0054] The number of previous influencing factors is windowed to establish a runoff time series.
[0055] In one embodiment, before and after obtaining the hydrological forecast model according to the optimal parameter combination of the employee, the method further includes:
[0056] The forecast model is tested by using a test set, and the runoff point forecast result is obtained after denormalization;
[0057] The accuracy of the hydrological forecast model is verified based on the runoff point forecast results.
[0058] In one embodiment, the Nash efficiency coefficient is used as the objective function of the initial hydrological forecast model, and the objective function value of each individual employee is obtained, including:
[0059] The Nash-efficiency coefficient is selected as the objective function of the model, and the objective function value of each individual employee is calculated as an indicator for the initial evaluation of the model's prediction performance. The Nash-efficiency coefficient is determined by the following formula:
[0060]
[0061] In the formula, Q obs,t is the actual observed value at time t, Q sim,t is the model prediction value at time t, is the mean of the observations and n is the number of sample points.
[0062] In a second aspect, an embodiment of the present application provides a hydrological forecasting system, the system comprising a module for dividing a training set and a test set, a module for constructing a hydrological forecasting model, and a module for obtaining a runoff point forecasting result, wherein:
[0063] The module for dividing the training set and the test set is used to determine the number of influencing factors according to the historical runoff data, establish a runoff time series based on the number of influencing factors, and divide the training set and the test set according to the runoff time series;
[0064] The hydrological forecast model building module is used to build a hydrological forecast model based on the training set by coupling the twin extreme learning machine through a cooperative search algorithm, wherein the hydrological forecast model inputs runoff data and outputs predicted runoff data; the cooperative search algorithm includes a team communication operator that introduces individual best positions for joint search, and a reflective learning operator that introduces dynamic disturbances;
[0065] The module for obtaining runoff point forecast results is used to obtain runoff point forecast results according to current runoff data and based on the hydrological forecast model.
[0066] In a third aspect, an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a hydrological forecasting method as described in the first aspect above is implemented.
[0067] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a hydrological forecasting method as described in the first aspect above.
[0068] The hydrological forecasting method, system, device and medium provided by the embodiments of the present application have at least the following technical effects.
[0069] Firstly, a time series is constructed based on the historical measured runoff data, and the series is preprocessed.
[0070] Secondly, a twin extreme learning machine is introduced to solve the regression problem, and an improved cooperative search algorithm is used to optimize the model parameters, thereby improving the global search capability while ensuring the local exploration capability.
[0071] Finally, by inputting the test set sample sequence into the trained model, the runoff prediction result can be obtained. This application makes up for the deficiency of the cooperative search algorithm in global search when dealing with problems, expands the application scope of the twin extreme learning machine, constructs a high-precision hydrological forecast model, and solves the problem of low hydrological forecast accuracy in related technologies.
[0072] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0074] Figure 1 is a flow chart of a hydrological forecasting method according to an embodiment of the present application;
[0075] Figure 2 is a flowchart of step S102 according to an exemplary embodiment;
[0076] Figure 3 is a schematic diagram showing a prediction result according to an exemplary embodiment;
[0077] Figure 4 is a schematic diagram of a prediction result of the prior art according to an exemplary embodiment.
[0078] Figure 5 is a block diagram of a hydrological forecasting system according to an exemplary embodiment
[0079] Figure 6 is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0080] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. 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. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0081] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the content disclosed in this application, some changes in design, manufacturing or production based on the technical content disclosed in this application are just conventional technical means, and should not be understood as insufficient content disclosed in this application.
[0082] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0083] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantitative limitation, and may represent the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects before and after are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0084] Current hydrological forecasting technology faces many challenges in dealing with runoff prediction under complex natural conditions. Traditional methods, such as linear programming, dynamic programming, and large system decomposition and coordination, are mature in theory, but are limited by the "curse of dimensionality" in practical applications. That is, as the complexity of the problem increases, the effectiveness and efficiency of the algorithm decrease significantly. In addition, such methods often have difficulty in achieving ideal prediction accuracy when dealing with nonlinear, volatility, and periodic characteristics.
[0085] On the other hand, intelligent optimization algorithms, including particle swarm optimization (PSO), genetic algorithm (GA), differential evolution algorithm (DE), etc., have been widely used in the field of hydrological forecasting due to their strong nonlinear adaptability and self-organizing characteristics. However, these algorithms also expose some inherent problems in actual engineering applications, such as easy to fall into local optimality, slow convergence speed and high consumption of computing resources, which limit their application potential in the optimization and dispatching of large-scale reservoir groups.
[0086] The cooperative search algorithm (CSA), as an intelligent heuristic algorithm developed in recent years, has become a potential way to solve the above problems due to its simple structure and convenient parameter adjustment. CSA improves the robustness and global search ability of the algorithm by simulating cooperative behavior in nature. However, the original CSA still has limitations in its global search ability when dealing with complex optimization problems, especially when dealing with high-dimensional optimization problems, and it is easy to converge to the local optimal solution prematurely.
[0087] In summary, the existing technology has the problem of low accuracy of hydrological forecasting.
[0088] Based on the above situation, the embodiments of the present application provide a hydrological forecasting method, system, device and medium to solve the above problems.
[0089] In a first aspect, the present application provides a hydrological forecasting method. Figure 1 It is a flow chart of hydrological forecasting, such as Figure 1 As shown, a hydrological forecasting method includes:
[0090] Step S101: determine the number of influencing factors according to historical runoff data, establish a runoff time series based on the number of influencing factors, and divide the runoff time series into a training set and a test set.
[0091] Step S102: Based on the training set, a hydrological forecasting model is constructed by coupling the twin extreme learning machine through a cooperative search algorithm, wherein the hydrological forecasting model inputs runoff data and outputs predicted runoff data; the cooperative search algorithm includes a team communication operator that introduces individual optimal positions for joint search, and a reflective learning operator that introduces dynamic disturbances.
[0092] Step S103: Obtain the runoff point forecast result according to the current runoff data and based on the hydrological forecast model.
[0093] In summary, a hydrological forecasting method provided in an embodiment of the present application first constructs a time series based on historical measured runoff data and preprocesses the sequence. Secondly, a twin extreme learning machine is introduced to solve the regression problem, and an improved cooperative search algorithm is used to optimize model parameters, thereby improving the global search capability while ensuring the local exploration capability. Finally, the test set sample sequence is input into the trained model to obtain the runoff prediction result. The present application makes up for the shortcomings of the cooperative search algorithm in global search when dealing with problems, expands the application scope of the twin extreme learning machine, constructs a high-precision hydrological forecasting model, and solves the problem of low hydrological forecasting accuracy in related technologies.
[0094] In one embodiment, step S101, according to historical runoff data, determine the number of influencing factors, establish a runoff time series based on the number of influencing factors, and divide the runoff time series into a training set and a test set.
[0095] Specifically include:
[0096] Normalize the historical measured runoff data;
[0097] The partial autocorrelation analysis method is used to determine the number of previous influencing factors on the normalized historical measured runoff data.
[0098] The number of previous influencing factors is windowed to establish the runoff time series.
[0099] Optionally, the historical measured runoff data is first normalized. The purpose of normalization is to map the data to the same scale range, usually in the interval [0,1], to eliminate the dimensional differences between different features, making the model training more stable and improving the convergence speed and prediction accuracy of the model. Next, the partial autocorrelation function (PACF) is used to determine the number of previous influencing factors. The partial autocorrelation function is a statistical method used to identify which previous runoff values in the runoff data have a significant impact on the current runoff, thereby improving the prediction ability of the model. According to the determined number of previous influencing factors, the historical runoff data is windowed to establish a runoff time series. Windowing means dividing the data into sequences of fixed length, each sequence containing a certain number of previous runoff values, which will be used as input features of the model. Finally, the established runoff time series data set is divided into a training set and a test set. The training set is used to train the model, while the test set is used to evaluate the prediction performance of the model.
[0100] Step S101 can effectively extract useful information from the time series through normalization processing, determining the number of previous influencing factors and window processing, thereby improving the prediction accuracy of the model.
[0101] Figure 2 is a flowchart of step S102 according to an exemplary embodiment. Figure 2 As shown, step S102, based on the training set, a hydrological forecast model is constructed by coupling the twin extreme learning machine through a cooperative search algorithm, wherein the hydrological forecast model inputs runoff data and outputs predicted runoff data; the cooperative search algorithm includes a team communication operator that introduces the best position of individuals for joint search, and a reflective learning operator that introduces dynamic disturbance. Specifically, the following steps are included:
[0102] Step S1021, setting parameters of the cooperative search algorithm, wherein the parameters include the scale of individual employees, the maximum number of iterations, the dimension of variables, the upper and lower limits of variables, and the position of initializing individual employees.
[0103] Optionally, various parameters of the cooperative search algorithm are set, wherein the individual employee scale refers to the number of individuals participating in the search in the algorithm. The maximum number of iterations refers to the maximum number of iterations allowed by the algorithm, and in this embodiment, the maximum number of iterations is 25. The algorithm will run within the specified number of iterations. The more iterations, the more opportunities the algorithm has to find a better solution. The variable dimension refers to the dimension of the model parameters, that is, the number of parameters that need to be optimized. In this case, it includes parameters such as weights and biases in the twin extreme learning machine (TELM). The upper and lower limits of the variables refer to the range of values of the model parameters. These ranges limit the search space of the parameters and help the algorithm focus on a meaningful solution domain. The initialization position of the individual employees refers to the initial parameter value of each individual at the beginning of the algorithm. These values can be generated randomly or set according to prior knowledge. By setting the various parameters of the cooperative search algorithm, it can be ensured that the algorithm effectively finds the optimal solution within limited computing resources. In practical applications, the parameters can be adjusted according to specific circumstances.
[0104] Step S1022: Based on the training set, parameters of the cooperative search algorithm, Lagrange multipliers and optimization conditions, an initial hydrological forecasting model of the cooperative search algorithm coupled with the twin extreme learning machine is established, and the hydrological forecasting model is converted into a corresponding dual optimization problem.
[0105] Optionally, based on the input data set x and output data set Y of the training set, the twin extreme learning machine constructs the following two quadratic programming problems;
[0106] Quadratic programming problem 1:
[0107]
[0108] stY-Hβ1≥eε1-ξ,ξ≥0 (1)
[0109] Quadratic programming problem 2
[0110]
[0111] stHβ2-Y≥eε2-η,η≥0 (2)
[0112] Where e is a unit vector; H = (h(x1) T ,…,h(x n ) T ) T is the hidden layer of the training set; h(x)=(h1(x),…,h L (x) Tis the nonlinear random feature mapping of the hidden layer relative to x, and L is the number of hidden layers; w i and b i are weights and biases respectively; G is the activation function; ξ and η are error vectors; C1 and C2 are trade-off parameters greater than 0; β1 and β2 are the weights between the hidden layer and the output layer of the two hyperplanes respectively.
[0113] By introducing Lagrange multipliers α and γ, the quadratic programming problem is transformed into:
[0114]
[0115] According to the necessary and sufficient optimality conditions, the Karush-Kuhn-Tucker optimization condition is expressed as follows:
[0116] -x T (Y-Hβ1-eε1)+x T α=0 (4)
[0117] -e T (Y-Hβ1-eε1)+e T α=0 (5)
[0118] C1e-α-γ=0 (6)
[0119] Y-Hβ1≥eε1-ξ,ξ≥0 (7)
[0120] α T (Y-Hβ1-eε1+ξ)=0,α≥0 (8)
[0121] γ T ξ=0,γ≥0 (9)
[0122] Introducing the regularization term δI, we get β1=(H T H+δI) -1 H T (f-α), and obtain the corresponding dual optimization problem:
[0123]
[0124]
[0125] In the formula, δ is the regularization parameter with a preset value, and I is the unit matrix of the preset dimension. T H+δI) -1 H T (g+γ), g=Y+eε2.
[0126]
[0127] By constructing a dual quadratic programming problem, the twin extreme learning machine can find the optimal weight vector by minimizing the error vector. The introduction of Lagrange multipliers and the use of KKT conditions are to ensure that the problem meets the necessary conditions for optimality, and then simplify the solution process of the original problem by solving the dual optimization problem. Compared with the traditional extreme learning machine, the twin extreme learning machine has better nonlinear characterization capabilities and can better fit complex data distributions. The improved cooperative search algorithm ICSA improves the generalization ability and prediction accuracy of the model by optimizing model parameters, especially when processing data with nonlinear, volatility and periodic characteristics. The improved cooperative search algorithm ICSA is used for parameter optimization, which can avoid falling into the local optimal solution and improve the global search capability. The cooperative search algorithm ICSA improved in this embodiment uses different individuals to traverse the search space, which can effectively improve the convergence speed and global exploration performance. It has the advantages of clear logic, simple structure, and easy implementation. It can significantly improve the efficiency of parameter optimization and the accuracy of the results, and provides an effective way for model parameter optimization.
[0128] Step S1023: Use the Nash efficiency coefficient as the objective function of the initial hydrological forecast model, and obtain the objective function value of each individual employee.
[0129] Optionally, the Nash efficiency coefficient is selected as the objective function of the model, and the objective function value of each individual employee is calculated as an indicator for initially evaluating the prediction performance of the model, wherein the Nash efficiency coefficient is determined by the following formula:
[0130]
[0131] In the formula, Q obs,t is the actual observed value at time t, Q sim,t is the model prediction value at time t, is the mean of the observations and n is the number of sample points.
[0132] The Nash-efficiency coefficient is an indicator that quantifies the prediction error of the model. It evaluates the prediction performance of the model by comparing the difference between the model prediction value and the actual observation value. By calculating the NSE value of each individual employee, the model performance under different parameter combinations can be evaluated. By selecting the Nash-efficiency coefficient as the objective function, the optimization process can be guided to find those model parameters that can minimize the prediction error. It helps to improve the prediction accuracy of the model and ultimately obtain a hydrological forecast model with superior performance. In addition, by calculating the objective function value of each individual employee, different parameter combinations of the model can be ranked to determine the best parameter combination.
[0133] Step S1024: Obtain the minimum objective function value among multiple objective function values, and use the individual employee position corresponding to the minimum objective function value as the optimal position of the current iteration. Update the position of each individual employee through the team communication operator, reflective learning operator and internal competition operator to obtain the optimal solution for the individual employee.
[0134] Optionally, the team communication operator is determined by the following formula:
[0135]
[0136] Formula 14 is used as the main convergence formula of the algorithm. pbest is introduced for joint search to improve the convergence speed.
[0137]
[0138] The number of M in Formula 15 (Formula 17) is dynamically selected to improve the global optimization capability in the early stage and avoid premature convergence. The global optimum is selected in the later stage to improve the local search capability.
[0139]
[0140] Formula 16 no longer uses population individuals for updating, but uses the population mean, which provides an overall optimization direction for population optimization and improves the convergence accuracy and convergence speed.
[0141] M=1+max(floor(3·α·I·(1-t / (0.7·T))),0) (17)
[0142] In the formula, The value of the jth variable after the update of the i-th employee group for the k+1th iteration; represents the value of the jth variable of the historical optimal decision of the i-th employee in the k-th iteration; represents the value of the jth variable of the indth best historical decision of the team at the kth iteration, where ind is randomly selected from the integer set {1,2,…,M}, and M represents the number of the best historical decisions of the team; They represent the information gains obtained from the leader, decision maker, and supervisor respectively; α and β represent adjustment parameters; t and T represent the current iteration number and the global iteration number respectively; floor is the rounding function;
[0143] The reflective learning operator is determined by the following formula:
[0144]
[0145] Formula 18 serves as the control operator for balancing global and local searches.
[0146]
[0147] Formula 19 introduces dynamic disturbances while reflective searching to prevent falling into local optimality as much as possible, improve the diversity of search in the early stage, and maintain stable reflective search in the later stage.
[0148]
[0149] Formula 20 adds dynamic disturbances to the population individuals and historical optimal individuals to improve local search capabilities.
[0150] In the formula, The value of the jth variable after the i-th employee reflects on his decision in the k+1th iteration; randn is a normal distribution random function; rand is a [0,1] random value function.
[0151] The internal competition operator is determined by the following formula:
[0152]
[0153] In the formula, F(x) is used to evaluate the work performance of employees and is the fitness value of the problem to be optimized;
[0154] By determining the team communication operator, reflective learning operator and internal competition operator, the position of each individual employee is updated to obtain the optimal solution for each individual employee.
[0155] The team communication operator introduces information exchange between team members so that each individual employee can learn from the experience of other members, thereby improving the global search capability. As the number of iterations increases, the algorithm tends to learn from the team's historical optimal decisions, which helps to avoid premature convergence and improve the local search capability in the later stage. The reflective learning operator improves the diversity and stability of the search by introducing random perturbations, especially improving the diversity of the search in the early stage and maintaining stable reflective search in the later stage, thereby avoiding falling into the local optimal solution. The internal competition operator improves the local search capability by adding dynamic perturbations, which helps the algorithm to focus more on the refinement of the local optimal solution in the later stage of the search. Through the use of the above operators, the improved cooperative search algorithm (ICSA) can effectively update the position of individual employees during the iteration process and gradually approach the optimal solution.
[0156] Step S1025, using the individual optimal solution of the employee as the input of the initial hydrological forecast model, iteratively obtaining the individual optimal solution of the employee, and in response to reaching a preset number of iterations, obtaining the individual optimal parameter combination of the employee, and obtaining the hydrological forecast model based on the employee's optimal parameter combination.
[0157] Optionally, return to execute step S1022 to step S1024 until the preset maximum number of iterations is reached, and use the result of the last iteration as the optimal parameter combination to obtain the TELM forecast model of the coupled ICSA method corresponding to the optimal parameters. In each iteration, a new optimal solution for individual employees is obtained based on the individual employee positions updated in the previous step S1024. This optimal solution is the position of the individual employee with the minimum objective function value in the current iteration. The iterative process will continue until the preset maximum number of iterations is reached. This preset number of iterations is one of the parameters of the cooperative search algorithm set in step S1021. When the preset maximum number of iterations is reached, the optimal solution for individual employees obtained in the last iteration is the final optimal parameter combination for individual employees. This set of parameters will be the final parameter configuration of the twin extreme learning machine (TELM) hydrological forecast model of the coupled ICSA optimization method. Use the final determined optimal parameter combination for individual employees to construct the final TELM hydrological forecast model of the coupled ICSA method.
[0158] In summary, the cooperative search algorithm in this implementation is an improved cooperative search algorithm, and the specific improvements are as follows:
[0159] (1) Improved team communication operator: Formula 14 is used as the main convergence formula of the algorithm. pbest is introduced for joint search to improve the convergence speed. The number of M in Formula 15 (Formula 17) is dynamically selected to improve the global optimization ability in the early stage and avoid premature convergence. The global optimum is selected in the later stage to improve the local search ability. Formula 16 no longer uses population individuals for updating, but uses the population mean to provide an overall optimization direction for population optimization and improve the convergence accuracy and convergence speed.
[0160] (2) Improved reflective learning operator: Formula 18 is used as a control operator to balance global and local search. Formula 19 introduces dynamic disturbances while reflective searching to prevent falling into local optimality as much as possible, improve the diversity of search in the early stage, and maintain stable reflective search in the later stage.
[0161] Formula 20 adds dynamic disturbances to the population individuals and historical optimal individuals to improve local search capabilities.
[0162] Steps S1021 to S1025 can effectively explore the solution space and avoid falling into the local optimal solution too early through the global search capability of the ICSA algorithm. Through the reflective learning operator and the internal competition operator, the algorithm can finely adjust the parameters and improve the local search capability, thereby improving the prediction accuracy of the model. By solving the dual optimization problem and gradually improving the optimization parameters, the model can better fit the historical data and improve the prediction accuracy. Through the iterative optimization process, the model can better adapt to unseen data, improve the generalization ability of the model, and make the prediction results more reliable.
[0163] In one embodiment, before and after obtaining the hydrological forecast model according to the optimal parameter combination of the employee, the method further includes:
[0164] The forecast model is tested on the test set, and the runoff point forecast results are obtained after denormalization;
[0165] The accuracy of the hydrological forecast model is verified based on the runoff point forecast results.
[0166] Optionally, the prediction results are restored from the normalized scale to the scale of the original data through denormalization, so that the predicted values can be intuitively compared with the actual observed values. Using the test set data instead of the training set data to evaluate the model performance can avoid overfitting and more accurately reflect the generalization ability of the model on unknown data.
[0167] Testing the forecast model with the test set and verifying the model's accuracy can ensure the model's effectiveness in practical applications. Denormalization and calculation of prediction error indicators help evaluate the model's prediction performance, thereby ensuring the model's reliability and generalization ability.
[0168] Figure 3 is a schematic diagram showing a prediction result according to an exemplary embodiment. Figure 4 is a schematic diagram of a prior art prediction result according to an exemplary embodiment. Figure 3 and Figure 4 As shown in the figure, the prediction results obtained by the present application have a higher degree of fit and a smaller error than the prediction results of the prior art. However, the generalization ability of the comparison method is poor and good prediction results cannot be obtained. Specifically, Figure 3 The left side is a runoff prediction process diagram of the present invention, and the right side is a scatter point fitting diagram of the runoff prediction value and the measured value of the present invention. Figure 4 The left side is the runoff prediction process diagram of the traditional ELM model, and the right side is the scatter point fitting diagram of the runoff prediction value and the measured value of the traditional ELM model. Figure 3 , Figure 4 The horizontal axis unit of the left figure is time period (day), and R is the correlation coefficient calculated between the predicted value and the measured value.
[0169] In summary, a hydrological forecasting method provided in an embodiment of the present application first constructs a time series based on historical measured runoff data and preprocesses the sequence. Secondly, a twin extreme learning machine is introduced to solve the regression problem, and an improved cooperative search algorithm is used to optimize model parameters, thereby improving the global search capability while ensuring the local exploration capability. Finally, the test set sample sequence is input into the trained model to obtain the runoff prediction result. The present application makes up for the shortcomings of the cooperative search algorithm in global search when dealing with problems, expands the application scope of the twin extreme learning machine, constructs a high-precision hydrological forecasting model, and solves the problem of low hydrological forecasting accuracy in related technologies.
[0170] Principle of the invention: By improving the coupling of cooperative search algorithm (ICSA) and twin extreme learning machine (TELM), the difficulties in hydrological forecasting caused by complex characteristics such as nonlinearity, volatility, and periodicity are overcome. ICSA enhances the global search capability by introducing innovative search mechanisms, such as team communication operators, reflective learning operators, and internal competition operators. At the same time, it avoids premature convergence and ensures the accuracy of local exploration through dynamic adjustment strategies. As an efficient machine learning model, TELM has shown stronger generalization and nonlinear expression capabilities in regression problems than traditional extreme learning machines (ELM), and is particularly suitable for dealing with complex nonlinear relationships in hydrological forecasting.
[0171] In a second aspect, an embodiment of the present application provides a hydrological forecasting system. Figure 5 FIG. 1 is a block diagram of a hydrological forecasting system according to an exemplary embodiment. Figure 5 As shown, the system includes a module 510 for dividing a training set and a test set, a module 520 for building a hydrological forecast model, and a module 530 for obtaining a runoff point forecast result, wherein:
[0172] The module 510 for dividing the training set and the test set is used to determine the number of influencing factors according to the historical runoff data, establish the runoff time series based on the number of influencing factors, and divide the training set and the test set according to the runoff time series;
[0173] A hydrological forecast model building module 520 is used to build a hydrological forecast model based on a training set by coupling a twin extreme learning machine through a cooperative search algorithm, wherein the hydrological forecast model inputs runoff data and outputs predicted runoff data;
[0174] The module 530 for obtaining the runoff point forecast result is used to obtain the runoff point forecast result according to the current runoff data and based on the hydrological forecast model.
[0175] In summary, a hydrological forecasting system provided by an embodiment of the present application constructs a high-precision hydrological forecasting model by dividing a training set and a test set module 510, constructing a hydrological forecasting model module 520, and obtaining a runoff point forecast result module 530, thereby solving the problem of low hydrological forecasting accuracy in related technologies. Specifically, first, a time series is constructed based on historical measured runoff data, and the sequence is preprocessed. Secondly, a twin extreme learning machine is introduced to solve the regression problem, and an improved cooperative search algorithm is used to optimize the model parameters, thereby improving the global search capability while ensuring the local exploration capability. Finally, the test set sample sequence is input into the trained model to obtain the prediction result of the runoff. The present application makes up for the shortcomings of the cooperative search algorithm in global search when dealing with problems, expands the application scope of the twin extreme learning machine, constructs a high-precision hydrological forecasting model, and solves the problem of low hydrological forecasting accuracy in related technologies.
[0176] It should be noted that the hydrological forecast system provided in this embodiment is used to implement the above-mentioned implementation mode, and the descriptions that have been made will not be repeated. As used above, the terms "module", "unit", "subunit" and the like can implement a combination of software and / or hardware for a predetermined function. Although the device described in the above embodiment is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0177] In a third aspect, an embodiment of the present application provides an electronic device, Figure 6 FIG. 1 is a block diagram of an electronic device according to an exemplary embodiment. Figure 6 As shown, the electronic device may include a processor 61 and a memory 62 storing computer program instructions.
[0178] Specifically, the processor 61 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0179] Among them, the memory 62 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 62 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 62 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 62 may be inside or outside the data processing device. In a specific embodiment, the memory 62 is a non-volatile memory. In a specific embodiment, the memory 62 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (Programmable Read-Only Memory, PROM for short), an erasable PROM (Erasable ProgrammableRead-Only Memory, EPROM for short), an electrically erasable PROM (Electrically Erasable ProgrammableRead-Only Memory, EEPROM for short), an electrically alterable ROM (Electrically Alterable Read-Only Memory, EAROM for short) or a flash memory (FLASH) or a combination of two or more of these. Under appropriate circumstances, the RAM can be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM can be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0180] The memory 62 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 61 .
[0181] The processor 61 implements any one of the hydrological forecasting methods in the above embodiments by reading and executing computer program instructions stored in the memory 62 .
[0182] In one embodiment, a hydrological forecasting device may further include a communication interface 63 and a bus 60. Figure 6 As shown, the processor 61, the memory 62, and the communication interface 63 are connected via a bus 60 and communicate with each other.
[0183] The communication interface 63 is used to implement communication between the modules, devices, units and / or equipment in the embodiment of the present application. The communication port 63 can also implement data communication with other components such as: external devices, image / data acquisition equipment, databases, external storage, and image / data processing workstations.
[0184] The bus 60 includes hardware, software or both, and couples the components of a hydrological forecasting device to each other. The bus 60 includes but is not limited to at least one of the following: a data bus, an address bus, a control bus, an expansion bus, and a local bus. By way of example and not limitation, bus 60 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of the above. Where appropriate, bus 60 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.
[0185] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements a hydrological forecasting method provided in the first aspect.
[0186] The readable storage medium may include but is not limited to: a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device or any suitable combination of the above.
[0187] In a possible implementation, the present invention can also be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to enable the terminal device to execute the steps of a hydrological forecasting method provided in the first aspect.
[0188] Among them, the program code for executing the present invention can be written in any combination of one or more programming languages, and the program code can be executed completely on the user device, partially on the user device, as an independent software package, partially on the user device and partially on a remote device, or completely on the remote device.
[0189] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.
[0190] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A hydrological forecasting method, characterized in that: The method comprises: Determine the number of influencing factors according to historical runoff data, establish a runoff time series based on the number of influencing factors, and divide the runoff time series into a training set and a test set; Based on the training set, a hydrological forecasting model is constructed by coupling a twin extreme learning machine through a cooperative search algorithm, wherein the hydrological forecasting model inputs runoff data and outputs predicted runoff data; the cooperative search algorithm includes a team communication operator that introduces individual best positions for joint search, and a reflective learning operator that introduces dynamic disturbances; According to the current runoff data and based on the hydrological forecast model, the runoff point forecast result is obtained.
2. The method according to claim 1, characterized in that Based on the training set, a hydrological forecast model is constructed by coupling a twin extreme learning machine through a cooperative search algorithm, including: Setting parameters of the cooperative search algorithm, wherein the parameters include the size of individual employees, the maximum number of iterations, the dimension of variables, the upper and lower limits of variables, and the position of initializing individual employees; According to the training set, the parameters of the cooperative search algorithm, the Lagrange multiplier and the optimization condition, an initial hydrological forecast model of the cooperative search algorithm coupled with the twin extreme learning machine is established, and the hydrological forecast model is converted into a corresponding dual optimization problem; Using the Nash-efficiency coefficient as the objective function of the initial hydrological forecast model, and obtaining the objective function value of each individual employee; Obtain the minimum objective function value among the multiple objective function values, take the individual employee position corresponding to the minimum objective function value as the optimal position of the current iteration, update the position of each individual employee through the team communication operator, the reflection learning operator and the internal competition operator, and obtain the optimal solution for the individual employee; The individual optimal solution of the employee is used as the input of the initial hydrological forecasting model, and the individual optimal solution of the employee is iteratively obtained. In response to reaching a preset number of iterations, the individual optimal parameter combination of the employee is obtained, and the hydrological forecasting model is obtained based on the optimal parameter combination of the employee.
3. The method according to claim 2, characterized in that The method of establishing an initial hydrological forecasting model of a cooperative search algorithm coupled with a twin extreme learning machine according to the training set, the parameters of the cooperative search algorithm, the Lagrange multiplier and the optimization condition, and converting the hydrological forecasting model into a corresponding dual optimization problem includes: Based on the input data set x and output data set Y of the training set, the twin extreme learning machine constructs the following two quadratic programming problems; Quadratic programming problem 1: stY-Hβ1≥eε1-ξ,ξ≥0 Quadratic programming problem 2: stHβ2-Y≥eε2-η,η≥0 Where e is a unit vector; H = (h(x1) T ,…,h(x n ) T ) T is the hidden layer of the training set; h(x)=(h1(x),…,h L (x) T is the nonlinear random feature mapping of the hidden layer relative to x, and L is the number of hidden layers; w i and b i are weights and biases respectively; G is the activation function; ξ and η are error vectors; C1 and C2 are trade-off parameters greater than 0; β1 and β2 are the weights between the hidden layer and the output layer of the two hyperplanes respectively. By introducing Lagrange multipliers α and γ, the quadratic programming problem is transformed into: According to the necessary and sufficient optimality conditions, the Karush-Kuhn-Tucker optimization condition is expressed as follows: -x T (Y-Hβ1-eε1)+x T α=0 -e T (Y-Hβ1-eε1)+e T α=0 C1e-α-γ=0 Y-Hβ1≥eε1-ξ,ξ≥0 a T (Y-Hβ1-eε1+ξ)=0,α≥0 c T ξ=0,γ≥0 Introducing the regularization term δI, we get β1=(H T H+δI) -1 H T (f-α), and obtain the corresponding dual optimization problem: st0≤α≤C1e st0≤γ≤C2e In the formula, δ is the regularization parameter with a preset value, and I is the unit matrix of the preset dimension. T H+δI) -1 H T (g+γ), g=Y+eε2.
4. The method according to claim 2, characterized in that: The above method updates the position of each individual employee through the team communication operator, the reflection learning operator and the internal competition operator to obtain the optimal solution for each individual employee, including: The team communication operator is determined by the following formula: M=1+max(floor(3·α·I·(1-t / (0.7·T))),0) In the formula, The value of the jth variable after the update of the i-th employee group for the k+1th iteration; represents the value of the jth variable of the historical optimal decision of the i-th employee in the k-th iteration; represents the value of the jth variable of the indth best historical decision of the team at the kth iteration, where ind is randomly selected from the integer set {1,2,…,M}, and M represents the number of the best historical decisions of the team; They represent the information gains obtained from the leader, decision maker, and supervisor respectively; α and β represent adjustment parameters; t and T represent the current iteration number and the global iteration number respectively; floor is the rounding function; The reflective learning operator is determined by the following formula: In the formula, The value of the jth variable after the i-th employee reflects on his decision in the k+1th iteration; randn is a normal distribution random function; rand is a [0,1] random value function; The internal competition operator is determined by the following formula: In the formula, F(x) is used to evaluate the work performance of employees and is the fitness value of the problem to be optimized; By determining the team communication operator, reflective learning operator and internal competition operator, the position of each individual employee is updated to obtain the optimal solution for each individual employee.
5. The method according to claim 1, characterized in that The method of determining the number of influencing factors according to the historical runoff data and establishing the runoff time series based on the number of influencing factors includes: normalizing the historical measured runoff data; The normalized historical measured runoff data is subjected to partial autocorrelation analysis to determine the number of previous influencing factors; The number of previous influencing factors is windowed to establish a runoff time series.
6. The method according to claim 2, characterized in that Before and after obtaining the hydrological forecast model according to the optimal parameter combination of the employees, the method further includes: The forecast model is tested by using a test set, and the runoff point forecast result is obtained after denormalization; The accuracy of the hydrological forecast model is verified based on the runoff point forecast results.
7. The method according to claim 6, characterized in that include: The Nash efficiency coefficient is used as the objective function of the initial hydrological forecast model, and the objective function value of each individual employee is obtained, including: The Nash-efficiency coefficient is selected as the objective function of the model, and the objective function value of each individual employee is calculated as an indicator for the initial evaluation of the model's prediction performance. The Nash-efficiency coefficient is determined by the following formula: In the formula, Q obs,t is the actual observed value at time t, Q sim,t is the model prediction value at time t, is the mean of the observations and n is the number of sample points.
8. A hydrological forecasting system, characterized in that: The system includes a module for dividing a training set and a test set, a module for building a hydrological forecast model, and a module for obtaining a runoff point forecast result, wherein: The module for dividing the training set and the test set is used to determine the number of influencing factors according to the historical runoff data, establish a runoff time series based on the number of influencing factors, and divide the training set and the test set according to the runoff time series; The hydrological forecast model building module is used to build a hydrological forecast model based on the training set by coupling the twin extreme learning machine through a cooperative search algorithm, wherein the hydrological forecast model inputs runoff data and outputs predicted runoff data; the cooperative search algorithm includes a team communication operator that introduces individual best positions for joint search, and a reflective learning operator that introduces dynamic disturbances; The module for obtaining runoff point forecast results is used to obtain runoff point forecast results according to current runoff data and based on the hydrological forecast model.
9. An electronic device, characterized in that: The invention comprises a memory and a processor, a computer program stored in the memory and executable on the processor, and the processor implements a hydrological forecasting method as claimed in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a hydrological forecasting method according to any one of claims 1 to 7 is implemented.