Adaptive Switching Method for Water Resource Emergency-Normal Management Mode Based on Machine Learning
Through a machine learning-based method, multi-source heterogeneous water resource data is processed, dual-flow neural network is built to perform dynamic threshold learning and system state prediction, and water resource management mode switching is optimized, which solves the problems of insufficient data processing capabilities, lack of adaptability to threshold setting and failure to evaluate uncertainty and risks in the decision-making process in the existing technology, and achieves efficient and reliable water resource management mode switching.
Patent Information
- Application Number
- CN202510378758.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-03-28
AI Technical Summary
The existing water resource management model switching method is difficult to effectively extract spatiotemporal characteristics when processing multi-source heterogeneous data, and the threshold setting lacks adaptability, and the uncertainty and risks of switching behavior are not effectively evaluated during the decision-making process, and it is difficult to balance benefits, risks and resource allocation in multi-objective decisions.
Using a machine learning-based method, by obtaining original monitoring data containing hydrological, meteorological and socioeconomic information, the initial feature matrix and spatiotemporal correlation matrix are obtained, a dual-stream neural network is built for dynamic threshold learning, the system state is predicted, and the switching timing is optimized, and the management mode switching instructions are generated.
It realizes intelligent switching of water resource management models, improves the scientificity and reliability of switching decisions, can dynamically adjust thresholds, evaluate the uncertainty and risks of switching behaviors, balances multi-target decisions, and significantly improves the intelligent level and decision-making efficiency of switching water resource emergency-normal management models.
Smart Images

