Water resource emergency-normal state management mode self-adaptive switching method based on machine learning

Through machine learning-based methods, multi-source heterogeneous water resource data are processed, dual-flow neural networks and improved LSTM networks are built, 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 effectively evaluate uncertainty and risks in the decision-making process, and achieves efficient and reliable water resource management mode switching.

CN119886473AActive Publication Date: 2025-04-25CHINA INST OF WATER RESOURCES & HYDROPOWER RES

Patent Information

Application Number
CN202510378758.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-04-25
Estimated Expiration
2045-03-28

AI Technical Summary

Technical Problem

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.

Method used

Using a machine learning-based method, we use raw monitoring data containing hydrological, meteorological and socioeconomic information, perform data processing and feature extraction, and build a dual-stream neural network for dynamic threshold learning, and combine the improved LSTM network and timing decision tree model to optimize the switching timing and generate management mode switching instructions.

Benefits of technology

It realizes intelligent switching of management mode, improves the scientificity and reliability of switching decisions, enhances the ability to respond to water resources systems, optimizes resource allocation efficiency during normal operation, and ensures regional water safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119886473A_ABST
    Figure CN119886473A_ABST
Patent Text Reader

Abstract

The invention provides a water resource emergency-normal management mode adaptive switching method based on machine learning, and the method comprises the following steps: obtaining original monitoring data, carrying out the preprocessing, and constructing spatial-temporal features; performing scene division and dynamic threshold learning based on the feature matrix; an improved LSTM network model is adopted to predict a system state and optimize a switching time sequence; and generating a decision scheme based on multi-objective optimization and performing risk assessment. According to the method, intelligent switching of the management modes is realized through a multi-source data fusion and deep learning method, the scientificity and reliability of switching decisions are improved, and the practical value is relatively high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to machine learning, and in particular to a method for adaptively switching between emergency and normal management modes of water resources based on machine learning. Background Art

[0002] The switching between emergency mode and normal mode of water resources management is a key link in ensuring water supply security. With the intensification of climate change and the acceleration of urbanization, the uncertainty and risks faced by the water resources system are increasing, which puts higher requirements on the scientificity and timeliness of management mode switching. Effective mode switching can not only improve the response capacity of the water resources system, but also optimize the resource allocation efficiency during normal operation, which is of great significance to ensuring regional water security.

[0003] At present, the switching of water resources management modes mainly relies on preset thresholds and expert experience for judgment. Traditional methods usually adopt rule-based switching strategies, combining hydrological and meteorological monitoring data and historical experience thresholds to build simple decision-making models. Some studies have begun to introduce machine learning methods, such as support vector machines (SVM) and artificial neural networks (ANN), to extract hydrological characteristics and predict system status. However, these methods often treat time series data as independent samples, ignoring the temporal and spatial correlation between data, and the threshold setting lacks a dynamic adjustment mechanism.

[0004] The existing technology has the following specific problems: First, the processing capability of multi-source heterogeneous data is insufficient, especially when processing high-dimensional and non-stationary hydrological and meteorological data, it is difficult to effectively extract spatiotemporal features and capture the changing patterns at different scales; second, the threshold determination lacks adaptive capability, and fails to fully consider the impact of system dynamic characteristics and external environmental changes on the threshold, resulting in insufficient adaptability of switching decisions; third, the uncertainty and risk of switching behavior are not effectively evaluated during the decision-making process, and there is a lack of reliable switching timing optimization mechanism, which can easily cause decision oscillation or miss the best switching opportunity; fourth, the existing methods often use simple linear weighting when dealing with multi-objective decision-making, which makes it difficult to balance multiple objectives such as benefits, risks and resource allocation, and lack a systematic evaluation and feedback mechanism for the effects of historical decisions. Summary of the invention

[0005] The purpose of the invention is to provide a method for adaptively switching between water resources emergency and normal management modes based on machine learning, in order to solve at least one technical problem existing in the prior art.

[0006] Technical solution, a method for adaptively switching water resource management modes based on machine learning, comprising the following steps: 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; The initial feature matrix and spatiotemporal correlation matrix are divided into scenes, and a two-stream neural network including feature stream and time series stream is constructed. The time series stream uses a residual attention module to obtain a dynamic threshold vector. The system state is predicted and the switching timing is optimized according to the dynamic threshold vector, and the management mode switching instruction is generated.

[0007] According to one aspect of the present application, the step of obtaining an initial feature matrix and a spatiotemporal correlation matrix includes: 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.

[0008] According to one aspect of the present application, the step of constructing a multi-scale time window sequence includes: 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.

[0009] According to one aspect of the present application, the step of scene division includes: 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.

[0010] According to one aspect of the present application, the steps of constructing 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.

[0011] According to one aspect of the present application, the processing steps of the time sequence 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.

[0012] According to one aspect of the present application, the step of predicting the system state includes: 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.

[0013] According to one aspect of the present application, the step of optimizing the switching timing includes: 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.

[0014] According to one aspect of the present application, the step of generating a handover risk assessment report is also included: 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.

[0015] According to one aspect of the present application, 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.

[0016] According to one aspect of the present application, before obtaining the dynamic threshold vector, the method further includes: 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.

[0017] According to one aspect of the present application, the Pareto optimization algorithm is used to optimize the candidate decision solutions, and the steps of obtaining 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.

[0018] Beneficial effect: through multi-source data fusion and deep learning methods, intelligent switching of management modes is realized, the scientificity and reliability of switching decisions are improved, and it has strong practical value. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a flow chart of the present invention.

