Zone area water level dynamic prediction method, system, equipment and medium
By integrating multi-source data and advanced machine learning techniques, a hybrid model of GBDT and LSTM was constructed. Combining the Attention mechanism and Bayesian optimization, the problems of insufficient accuracy in water level prediction in power distribution areas and difficulty in integrating multi-source data were solved. This enabled high-precision and reliable dynamic water level prediction and early warning, thereby improving the disaster prevention and mitigation capabilities of the power system.
Patent Information
- Application Number
- CN202511426478.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2025-11-18
AI Technical Summary
Existing technologies lack accuracy in predicting water levels in flood-prone areas, face difficulties in integrating multi-source heterogeneous data, and exhibit poor model robustness under extreme weather conditions, making it difficult to achieve efficient and accurate flood warnings.
We employ multi-source data fusion technology, process data through spatiotemporal Kriging interpolation and isolated forest algorithms, construct a hybrid GBDT and LSTM model, combine the Attention mechanism and Bayesian optimization of hyperparameters, utilize the Monte Carlo Dropout method to quantify uncertainty, and design a dynamic threshold mechanism to achieve online incremental learning.
It improves the accuracy and reliability of water level prediction in power distribution areas, reduces the risk of false alarms and missed alarms under extreme weather conditions, enhances the power system's ability to respond to flood disasters, and provides efficient and reliable early warning support.
Smart Images