Figure CN119886473B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to machine learning, especially an adaptive switching method for water resource emergency-normal management mode based on machine learning. Background Art
[0002] The switching between the emergency mode and the normal mode of water resource management is a key link to ensure water supply safety. With the intensification of climate change and the acceleration of urbanization, the uncertainties and risks faced by the water resource system are increasing continuously, posing higher requirements for the scientificity and timeliness of management mode switching. Effective mode switching can not only enhance the response ability of the water resource system, but also optimize the resource allocation efficiency during normal operation, which is of great significance for ensuring regional water safety.
[0003] Currently, the switching of water resource management mode mainly relies on preset thresholds and expert experience for judgment. Traditional methods usually adopt rule-based switching strategies, combine hydrological and meteorological monitoring data with historical experience thresholds, and construct simple decision-making models. Some studies have begun to introduce machine learning methods, such as support vector machine (SVM) and artificial neural network (ANN), etc., to extract hydrological features and predict system states. However, these methods often treat time series data as independent samples, ignoring the spatio-temporal correlation between data, and the threshold setting lacks a dynamic adjustment mechanism.
[0004] The existing technologies have the following specific problems: First, the ability to process multi-source heterogeneous data is insufficient. Especially when dealing with high-dimensional and non-stationary hydrological and meteorological data, it is difficult to effectively extract spatio-temporal features and capture the variation laws at different scales; Second, the determination of thresholds lacks adaptability, and the influence of system dynamic characteristics and external environment changes on thresholds is not fully considered, resulting in insufficient adaptability of switching decisions; Third, the uncertainty and risks of switching behaviors cannot be effectively evaluated during the decision-making process, and there is a lack of a reliable switching time sequence optimization mechanism, which is likely to cause decision-making oscillations or miss the best switching opportunity; Fourth, existing methods often adopt simple linear weighting when dealing with multi-objective decisions, making it difficult to balance multiple objectives such as benefits, risks, and resource allocation, and lacking a systematic evaluation and feedback mechanism for historical decision-making effects. Summary of the Invention
[0005] The object of the invention is to provide an adaptive switching method for water resource emergency-normal management mode based on machine learning, in order to solve at least one technical problem existing in the prior art.
[0006] Technical solution: An adaptive switching method for water resource management mode based on machine learning, comprising the following steps:
[0007] Obtain the original monitoring data containing hydrological, meteorological and socioeconomic information, and obtain the initial feature matrix and spatio-temporal correlation matrix after processing;
[0008] Perform scene partitioning on the initial feature matrix and the spatio-temporal correlation matrix, construct a two-stream neural network including a feature stream and a temporal stream, use a residual attention module for the temporal stream to obtain a dynamic threshold vector;
[0009] Predict the system state based on the dynamic threshold vector and optimize the switching time sequence to generate a management mode switching instruction.
[0010] According to one aspect of the present application, the steps of obtaining the initial feature matrix and the spatio-temporal correlation matrix include:
[0011] Extract feature matrices from the original monitoring dataset respectively, including a hydrological feature matrix, a meteorological feature matrix, and a socio-economic feature matrix;
[0012] Construct an outlier detector using a statistical detection module and a rule detection module, perform outlier cleaning on the feature matrix to obtain a cleaned dataset;
[0013] Use an improved Transformer imputation model to fill in the missing data in the cleaned dataset to obtain a complete dataset;
[0014] Construct a multi-scale time window sequence based on the complete dataset, and use wavelet transform to obtain a time feature set;
[0015] Use a spatial attention mechanism to process the complete dataset to obtain a spatial feature set;
[0016] Fuse the time feature set and the spatial feature set to generate an initial feature matrix and a spatio-temporal correlation matrix.
[0017] According to one aspect of the present application, the steps of constructing a multi-scale time window sequence include:
[0018] Extract time window reference parameters from a pre-stored time parameter library, including hour-scale parameters, day-scale parameters, and month-scale parameters;
[0019] Perform sliding segmentation on the complete dataset according to the time window reference parameters to generate hour-level, day-level, and month-level time window sequences;
[0020] Combine the time window sequences of the three scales to obtain a multi-scale time window sequence.
[0021] According to one aspect of the present application, the steps of scene partitioning include:
[0022] Use a hierarchical clustering algorithm to process the initial feature matrix and the spatio-temporal correlation matrix to obtain a scene category set;
[0023] Calculate an initial threshold for each scene in the scene category set to obtain an initial threshold set;
[0024] Establish the correspondence between scenarios and thresholds according to the scenario category set and the initial threshold set, and obtain the mapping matrix.
[0025] According to one aspect of the present application, the construction steps of the two-stream neural network include:
[0026] Construct a feature stream network and a temporal stream network, convert the mapping matrix into a feature data sequence, and arrange the initial threshold set in chronological order to obtain a temporal data sequence;
[0027] The temporal stream network includes a residual attention module with L residual blocks, and each residual block includes an attention sublayer and a feed-forward sublayer;
[0028] Construct a feature fusion device, which includes a feature mapping module and a feature aggregation module, and adaptively fuse the outputs of the feature stream and the temporal stream by using a gating mechanism to obtain a fused feature vector;
[0029] Map the fused feature vector to the threshold space through a fully connected layer to obtain a dynamic threshold vector and a threshold credibility index.
[0030] According to one aspect of the present application, the processing steps of the temporal stream network include:
[0031] Input the temporal data sequence into the first residual block, calculate the attention weights and perform residual connection to obtain intermediate features;
[0032] Input the intermediate features into the subsequent residual blocks in turn, and extract deep temporal features layer by layer to obtain L intermediate feature sequences;
[0033] Perform weighted combination on the L intermediate feature sequences to obtain a temporal feature vector.
[0034] According to one aspect of the present application, the steps of predicting the system state include:
[0035] Construct an improved LSTM cell including an input gate, a forget gate and an output gate;
[0036] Use the improved LSTM cell to perform sliding segmentation and normalization processing on the real-time monitoring data stream to obtain a normalized sequence;
[0037] Construct a multi-layer LSTM prediction network, including a state encoding layer, a feature extraction layer and a prediction output layer;
[0038] Input the normalized sequence and the dynamic threshold vector into the multi-layer LSTM prediction network, and use the attention mechanism to obtain a predicted state sequence;
[0039] Calculate the state transition probability according to the predicted state sequence to obtain a transition probability matrix.
[0040] According to one aspect of the present application, the steps of optimizing the switching time sequence include:
[0041] Construct a temporal decision tree model, process the prediction state sequence and the transition probability matrix, calculate the switching benefits at each time point, and obtain the benefit vector;
[0042] Define the switching action space according to the benefit vector, and optimize the switching strategy using the policy gradient method;
[0043] Select the optimal switching sequence according to the optimized strategy to obtain the optimized temporal sequence;
[0044] Construct a probability evaluation model to process the optimized temporal sequence and calculate the switching probability distribution.
[0045] According to one aspect of the present application, it further includes the step of generating a switching risk assessment report:
[0046] Construct a multi-objective optimization model, which includes three objective functions: benefit maximization, risk minimization, and optimal resource allocation;
[0047] Generate candidate decision-making schemes according to the switching probability distribution and the optimized temporal sequence;
[0048] Optimize the candidate decision-making schemes using the Pareto optimization algorithm to obtain the optimized decision;
[0049] Calculate the index values of the optimized decision in the dimensions of benefit, risk, and resource allocation, and generate a switching risk assessment report.
[0050] According to one aspect of the present application, the steps of obtaining the initial feature matrix and the spatio-temporal correlation matrix specifically include:
[0051] After obtaining the initial feature matrix, use the multi-head self-attention mechanism to calculate the correlation strength between features to obtain the correlation strength matrix;
[0052] Based on the correlation strength matrix, perform feature selection to obtain the optimized feature matrix;
[0053] Perform standardization processing on the optimized feature matrix to obtain the standardized feature matrix;
[0054] Construct the optimized feature matrix into a spatio-temporal graph network and process it using the graph attention network to obtain the spatio-temporal correlation matrix.
[0055] According to one aspect of the present application, before obtaining the dynamic threshold vector, it further includes:
[0056] Construct an ensemble learning framework composed of multiple base learners;
[0057] Use the ensemble learning framework to process the fused feature vector, calculate its prediction uncertainty, and obtain the uncertainty index;
[0058] Calculate the credibility score according to the uncertainty index to obtain the threshold credibility index;
[0059] Generate a dynamic threshold vector based on the fusion feature vector and the threshold credibility index.
[0060] According to one aspect of the present application, the steps of optimizing the candidate decision-making scheme by using the Pareto optimization algorithm to obtain the optimized decision include:
[0061] Calculate the dominance relationship between the schemes to obtain the dominance matrix;
[0062] Perform hierarchical processing on the dominance matrix, divide the schemes into different Pareto levels to obtain the level sequence;
[0063] Extract the non-dominated solutions of the first level from the level sequence to obtain the Pareto optimal set;
[0064] Perform clustering analysis on the schemes in the Pareto optimal set, select the optimal scheme from the cluster centers to obtain the optimized decision.
[0065] Beneficial effects: The intelligent switching of the management mode is realized through multi-source data fusion and deep learning methods, which improves the scientificity and reliability of the switching decision-making and has strong practical value. Brief Description of the Drawings
[0066] Figure 1 is the flowchart of the present invention.
[0067] Figure 2 is the flowchart of the present invention for obtaining the initial feature matrix and the spatio-temporal correlation matrix.
[0068] Figure 3 is the flowchart of the present invention for constructing the multi-scale time window sequence.
[0069] Figure 4 is the flowchart of the present invention for scenario division.
[0070] Figure 5 is the flowchart of the present invention for constructing the two-stream neural network. Detailed Embodiments
[0071] As Figure 1 shown,
[0072] The adaptive switching method for the water resource emergency-normal management mode based on machine learning includes:
[0073] Step S1, obtain the original monitoring data set containing hydrological, meteorological, and socioeconomic information, perform data cleaning and filling processing on it to obtain a complete data set; according to the complete data set, construct time windows to extract time features and extract spatial features to obtain an initial feature matrix; according to the initial feature matrix, calculate the correlation strength between features and perform feature optimization to obtain a standardized feature matrix and a spatio-temporal correlation matrix.
[0074] Step S2, according to the standardized feature matrix and the spatio-temporal correlation matrix, perform scenario division on historical data and calculate initial thresholds to obtain an initial threshold set and a mapping matrix; based on the initial threshold set and the mapping matrix, construct a two-stream neural network for dynamic threshold learning to obtain threshold prediction values; according to the threshold prediction values, evaluate their credibility through an ensemble learning framework, and finally obtain a dynamic threshold vector and a threshold credibility index.
[0075] Step S3, according to the dynamic threshold vector, the threshold credibility index, and the real-time monitoring data stream, use an improved LSTM network to predict the system state to obtain a state sequence and a transition probability matrix; based on the state sequence, the transition probability matrix, and the threshold credibility index, use a time series decision tree model to optimize the switching time sequence to obtain an optimized time sequence; according to the optimized time sequence and the state sequence, evaluate the switching probability, and finally obtain a switching probability distribution and an optimal switching time sequence.
[0076] Step S4, according to the switching probability distribution, the optimal switching time sequence, and the historical decision effect matrix, use a multi-objective optimization model to generate and evaluate candidate decision plans to obtain a decision set and an evaluation matrix; use the Pareto optimization algorithm to process the decision set and the evaluation matrix to obtain an optimized decision and an execution plan; evaluate the decision effect according to the optimized decision and the execution plan and update the historical data, and finally obtain a management mode switching instruction and a switching risk assessment report.
[0077] By constructing a complete adaptive switching framework for data-driven water resource management mode, the full-process intelligence from data processing, feature extraction, threshold learning to decision optimization is realized. First, at the data level, through multi-scale spatio-temporal feature extraction and optimization, a comprehensive expression of the dynamic characteristics of the hydrological system is established; second, at the model level, a dual-stream neural network and an improved LSTM network are designed to achieve accurate prediction of dynamic thresholds and accurate prediction of system states; finally, at the decision-making level, through multi-objective optimization and Pareto decision-making methods, the scientific generation and optimization of switching schemes are realized. The whole technical solution: 1) realizes the transformation from static threshold to dynamic threshold, improving the adaptability of switching decisions; 2) establishes a credibility evaluation mechanism, providing a quantitative basis for decision-making risks; 3) constructs a multi-objective optimization framework, ensuring the scientificity and balance of decisions; 4) designs a historical experience update mechanism, realizing the continuous improvement of decision-making effects. It significantly improves the intelligence level and decision-making efficiency of the switching between water resource emergency-normal management modes, providing strong technical support for the scientific decision-making of water resource management.
[0078] According to one aspect of the present application, step S1 is specifically as follows:
[0079] In step S11, obtain the original monitoring data set containing hydrological, meteorological and socioeconomic information, and respectively extract hydrological data, meteorological data and socioeconomic data from it; clean the outliers of the extracted data to obtain the cleaned data set; use the Transformer imputation model to fill in the missing data in the cleaned data set to obtain the complete data set.
[0080] In step S12, based on the complete data set, construct a time window sequence including hourly, daily and monthly scales; according to the time window sequence, use wavelet transform to process the data in each time window to obtain a time feature set; use a spatial attention mechanism to process the complete data set to obtain a spatial feature set; fuse the time feature set and the spatial feature set to generate an initial feature matrix.
[0081] In step S13, according to the initial feature matrix, use the multi-head self-attention mechanism to calculate the correlation strength between features to obtain a correlation strength matrix; perform feature selection based on the correlation strength matrix to obtain an optimized feature matrix; construct the optimized feature matrix into a spatio-temporal graph network and use a graph attention network to process it to obtain a spatio-temporal correlation matrix; perform normalization processing on the optimized feature matrix to obtain a normalized feature matrix.
[0082] Among them, the multi-head attention calculation formula is MHA(X) = Concat(head1,..., headh)WO; where: headi = Attention(XWQi, XWKi, XWVi); Attention(Q, K, V) = softmax(QKT / √dk + M)V; M is the mask term of the adjacency matrix; WQi, WKi, and WVi are the parameter matrices of the i-th attention head; WO is the output mapping matrix; h is the number of attention heads; dk is the attention dimension; and X is the input feature matrix.
[0083] By constructing a complete data preprocessing process that includes data cleaning, spatio-temporal feature extraction, and feature optimization, first, the original monitoring data is processed using outlier detection and the Transformer imputation model, ensuring the integrity and reliability of the data and avoiding the impact of missing data and outliers on subsequent analysis. Subsequently, by constructing multi-scale time windows and applying wavelet transforms, dynamic features and periodic change patterns at different time scales can be captured. At the same time, the spatial attention mechanism is used to extract correlation features in the spatial dimension, realizing the multi-dimensional expression of spatio-temporal features. Finally, the multi-head self-attention mechanism is used to calculate the correlation strength between features and optimize the features, not only reducing the redundancy of the data but also retaining the key correlation information between features. By constructing a spatio-temporal graph network and applying a graph attention network, the spatio-temporal consistency of feature expression is further enhanced. This multi-level feature extraction and optimization method provides high-quality input data for subsequent scenario division and threshold learning, significantly improving the accuracy and reliability of the water resource management mode switching decision.
[0084] According to one aspect of the present application, step S2 is specifically as follows:
[0085] In step S21, a hierarchical clustering algorithm is used to process the standardized feature matrix and the spatio-temporal correlation matrix to obtain a set of scene categories; an initial threshold is calculated for each scene in the set of scene categories to obtain a set of initial thresholds; according to the set of scene categories and the set of initial thresholds, a correspondence between scenes and thresholds is established to obtain a mapping matrix.
[0086] In step S22, based on the set of initial thresholds and the mapping matrix, a two-stream neural network including a feature stream and a time series stream is constructed; a residual attention module is used to process the time series data to obtain a time series feature vector; the time series feature vector is fused with the scene features to obtain a threshold prediction value.
[0087] Among them, the dual-stream neural network is: the spatio-temporal feature fusion formula F = α·Ft + (1-α)·Fs + β·(Ft×Fs); where: Ft is the temporal stream feature; Fs is the feature stream feature; α is the adaptive weight coefficient, α = sigmoid(WF[Ft;Fs]); β is the interaction intensity coefficient, β = tanh(WI[Ft;Fs]); WF and WI are learnable weight matrices; × is the outer product operation; [;] represents feature concatenation.
[0088] Step S23, construct an ensemble learning framework composed of multiple base learners, process the threshold prediction value, calculate its prediction uncertainty, and obtain the uncertainty index; calculate the credibility score according to the uncertainty index to obtain the threshold credibility index; generate a dynamic threshold vector according to the threshold prediction value.
[0089] This step realizes the accurate prediction and credibility evaluation of the water resource management mode switching threshold by constructing a dynamic threshold learning mechanism based on scenario division and dual-stream neural network. First, the hierarchical clustering algorithm is used to divide the standardized feature matrix into scenarios, which can identify the feature patterns under different management situations and establish the mapping relationship between scenarios and thresholds, providing a scenario-based foundation for threshold learning. Second, a dual-stream neural network structure including a feature stream and a temporal stream is designed. The feature stream processes the scenario feature information, and the temporal stream captures the temporal evolution features through the residual attention module. The information of the two streams can comprehensively express the dynamic change features of the scenario after fusion processing. Finally, by constructing an ensemble learning framework to evaluate the credibility of the threshold prediction, not only the predicted threshold is obtained, but also the corresponding credibility index is obtained. This measurable uncertainty evaluation mechanism can provide a more reliable reference basis for management decisions and effectively reduce the decision-making risk. The whole step realizes the transformation from a static threshold to a dynamic threshold, enabling the switching threshold to be adaptively adjusted as the scenario changes, and significantly improving the adaptability and robustness of the water resource management mode switching.
[0090] According to one aspect of the present application, step S3 is specifically as follows:
[0091] Step S31, use an improved LSTM network to process the dynamic threshold vector and the real-time monitoring data stream, predict the system state in the future time window, and obtain the state sequence; calculate the state transition probability according to the state sequence to obtain the transition probability matrix.
[0092] Step S32, construct a temporal decision tree model, process the state sequence, the transition probability matrix and the threshold credibility index, calculate the switching benefit at each time point to obtain the benefit vector; use the temporal reinforcement learning algorithm to optimize the benefit vector to obtain the optimized temporal sequence.
[0093] Step S33: Construct a probability evaluation model to process the optimized time series and state sequence, calculate the switching probability distribution, and obtain the switching probability distribution; determine the optimized time series as the optimal switching time series.
[0094] By constructing an improved LSTM network and a time series decision optimization framework, the accurate prediction of the system state and the optimization of the switching time series are realized. First, an improved LSTM cell structure is adopted, including the design of an input gate, a forget gate, and an output gate, enabling the network to better handle long-term dependencies and improving the ability to capture the long-term evolution characteristics of the water resource system. On this basis, a multi-layer LSTM prediction network is constructed. Through the hierarchical processing of the state encoding layer, the feature extraction layer, and the prediction output layer, combined with the attention mechanism, it can not only accurately predict the system state in the future time window but also obtain the state transition probability matrix, providing probabilistic support for the switching decision. Subsequently, the time series decision tree model and the time series reinforcement learning algorithm are used to optimize the switching time series. By calculating the switching benefits at each time point and optimizing the switching strategy, the optimal switching time series is found. This method combining state prediction and time series optimization not only ensures the accurate grasp of the system state evolution but also realizes the optimal selection of the switching time series, significantly improving the scientificity and timeliness of the water resource emergency-normal management mode switching.
[0095] According to one aspect of the present application, step S4 is specifically as follows:
[0096] Step S41: Construct a multi-objective optimization model to process the switching probability distribution, the optimal switching time series, and the historical decision effect matrix, generate candidate decision plans, and obtain a decision set; evaluate the risks and benefits of the plans in the decision set to obtain an evaluation matrix.
[0097] Step S42: Use the Pareto optimization algorithm to process the decision set and the evaluation matrix, screen the optimal decision plan, and obtain the optimized decision; generate specific implementation suggestions according to the optimized decision to obtain an implementation plan.
[0098] Step S43: Construct an evaluation index system, calculate the decision effect score according to the optimized decision and the implementation plan to obtain the effect score; update the historical decision effect data with the effect score to obtain the updated matrix; generate a management mode switching instruction based on the optimized decision, and generate a switching risk assessment report according to the effect score and the updated matrix.
[0099] By constructing a multi-objective optimization and Pareto decision framework, the generation and optimization of the management mode switching plan are realized. First, a multi-objective optimization model is constructed based on the switching probability distribution and the optimal switching sequence, and the three objectives of benefit maximization, risk minimization and optimal resource allocation are considered at the same time, ensuring the comprehensiveness and balance of the decision. When generating candidate plans, the feasibility of the plan is ensured through the dual constraint mechanism of probability constraint and timing constraint. Subsequently, the Pareto optimization algorithm is used to screen the candidate plans. By calculating the dominance relationship and grade division between the plans, the non-dominated solution set is found, and the optimal decision plan is selected through cluster analysis. Finally, an evaluation index system is constructed to quantitatively evaluate the decision effect, and the dynamic update mechanism of historical decision effect data is used to achieve continuous optimization of the decision process. This decision-making method combining multi-objective optimization and dynamic evaluation not only ensures the scientificity and feasibility of the switching plan, but also achieves continuous improvement of the decision effect through the accumulation of historical experience, providing reliable decision support for the intelligent switching of water resources management mode.
[0100] According to one aspect of the present application, S11 specifically includes:
[0101] Step S111, extract data features from the original monitoring data set to obtain the hydrological feature matrix Xh, the meteorological feature matrix Xm and the socio-economic feature matrix Xe; according to the pre-stored data format template, check the data format of each feature matrix, mark the format abnormal data, and obtain the abnormal mark set F; according to the abnormal mark set F, unify the format of the feature matrix to obtain the formatted data matrix Xs.
[0102] Step S112, construct an outlier detector, including a statistical detection module and a rule detection module; use the 3σ criterion to perform statistical analysis on the formatted data matrix Xs, identify data points that exceed the normal range, and obtain a statistical anomaly set S1; according to the pre-stored professional rule library, check whether the data violates the professional rules to obtain a rule anomaly set S2; merge the statistical anomaly set S1 and the rule anomaly set S2 to obtain a comprehensive anomaly set Sa; remove the data marked as abnormal in the formatted data matrix Xs to obtain a cleaned data set.
[0103] Step S113, construct an improved Transformer interpolation model, including encoder and decoder modules; divide the cleaned data set into training data and verification data according to time series to obtain a training set Dt and a verification set Dv; use the training set Dt to train the Transformer model to obtain a model parameter set θ; use the attention mechanism to calculate the spatiotemporal correlation between data to obtain the correlation weight matrix W; interpolate the missing values in the cleaned data set according to the model parameter set θ and the correlation weight matrix W to obtain a complete data set.
[0104] Among them, the improved Transformer interpolation model is: the spatio-temporal attention calculation formula At(Q, K, V) = softmax((QWq·KWk^T) / √dk)·VWv + PE(t); where: Q is the query matrix with a dimension of n×d; K is the key matrix with a dimension of n×d; V is the value matrix with a dimension of n×d; Wq, Wk, and Wv are learnable weight matrices with dimensions of d×d; dk is the dimension of the attention head; PE(t) is the position encoding, and the calculation formula is PE(t, 2i) = sin(t / 10000^(2i / d)), PE(t, 2i + 1) = cos(t / 10000^(2i / d)); t is the time step; i is the position index; d is the model dimension; n is the sequence length.
[0105] By constructing a complete data preprocessing process, high-quality cleaning and filling of the original monitoring data are achieved. First, format checking and unification processing are carried out according to the pre-stored data format template to ensure the format consistency of data from different sources; subsequently, a dual outlier detection mechanism including a statistical detection module and a rule detection module is designed. Through statistical analysis using the 3σ criterion and rule checking in combination with a professional rule library, abnormal data can be comprehensively identified and removed. Finally, the improved Transformer interpolation model is used to fill the missing data. This model calculates the spatio-temporal correlation between data through the attention mechanism to obtain the correlation weight matrix, enabling the data filling process to fully consider the spatio-temporal correlation characteristics. Compared with traditional interpolation methods, it can more accurately infer the missing values. This data preprocessing method combining statistical rules and deep learning not only ensures the integrity and reliability of the data but also maintains the spatio-temporal correlation characteristics of the data, providing a high-quality data basis for subsequent feature extraction and model training, and significantly improving the data support reliability for water resource management decision-making.
[0106] According to one aspect of the present application, step S12 is specifically as follows:
[0107] Step S121, extract the time window reference parameters from the pre-stored time parameter library, including the hour-scale parameter h, the day-scale parameter d, and the month-scale parameter m; according to the time window reference parameters, perform sliding segmentation on the complete data set to generate the hour-level time window sequence Wh, the day-level time window sequence Wd, and the month-level time window sequence Wm; combine the time window sequences of the three scales to obtain the multi-scale time window sequence W.
[0108] Step S122: Process the data in the multi-scale time window sequence W using wavelet transform. First, calculate the wavelet coefficients within each time window to obtain a wavelet coefficient matrix; reconstruct the wavelet coefficient matrix to extract the time features of different frequency components, obtaining a frequency feature set; calculate the statistical features of the time series based on the frequency feature set, including mean, variance, skewness, and kurtosis, obtaining a statistical feature set; combine the frequency feature set and the statistical feature set to obtain a time feature set Ft.
[0109] Step S123: Construct a spatial attention network according to the pre-stored spatial relationship library. This network contains K attention heads; for each attention head k, calculate the query matrix Q, the key matrix K, and the value matrix V respectively to obtain K groups of attention weight matrices; perform weighted calculation on the K groups of attention weight matrices and the spatial data in the complete dataset to obtain K groups of spatial feature subsets; perform weighted fusion on the K groups of spatial feature subsets to obtain a spatial feature set Fs.
[0110] Among them, the spatial attention calculation formula is SAtt(X) = σ(f(max(X), avg(X)))O X; where: X is the input feature matrix with a dimension of C×H×W; f(·) is a 1×1 convolution operation for feature dimensionality reduction; max(X) is the result of channel-wise maximum pooling; avg(X) is the result of channel-wise average pooling; σ is the sigmoid activation function; O is element-wise multiplication; C is the number of feature channels; H is the height of the feature map; W is the width of the feature map.
[0111] Step S124: Construct a feature fusion network, which includes a feature mapping layer and a feature integration layer; input the time feature set Ft obtained in step S122 into the feature mapping layer to obtain a time feature mapping matrix Mt; input the spatial feature set Fs obtained in step S123 into the feature mapping layer to obtain a spatial feature mapping matrix Ms; in the feature integration layer, use an adaptive weight mechanism to fuse the time feature mapping matrix Mt and the spatial feature mapping matrix Ms to obtain an initial feature matrix.
[0112] By constructing a multi-scale spatio-temporal feature extraction framework, the dynamic characteristics of the water resource system are comprehensively captured. First, a time window sequence including three scales of hour, day, and month is constructed based on a pre-stored time parameter library. Through sliding segmentation, hierarchical extraction of features at different time scales is achieved, enabling the simultaneous capture of short-term fluctuations and long-term evolution characteristics. Second, wavelet transform is used to process the data of each time window, not only extracting the time features of different frequency components but also calculating statistical features, realizing the multi-dimensional expression of time series features. At the same time, a spatial attention network with K attention heads is designed. By calculating the query matrix, key matrix, and value matrix, multiple groups of attention weight matrices are obtained, realizing the adaptive extraction of spatial features. Finally, through the feature fusion network, adaptive weight fusion of time features and spatial features is carried out, which not only maintains the independence of features but also realizes complementary enhancement of features. This multi-scale and multi-dimensional feature extraction method can comprehensively depict the dynamic characteristics of the water resource system, providing strong feature support for accurate state prediction and management mode switching.
[0113] According to one aspect of the present application, step S22 is specifically as follows:
[0114] Step S221, construct a two-stream neural network based on a pre-stored network configuration library, including a feature stream network and a time series stream network; arrange the initial threshold set Ti in chronological order to obtain a time series data sequence Dt; convert the mapping matrix M into a feature vector to obtain a feature data sequence Df; construct a data batch generator, and package the time series data sequence Dt and the feature data sequence Df into data batches of a fixed size respectively to obtain a time series batch set Bt and a feature batch set Bf.
[0115] Step S222, construct a residual attention module including L residual blocks, and each residual block includes an attention sub-layer and a feed-forward sub-layer; input the time series batch set Bt obtained in step S221 into the first residual block, calculate the attention weight and perform residual connection to obtain an intermediate feature H1; sequentially input the intermediate feature H1 into the subsequent residual blocks to extract deep time series features layer by layer, obtaining L intermediate feature sequences; perform weighted combination on the L intermediate feature sequences to obtain a time series feature vector St.
[0116] Among them, the residual attention module is: the residual feature calculation formula H = X + MLP(LN(X + MHSA(LN(X)))); where: X is the input feature; MHSA is the multi-head self-attention layer; LN is the layer normalization; MLP is the multi-layer perceptron; H is the output feature; the residual attention weight w = σ(fc2(ReLU(fc1(AvgPool(X))))); fc1 and fc2 are fully connected layers; σ is the sigmoid function.
[0117] Step S223: Construct a feature fusion device, which includes a feature mapping module and a feature aggregation module; input the feature batch set Bf obtained in step S221 into the feature mapping module to obtain a feature mapping vector Vf; input the temporal feature vector St obtained in step S222 and the feature mapping vector Vf into the feature aggregation module, and adopt a gating mechanism for adaptive fusion to obtain a fused feature vector F; map the fused feature vector F to a threshold space through a fully connected layer to obtain a threshold prediction value Tp.
[0118] By designing a two-stream neural network structure, the effective fusion of scene features and temporal features is realized. First, a two-stream neural network is constructed based on a pre-stored network configuration library, and two processing branches, namely a feature stream and a temporal stream, are designed respectively. The data is efficiently batch-processed through a data batch generator. Among them, the temporal stream branch adopts a residual attention module containing L residual blocks. Each residual block can extract deep temporal features layer by layer through the combination of an attention sub-layer and a feed-forward sub-layer. The design of the residual connection effectively avoids the problem of gradient disappearance in deep networks. The feature fusion device realizes the adaptive fusion of features through the feature mapping module and the feature aggregation module, and adopts a gating mechanism. This gating-based fusion method can dynamically adjust the fusion weights according to the importance of features, improving the expression ability of the fused features. This innovative network structure design not only realizes the effective fusion of scene features and temporal features, but also improves the expression ability and training stability of the model through the residual attention mechanism, laying a solid model foundation for accurate threshold prediction.
[0119] According to one aspect of the present application, step S31 is specifically as follows:
[0120] Step S311: Load the basic structure parameters of the LSTM network from a pre-stored network parameter library, including the number of hidden layer units n, the time step l, and the prediction step p; construct an improved LSTM cell including an input gate, a forget gate, and an output gate, and perform a sliding segmentation on the real-time monitoring data stream S to obtain an input sequence group Is; convert the dynamic threshold vector T into a threshold constraint condition to obtain a threshold constraint vector Tc; construct a data pre-processor to perform normalization processing on the input sequence group Is to obtain a normalized sequence Ns.
[0121] Among them, the improved LSTM network is as follows: the calculation formula of the gating unit is ft = σ(Wf·[ht-1, xt] + αf·ct-1 + bf); it = σ(Wi·[ht-1, xt] + αi·ct-1 + bi); ot = σ(Wo·[ht-1, xt] + αo·ct-1 + bo); ct = ft×ct-1 + it×tanh(Wc·[ht-1, xt] + bc); ht = ot×tanh(ct); where: ft, it, and ot are the forget gate, input gate, and output gate respectively; ct is the cell state; ht is the hidden state; xt is the input; W and b are the weight and bias terms; αf, αi, and αo are the cell state feedback coefficients.
[0122] Step S312: Construct a multi-layer LSTM prediction network, including a state encoding layer, a feature extraction layer, and a prediction output layer; input the standardized sequence Ns obtained in step S311 into the state encoding layer to extract time-dependent features and obtain an encoded feature vector E; combine the encoded feature vector E with the threshold constraint vector Tc and input it into the feature extraction layer to obtain a hidden state sequence H; in the prediction output layer, use the attention mechanism to weight the features of different time steps of the hidden state sequence H to obtain a predicted state sequence Ps; according to the pre-stored state mapping rule, map the predicted state sequence Ps to the system state to obtain a state sequence Sq.
[0123] Step S313: Construct a state transition analyzer, including a transition frequency statistics module and a probability calculation module; pair adjacent states in the state sequence Sq obtained in step S312 to obtain a state transition pair set Tp; according to the state transition pair set Tp, count the transition frequencies between each state to obtain a transition frequency matrix Fm; normalize the transition frequency matrix Fm to obtain a transition probability matrix Pm.
[0124] By improving the LSTM network structure, accurate prediction of the system state is achieved. First, an improved LSTM cell is constructed based on a pre-stored network parameter library. The design of the input gate, forget gate, and output gate enables the network to better process long sequence data. The real-time monitoring data stream is subjected to sliding segmentation and normalization processing to ensure the quality of the input data. Second, a multi-layer LSTM prediction network including a state encoding layer, a feature extraction layer, and a prediction output layer is designed. Through hierarchical feature extraction and state prediction, the expressive ability of the model is improved. In the prediction output layer, the attention mechanism is used to weight the features at different time steps, enabling the model to adaptively focus on important time-step features. Finally, by analyzing the frequency of state transition pairs and performing normalization processing, an accurate transition probability matrix is obtained. This improved LSTM network structure, through the combination of the gating mechanism, multi-layer feature extraction, and the attention mechanism, significantly improves the accuracy and reliability of state prediction, providing reliable state prediction support for the switching decision of the water resource management mode.
[0125] According to one aspect of the present application, step S32 is specifically as follows:
[0126] Step S321: Load the basic parameters from the pre-stored decision tree configuration library, including the maximum depth d of the tree, the splitting threshold s, and the minimum number of samples m in the leaf node; construct a time-series feature extractor according to the state sequence Sq, extract the time-series pattern features in the sequence to obtain the time-series feature set Tf; convert the transition probability matrix Pm into decision constraint conditions to obtain the constraint rule set Rs; construct a decision tree model based on the time-series feature set Tf and the constraint rule set Rs to obtain the initial decision tree Dt.
[0127] Step S322: Construct a revenue calculator, including an immediate revenue module and a delayed revenue module; for each leaf node of the initial decision tree Dt, calculate the immediate revenue of the switching operation in combination with the threshold credibility index C to obtain the immediate revenue vector Ri; calculate the potential revenue of future state transitions based on the transition probability matrix Pm to obtain the delayed revenue vector Rd; perform weighted combination on the immediate revenue vector Ri and the delayed revenue vector Rd to obtain the revenue vector B.
[0128] Step S323: Construct a time-series reinforcement learning optimizer, including an action space generation module and a policy optimization module; define the switching action space according to the revenue vector B to obtain the action set A; use the policy gradient method to optimize the switching policy, calculate the policy gradient according to the historical state and the current state for each time point t to obtain the gradient sequence G; update the policy parameters based on the gradient sequence G to obtain the optimized policy π; select the optimal switching sequence in the action set A according to the optimized policy π to obtain the optimized time-series sequence O.
[0129] By constructing an innovative optimization framework that combines a time-series decision tree and reinforcement learning, intelligent optimization of the switching time series is achieved. First, an adaptive time-series feature extraction mechanism is constructed based on a pre-stored decision tree configuration library. By analyzing the state sequence, time-series pattern features are extracted, and the transition probability matrix is converted into decision constraints. This method of constructing a decision tree that combines time-series features and probability constraints ensures that the decision model not only considers historical evolution laws but also satisfies probability transfer constraints. Second, a dual-benefit evaluation mechanism that includes immediate benefits and delayed benefits is designed. By combining the threshold credibility index, the immediate switching benefit is calculated, and at the same time, the potential benefits of future state transitions are evaluated based on the transition probability matrix. This comprehensive evaluation method that considers current and future benefits can more comprehensively evaluate the long-term effects of switching decisions. Finally, a time-series reinforcement learning method is used for policy optimization. By constructing an action space and using the policy gradient method to optimize the switching policy, dynamic update of policy parameters based on historical experience is achieved, thus obtaining the optimal switching sequence. This optimization method that combines decision trees, benefit evaluation, and reinforcement learning can not only accurately evaluate the short-term and long-term benefits of switching decisions but also achieve adaptive optimization of switching policies, significantly improving the scientificity and forward-looking nature of water resource management mode switching.
[0130] According to one aspect of the present application, step S41 is specifically as follows:
[0131] In step S411, load the multi-objective optimization basic parameters from the pre-stored optimization model library, including the objective weight vector w, the constraint condition set c, and the optimization step size α; construct probability constraint conditions according to the switching probability distribution P to obtain the probability constraint matrix Pc; extract time-series features based on the optimal switching time series O to obtain the time-series constraint matrix Tc; analyze the decision-making patterns in the historical decision effect matrix H to obtain the historical pattern matrix Hm; combine the three matrices to construct a multi-objective optimization model Z, which includes three objective functions: benefit maximization, risk minimization, and optimal resource allocation.
[0132] Among them, the multi-objective optimization model is: the objective function max F(x) = [f1(x), f2(x), f3(x)]; where: f1(x) = λ1·E(x) - λ2·C(x) is the benefit objective; f2(x) = -[μ1·R1(x) + μ2·R2(x)] is the risk objective; f3(x) = η1·U(x) - η2·V(x) is the resource allocation objective; E(x) is the economic benefit; C(x) is the cost; R1(x) and R2(x) are the system risk and environmental risk; U(x) is the resource utilization rate; V(x) is the resource loss rate; λ1, λ2, μ1, μ2, η1, η2 are weight coefficients.
[0133] Step S412: Construct a decision-making solution generator, which includes a solution encoding module and a constraint verification module; based on the objective function of the multi-objective optimization model Z, generate an initial decision-making solution to obtain a candidate solution set Cs; for each solution in the candidate solution set Cs, check whether it meets the requirements of the probability constraint matrix Pc and the timing constraint matrix Tc, filter out the feasible solutions to obtain a feasible solution set Fs; optimize and adjust the feasible solution set Fs according to the successful experiences in the historical pattern matrix Hm to obtain a decision-making set D.
[0134] Step S413: Construct a solution evaluator, which includes an index calculation module and a comprehensive evaluation module; for each solution in the decision-making set D, calculate its index values in the three dimensions of benefit, risk, and resource allocation to obtain an index matrix Im; according to the pre-stored evaluation rule library, standardize the indexes in the index matrix Im to obtain a standardized index matrix Nm; use the analytic hierarchy process to calculate the weights of each index to obtain a weight vector W; perform weighted calculation on the standardized index matrix Nm and the weight vector W to obtain an evaluation matrix V.
[0135] By constructing a comprehensive multi-objective optimization decision-making framework, the intelligent generation and evaluation of the management mode switching solution are realized. First, a multi-objective optimization model based on three constraint matrices is designed. By transforming the switching probability distribution into probability constraint conditions and the optimal switching timing into timing constraint conditions, and combining historical decision-making pattern analysis, a three-dimensional objective function including benefit maximization, risk minimization, and optimal resource allocation is constructed. This multi-dimensional constraint and optimization objective design ensure the comprehensiveness and feasibility of the decision-making solution. Second, the automatic generation and screening of the solution are realized through the decision-making solution generator, and a dual constraint verification mechanism is introduced, which not only ensures that the solution meets the probability and timing constraints, but also optimizes the solution quality through the injection of historical experiences. This solution generation method combining constraint verification and experience optimization significantly improves the feasibility and effectiveness of the candidate solutions. Finally, a solution evaluation mechanism based on multi-dimensional indexes is designed. By using the analytic hierarchy process to determine the index weights, the comprehensive evaluation of the solution in the three dimensions of benefit, risk, and resource allocation is realized. This multi-dimensional evaluation method provides an objective quantitative basis for solution selection. The whole process realizes the full-process intelligence of the switching solution from generation to evaluation through the organic combination of multi-objective optimization, constraint verification, and multi-dimensional evaluation, providing reliable decision-making support for the scientific switching of the water resource management mode.
[0136] According to one aspect of the present application, step S42 is specifically as follows:
[0137] Step S421: Construct a Pareto optimizer, which includes a dominance relation analysis module and a ranking module; calculate the dominance relation between solutions according to the evaluation metrics in the evaluation matrix V to obtain a dominance matrix Dm; perform hierarchical processing on the dominance matrix Dm to divide the solutions into different Pareto ranks to obtain a rank sequence L; extract the non-dominated solutions of the first rank from the rank sequence L to obtain a Pareto optimal set Ps.
[0138] Step S422: Construct a decision preference selector, which includes a clustering analysis module and a solution screening module; perform clustering analysis on the solutions in the Pareto optimal set Ps to obtain a clustering cluster set C; calculate the central solutions of each clustering cluster to obtain a cluster center set Cc; select the optimal solution from the cluster center set Cc according to the pre-stored decision preference rules to obtain an optimized decision M.
[0139] Step S423: Construct an execution plan generator, which includes a task decomposition module and a resource allocation module; decompose the optimized decision M into specific execution tasks to obtain a task sequence Ts; allocate execution resources to each task according to the pre-stored resource constraint conditions to obtain a resource allocation plan Ra; integrate the task sequence Ts and the resource allocation plan Ra to obtain an execution plan E.
[0140] Among them, the calculation formula of the Pareto optimization algorithm is: the dominance relation calculation formula Dom(x, y) = ∏i = 1, m[fi(x) ≥ fi(y)]; the non-dominated sorting score S(x) = ∑y∈P[1 - Dom(y, x)]; the crowding degree calculation D(x) = ∑i = 1, m|fi(x + 1) - fi(x - 1)| / fmax, i; where: x, y are candidate solutions in the solution space; fi is the i-th objective function; m is the number of objective functions; P is the population set; fmax, i is the maximum value of the i-th objective; Dom(x, y) represents the dominance relation of x over y; S(x) is the non-dominated sorting score; D(x) is the crowding degree.
[0141] By constructing a Pareto optimization decision-making process, the scientific optimization of the switching scheme is achieved. First, a dominance relationship analysis module and a hierarchical division module are designed. By calculating the dominance relationship between schemes and performing hierarchical processing, Pareto solution sets at different levels are obtained. Second, a clustering analysis method is used to cluster the schemes in the Pareto optimal set, and the central scheme of each cluster is calculated. This scheme screening method based on clustering can find the most representative scheme while maintaining the diversity of schemes. Finally, the optimal scheme is selected from the set of cluster centers according to the pre-stored decision preference rules, and a specific implementation scheme is formed through task decomposition and resource allocation. This decision-making method combining Pareto optimization, clustering analysis, and task decomposition not only ensures the scientificity and feasibility of the decision-making scheme but also realizes the seamless connection from decision-making to execution, providing a complete decision-making support scheme for the implementation of the water resource management mode switch.
[0142] In summary, aiming at the problem of insufficient multi-source heterogeneous data processing ability, this scheme adopts a multi-scale spatio-temporal feature extraction method: First, the Transformer imputation model is used to process data missing, then a time window sequence including three scales of hours, days, and months is constructed, and combined with wavelet transform and spatial attention mechanism to extract time features and spatial features respectively. Through the adaptive weight mechanism of the feature fusion network, the efficient integration of heterogeneous data such as hydrology, meteorology, and social economy is realized, and the multi-scale change characteristics of the data are effectively captured.
[0143] Regarding the problem of insufficient threshold adaptability, this scheme proposes a solution of dual-stream neural network + ensemble learning: First, scene division is carried out based on hierarchical clustering to establish the mapping relationship between scenes and thresholds; then, through the dual-stream neural network, the feature stream and time series stream data are processed respectively, and combined with the residual attention module to extract deep time series features; finally, the credibility of threshold prediction is evaluated through the ensemble learning framework, realizing the dynamic adjustment and adaptive optimization of the threshold.
[0144] Aiming at the problems of insufficient evaluation and optimization of switching decision uncertainty, this scheme designs an innovative method of improved LSTM + time series decision tree: The system state is predicted by the improved LSTM network and the state transition probability is calculated, combined with the time series decision tree model to calculate the switching benefit, and the time series reinforcement learning algorithm is used to optimize the switching time series, realizing the accurate evaluation of the switching behavior uncertainty and the dynamic optimization of the switching time series.
[0145] For the problems of multi-objective decision-making balance and historical effect evaluation, this scheme adopts a strategy of Pareto optimization + feedback update: A multi-objective optimization model including benefit maximization, risk minimization, and optimal resource allocation is constructed, the optimal decision-making scheme is screened by the Pareto optimization algorithm, and at the same time, a complete decision-making effect evaluation system is established, and the evaluation results are fed back and updated to the historical decision-making effect matrix to form a closed-loop decision-making optimization mechanism.
[0146] Case 1:
[0147] 1. Obtain hydrological basic data and social attribute data, construct a three-dimensional correlation matrix, and use stochastic mathematical methods for parameter calibration to obtain water resource normal-emergency management correlation characteristic data.
[0148] Obtain historical hydrological data from hydrological monitoring stations, including time series data such as precipitation, runoff, and water level, and use wavelet analysis method to preprocess the data to obtain hydrological characteristic sequence data; obtain social and economic data from a certain statistical yearbook, including population size, GDP, water use quota, etc., and use standardization processing method to obtain standardized social attribute data.
[0149] Based on the hydrological characteristic sequence data, calculate indicators such as inter-annual variation coefficient, intra-annual distribution coefficient, and wet-dry ratio, construct a hydrological characteristic index system, and obtain hydrological characteristic index data; based on the standardized social attribute data, calculate indicators such as per capita water consumption, water consumption per 10,000 yuan of GDP, and water supply guarantee rate, construct a social attribute index system, and obtain social characteristic index data.
[0150] Organize the hydrological characteristic index data and social characteristic index data in three dimensions of time, space, and management level, construct a three-dimensional correlation matrix, use principal component analysis method to extract key characteristics, and obtain initial correlation matrix data; apply Monte Carlo simulation method to the initial correlation matrix data for parameter sensitivity analysis and uncertainty quantification, and obtain water resource normal-emergency management correlation characteristic data.
[0151] 2. Based on the fuzzy mathematics theory, construct an evaluation model to conduct a fuzzy comprehensive evaluation of the water resource management status and obtain management status discrimination data.
[0152] Use the water resource normal-emergency management correlation characteristic data to establish a fuzzy evaluation factor set and a comment set, use the fuzzy analytic hierarchy process to determine the weight coefficients, and obtain fuzzy evaluation matrix data; based on the management status annotation data in the historical case library, construct a fuzzy rule base and obtain fuzzy rule data.
[0153] Input the fuzzy evaluation matrix data into the fuzzy inference system, conduct fuzzy composition operations based on the fuzzy rule data, and obtain fuzzy evaluation result data; conduct defuzzification processing on the fuzzy evaluation result data, and use the maximum membership degree method to determine the management status category to obtain management status discrimination data.
[0154] 3. Construct a deep neural network model to realize the adaptive switching of the water resource normal-emergency management mode and obtain management mode switching strategy data.
[0155] Divide the associated feature data of normal-emergency water resource management and the discriminant data of management status into a training set and a test set according to a ratio of 7:3. Use the sliding time window method to construct sample sequences to obtain model training data and model test data.
[0156] Construct a deep neural network model containing an LSTM layer and an attention mechanism. Input the model training data, and use the Adam optimizer to train the model to obtain the initial model parameter data; input the model test data for verification, and use the cross-validation method to optimize the model parameters to obtain the optimized model parameter data.
[0157] Input the real-time monitored hydrological feature sequence data and social feature index data into the trained deep neural network model, perform forward calculation based on the optimized model parameter data to obtain the management mode switching probability, and combine the predefined switching threshold to generate the management mode switching strategy data.
[0158] IV. Construct an online learning and feedback mechanism to continuously optimize the model performance and obtain updated model parameter data.
[0159] Collect the actual effect feedback data after the management mode switching, including indicators such as the water supply guarantee rate, flood control safety level, and water resource utilization efficiency, construct a multi-objective evaluation system, and obtain the mode switching effect evaluation data.
[0160] Compare and analyze the mode switching effect evaluation data with the expected goals, calculate the performance difference, use the reinforcement learning method to update the model weights to obtain the model weight adjustment data; perform online fine-tuning on the deep neural network model based on the model weight adjustment data to obtain the updated model parameter data.
[0161] As can be seen from Example 1, some methods can be implemented by other methods, not limited to the methods described above.
[0162] Case 2: STEP1. Multi-scale data preprocessing and feature extraction
[0163] STEP11. Data collection and preliminary preprocessing
[0164] Collect the original monitoring data set D (including hydrological, meteorological, and socio-economic data), including:
[0165] Read the original hydrological data Dh (flow, water level, rainfall, etc.), meteorological data Dm (temperature, humidity, air pressure, etc.), and socio-economic data De (water consumption, population, GDP, etc.); perform data cleaning to remove outliers to obtain the cleaned data set Dc; use an improved Transformer imputation model to fill in the missing data to obtain the complete data set Df.
[0166] STEP12. Multi-scale feature extraction
[0167] Read the complete dataset Df, construct a time window sequence W = {w1, w2,..., wn}, where wi represents different time scales (hours, days, months); for each time window wi, use wavelet transform to extract time features to obtain a time feature set Ft; use an improved spatial attention mechanism to extract spatial features to obtain a spatial feature set Fs; fuse Ft and Fs to generate an initial feature matrix Fi;
[0168] STEP13. Feature Optimization and Correlation Analysis
[0169] Read the initial feature matrix Fi; use the multi-head self-attention mechanism to calculate the correlation strength between features to obtain a correlation strength matrix A; based on the correlation strength matrix A, use an improved feature selection algorithm to obtain an optimized feature matrix Fo; construct a spatio-temporal graph network G, and use the graph attention network to extract the spatio-temporal correlation matrix R Output: a standardized feature matrix F (obtained by standardizing Fo) and a spatio-temporal correlation matrix R;
[0170] STEP2. Construction of a Dynamic Threshold Prediction Model
[0171] STEP21. Threshold Initialization
[0172] Read the standardized feature matrix F and the spatio-temporal correlation matrix R; use the hierarchical clustering algorithm to divide the historical data into scenarios to obtain a scenario category set K; for each scenario k ∈ K, calculate the initial threshold to obtain an initial threshold set Ti; construct a scenario-threshold mapping relationship to obtain a mapping matrix M;
[0173] STEP22. Dynamic Threshold Learning
[0174] Read the initial threshold set Ti and the mapping matrix M; construct a two-stream neural network model N, including a feature stream and a time series stream. Use an improved residual attention module to extract time series features to obtain a time series feature vector St; fuse St and the scenario features to predict the dynamic threshold to obtain a threshold prediction value Tp.
[0175] STEP23. Threshold Credibility Evaluation
[0176] Read the threshold prediction value Tp; construct an ensemble learning framework, including multiple base learners; calculate the uncertainty of the prediction value to obtain an uncertainty index U; calculate the credibility score based on U to obtain a threshold credibility index C Output: a dynamic threshold vector T (composed of Tp) and a threshold credibility index C;
[0177] STEP3. Design of a Predictive Switching Mechanism
[0178] STEP31. State Prediction
[0179] Read the dynamic threshold vector T and the real-time monitored data stream; construct the state prediction model P using the improved LSTM network; predict the system state in the future time window to obtain the state sequence Sq; calculate the state transition probability to obtain the transition probability matrix Pm.
[0180] STEP32. Switching Timing Optimization
[0181] Read the state sequence Sq, the transition probability matrix Pm, and the threshold credibility index C; construct the time series decision tree model D; calculate the switching benefits at each time point to obtain the benefit vector B; use the improved time series reinforcement learning algorithm to optimize the switching timing to obtain the optimized timing sequence O.
[0182] STEP33. Switching Probability Evaluation
[0183] Read the optimized timing sequence O and the state sequence Sq; construct the probability evaluation model E; calculate the switching probability distribution to obtain the probability distribution vector P Output: the switching probability distribution P and the optimal switching timing O.
[0184] STEP4. Switching Decision Optimization and Execution
[0185] STEP41. Decision Generation
[0186] Read the switching probability distribution P, the optimal switching timing O, and the historical decision effect matrix H; construct the multi-objective optimization model Z; generate the candidate decision set to obtain the decision set D; evaluate the risks and benefits of each decision plan to obtain the evaluation matrix V.
[0187] STEP42. Decision Optimization
[0188] Read the decision set D and the evaluation matrix V; use the improved Pareto optimization algorithm to screen the decision plans; calculate the optimal decision plan to obtain the optimized decision M; generate the decision execution suggestion to obtain the execution plan E.
[0189] STEP43. Effect Evaluation and Feedback.
[0190] Read the optimized decision M and the execution plan E; construct the evaluation index system S; calculate the decision effect score to obtain the effect score R; update the historical decision effect matrix to obtain the updated matrix H' Output: the management mode switching instruction M and the switching risk assessment report E.
[0191] Case 3: In a certain scenario, the data processing process is as follows.
[0192] The system data collection is configured as follows: 50 hydrological monitoring stations (water level, flow rate, water quality) and 30 meteorological stations (rainfall, temperature, humidity), with a sampling frequency of once every 5 minutes. First, the original data is preprocessed. The hydrological data matrix Xh (50×288) and the meteorological data matrix Xm (30×288) are checked by the 3σ rule and professional rules, and 37 abnormal points and 25 incorrect data are removed respectively. A 6-layer 8-head Transformer model (time step 12) is used for data imputation, and the imputation accuracy RMSE reaches 0.15. Feature extraction adopts a multi-scale strategy: window sequences of [1h, 3h, 6h], [1d, 3d, 7d], [1m, 3m] are constructed in the time dimension, and frequency features (120 dimensions), statistical features (40 dimensions), periodic features (120 dimensions), trend features (40 dimensions), and long-term change features (40 dimensions) are extracted through wavelet transform respectively; a 50×30 correlation matrix is constructed in the spatial dimension, and 256-dimensional spatial features are extracted through an 8-head attention network (dk = 32, dv = 32).
[0193] During the dynamic threshold learning process, first, the K-means algorithm (k = 5, 20 iterations) is used for scenario division, and then a two-stream neural network is constructed: the feature stream adopts a 3-layer CNN (64-128-256, dropout = 0.3), and the time series stream adopts a 2-layer BiLSTM (128-64) and a 64-dimensional attention layer. The initial threshold matrix T (5×4) contains thresholds for four dimensions: water level, supply-demand ratio, water quality, and cost, and is dynamically adjusted every 6 hours (range ±10%). State prediction adopts an improved three-layer LSTM network (128-64-32 neurons) to predict the system state in the next 24 hours; a 4-layer time series decision tree (minimum sample number 100, information gain ratio splitting, α = 0.01 pruning) is constructed to optimize the switching time series, and the benefit calculation includes the immediate benefit Ri (water supply guarantee rate w1 = 0.4, operating cost w2 = 0.3, system stability w3 = 0.3) and the delayed benefit Rd (discount factor γ = 0.9, time window T = 12h).
[0194] Finally, the three-objective model (maximizing the water supply guarantee rate, minimizing the system risk degree, and minimizing the operating cost) is adopted for decision optimization, and the constraint conditions include water balance, water quality compliance, energy consumption, and time requirements. The Pareto optimization algorithm (population size 100, number of evolutionary generations 50, Pc = 0.8, Pm = 0.1) is used to generate 15 candidate solutions, and an evaluation matrix E (15×5) is constructed to comprehensively evaluate from five dimensions: technical feasibility, economic rationality, operation difficulty, risk degree, and response time. The actual operation results of the system show that the mode switching accuracy reaches 95.3%, the average response time is 28.5 minutes, the false alarm rate is reduced to 2.8%, the system stability is improved by 15.2%, the operating cost is reduced by 11.8%, and the water supply guarantee rate is improved by 3.7%.
[0195] The preferred embodiments of the present invention have been described in detail above. However, the present invention is not limited to the specific details in the above embodiments. Within the scope of the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all fall within the protection scope of the present invention.
[0196] In addition, it should be particularly noted that for clearly showing the step flow of the present invention, serial numbers are marked for each step in the specification. These serial numbers are only for the convenience of description and do not limit the execution order of the steps. In actual operation, according to the technical requirements of the specific implementation scenario, the steps can be executed in an order different from that shown in the specification / specification drawings, and in some cases, parallel processing between steps can also be achieved.
Claims
1. A method for adaptively switching between emergency and normal management modes of water resources based on machine learning, characterized in that: The following steps are involved: The original monitoring data containing hydrological, meteorological and socio-economic information are obtained and processed to obtain the initial feature matrix and spatiotemporal correlation matrix, which are as follows: The original monitoring data set containing hydrological, meteorological and socio-economic information is obtained, and the data is cleaned and filled to obtain a complete data set; based on the complete data set, a time window is constructed to extract time features, and spatial features are extracted to obtain an initial feature matrix; based on the initial feature matrix, the correlation strength between features is calculated and feature optimization is performed to obtain a standardized feature matrix and a spatiotemporal correlation matrix; The initial feature matrix and spatiotemporal correlation matrix are divided into scenes, and a two-stream neural network containing feature stream and time series stream is constructed. The time series stream uses a residual attention module to obtain a dynamic threshold vector, which is: According to the standardized feature matrix and spatiotemporal correlation matrix, the historical data is divided into scenes and the initial threshold is calculated to obtain the initial threshold set and mapping matrix; based on this, a two-stream neural network is constructed to perform dynamic threshold learning to obtain the threshold prediction value; according to the threshold prediction value, its credibility is evaluated through an integrated learning framework to obtain the dynamic threshold vector and threshold credibility index; According to the dynamic threshold vector, the system state is predicted and the switching timing is optimized to generate the management mode switching instruction, which is as follows: According to the dynamic threshold vector, threshold credibility index and real-time monitoring data flow, the improved LSTM network is used to predict the system state, and the state sequence and transition probability matrix are obtained. Based on the state sequence, transition probability matrix and threshold credibility index, the timing decision tree model is used to optimize the switching timing and obtain the optimized timing sequence. According to the optimized timing sequence and state sequence, the switching probability is evaluated, and finally the switching probability distribution and the optimal switching timing are obtained. Based on the switching probability distribution, optimal switching sequence and historical decision effect matrix, a multi-objective optimization model is used to generate and evaluate candidate decision plans to obtain a decision set and an evaluation matrix; the Pareto optimization algorithm is used to process the decision set and the evaluation matrix to obtain an optimized decision and an execution plan; based on the optimized decision and execution plan, the decision effect is evaluated and historical data is updated to obtain a management mode switching instruction and a switching risk assessment report; Among them, the steps to generate a switching risk assessment report are: Construct a multi-objective optimization model, including three objective functions: benefit maximization, risk minimization, and optimal resource allocation; Generate candidate decision plans based on the switching probability distribution and the optimized timing sequence; The Pareto optimization algorithm is used to optimize the candidate decision plans and obtain the optimal decision; Calculate the indicator values of the optimization decision in the dimensions of benefit, risk and resource allocation, and generate a switching risk assessment report.
2. The method according to claim 1, characterized in that The steps of obtaining the initial feature matrix and the spatiotemporal correlation matrix include: Extract characteristic matrices from the original monitoring data set, including hydrological characteristic matrix, meteorological characteristic matrix and socio-economic characteristic matrix; The statistical detection module and the rule detection module are used to construct an outlier detector, and the feature matrix is cleaned for outliers to obtain a cleaned data set. The improved Transformer interpolation model is used to fill the missing data in the cleaned data set to obtain a complete data set; Construct a multi-scale time window sequence based on the complete data set, and use wavelet transform to obtain the time feature set; The spatial feature set is obtained by processing the complete dataset using the spatial attention mechanism; The temporal feature set and the spatial feature set are fused to generate the initial feature matrix and the spatiotemporal correlation matrix.
3. The method according to claim 2, characterized in that The steps to construct a multi-scale time window sequence include: Extracting time window benchmark parameters from a pre-stored time parameter library, including hourly scale parameters, daily scale parameters, and monthly scale parameters; Sliding split the complete data set according to the time window benchmark parameters to generate hourly, daily, and monthly time window sequences; The time window sequences of three scales are combined to obtain a multi-scale time window sequence.
4. The method according to claim 1, characterized in that The steps of scene division include: A hierarchical clustering algorithm is used to process the initial feature matrix and spatiotemporal correlation matrix to obtain a set of scene categories; Calculate the initial threshold for each scene in the scene category set to obtain an initial threshold set; According to the scene category set and the initial threshold set, the corresponding relationship between the scene and the threshold is established to obtain the mapping matrix.
5. The method according to claim 1, characterized in that The steps to build a two-stream neural network include: Construct feature flow network and time series flow network, convert the mapping matrix into feature data sequence, and arrange the initial threshold set in chronological order to obtain the time series data sequence; The temporal stream network contains a residual attention module of L residual blocks, each of which contains an attention sublayer and a feedforward sublayer; Construct a feature fusion module, including a feature mapping module and a feature aggregation module, and use a gating mechanism to adaptively fuse the outputs of the feature stream and the time series stream to obtain a fused feature vector; The fused feature vector is mapped to the threshold space through the fully connected layer to obtain the dynamic threshold vector and threshold credibility index.
6. The method according to claim 5, characterized in that The processing steps of the temporal flow network include: Input the time series data sequence into the first residual block, calculate the attention weight and perform residual connection to obtain the intermediate features; The intermediate features are sequentially input into the subsequent residual blocks, and the deep temporal features are extracted layer by layer to obtain L intermediate feature sequences; The L intermediate feature sequences are weighted combined to obtain the time series feature vector.
7. The method according to claim 1, characterized in that The steps to predict the system state include: Construct an improved LSTM unit containing input gate, forget gate and output gate; The improved LSTM unit is used to perform sliding segmentation and normalization on the real-time monitoring data stream to obtain a standardized sequence; Construct a multi-layer LSTM prediction network, including a state encoding layer, a feature extraction layer, and a prediction output layer; The standardized sequence and dynamic threshold vector are input into the multi-layer LSTM prediction network, and the attention mechanism is used to obtain the prediction state sequence; The state transition probability is calculated according to the predicted state sequence to obtain the transition probability matrix.
8. The method according to claim 7, characterized in that The steps to optimize switching timing include: Construct a time series decision tree model, process the predicted state sequence and transition probability matrix, calculate the switching benefits at each time point, and obtain the benefit vector; Define the switching action space according to the benefit vector, and use the policy gradient method to optimize the switching strategy; Select the optimal switching sequence according to the optimization strategy to obtain the optimized timing sequence; Construct a probability evaluation model to process the optimized timing sequence and calculate the switching probability distribution.
9. The method according to claim 2, characterized in that The steps of obtaining the initial feature matrix and the spatiotemporal correlation matrix specifically include: After obtaining the initial feature matrix, the multi-head self-attention mechanism is used to calculate the correlation strength between features to obtain the correlation strength matrix; Perform feature selection based on the correlation strength matrix to obtain an optimized feature matrix; The optimized feature matrix is standardized to obtain a standardized feature matrix; The optimized feature matrix is constructed as a spatiotemporal graph network and processed using a graph attention network to obtain a spatiotemporal correlation matrix.
10. The method according to claim 5, characterized in that Before obtaining the dynamic threshold vector, the following steps are also included: Construct an integrated learning framework consisting of multiple base learners; Use the ensemble learning framework to process the fused feature vector, calculate its prediction uncertainty, and obtain the uncertainty index; Calculate the credibility score according to the uncertainty index to obtain the threshold credibility index; A dynamic threshold vector is generated based on the fused feature vector and the threshold credibility indicator.
11. The method according to claim 1, characterized in that The Pareto optimization algorithm is used to optimize the candidate decision-making schemes. The steps to obtain the optimized decision include: Calculate the dominance relationship between the solutions and obtain the dominance matrix; The dominance matrix is hierarchically processed to divide the schemes into different Pareto levels and obtain a level sequence; Extract the first-level non-dominated solutions from the level sequence and obtain the Pareto optimal set; Perform cluster analysis on the solutions in the Pareto optimal set, select the best solution from the cluster center, and obtain the optimal decision.
Citation Information
Patent Citations
Unmanned aerial vehicle-based river hydrological sampling inspection method and system
CN119151387A
HBase client main and standby switching method and system based on fault perception
CN119537484A