[0020] Figure 2 It is a flow chart of obtaining the initial feature matrix and the spatiotemporal correlation matrix of the present invention.

[0021] Figure 3 It is a flow chart of constructing a multi-scale time window sequence in the present invention.

[0022] Figure 4 It is a flow chart of scene division of the present invention.

[0023] Figure 5 It is a flow chart of the dual-stream neural network construction of the present invention. DETAILED DESCRIPTION

[0024] like Figure 1 As shown, The adaptive switching method of water resources emergency-normal management mode based on machine learning includes: Step S1, obtain the original monitoring data set containing hydrological, meteorological and socio-economic information, perform data cleaning and filling processing on it to obtain a complete data set; based on the complete data set, construct a time window to extract time features, and extract spatial features to obtain an initial feature matrix; based on the initial feature matrix, calculate the correlation strength between features and perform feature optimization to obtain a standardized feature matrix and a spatiotemporal correlation matrix.

[0025] Step S2, according to the standardized feature matrix and the spatiotemporal correlation matrix, the historical data is divided into scenes and the initial threshold is calculated to obtain the initial threshold set and the mapping matrix; based on the initial threshold set and the mapping matrix, 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 the integrated learning framework, and finally the dynamic threshold vector and threshold credibility index are obtained.

[0026] Step S3, according to the dynamic threshold vector, the threshold credibility index and the real-time monitoring data flow, the improved LSTM network is used to predict the system state to obtain the state sequence and the transition probability matrix; based on the state sequence, the transition probability matrix and the threshold credibility index, the timing decision tree model is used to optimize the switching timing to obtain the optimized timing sequence; according to the optimized timing sequence and the state sequence, the switching probability is evaluated to finally obtain the switching probability distribution and the optimal switching timing.

[0027] Step S4, based on the switching probability distribution, the optimal switching timing and the 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; the decision effect is evaluated and historical data is updated based on the optimized decision and execution plan, and finally a management mode switching instruction and a switching risk assessment report are obtained.

[0028] By building a complete data-driven adaptive switching framework for water resources management mode, the whole process from data processing, feature extraction, threshold learning to decision optimization is intelligentized. First, at the data level, through multi-scale spatiotemporal feature extraction and optimization, a comprehensive expression of the dynamic characteristics of the hydrological system is established; secondly, at the model level, a two-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 level, through multi-objective optimization and Pareto decision methods, the scientific generation and optimization of switching schemes are achieved. The entire technical solution: 1) realizes the transition from static thresholds to dynamic thresholds, improving the adaptability of switching decisions; 2) establishes a credibility assessment mechanism, providing a quantitative basis for decision-making risks; 3) constructs a multi-objective optimization framework to ensure the scientificity and balance of decision-making; 4) designs a historical experience update mechanism to achieve continuous improvement of decision-making effects. The intelligent level and decision-making efficiency of the water resources emergency-normal management mode switching have been significantly improved, providing strong technical support for scientific decision-making in water resources management.

[0029] According to one aspect of the present application, step S1 specifically comprises: Step S11, obtaining the original monitoring data set containing hydrological, meteorological and socio-economic information, and extracting hydrological data, meteorological data and socio-economic data therefrom respectively; cleaning the extracted data for outliers to obtain a cleaned data set; and using the Transformer interpolation model to fill in the missing data in the cleaned data set to obtain a complete data set.

[0030] Step S12, based on the complete data set, construct a time window sequence containing hour, day, and month 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 the 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.

[0031] Step S13, according to the initial feature matrix, a multi-head self-attention mechanism is used to calculate the correlation strength between features to obtain a correlation strength matrix; feature selection is performed based on the correlation strength matrix to obtain an optimized 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; the optimized feature matrix is ​​standardized to obtain a standardized feature matrix.

[0032] Among them, the multi-head attention calculation formula 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 item of the adjacency matrix; WQi, WKi, 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; X is the input feature matrix.

[0033] By constructing a complete data preprocessing process including data cleaning, spatiotemporal feature extraction and feature optimization, the original monitoring data is first processed using outlier detection and Transformer interpolation models to ensure the integrity and reliability of the data and avoid the impact of missing data and outliers on subsequent analysis. Subsequently, by constructing a multi-scale time window and applying wavelet transform, the dynamic characteristics and periodic change laws at different time scales can be captured. At the same time, the spatial attention mechanism is used to extract the correlation features of the spatial dimension, realizing the multi-dimensional expression of spatiotemporal features. Finally, the multi-head self-attention mechanism is used to calculate the correlation strength between features and perform feature optimization, which not only reduces the redundancy of the data, but also retains the key correlation information between features. By constructing a spatiotemporal graph network and applying a graph attention network, the spatiotemporal consistency of feature expression is further enhanced. This multi-level feature extraction and optimization method provides high-quality input data for subsequent scene division and threshold learning, and significantly improves the accuracy and reliability of water resources management mode switching decisions.

[0034] According to one aspect of the present application, step S2 is specifically: Step S21, using a hierarchical clustering algorithm to process the standardized feature matrix and the spatiotemporal correlation matrix to obtain a scene category set; calculating an initial threshold for each scene in the scene category set to obtain an initial threshold set; establishing a correspondence between scenes and thresholds based on the scene category set and the initial threshold set to obtain a mapping matrix.

[0035] Step S22, based on the initial threshold set and the mapping matrix, construct a two-stream neural network including a feature stream and a time series stream; use the residual attention module to process the time series data to obtain a time series feature vector; fuse the time series feature vector with the scene feature to obtain a threshold prediction value.

[0036] Among them, the two-stream neural network is: the spatiotemporal feature fusion formula F = α·Ft + (1-α)·Fs + β·(Ft×Fs); where: Ft is the time series 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.