Figure CN120975334A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to a transformer area water level dynamic prediction method, system, device and medium. BACKGROUND
[0002] Traditional water immersion early warning methods face many challenges, especially in the field of transformer area water immersion early warning. It is difficult to achieve the accuracy, real-time and intelligent requirements of early warning with traditional technical means. The transformer area water immersion early warning of the power industry not only needs to accurately monitor the water level change and predict the water immersion risk, but also should have real-time and reliability to ensure the safety of power equipment and the stability of power supply.
[0003] In recent years, machine learning models have made significant progress in prediction and classification tasks, and can process massive data and generate early warning results with certain accuracy. However, when these models are applied to transformer area water immersion early warning, the early warning accuracy may be poor due to insufficient multi-source data fusion, unreasonable feature extraction and other problems, making it difficult to accurately respond to water immersion disasters in complex environments. In addition, transformer area water immersion early warning relies on a large amount of multi-source information, which usually exists in structured or unstructured form, such as meteorological data, water level data, terrain data, etc. Traditional early warning methods cannot effectively integrate these multi-source heterogeneous data, resulting in a lack of comprehensiveness and accuracy of the early warning results. At the same time, existing machine learning models often cannot fully mine key information from multi-source heterogeneous data when predicting water level, resulting in a significant decrease in prediction accuracy under extreme weather. Although existing multi-source data fusion technology performs well in data integration, it still lacks effective feature processing and model optimization strategies in the application of machine learning models in transformer area water immersion dynamic prediction.
[0004] Therefore, it is necessary to build a dynamic prediction system that combines multi-source data fusion technology and improves the early warning ability of machine learning models. SUMMARY
[0005] The present application provides a transformer area water level dynamic prediction method, system, device and medium, which solves the technical problems of insufficient transformer area water level prediction accuracy, difficulty in integrating multi-source heterogeneous data and poor model robustness under extreme weather in the prior art.
[0006] Therefore, the present application provides a transformer area water level dynamic prediction method, system, device and medium, which solves the technical problems of insufficient transformer area water level prediction accuracy, difficulty in integrating multi-source heterogeneous data and poor model robustness under extreme weather in the prior art.
[0007] Collecting multi-source data and preprocessing the multi-source data, wherein the multi-source data is data affecting the change of the transformer area water level;
[0008] Based on the pre-processed multi-source data, several dimensions of features are constructed, and the Attention mechanism is used to dynamically adjust the weights of each feature to obtain a key feature set for model training.
[0009] The key feature set is input into a hybrid model composed of GBDT and LSTM for training; the GBDT model is used to capture the nonlinear relationship in the key feature set, and the LSTM model is used to model the time sequence of the GBDT output to output the water level prediction value.
[0010] The Monte Carlo Dropout method is used to sample the water level prediction value of the LSTM model to generate a prediction interval and a prediction confidence; the water level prediction value is corrected according to the meteorological ensemble prediction data to obtain a corrected prediction value; the warning threshold is determined based on the prediction confidence, and the corrected prediction value is compared with the warning threshold to trigger a corresponding level of warning.
[0011] Based on newly collected data, the hybrid model is updated using an online incremental learning method and then deployed.
[0012] Optionally, the pre-processing of the multi-source data includes: using the spatio-temporal Kriging interpolation method to process the missing values of the multi-source data, and detecting and correcting the outliers of the multi-source data by the Isolation Forest algorithm.
[0013] Optionally, the features include: time series features, spatial features, and interaction features.
[0014] The time series features include water level mean and water level change rate calculated by sliding window; the spatial features include basin slope calculated from terrain elevation data; and the interaction features include the correlation between rainfall and water level at different lag times.
[0015] Optionally, the hyperparameters of the GBDT model and the LSTM model are automatically optimized by the Bayesian optimization method.
[0016] Optionally, the expression for correcting the water level prediction value according to the meteorological ensemble prediction data is:
[0017] ;
[0018] wherein, ;
[0019] In the formula, is the corrected prediction value, is the water level prediction value, k is the rainfall-water level sensitivity coefficient, is the rainfall deviation, is the rainfall forecast value, is a rainfall measured value.
[0020] Optionally, an expression for determining the early warning threshold based on the prediction confidence is:
[0021]
[0022] In the formula, is a dynamic early warning threshold, is a reference threshold set according to historical water level of a transformer area, is the prediction confidence.
[0023] Optionally, the hybrid model is updated in an online incremental learning manner, including: freezing parameters of the GBDT model, and only adjusting weights of the LSTM model by using a stochastic gradient descent method.
[0024] The second aspect of the present application provides a transformer area water level dynamic prediction system, the system comprising:
[0025] A collection unit is configured to collect multi-source data and pre-process the multi-source data, wherein the multi-source data is data affecting water level change of a transformer area.
[0026] A construction unit is configured to construct features of several dimensions based on the pre-processed multi-source data, and dynamically adjust weights of the features by using an Attention mechanism to obtain a key feature set for model training.
[0027] A training unit is configured to input the key feature set into a hybrid model composed of GBDT and LSTM for training, wherein the GBDT model is configured to capture nonlinear relationships in the key feature set, and the LSTM model is configured to perform time series modeling on results output by the GBDT to output a water level prediction value.
[0028] A prediction unit is configured to generate a prediction interval and a prediction confidence by sampling the water level prediction value of the LSTM model by using a Monte Carlo Dropout method, to perform bias correction on the water level prediction value based on meteorological ensemble prediction data to obtain a corrected prediction value, to determine an early warning threshold based on the prediction confidence, and to compare the corrected prediction value with the early warning threshold to trigger a corresponding level of early warning.
[0029] An updating unit is configured to update the hybrid model in an online incremental learning manner based on newly collected data and then deploy the hybrid model.
[0030] The third aspect of the present application provides a transformer area water level dynamic prediction device, the device comprising a processor and a memory:
[0031] The memory is configured to store program code and transmit the program code to the processor.
[0032] The processor is configured to execute the steps of the transformer area water level dynamic prediction method according to the instructions in the program code.
[0033] The fourth aspect of the present application provides a computer readable storage medium for storing program code, the program code being used to execute the transformer area water level dynamic prediction method of the first aspect.
[0034] From the above technical solutions, the present application has the following advantages:
[0035] The transformer area water level dynamic prediction method provided by the present application aims to improve the accuracy, real-time performance and reliability of transformer area water level prediction by combining multi-source data fusion and advanced machine learning techniques, and to provide strong technical support for power system transformer area water immersion disaster warning. First, by collecting and fusing historical water level, weather, terrain, soil and other multi-source heterogeneous data, a comprehensive data source is constructed, providing a rich information base for the prediction model, which can effectively avoid the prediction deviation caused by one-sided information, and ensure the comprehensiveness and accuracy of the prediction under complex scenarios such as extreme weather. Second, time and space Kriging interpolation and isolated forest algorithm are used for data preprocessing, combined with Attention mechanism for dynamic selection and enhancement of features, focusing on key features and eliminating redundant information, which enhances the stability and generalization ability of the prediction. Third, a GBDT and LSTM hybrid model is constructed and Bayesian optimization hyperparameters are introduced, realizing accurate modeling of nonlinear relationships and time series dependencies. The bottom layer GBDT effectively captures the complex nonlinear relationships between multi-source data, and the top layer LSTM accurately describes the time series dynamics of water level changes. The two work together to make up for the performance short board of single model in complex scenarios. At the same time, the prediction uncertainty is quantified by Monte Carlo Dropout, combined with weather ensemble prediction to correct extreme value deviation, and a dynamic threshold mechanism is designed, so that the warning system can flexibly adjust the warning strategy according to the prediction confidence. This uncertainty processing and dynamic warning mode effectively reduces the risk of false positives and false negatives under extreme weather, improving the reliability and practicality of the warning. In addition, incremental learning enables the model to quickly adapt to new data distribution, maintaining long-term prediction performance. In summary, the transformer area water level dynamic prediction method of the present application can provide high-precision and high-reliable transformer area water level dynamic prediction results, improve the warning efficiency, and enhance the ability of the power system to cope with water immersion disasters, with strong adaptability and practicality. These features work together to significantly improve the overall performance of transformer area water level prediction and warning, making it more efficient and reliable in practical applications of disaster prevention and mitigation in the power industry. Thus, the technical problems of insufficient transformer area water level prediction accuracy, difficulty in integrating multi-source heterogeneous data, and poor model robustness under extreme weather in the prior art are solved. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 A flowchart illustrating a method for dynamic prediction of water level in a distribution area, provided in an embodiment of the present invention;
[0038] Figure 2 This is a flowchart illustrating a method for dynamic prediction of water level in a distribution area, as provided in an embodiment of the present invention. Detailed Implementation
[0039] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0040] Example 1:
[0041] Please see Figure 1 The present invention provides a method for dynamic prediction of water level in a distribution area, comprising:
[0042] Step 101: Collect multi-source data and preprocess the multi-source data. The multi-source data refers to data that affects the water level changes in the transformer area.
[0043] It should be noted that multi-source data acquisition and preprocessing are fundamental to building the predictive model, aiming to provide complete and high-quality input data for subsequent analysis. The multi-source data acquired in this step consists of various parameters that can directly or indirectly affect the water level changes in the distribution area, as described below.
[0044] In one embodiment, step 101 involves preprocessing the multi-source data, including: processing missing values in the multi-source data using the spatiotemporal Kriging interpolation method, and detecting and correcting outliers in the multi-source data using the isolated forest algorithm.
[0045] Specifically, the first step is multi-source data acquisition:
[0046] The system collects key data affecting water level changes in the distribution area, covering three core types of information:
[0047] 1) Hydrological data: historical water levels (Unit: m) The water level is collected in real time by water level sensors deployed in the transformer area, with a sampling frequency of 5 minutes / time, and the water level values at different timestamps are recorded.
[0048] 2) Meteorological data: Rainfall (Unit: mm / h) Temperature (Unit: °C) Atmospheric pressure (Unit: hPa), acquired from meteorological monitoring systems or specialized equipment, with a data granularity of 1 hour / time;
[0049] 3) Geographic and Soil Data: Topographic Elevation (Unit: m, based on CGCS2000 coordinate system) Soil permeability obtained through high-precision mapping. (Unit: m / d) Determined through soil sampling experiments.
[0050] Then, data preprocessing is performed:
[0051] Missing values were handled using the spatiotemporal Kriging interpolation method, which combines the spatial correlation of the data (such as the correlation of water levels in adjacent transformer areas) and the temporal continuity (such as the pattern of rainfall time series). The calculation formula is as follows:
[0052] ;
[0053] in, This is an estimate of the missing location. These are the measured values of known sample points. Weights (satisfying) ), through mutation function Calculate spatial correlation to ensure that the interpolation results closely reflect actual hydrological patterns.
[0054] Outlier handling uses the Isolation Forest algorithm to detect outliers. The formula for outlier scoring is:
[0055] ;
[0056] in For the sample Path length in an isolated tree This represents the average path length. Sample size The corresponding correction coefficient. When If a value is identified as an outlier, it is corrected by the mean of the three normal data points before and after it to ensure data validity.
[0057] It should be noted that the Kriging interpolation method is a spatial interpolation method based on the theory of variogram. The method first calculates the spatio-temporal variogram of different time and different monitoring point data, constructs a spatio-temporal correlation model of the data, and then uses the spatio-temporal weight of the known data points around the interpolation point for weighted estimation to fill in the missing values in the data sequence. For the treatment of abnormal values, the isolation forest algorithm is used. The algorithm isolates the data by building multiple isolated trees, and identifies those samples that are far away from most samples in the feature space and are difficult to be normally isolated as abnormal values; for the detected abnormal values, according to the time trend and spatial neighborhood characteristics of the data sequence where the abnormal values are located, if the abnormal value is a single-point sudden abnormal value, the moving average method of the data at the previous and next time is used to replace it, and if it is a regional continuous abnormal value, it is modified in cooperation with the same period data of other monitoring points in the same region, so as to ensure that the preprocessed data can accurately reflect the real influencing factors of the change of the water level in the district.
[0058] Step 102, based on the preprocessed multi-source data, a plurality of dimensional features are constructed, and the weights of the features are dynamically adjusted by using the Attention mechanism to obtain a key feature set for model training;
[0059] It should be noted that the key feature set for model training is obtained by dynamic feature selection and enhancement in this step. It can be understood that the dynamic feature selection and enhancement aims to extract key information from the preprocessed data, eliminate redundant features, and improve the model's ability to capture the change rule of water level.
[0060] In one embodiment, in step 102, the plurality of dimensional features include: time series features, spatial features and interaction features; wherein the time series features include water level mean and water level change rate calculated by sliding window; the spatial features include the basin slope calculated from the terrain elevation data; and the interaction features include the correlation between rainfall and water level at different lag times.
[0061] Specifically, first, multi-dimensional feature construction is performed:
[0062] Based on the preprocessed data, three types of features are constructed, including time series features, spatial features and interaction features, which are used to comprehensively describe the driving factors of water level change, wherein:
[0063] 1) Time series features: statistical quantities calculated by sliding window, such as water level mean and water level change rate within a window size of 1 hour, 3 hours and 6 hours, which capture the dynamic change trend of water level; 2) Spatial features: basin slope calculated from terrain elevation data
[0064] For elevation difference, (horizontal distance), reflecting the influence of topography on the confluence velocity of water flow;
[0065] 3) Interaction characteristics: Analyze the lag relationship between rainfall and water level, and calculate the lag time. Correlation at (0.5 hours, 1 hour, 2 hours) To explore the patterns of synergistic effects of multiple factors.
[0066] Then, an attention mechanism is introduced to dynamically adjust feature weights, highlighting key influencing factors. The calculation formula is as follows:
[0067]
[0068] in, For the first Vector representation of each feature For learnable parameters, For feature weights. Retain. By identifying key features and eliminating redundant information, the quality of model input can be improved.
[0069] Understandably, step 102 first constructs a multi-dimensional feature set, systematically extracting a basic feature set capable of characterizing the driving factors of water level changes from three levels: temporal, spatial, and interactive. Then, it innovatively introduces an Attention mechanism to dynamically adjust the weights of these features. Specifically, this mechanism first represents each feature as a vector... Input to learnable parameters In the constructed neural network, the energy value of this feature is calculated using the tanh activation function and a linear transformation. Then, the softmax function is used to normalize the energy values of all features to obtain the weights corresponding to each feature. In practical applications, a weight threshold of 0.05 is set, and the weights are retained. Features with a value greater than 0.05 are used to effectively eliminate redundant information that contributes little to water level prediction, significantly improving the quality of the model input data and ultimately obtaining a key feature set for subsequent model training. This process not only achieves comprehensive capture of features related to water level changes but also highlights key influencing factors through a dynamic weight adjustment mechanism, which is used in subsequent steps to improve the accuracy of dynamic water level prediction in the substation area.
[0070] Step 103: Input the key feature set into a hybrid model consisting of GBDT and LSTM for training; wherein, the GBDT model is used to capture the nonlinear relationship in the key feature set, and the LSTM model is used to perform time series modeling on the results of GBDT to output the water level prediction value.
[0071] In one embodiment, in step 103: the hyperparameters of the GBDT model and the LSTM model are automatically optimized by a Bayesian optimization method.
[0072] It should be noted that the hybrid model training combines the advantages of GBDT and LSTM, accurately captures the nonlinear relationship and time series dependence in the data, and improves the prediction accuracy.
[0073] The nonlinear relationship is captured by the ensemble of multiple decision trees, and the output of the first tree is:
[0074] ;
[0075] wherein is the mean square error loss , the ensemble output , realizing nonlinear transformation of multi-source features;
[0076] The time series features of the GBDT output are processed, and the long-term dependence is modeled through a gating mechanism. The cell state update formula is:
[0077] ;
[0078] wherein is the forget gate, is the input gate, is the candidate cell state, is the element-wise operation, effectively capturing the time series regularity of water level changes.
[0079] The Bayesian optimization is used to automatically adjust the hyperparameters, and the optimization goal is to minimize the prediction error, whose calculation formula is:
[0080] ;
[0081] The parameter space includes the tree depth of GBDT (5-15), the learning rate (0.01-0.2), and the hidden layer dimension of LSTM (32-128). The relationship between the hyperparameters and the error is modeled by Gaussian process, improving the generalization ability of the model.
[0082] It can be understood that this step firstly passes through the mixed model composed of GBDT and LSTM, then captures the nonlinear relationship of the input key feature set by using the GBDT model, maps the original feature space to a high-dimensional feature with better representation ability through the ensemble learning of multiple decision trees. Each decision tree is iteratively optimized based on the residual of the previous tree during the training process, and the structure and parameters of the tree are continuously adjusted by minimizing the mean square error loss function, and the output of the final ensemble model can effectively fuse the complex nonlinear information in the multi-source features. Subsequently, the feature results output by the GBDT model are taken as the input of the LSTM model, and the LSTM model uses its unique gating mechanism, including the forget gate, the input gate and the output gate, to model the time series data in depth. The forget gate is responsible for selectively forgetting unimportant information in the historical cell state, and the input gate controls the inflow of new candidate cell state information. After element product operation, the cell state is updated to capture the long-term dependence and dynamic evolution law in the water level change process. In the training process of the entire hybrid model, the Bayesian optimization method is used to automatically optimize the hyperparameters of GBDT and LSTM. This method takes minimizing the prediction error (measured by the RMSE index) as the optimization objective, and in the preset parameter space (such as the tree depth range of GBDT 5-15, the learning rate range 0.01-0.2, and the hidden layer dimension range of LSTM 32-128), the Gaussian process is used to construct the probability model between the hyperparameters and the model prediction error, and the optimal hyperparameter combination is iteratively explored to effectively improve the generalization ability and prediction accuracy of the model, and to ensure that the hybrid model can stably and accurately output the water level prediction value.
[0083] Step 104, using the Monte Carlo Dropout method to sample the water level prediction value of the LSTM model to generate a prediction interval and a prediction confidence; correcting the water level prediction value according to the meteorological ensemble prediction data to obtain a corrected prediction value; determining a warning threshold based on the prediction confidence, and comparing the corrected prediction value with the warning threshold to trigger a warning of a corresponding level;
[0084] It should be noted that uncertainty quantification and correction are the core of improving the reliability of the warning, and by quantifying the prediction risk and correcting the extreme value deviation, dynamic hierarchical warning is realized.
[0085] First, the prediction interval is generated. The Monte Carlo Dropout method is used to quantify uncertainty, and Dropout (probability p = 0.2) is introduced in the LSTM layer to generate a prediction distribution by repeating inference 100 times The 90% confidence interval is: [quantile ,quantile ].
[0086] quantile is a quantile function, and explicitly predicts the reliable range of the prediction result.
[0087] Then, the bias correction of extreme values is performed. The extreme values are corrected in combination with the meteorological ensemble prediction data. According to the rainfall bias Adjust the water level prediction value:
[0088] ;
[0089] wherein k is a rainfall-water level sensitivity coefficient (obtained by fitting historical data), to improve the prediction accuracy under extreme weather, is the corrected prediction value, is the water level prediction value, is the rainfall bias, is the rainfall forecast value, is the measured rainfall value.
[0090] Finally, a dynamic threshold mechanism is established. The warning threshold is dynamically adjusted according to the prediction confidence C (the inverse of the confidence interval width):
[0091]
[0092] wherein, is the dynamic warning threshold, is the prediction confidence, is the reference threshold (e.g. 80% of the historical maximum water level of the transformer area), the higher the confidence, the stricter the threshold, and when the corresponding level of warning is triggered.
[0093] It can be understood that step 104 first introduces randomness in the inference stage of the LSTM model by the Monte Carlo Dropout method, generates a prediction distribution by repeatedly inferring multiple times, and then calculates a prediction interval that can reflect the reliable range of the prediction result, so as to quantify the uncertainty of the water level prediction. On this basis, in combination with the bias between the forecast value and the measured value of the rainfall in the meteorological ensemble prediction data, the rainfall-water level sensitivity coefficient obtained by fitting historical data is used to adjust the water level prediction value, realize the bias correction of extreme values, and effectively improve the accuracy of water level prediction under extreme weather conditions. Finally, a dynamic warning threshold mechanism is established based on the prediction confidence (i.e. the inverse of the confidence interval width), so that the warning threshold can be dynamically adjusted according to the reliability of the prediction result, and when the corrected water level prediction value exceeds the dynamic warning threshold, the corresponding level of warning is triggered, thereby realizing a complete process from uncertainty quantification to bias correction and dynamic grading warning, and providing scientific and accurate decision support for transformer area water level safety monitoring.
[0094] Step 105, based on the newly collected data, the hybrid model is updated and deployed in an online incremental learning manner.
[0095] In one embodiment, in step 105:
[0096] The hybrid model is updated in an online incremental learning manner, including: freezing the parameters of the GBDT model, and adjusting only the weights of the LSTM model using the stochastic gradient descent method.
[0097] It should be noted that model iteration and deployment are designed to achieve dynamic updating and low-latency response, ensuring that the system adapts to actual scene requirements for a long time. After receiving new collected data (new collected data needs to be processed by methods such as steps 101 and 102) every day, freeze the GBDT parameters to retain historical rules, and only fine-tune the LSTM output layer weights:
[0098] ;
[0099] wherein is the learning rate, L is the cross-entropy loss, and the model quickly adapts to new data distribution, such as changes in water level rules caused by seasonal changes.
[0100] It can be understood that step 105 dynamically adjusts the update frequency and parameter optimization strategy of the model, significantly reducing the consumption of computing resources while ensuring the prediction accuracy of the model. Specifically, the system will automatically trigger a high-frequency update mechanism according to the timestamp characteristics of the new data (such as a continuous rainfall period, a seasonal alternating node), at which time the learning rate η is temporarily increased to accelerate the convergence of the LSTM weight. For example: In the data distribution stable period (such as a continuous sunny day without significant weather anomalies), an interval update mode is adopted, and the weight fine-tuning is performed every 48 hours, and η is reduced to 0.005 to avoid overfitting.
[0101] Embodiment 2:
[0102] Step 1: Collecting multi-source data and pre-processing the multi-source data, including:
[0103] Step 1.1 Collect multi-source data. Collect multi-source data of a certain area for 6 consecutive months, including: historical water level data (collected by 5 water level sensors deployed in the area, sampling frequency 5 minutes / time, recorded as , unit m), meteorological data (rainfall unit mm / h, air temperature unit ℃, air pressure unit hPa, obtained from the local weather station, sampling frequency 1 hour / time), terrain elevation data (obtained by high-precision surveying , unit m), soil permeability data (determined by 3 soil sampling experiments, average value m / d). The data was pre-processed, time-stamped, and associated with the spatial location of the station area.
[0104] Step 1.2 Handle missing values. Temporal and spatial Kriging interpolation was used to handle missing data. For the 200 missing water level data caused by sensor failure, the spherical variogram function was constructed with the same period data of the surrounding 3 normal sensors as samples (where m is the range), and the weight was calculated Then the missing data was interpolated by the formula The data integrity rate after interpolation reached 99.2%.
[0105] Step 1.3 Detect and correct outliers. Isolation Forest algorithm (set tree number 100, sample subset size 256) was used to detect outliers, and the outlier score was calculated 12 abnormal data (such as false high water level of sensor during heavy rain) were marked as outliers, and the mean of the previous and next 3 normal data was used for correction. The standard deviation of the corrected data decreased by 15%.
[0106] Step 2 Based on the pre-processed multi-source data, construct several dimensions of features, and use Attention mechanism to dynamically adjust the weight of each feature to get the key feature set for model training, including:
[0107] Step 2.1 Construct multi-dimensional features based on the data in step 1. Based on the standardized data set output in step 1, extract three types of features:
[0108] Time series features: Use the historical water level and rainfall data in step 1 to calculate the statistics of sliding window (1 hour, 3 hours, 6 hours), such as 1 hour window water level mean Mean (1 hour contains 12 data points due to 5 minutes / second sampling), 3 hour window rainfall rate Rate , a total of 8 time series features;
[0109] Spatial features: Based on the terrain elevation data in step 1 , calculate the slope of the basin where the station area is located (where m is the elevation difference between upstream and downstream of the basin, m is the horizontal distance, and ), and 2 spatial features such as terrain relief;
[0110] Interaction features: combine the rainfall and water level data in step 1, calculate the rainfall-water level correlation Corr(R(t-τ), H(t)) with lag time τ = 0.5h, 1h, 2h, and get the Pearson coefficient ρ= Calculate to get 3 interaction features; finally, 13 initial features are constructed.
[0111] Step 2.2: Feature selection based on Attention mechanism. Convert the data processed in step 1 to a 13-dimensional feature vector representation h_{i}(i=1,2,…,13), calculate the weight through the Attention mechanism: e_{i}=v^{T}(Wh_{i}+b)(where W is a 32x13 matrix, b is a 32-dimensional bias, v is a 32-dimensional vector, all of which are optimized through training), and then get a_{i}= through the softmax function. Keep the features with a_{i}>0.05, and finally select 6 key features (such as 3-hour window water level change rate, basin slope, 1-hour lag rainfall-water level correlation, etc.). After removing redundant features, the data dimension is reduced by 53.8%.
[0112] Step 3: input the key feature set into a hybrid model composed of GBDT and LSTM for training, including:
[0113] Step 3.1: build a GBDT-LSTM hybrid model architecture. Take the 6 key features output in step 2 as input and train in two layers:
[0114] Bottom GBDT training: input the 6-dimensional key feature matrix of step 2 (sample size 8000, first 70% as training set), set tree number 100, initial learning rate 0.1, and fit the residual by iteration: the 1st tree fits the residual of the true value and the mean of the water level, the kth tree fits the residual of the first k-1 trees, and the loss function is the mean square error , finally output the nonlinear transformation result F(x)=∑{k=1}^{100}f{k}(x)(1-dimensional vector), which is used to capture the nonlinear relationship between features (such as the nonlinear correlation between slope and water level rising speed);
[0115] Top LSTM training: The 1-dimensional conversion results output by GBDT are reshaped into a time series sequence of T=24 (time step, 1 step per hour) as LSTM input. Set the hidden layer dimension to 64, update the cell state through the gating mechanism: c_{t}=f_{t}⊙c_{t-1}+i_{t}⊙{t}(where f{t} is the forget gate, i_{t} is the input gate, activated by the Sigmoid function, and_{t} is the candidate cell state, activated by tanh), model the time series dependence of water level (such as the cumulative effect of continuous rainfall on water level), and output the water level prediction value for the next 1 hour.
[0116] Step 3.2 Bayesian optimization of hyperparameters. Based on the feature data in step 2, the RMSE of the validation set (20% of the training set) is:
[0117] ;
[0118] To achieve this goal, the tree depth of GBDT (5-15), the learning rate (0.01-0.2), and the hidden layer dimension of LSTM (32-128) are optimized. Through Gaussian process modeling of the relationship between hyperparameters and RMSE, the optimal parameters are determined through 25 iterations: tree depth 10, learning rate 0.05, and LSTM hidden layer dimension 64, at which time the validation set RMSE decreases from the initial 0.18m to 0.09m.
[0119] Step 3.3 Model evaluation. The remaining 30% of the test set in step 2 is used for validation, and the mixed model prediction error is 0.08m, which is 38.5% and 46.7% lower than the single GBDT model (error 0.13m) and the single LSTM model (error 0.15m) respectively, proving that it can effectively use the key features selected in step 2 to improve prediction accuracy.
[0120] Step 4 uses the Monte Carlo Dropout method to sample the water level prediction value of the LSTM model to generate a prediction interval and a prediction confidence; the water level prediction value is corrected according to the meteorological ensemble prediction data to obtain a corrected prediction value; a warning threshold is determined based on the prediction confidence, and the corrected prediction value is compared with the warning threshold to trigger a corresponding level of warning, including:
[0121] Step 4.1 Generate prediction interval. Introduce Dropout (probability 0.2) to the LSTM layer, and repeat the inference of the test set features in step 2 100 times to obtain the prediction distribution , and calculate the 90% confidence interval as [quantile( ,0.05),quantile( , 0.95)], covering 91.3% of the actual water level values.
[0122] Step 4.2 Correct the deviation of extreme values. Combine the rainfall deviation of meteorological ensemble prediction , fit the rainfall by historical data. Set the water level sensitive coefficient , correct the predicted value: , the prediction deviation under extreme weather is reduced to within 0.06m.
[0123] Step 4.3 Dynamic threshold early warning. According to the confidence Adjust the threshold: When the threshold is 75% of the highest water level in history, When it is 80%, the early warning accuracy rate reaches 92%.
[0124] Step 5 Based on the newly collected data, update the mixed model in an online incremental learning way, so that the mixed model adapts to the change of data distribution.
[0125] Step 5.1 Online incremental learning. Receive the monitoring data added in step 1 every day, process it through step 2, freeze the GBDT parameters, and only fine-tune the LSTM output layer weight .
[0126] Through the above steps, this embodiment successfully realizes the dynamic prediction of transformer area water level based on multi-source data. It provides reliable technical support for transformer area water immersion disaster prevention and control.
[0127] The application provides a kind of substation water level dynamic prediction method, to improve the accuracy, real-time and reliability of substation water level prediction by the combination of multi-source data fusion and advanced machine learning technology, provide strong technical support for power system substation water immersion disaster early warning.First, by collecting and fusing historical water level, weather, terrain, soil and other multi-source heterogeneous data, a comprehensive data source is constructed, providing a rich information base for the prediction model, which can effectively avoid the prediction bias caused by one-sided information, and ensure the comprehensiveness and accuracy of the prediction under complex scenarios such as extreme weather.Second, time and space Kriging interpolation and isolation forest algorithm are used for data preprocessing, combined with Attention mechanism for dynamic feature selection and enhancement, focusing on key features and eliminating redundant information, enhancing the stability and generalization ability of the prediction.Furthermore, a hybrid model of GBDT and LSTM is constructed and Bayesian optimization hyperparameters are introduced, realizing accurate modeling of nonlinear relationships and time series dependencies.Bottom GBDT effectively captures the complex nonlinear relationships between multi-source data, and top LSTM accurately depicts the time series dynamics of water level changes, both of which work together to make up for the performance short board of single model in complex scenarios.Meanwhile, the prediction uncertainty is quantified by Monte Carlo Dropout, combined with weather ensemble prediction to correct extreme value deviation, and a dynamic threshold mechanism is designed, so that the early warning system can flexibly adjust the early warning strategy according to the prediction confidence.This uncertainty processing and dynamic early warning mode effectively reduces the false alarm and missed alarm risk under extreme weather, improves the reliability and practicality of early warning.In addition, incremental learning enables the model to quickly adapt to new data distribution and maintain long-term prediction performance.In summary, the substation water level dynamic prediction method of the application can provide high-precision and high-reliable substation water level dynamic prediction results, improve the early warning efficiency, enhance the ability of power system to cope with water immersion disasters, and have strong adaptability and practicality.These features work together to significantly improve the overall performance of substation water level prediction and early warning, making it more efficient and reliable in practical applications of disaster prevention and mitigation in the power industry.The technical problems of insufficient prediction accuracy of substation water level, difficulty in integrating multi-source heterogeneous data and poor model robustness under extreme weather in the prior art are solved.
[0128] The above is a substation water level dynamic prediction method provided in an embodiment of the application, and the following is a substation water level dynamic prediction system provided in an embodiment of the application.
[0129] Please refer to Figure 2 The substation water level dynamic prediction system provided in an embodiment of the application comprises:
[0130] The acquisition unit 201 is configured to acquire multi-source data and pre-process the multi-source data, wherein the multi-source data is data affecting the change of substation water level.
[0131] The constructing unit 202 is configured to construct features of several dimensions based on the preprocessed multi-source data, and dynamically adjust weights of the features by using an attention mechanism to obtain a key feature set for model training.
[0132] The training unit 203 is configured to input the key feature set into a hybrid model composed of a GBDT and an LSTM for training.
[0133] The prediction unit 204 is configured to generate a prediction interval and a prediction confidence by sampling the water level prediction value of the LSTM model by using a Monte Carlo Dropout method, to correct the water level prediction value by using meteorological ensemble prediction data to obtain a corrected prediction value, to determine a warning threshold based on the prediction confidence, and to compare the corrected prediction value with the warning threshold to trigger a warning of a corresponding level.
[0134] The updating unit 205 is configured to update the hybrid model based on newly collected data by using an online incremental learning method and to deploy the updated hybrid model.
[0135] Further, the embodiment of the present application also provides a dynamic water level prediction device for a transformer area, which comprises a processor and a memory.
[0136] The memory is configured to store program code and transmit the program code to the processor.
[0137] The processor is configured to execute steps of the dynamic water level prediction method for the transformer area according to instructions in the program code.
[0138] Further, the embodiment of the present application also provides a computer readable storage medium, which is configured to store program code, and the program code is configured to execute the dynamic water level prediction method for the transformer area.
[0139] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and the unit described above can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0140] In several embodiments provided by the present application, it should be understood that the disclosed system, device and method can be implemented in other manners. For example, the described device embodiments are merely schematic. For example, the division of the units is merely logical function division. There can be other division manners in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between different units, can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.
[0141] The units described as separated components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments.
[0142] In addition, each function unit in the various embodiments of the present application can be integrated into a processing unit, or each unit can exist physically independently, or two or more units can be integrated into one unit. The integrated unit can be implemented in the form of hardware, or in the form of a software function unit.
[0143] If the integrated unit is implemented in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such an understanding, the technical solutions of the present application essentially or substantially, or all or part of the technical solutions, can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in the various embodiments of the present application. The foregoing storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, and various media that can store program codes.
[0144] The above embodiments are merely used to describe the technical solutions of the present application, rather than limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some technical features; and these modifications or replacements do not cause the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for dynamic prediction of water level in a distribution area, characterized in that, include: Collect multi-source data and preprocess the multi-source data, wherein the multi-source data is: data affecting the water level change in the transformer area; Based on the preprocessed multi-source data, features of several dimensions are constructed, and the weights of each feature are dynamically adjusted using the Attention mechanism to obtain a key feature set for model training. The key feature set is input into a hybrid model consisting of GBDT and LSTM for training; wherein, the GBDT model is used to capture the nonlinear relationships in the key feature set, and the LSTM model is used to perform time series modeling on the output of GBDT to output water level prediction values. The Monte Carlo Dropout method is used to sample the water level prediction values of the LSTM model to generate prediction intervals and prediction confidence levels; the water level prediction values are biased and corrected based on meteorological ensemble forecast data to obtain corrected prediction values; a warning threshold is determined based on the prediction confidence level, and the corrected prediction values are compared with the warning threshold to trigger a warning of the corresponding level. Based on the newly collected data, the hybrid model is updated using an online incremental learning approach before deployment.
2. The method for dynamic prediction of water level in a distribution area according to claim 1, characterized in that, The preprocessing of the multi-source data includes: processing missing values in the multi-source data using the spatiotemporal Kriging interpolation method, and detecting and correcting outliers in the multi-source data using the isolated forest algorithm.
3. The method for dynamic prediction of water level in a distribution area according to claim 1, characterized in that, The features include: temporal features, spatial features, and interaction features; The temporal features include the mean water level and the rate of change of water level calculated through a sliding window; the spatial features include the watershed slope calculated from topographic elevation data; and the interactive features include the correlation between rainfall and water level at different lag times.
4. The method for dynamic prediction of water level in a distribution area according to claim 1, characterized in that, The hyperparameters of the GBDT and LSTM models are automatically optimized using Bayesian optimization methods.
5. The method for dynamic prediction of water level in a distribution area according to claim 1, characterized in that, The expression for correcting the deviation of the water level prediction based on meteorological ensemble forecast data is as follows: ; in, ; In the formula, The corrected predicted value, Here, k is the predicted water level value, and k is the rainfall-water level sensitivity coefficient. Due to rainfall deviation, This is the predicted rainfall value. These are measured rainfall values.
6. The method for dynamic prediction of water level in a distribution area according to claim 1, characterized in that, The expression for determining the early warning threshold based on the prediction confidence level is as follows: ; In the formula, For dynamic early warning thresholds, This is a benchmark threshold set based on the historical water level of the area. The prediction confidence level is given.
7. The method for dynamic prediction of water level in a distribution area according to claim 1, characterized in that, The method of updating the hybrid model using online incremental learning includes: freezing the parameters of the GBDT model and adjusting the weights of the LSTM model only using stochastic gradient descent.
8. A dynamic water level prediction system for a transformer substation, characterized in that, include: The acquisition unit is used to acquire multi-source data and preprocess the multi-source data, wherein the multi-source data is: data affecting the water level change in the transformer area; The building unit is used to construct features of several dimensions based on preprocessed multi-source data, and to dynamically adjust the weights of each feature using an attention mechanism to obtain a key feature set for model training. The training unit is used to input the key feature set into a hybrid model composed of GBDT and LSTM for training; wherein, the GBDT model is used to capture the nonlinear relationship in the key feature set, and the LSTM model is used to perform time series modeling on the results of GBDT to output water level prediction values. The prediction unit is used to sample the water level prediction values of the LSTM model using the Monte Carlo Dropout method to generate prediction intervals and prediction confidence levels; to perform deviation correction on the water level prediction values based on meteorological ensemble forecast data to obtain corrected prediction values; to determine the warning threshold based on the prediction confidence levels; and to compare the corrected prediction values with the warning thresholds to trigger warnings of the corresponding level. The update unit is used to update the hybrid model based on the newly collected data using an online incremental learning method before deployment.
9. A device for dynamic prediction of water level in a distribution area, characterized in that, The device includes a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the dynamic water level prediction method for the substation area according to any one of claims 1-7, based on the instructions in the program code.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program code for executing the dynamic prediction method for water level in the substation area according to any one of claims 1-7.
Citation Information
Cited By
Dam osmotic pressure state prediction model optimization method and device, equipment and storage medium
CN121959203A