[0037] Step S23, construct an integrated 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.

[0038] This step achieves accurate prediction and credibility assessment of the threshold for switching water resource management modes by constructing a dynamic threshold learning mechanism based on scenario division and two-stream neural network. First, the hierarchical clustering algorithm is used to divide the standardized feature matrix into scenarios, which can identify the characteristic patterns under different management scenarios and establish the mapping relationship between scenarios and thresholds, providing a scenario-based basis for threshold learning. Secondly, a two-stream neural network structure containing feature streams and time series streams is designed, in which the feature stream processes the scene feature information, and the time series stream captures the time series evolution characteristics through the residual attention module. The information of the two streams can fully express the dynamic change characteristics of the scene after fusion processing. Finally, by constructing an integrated learning framework to evaluate the credibility of the threshold prediction, not only the prediction threshold but also the corresponding credibility index is obtained. This measurable uncertainty assessment mechanism can provide a more reliable reference for management decisions and effectively reduce the decision-making risk. The whole step realizes the transition from static threshold to dynamic threshold, so that the switching threshold can be adaptively adjusted as the scenario changes, significantly improving the adaptability and robustness of water resource management mode switching.

[0039] According to one aspect of the present application, step S3 is specifically: Step S31, using an improved LSTM network to process dynamic threshold vectors and real-time monitoring data streams, predicting the system state in the future time window, and obtaining a state sequence; calculating the state transition probability according to the state sequence, and obtaining a transition probability matrix.

[0040] Step S32, construct a time series decision tree model, process the state sequence, transition probability matrix and threshold credibility index, calculate the switching benefit at each time point, and obtain a benefit vector; use a time series reinforcement learning algorithm to optimize the benefit vector to obtain an optimized time series sequence.

[0041] Step S33, constructing a probability evaluation model, processing the optimized timing sequence and state sequence, calculating the switching probability distribution, and obtaining the switching probability distribution; determining the optimized timing sequence as the optimal switching timing sequence.

[0042] By constructing an improved LSTM network and a sequential decision optimization framework, accurate prediction of the system state and optimization of the switching timing are achieved. First, the improved LSTM unit structure, including the design of input gates, forget gates, and output gates, is adopted, so that the network can better handle long-term dependencies and improve the ability to capture the long-term evolution characteristics of the water resources system. On this basis, a multi-layer LSTM prediction network is constructed. Through the hierarchical processing of the state encoding layer, feature extraction layer, and prediction output layer, combined with the attention mechanism, it can not only accurately predict the system state of the future time window, but also obtain the state transition probability matrix, providing probabilistic support for the switching decision. Subsequently, the sequential decision tree model and sequential reinforcement learning algorithm are used to optimize the switching timing. By calculating the switching benefits at each time point and optimizing the switching strategy, the optimal switching timing is found. This method of combining state prediction and sequential optimization not only ensures the accurate grasp of the evolution of the system state, but also realizes the optimal choice of the switching timing, significantly improving the scientificity and timeliness of the switching of the water resources emergency-normal management mode.

[0043] According to one aspect of the present application, step S4 is specifically: Step S41, construct a multi-objective optimization model, process the switching probability distribution, the optimal switching timing and the historical decision effect matrix, generate candidate decision plans, and obtain a decision set; perform risk and benefit evaluation on the plans in the decision set to obtain an evaluation matrix.

[0044] Step S42, using the Pareto optimization algorithm to process the decision set and the evaluation matrix, screen the best decision plan, and obtain the optimized decision; generate specific execution suggestions based on the optimized decision to obtain the execution plan.

[0045] Step S43, construct an evaluation index system, calculate the decision effect score according to the optimized decision and the execution plan, and obtain the effect score; use the effect score to update the historical decision effect data 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.

[0046] 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.

[0047] According to one aspect of the present application, S11 specifically includes: 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.

[0048] 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.

[0049] 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.

[0050] Among them, the improved Transformer interpolation model is: the spatiotemporal 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.

[0051] By building a complete data preprocessing process, high-quality cleaning and filling of original monitoring data is achieved. First, the format is checked and unified according to the pre-stored data format template to ensure the format consistency of data from different sources; then, a dual outlier detection mechanism including a statistical detection module and a rule detection module is designed. Through statistical analysis based on the 3σ criterion and rule verification combined with a professional rule library, abnormal data can be comprehensively identified and eliminated. Finally, the improved Transformer interpolation model is used to fill in the missing data. The model calculates the spatiotemporal correlation between data through the attention mechanism and obtains the correlation weight matrix, so that the data filling process fully considers the spatiotemporal correlation characteristics. Compared with traditional interpolation methods, missing values ​​can be inferred more accurately. This data preprocessing method based on the combination of statistical rules and deep learning not only ensures the integrity and reliability of the data, but also maintains the spatiotemporal correlation characteristics of the data, providing a high-quality data foundation for subsequent feature extraction and model training, and significantly improving the reliability of data support for water resources management decisions.

[0052] According to one aspect of the present application, step S12 is specifically: Step S121, extracting time window benchmark parameters from the pre-stored time parameter library, including hourly scale parameter h, daily scale parameter d, and monthly scale parameter m; performing sliding segmentation on the complete data set according to the time window benchmark parameters to generate hourly time window sequence Wh, daily time window sequence Wd, and monthly time window sequence Wm; combining the time window sequences of the three scales to obtain a multi-scale time window sequence W.

[0053] Step S122, using wavelet transform to process the data in the multi-scale time window sequence W, first calculate the wavelet coefficients in each time window to obtain a wavelet coefficient matrix; reconstruct the wavelet coefficient matrix, extract the time characteristics of different frequency components, and obtain a frequency feature set; based on the frequency feature set, calculate the statistical characteristics of the time series, including mean, variance, skewness and kurtosis, to obtain a statistical feature set; combine the frequency feature set and the statistical feature set to obtain a time feature set Ft.

[0054] Step S123, construct a spatial attention network based on the pre-stored spatial relationship library, which includes K attention heads; for each attention head k, calculate the query matrix Q, key matrix K and 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 data set to obtain K groups of spatial feature subsets; perform weighted fusion on the K groups of spatial feature subsets to obtain the spatial feature set Fs.

[0055] Among them, the spatial attention calculation formula SAtt(X) = σ(f(max(X), avg(X)))OX; where: X is the input feature matrix with dimension C×H×W; f(·) is a 1×1 convolution operation for feature dimensionality reduction; max(X) is the maximum pooling result in the channel dimension; avg(X) is the average pooling result in the channel dimension; σ is the sigmoid activation function; O is element-by-element multiplication; C is the number of feature channels; H is the feature map height; W is the feature map width.

[0056] Step S124, construct a feature fusion network, which includes a feature mapping layer and a feature integration layer; input the temporal feature set Ft obtained in step S122 into the feature mapping layer to obtain a temporal 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, an adaptive weight mechanism is used to fuse the temporal feature mapping matrix Mt and the spatial feature mapping matrix Ms to obtain an initial feature matrix.

[0057] By constructing a multi-scale spatiotemporal feature extraction framework, the dynamic characteristics of the water resource system are fully captured. First, a time window sequence containing three scales of hours, days, and months is constructed based on the pre-stored time parameter library. The hierarchical extraction of features of different time scales is achieved through sliding segmentation, which can simultaneously capture short-term fluctuations and long-term evolution characteristics. Secondly, the data of each time window is processed by wavelet transform, which not only extracts the time characteristics of different frequency components, but also calculates the statistical characteristics, realizing the multi-dimensional expression of time series characteristics. At the same time, a spatial attention network containing 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, the temporal features and spatial features are adaptively weighted fused through the feature fusion network, which not only maintains the independence of the features, but also realizes the complementary enhancement of the features. This multi-scale and multi-dimensional feature extraction method can comprehensively characterize the dynamic characteristics of the water resource system and provide strong feature support for accurate state prediction and management mode switching.

[0058] According to one aspect of the present application, step S22 is specifically: Step S221, construct a two-stream neural network based on the 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 pack the time series data sequence Dt and the feature data sequence Df into fixed-size data batches respectively to obtain a time series batch set Bt and a feature batch set Bf.

[0059] Step S222, construct a residual attention module containing L residual blocks, each residual block contains an attention sublayer and a feedforward sublayer; 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 the intermediate feature H1; input the intermediate feature H1 into the subsequent residual blocks in turn, extract the deep time series features layer by layer, and obtain L intermediate feature sequences; perform weighted combination of the L intermediate feature sequences to obtain the time series feature vector St.

[0060] 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 layer normalization; MLP is the multi-layer perceptron; H is the output feature; residual attention weight w = σ(fc2(ReLU(fc1(AvgPool(X))))); fc1 and fc2 are fully connected layers; σ is the sigmoid function.

[0061] 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 time series feature vector St and the feature mapping vector Vf obtained in step S222 into the feature aggregation module, and use a gating mechanism to adaptively fuse them to obtain a fused feature vector F; map the fused feature vector F to the threshold space through a fully connected layer to obtain a threshold prediction value Tp.

[0062] By designing a two-stream neural network structure, the effective fusion of scene features and time series features is achieved. First, a two-stream neural network is constructed based on the pre-stored network configuration library, and two processing branches, feature stream and time series stream, are designed respectively. The efficient batch processing of data is achieved through the data batch generator. Among them, the time series stream branch adopts a residual attention module containing L residual blocks. Each residual block can extract deep time series features layer by layer through the combination of attention sublayer and feedforward sublayer. The design of residual connection effectively avoids the gradient disappearance problem of deep network. The feature fuser realizes adaptive fusion of features through feature mapping module and feature aggregation module by adopting gating mechanism. This gating-based fusion method can dynamically adjust the fusion weight according to the importance of the feature, and improves the expression ability of the fusion feature. This innovative network structure design not only realizes the effective fusion of scene features and time series 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.

[0063] According to one aspect of the present application, step S31 is specifically: Step S311, load the LSTM network infrastructure parameters from the 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 unit including an input gate, a forget gate and an output gate, perform sliding segmentation on the real-time monitoring data stream S, and obtain the input sequence group Is; convert the dynamic threshold vector T into a threshold constraint condition to obtain the threshold constraint vector Tc; construct a data preprocessor, standardize the input sequence group Is, and obtain a standardized sequence Ns.

[0064] Among them, the improved LSTM network is: the calculation formula of the gate unit 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); among them: ft, it, 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 weights and bias terms; αf, αi, αo are the cell state feedback coefficients.

[0065] 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, extract the time-dependent features, and obtain the encoded feature vector E; combine the encoded feature vector E with the threshold constraint vector Tc, input it into the feature extraction layer, and obtain the hidden state sequence H; in the prediction output layer, use the attention mechanism to weight the features of the hidden state sequence H at different time steps to obtain the predicted state sequence Ps; according to the pre-stored state mapping rule, map the predicted state sequence Ps to the system state to obtain the state sequence Sq.

[0066] 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; based on the state transition pair set Tp, count the transition frequencies between states to obtain a transition frequency matrix Fm; normalize the transition frequency matrix Fm to obtain a transition probability matrix Pm.

[0067] By improving the LSTM network structure, accurate prediction of the system state is achieved. First, an improved LSTM unit is constructed based on the 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, perform sliding segmentation and standardization on the real-time monitoring data stream, and ensure the quality of the input data. Secondly, a multi-layer LSTM prediction network including a state encoding layer, a feature extraction layer and a prediction output layer is designed. The expression ability of the model is improved through hierarchical feature extraction and state prediction. In the prediction output layer, the attention mechanism is used to weight the features of different time steps, so that the model can adaptively focus on important time step features. Finally, by analyzing the frequency of state transition pairs and normalizing them, an accurate transition probability matrix is ​​obtained. This improved LSTM network structure significantly improves the accuracy and reliability of state prediction through the combination of gating mechanism, multi-layer feature extraction and attention mechanism, and provides reliable state prediction support for the switching decision of water resources management mode.

[0068] According to one aspect of the present application, step S32 is specifically: Step S321, load basic parameters from the pre-stored decision tree configuration library, including the maximum depth d of the tree, the split threshold s, and the minimum number of samples m of the leaf nodes; construct a time series feature extractor based on the state sequence Sq, extract the time series pattern features in the sequence, and obtain the time series feature set Tf; convert the transition probability matrix Pm into decision constraints 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.

[0069] Step S322, construct a profit calculator, including an immediate profit module and a delayed profit module; for each leaf node of the initial decision tree Dt, calculate the immediate profit of the switching operation in combination with the threshold credibility index C to obtain the immediate profit vector Ri; calculate the potential profit of future state transfer based on the transition probability matrix Pm to obtain the delayed profit vector Rd; perform weighted combination of the immediate profit vector Ri and the delayed profit vector Rd to obtain the profit vector B.

[0070] 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 benefit vector B to obtain the action set A; use the policy gradient method to optimize the switching strategy, and for each time point t, calculate the policy gradient according to the historical state and the current state to obtain the gradient sequence G; update the policy parameters based on the gradient sequence G to obtain the optimized strategy π; according to the optimized strategy π, select the optimal switching sequence in the action set A to obtain the optimized time series sequence O.

[0071] By constructing an innovative optimization framework combining time-series decision trees and reinforcement learning, the intelligent optimization of switching timing is realized. First, an adaptive time-series feature extraction mechanism is constructed based on the pre-stored decision tree configuration library. The time-series pattern features are extracted by analyzing the state sequence, and the transition probability matrix is ​​converted into decision constraints. This decision tree construction method combining time-series features and probability constraints ensures that the decision model not only considers the historical evolution law but also satisfies the probability transfer constraints. Secondly, a dual benefit evaluation mechanism including immediate benefits and delayed benefits is designed. The immediate switching benefits are calculated by combining the threshold credibility index, and the potential benefits of future state transfer are evaluated based on the transition probability matrix. This comprehensive evaluation method considering current and future benefits can more comprehensively evaluate the long-term effect of switching decisions. Finally, the time-series reinforcement learning method is used for policy optimization. By constructing the action space and using the policy gradient method to optimize the switching strategy, the dynamic update of the strategy parameters based on historical experience is realized, thereby obtaining the optimal switching sequence. This optimization method combining decision trees, benefit evaluation and reinforcement learning can not only accurately evaluate the short-term and long-term benefits of switching decisions, but also realize the adaptive optimization of switching strategies, significantly improving the scientificity and foresight of water resources management mode switching.

[0072] According to one aspect of the present application, step S41 is specifically: Step S411, load the basic parameters of multi-objective optimization from the pre-stored optimization model library, including the target weight vector w, the constraint set c and the optimization step α; construct the probability constraint conditions according to the switching probability distribution P to obtain the probability constraint matrix Pc; extract the timing characteristics based on the optimal switching timing O to obtain the timing constraint matrix Tc; analyze the decision mode in the historical decision effect matrix H to obtain the historical mode 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.

[0073] The multi-objective optimization model is as follows: objective function max F(x) = [f1(x), f2(x), f3(x)]; where: f1(x) = λ1·E(x) - λ2·C(x) is the benefit target; f2(x) = -[μ1·R1(x) + μ2·R2(x)] is the risk target; f3(x) = η1·U(x) - η2·V(x) is the resource allocation target; 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.

[0074] Step S412, construct a decision solution generator, including a solution encoding module and a constraint checking module; based on the objective function of the multi-objective optimization model Z, generate an initial decision 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, screen out feasible solutions, and obtain a feasible solution set Fs; according to the successful experience in the historical pattern matrix Hm, optimize and adjust the feasible solution set Fs to obtain a decision set D.

[0075] Step S413, construct a solution evaluator, including an indicator calculation module and a comprehensive evaluation module; for each solution in the decision set D, calculate its indicator values ​​in the three dimensions of benefit, risk and resource allocation to obtain the indicator matrix Im; according to the pre-stored evaluation rule library, standardize the indicators in the indicator matrix Im to obtain the standardized indicator matrix Nm; use the hierarchical analysis method to calculate the weight of each indicator to obtain the weight vector W; perform weighted calculation on the standardized indicator matrix Nm and the weight vector W to obtain the evaluation matrix V.

[0076] By constructing a comprehensive multi-objective optimization decision-making framework, the intelligent generation and evaluation of management mode switching schemes are realized. First, a multi-objective optimization model based on three constraint matrices is designed. By converting the switching probability distribution into probability constraints and the optimal switching timing into timing constraints, combined with the 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 target design ensures the comprehensiveness and feasibility of the decision-making scheme. Secondly, the automatic generation and screening of schemes are realized through the decision scheme generator. A dual constraint verification mechanism is introduced to ensure that the scheme meets the probability and timing constraints and optimizes the scheme quality by injecting historical experience. This scheme generation method combining constraint verification and experience optimization significantly improves the feasibility and effectiveness of candidate schemes. Finally, a scheme evaluation mechanism based on multi-dimensional indicators is designed. The indicator weights are determined by the hierarchical analysis method, and a comprehensive evaluation of the scheme in the three dimensions of benefit, risk and resource allocation is realized. This multi-dimensional evaluation method provides an objective quantitative basis for scheme selection. The entire process is intelligent through the organic combination of multi-objective optimization, constraint verification and multi-dimensional evaluation, which realizes the full process of switching plan from generation to evaluation, and provides reliable decision-making support for the scientific switching of water resources management mode.

[0077] According to one aspect of the present application, step S42 is specifically: Step S421, construct a Pareto optimizer, including a dominance relationship analysis module and a level division module; calculate the dominance relationship between the solutions according to the evaluation indicators in the evaluation matrix V to obtain the dominance matrix Dm; perform hierarchical processing on the dominance matrix Dm to divide the solutions into different Pareto levels to obtain a level sequence L; extract the non-dominated solution of the first level from the level sequence L to obtain the Pareto optimal set Ps.

[0078] Step S422, construct a decision optimizer, including a cluster analysis module and a solution screening module; perform cluster analysis on the solutions in the Pareto optimal set Ps to obtain a cluster cluster set C; calculate the central solution of each cluster 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 the optimized decision M.

[0079] Step S423, construct an execution plan generator, including a task decomposition module and a resource allocation module; decompose the optimization decision M into specific execution tasks to obtain a task sequence Ts; allocate execution resources to each task according to pre-stored resource constraints to obtain a resource allocation plan Ra; integrate the task sequence Ts and the resource allocation plan Ra to obtain an execution plan E.

[0080] Among them, the calculation formula of the Pareto optimization algorithm is: dominance relationship calculation formula Dom(x, y) = ∏i=1, m[fi(x) ≥ fi(y)]; non-dominated sorting score S(x) = ∑y∈P[1 - Dom(y, x)]; crowding 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 relationship of x to y; S(x) is the non-dominated sorting score; D(x) is the crowding degree.

[0081] By constructing a Pareto optimization decision-making process, the scientific optimization of the switching scheme is achieved. First, the dominance relationship analysis module and the level division module are designed. By calculating the dominance relationship between the schemes and performing hierarchical processing, Pareto solution sets of different levels are obtained. Secondly, the clustering analysis method is used to cluster the schemes in the Pareto optimal set, and the central scheme of each cluster cluster is calculated. This clustering-based scheme screening method can find the most representative scheme while maintaining the diversity of the schemes. Finally, the optimal scheme is selected from the cluster center set according to the pre-stored decision preference rules, and a specific implementation plan is formed through task decomposition and resource allocation. This decision-making method that combines Pareto optimization, cluster analysis and task decomposition not only ensures the scientificity and feasibility of the decision-making plan, but also realizes seamless connection from decision-making to execution, providing a complete decision support plan for the switching implementation of the water resources management model.

[0082] In summary, in order to address the problem of insufficient processing capabilities for multi-source heterogeneous data, this solution adopts a multi-scale spatiotemporal feature extraction method: first, the Transformer interpolation model is used to handle data missing, and then a time window sequence containing three scales of hours, days, and months is constructed, and combined with wavelet transform and spatial attention mechanism, time features and spatial features are extracted respectively. Through the adaptive weight mechanism of the feature fusion network, efficient integration of heterogeneous data such as hydrology, meteorology, and socio-economics is achieved, and the multi-scale change characteristics of the data are effectively captured.

[0083] Regarding the problem of insufficient threshold adaptive capability, this solution proposes a dual-stream neural network + integrated learning solution: first, scene division is performed based on hierarchical clustering to establish a mapping relationship between scenes and thresholds; then, the dual-stream neural network is used to process feature stream and time series stream data separately, and the residual attention module is used to extract deep time series features; finally, the credibility of threshold prediction is evaluated through an integrated learning framework, realizing dynamic adjustment and adaptive optimization of the threshold.

[0084] To address the problem of insufficient uncertainty assessment and optimization of switching decisions, this solution designs an innovative method to improve the LSTM+series decision tree: the improved LSTM network is used to predict the system state and calculate the state transition probability, the switching benefit is calculated in combination with the sequence decision tree model, and the switching timing is optimized using the sequence reinforcement learning algorithm, thus achieving accurate assessment of the uncertainty of switching behavior and dynamic optimization of the switching timing.

[0085] For the problems of multi-objective decision-making balance and historical effect evaluation, this solution adopts the strategy of Pareto optimization + feedback update: construct a multi-objective optimization model that includes benefit maximization, risk minimization and optimal resource allocation, screen the optimal decision plan through the Pareto optimization algorithm, and establish a complete decision effect evaluation system. The evaluation results are fed back and updated to the historical decision effect matrix, forming a closed-loop decision optimization mechanism.

[0086] Case 1: 1. Obtain basic hydrological data and social attribute data, construct a three-dimensional correlation matrix, use random mathematical methods to correct parameters, and obtain water resources normal-emergency management correlation characteristic data.

[0087] Historical hydrological data, including time series data such as precipitation, runoff, and water level, were obtained from hydrological monitoring stations. Wavelet analysis was used to preprocess the data to obtain hydrological characteristic sequence data. Social and economic data, including population size, GDP, water quota, etc., were obtained from a statistical yearbook. Standardized processing methods were used to obtain standardized social attribute data.

[0088] Based on the hydrological characteristic sequence data, we calculated the interannual variation coefficient, annual distribution coefficient, wet-dry ratio and other indicators, constructed a hydrological characteristic indicator system, and obtained the hydrological characteristic indicator data; based on the standardized social attribute data, we calculated the per capita water consumption, water consumption per 10,000 yuan of GDP, water supply guarantee rate and other indicators, constructed a social attribute indicator system, and obtained the social characteristic indicator data.

[0089] The hydrological characteristic indicator data and social characteristic indicator data are organized according to the three dimensions of time, space and management level to construct a three-dimensional correlation matrix. The principal component analysis method is used to extract key features to obtain the initial correlation matrix data. The Monte Carlo simulation method is used to perform parameter sensitivity analysis and uncertainty quantification on the initial correlation matrix data to obtain the water resources normal-emergency management correlation characteristic data.

[0090] 2. Based on fuzzy mathematics theory, an evaluation model is constructed to conduct a fuzzy comprehensive evaluation of the water resources management status and obtain management status discrimination data.

[0091] Using the characteristic data of water resources normal-emergency management, a fuzzy evaluation factor set and comment set are established, and the fuzzy analytic hierarchy process is used to determine the weight coefficient to obtain the fuzzy evaluation matrix data; based on the management status annotation data in the historical case library, a fuzzy rule library is constructed to obtain fuzzy rule data.

[0092] The fuzzy evaluation matrix data is input into the fuzzy inference system, and fuzzy synthesis operation is performed based on the fuzzy rule data to obtain the fuzzy evaluation result data; the fuzzy evaluation result data is centrifuged, and the management status category is determined using the maximum membership method to obtain the management status discrimination data.

[0093] 3. Build a deep neural network model to realize the adaptive switching of normal and emergency management modes of water resources and obtain management mode switching strategy data.

[0094] The water resources normal-emergency management associated characteristic data and management status discrimination data are divided into training set and test set in a ratio of 7:3. The sliding time window method is used to construct the sample sequence to obtain the model training data and model test data.

[0095] Construct a deep neural network model including LSTM layer and attention mechanism, input model training data, use Adam optimizer to train the model, and obtain initial model parameter data; input model test data for verification, use cross-validation method to optimize model parameters, and obtain optimized model parameter data.

[0096] The real-time monitored hydrological characteristic sequence data and social characteristic indicator data are input into the trained deep neural network model, and forward calculation is performed based on the optimized model parameter data to obtain the management mode switching probability. Combined with the predefined switching threshold, the management mode switching strategy data is generated.

[0097] 4. Build an online learning and feedback mechanism to continuously optimize model performance and obtain updated model parameter data.

[0098] Collect actual effect feedback data after the management mode is switched, including indicators such as water supply guarantee rate, flood control safety, and water resource utilization efficiency, build a multi-objective evaluation system, and obtain mode switching effect evaluation data.

[0099] The mode switching effect evaluation data is compared and analyzed with the expected target, the performance difference is calculated, and the model weight is updated by the reinforcement learning method to obtain the model weight adjustment data; the deep neural network model is fine-tuned online based on the model weight adjustment data to obtain updated model parameter data.

[0100] It can be seen from the first embodiment that some methods can be implemented by other methods and are not limited to the above methods.

[0101] Case 2: STEP 1, multi-scale data preprocessing and feature extraction STEP11: Data collection and preliminary preprocessing Collect the original monitoring data set D (including hydrological, meteorological, and socio-economic data), including: 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, remove outliers, and obtain the cleaned data set Dc; use the improved Transformer interpolation model to fill in the missing data to obtain the complete data set Df.

[0102] STEP 12. Multi-scale feature extraction Read the complete data set Df, construct a time window sequence W={w1, w2, ..., wn}, wi represents different time scales (hours, days, months); for each time window wi, use wavelet transform to extract time features and obtain the time feature set Ft; use the improved spatial attention mechanism to extract spatial features and obtain the spatial feature set Fs; fuse Ft and Fs to generate the initial feature matrix Fi; STEP13. Feature optimization and association analysis Read the initial feature matrix Fi; use the multi-head self-attention mechanism to calculate the correlation strength between features and obtain the correlation strength matrix A; based on the correlation strength matrix A, use the improved feature selection algorithm to obtain the optimized feature matrix Fo; construct the spatiotemporal graph network G, and use the graph attention network to extract the spatiotemporal correlation matrix R Output: standardized feature matrix F (obtained by Fo normalization) and spatiotemporal correlation matrix R; STEP 2. Dynamic threshold prediction model construction STEP 21. Threshold initialization Read the standardized feature matrix F and the spatiotemporal correlation matrix R; use the hierarchical clustering algorithm to divide the historical data into scenes and obtain the scene category set K; for each scene k∈K, calculate the initial threshold and obtain the initial threshold set Ti; construct the scene-threshold mapping relationship and obtain the mapping matrix M; STEP 22. Dynamic threshold learning Read the initial threshold set Ti and mapping matrix M; build a two-stream neural network model N, including feature stream and time series stream, use the improved residual attention module to extract time series features, and obtain the time series feature vector St; fuse St and scene features, predict the dynamic threshold, and obtain the threshold prediction value Tp.

[0103] STEP 23. Threshold credibility assessment Read the threshold prediction value Tp; build an integrated learning framework, including multiple base learners; calculate the uncertainty of the prediction value and obtain the uncertainty index U; calculate the credibility score based on U and obtain the threshold credibility index C Output: dynamic threshold vector T (composed of Tp) and threshold credibility index C; STEP 3. Predictive switching mechanism design STEP 31. Status prediction Read the dynamic threshold vector T and monitor the data flow in real time; build the state prediction model P using the improved LSTM network; predict the system state in the future time window and obtain the state sequence Sq; calculate the state transition probability and obtain the transition probability matrix Pm.

[0104] STEP 32. Optimize switching timing Read the state sequence Sq, the transition probability matrix Pm, and the threshold credibility index C; construct a 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 and obtain the optimized timing sequence O; STEP 33. Switching probability evaluation Read the optimized timing sequence O and state sequence Sq; build the probability evaluation model E; calculate the switching probability distribution and obtain the probability distribution vector P. Output: switching probability distribution P and optimal switching timing O; STEP 4. Switching decision optimization and execution STEP 41. Decision making Read the switching probability distribution P, the optimal switching sequence O, and the historical decision effect matrix H; build a multi-objective optimization model Z; generate a candidate decision set and obtain a decision set D; evaluate the risks and benefits of each decision plan and obtain an evaluation matrix V; STEP 42. Decision optimization Read the decision set D and the evaluation matrix V; use the improved Pareto optimization algorithm to screen the decision solutions; calculate the optimal decision solution and obtain the optimized decision M; generate decision execution suggestions and obtain the execution solution E; STEP43. Effect evaluation and feedback.

[0105] Read the optimization decision M and execution plan E; build the evaluation index system S; calculate the decision effect score and obtain the effect score R; update the historical decision effect matrix and obtain the updated matrix H' Output: management mode switching instruction M and switching risk assessment report E.

[0106] Case 3: In a certain scenario, the data processing process is as follows.

[0107] The system data collection configuration is: 50 hydrological monitoring stations (water level, flow, water quality) and 30 meteorological stations (rainfall, temperature, humidity), with a sampling frequency of 5 minutes / time. 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 erroneous data are removed respectively. A 6-layer 8-head Transformer model (time step 12) is used for data interpolation, and the interpolation accuracy RMSE reaches 0.15. A multi-scale strategy is adopted for feature extraction: in the time dimension, window sequences of [1h, 3h, 6h], [1d, 3d, 7d], and [1m, 3m] are constructed, 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 respectively through wavelet transform; in the spatial dimension, a 50×30 correlation matrix is ​​constructed, and 256-dimensional spatial features are extracted through an 8-head attention network (dk=32, dv=32).

[0108] In the dynamic threshold learning process, the K-means algorithm (k=5, 20 iterations) is first used to divide the scene, and then a two-stream neural network is constructed: the feature stream uses a 3-layer CNN (64-128-256, dropout=0.3), and the time series stream uses a 2-layer BiLSTM (128-64) and a 64-dimensional attention layer. The initial threshold matrix T (5×4) contains thresholds in four dimensions: water level, supply-demand ratio, water quality, and cost, and is dynamically adjusted every 6 hours (range ±10%). The 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 timing, and the benefit calculation includes immediate benefit Ri (water supply guarantee rate w1=0.4, operating cost w2=0.3, system stability w3=0.3) and delayed benefit Rd (discount factor γ=0.9, time window T=12h).

[0109] The final decision optimization adopts a three-objective model (maximizing water supply guarantee rate, minimizing system risk, and minimizing operating costs), and the constraints include water balance, water quality compliance, energy consumption, and time requirements. The Pareto optimization algorithm (population size 100, evolutionary generations 50, Pc=0.8, Pm=0.1) was used to generate 15 candidate solutions, and the evaluation matrix E (15×5) was constructed to conduct a comprehensive evaluation from five dimensions: technical feasibility, economic rationality, operational difficulty, risk level, and response time. The actual operation results of the system show that the mode switching accuracy rate is 95.3%, the average response time is 28.5min, 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 increased by 3.7%.

[0110] The preferred embodiments of the present invention are described in detail above; however, the present invention is not limited to the specific details in the above embodiments. Within 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 belong to the protection scope of the present invention.

[0111] It should be noted that in order to clearly show the steps of the present invention, serial numbers are marked for each step in the specification. These serial numbers are only used for the convenience of explanation 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 a different order than that shown in the specification / the drawings in the specification, and in some cases, parallel processing between steps can 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; The initial feature matrix and spatiotemporal correlation matrix are divided into scenes, and a two-stream neural network including feature stream and time series stream is constructed. The time series stream uses a residual attention module to obtain a dynamic threshold vector. The system state is predicted and the switching timing is optimized according to the dynamic threshold vector, and the management mode switching instruction is generated.

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 sequential 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 prediction state sequence is obtained by using the attention mechanism; 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 8, characterized in that Also included are steps to generate a cutover risk assessment report: 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.

10. 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.

11. 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.

12. The method according to claim 9, 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

  • Hydrology and water resource monitoring system

    CN117890553A

  • Switching method and device of dual-lens motion camera and computer equipment

    CN118574002A

  • 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

Cited By

  • Wireless network high-speed switching automatic test optimization method based on edge computing

    CN120264324A

  • Deep learning-based bridge floor runoff real-time monitoring and processing system and method

    CN120950827A

  • A bridge deck runoff real-time monitoring processing system and method based on deep learning

    CN120950827B

  • Operation condition evaluation method and system for water supply system

    CN121072928A

  • Basin water environment comprehensive management and decision support system based on big data analysis

    CN122155468A