CNN-LSTM-AM-based microgrid power load prediction and dynamic control method
Through the CNN-LSTM-AM hybrid prediction model and multi-level stabilization control strategy, the prediction error and response lag problems of the microgrid power load forecasting and control system are solved, efficient and real-time power load forecasting and dynamic control are achieved, and the stability and economy of the system are improved.
Patent Information
- Application Number
- CN202510598269.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-09
- Publication Date
- 2025-09-09
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing microgrid power load forecasting and control systems face problems such as high prediction errors, delayed control response, difficulty in spatiotemporal alignment of multi-source data, low power supply reliability, and increased electricity costs. Especially in scenarios with a high proportion of renewable energy access, it is difficult to effectively cope with second-level load fluctuations and real-time optimization.
A CNN-LSTM-AM hybrid prediction model is adopted to construct a dual-branch multi-scale convolution kernel and a dynamic attention mechanism through multi-source data collection and preprocessing. The charging and discharging strategy is optimized by combining the energy storage SOC and real-time electricity prices to achieve dynamic control and trigger a multi-level stabilization strategy to enhance the spatiotemporal feature coupling capability and control response speed.
It improves the accuracy of power load forecasting, shortens the response time to load mutations, improves power supply reliability and economy, reduces electricity costs, and enhances the model's anti-interference ability and comprehensive predictability.
Smart Images

Figure CN120613787A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of intelligent control of microgrid power systems, and specifically relates to a microgrid power load prediction and dynamic control method based on CNN-LSTM-AM. Background Art
[0002] As the penetration of renewable energy in microgrids continues to increase, traditional power load forecasting and control systems face multiple challenges. Existing methods rely on single historical load data, ignoring the wide-area distribution characteristics of distributed photovoltaics, key parameters such as energy storage SOC, and real-time electricity prices, resulting in forecast errors (MAPE) generally exceeding 8%. Static control strategies have response delays exceeding 5 seconds, making it difficult to cope with second-level load fluctuations. The sampling frequencies of multi-source data vary widely (e.g., 5 minutes for smart meters and 10 milliseconds for WAMS), making spatiotemporal alignment difficult and disconnecting prediction and control. Relying on cloud-based optimization during communication interruptions results in island mode switching delays exceeding 2 seconds, and the lack of local optimization strategies based on energy storage SOC reduces power supply reliability. Furthermore, the lack of coordinated optimization with real-time electricity prices increases electricity costs by over 20%. An efficient, real-time, and cost-effective solution is urgently needed. Summary of the Invention
[0003] The main purpose of the present invention is to provide a microgrid power load forecasting and dynamic control method based on CNN-LSTM-AM to solve the technical problems of insufficient prediction accuracy, delayed control response and poor adaptability of the existing power system.
[0004] To solve the above technical problems, the technical solution adopted by the present invention is: a microgrid power load forecasting and dynamic control method based on CNN-LSTM-AM, comprising the following steps: S1: Collect multi-source data, including load data, environmental data, grid status data, photovoltaic / wind power output, energy storage SOC and real-time electricity price, and perform data preprocessing; S2: Construct a CNN-LSTM-AM hybrid prediction model, which includes a sequentially connected input layer, CNN layer, LSTM layer, AM layer, and output layer. The CNN layer includes a dual-branch multi-scale one-dimensional convolution kernel. The outputs of the input layer and LSTM layer are connected to the DSTCW module, which outputs weighted load characteristics and PV / wind power characteristics. S3: Use the pre-processed multi-source data to train the CNN-LSTM-AM hybrid prediction model, use a dynamic weighted loss function to simultaneously optimize the load and renewable energy output forecasts, and save the optimal prediction model; S4: Based on the output of the optimal prediction model, the charging and discharging priorities are optimized based on the energy storage SOC and real-time electricity prices. A multi-level collaborative stabilization strategy is triggered through a closed-loop control link to achieve dynamic control.
[0005] In the preferred embodiment, the structure of the CNN-LSTM-AM hybrid prediction model includes: The input layer is used to receive multi-source spatiotemporal series data of microgrids; The CNN layer is used for multi-scale one-dimensional convolution with kernels of 3×1 and 5×1 to extract local and wide-area spatial features of distributed photovoltaic / wind power; The LSTM layer is used to capture the long-term temporal dependency between microgrid load and renewable energy output; The AM layer is used to assign weights through DSTCW, focusing on the temporal and spatial correlation between load and photovoltaic output, and achieving dual-task output synchronization. The dual-task output includes: The main task output layer: The multi-source data is processed through the CNN layer to extract spatial features, the LSTM layer to capture time series features, and the AM layer to dynamically assign attention weights. The feature sequence is then input into the fully connected layer of the main task. The neurons in the fully connected layer linearly combine the feature vectors using the weight matrix and bias vector, and calculate the activation function to output the load power forecast values at multiple future time points. This forms the main task output layer and obtains the load power forecast results for the microgrid park. Auxiliary task output layer: The feature sequence of historical renewable energy output data and related environmental data processed by the CNN layer, LSTM layer, and AM layer is input into the fully connected layer corresponding to the auxiliary task; the neurons in the fully connected layer linearly combine the features and calculate through the activation function to output the output forecast values of photovoltaic and wind power, forming the auxiliary task output layer and obtaining the forecast results of renewable energy output.
[0006] In a preferred solution, the multi-source data specifically includes: Load data includes active power, reactive power and interruptible load identification; Environmental data includes temperature, humidity, light intensity and photovoltaic array tilt; Grid status data includes voltage, frequency, phase angle and energy storage SOC; Microgrid-specific data: real-time electricity prices, distributed energy location coordinates.
[0007] In a preferred embodiment, the data preprocessing in S1 includes: S101: Collect multi-source data and use a sliding window mechanism to perform time alignment; S102: Data cleaning and outlier processing: missing values are processed according to the length of the cycle, and outlier detection and correction are performed. The input data is eliminated using the z-score standardization method. S103: Data fusion, arranging the normalized multi-source data in chronological order to generate a power load information sequence. For each time point t, the fused data vector expression is: ; Where: : Load power (active power and reactive power); : Photovoltaic output; :temperature; :humidity; : light intensity; :Voltage; :frequency; : phase angle; SOC: energy storage state of charge; :Real-time electricity prices; S104: performing data normalization processing; The z-score standardization method is used, and the formula is: ; Where, is the original data, is the mean value of the data, is the standard deviation.
[0008] In the preferred solution, the closed-loop control link dynamically triggers multi-level control actions by obtaining the deviation between the prediction result and the actual state of the power grid in real time: When the deviation is greater than 10%, the load and energy storage charging and discharging sequence can be adjusted within 500ms; When the deviation is greater than 15%, energy storage discharge is enabled within 300ms and the backup power priority is optimized based on the real-time electricity price; When communication is interrupted, the system switches to a local lightweight model to maintain control (response ≤ 0.5 seconds). At the same time, the model parameters and control thresholds are adaptively adjusted through the online learning module to optimize the response accuracy.
[0009] In the preferred solution, energy storage charging and discharging priority optimization includes: When the energy storage SOC is less than 30% and the electricity price is at a valley value, charging is prioritized and the backup power supply is delayed; When the energy storage SOC is greater than 80% and the deviation is greater than 10%, discharge is prioritized to smooth out load fluctuations.
[0010] In the preferred solution, the execution logic of the multi-level stabilization control strategy includes: Detecting the level of prediction bias; Dynamically trigger interruptible load adjustment, energy storage discharge, or backup power activation based on deviation thresholds; Evaluate control effectiveness and adjust strategies in real time.
[0011] In the preferred solution, prediction and control are maintained through local lightweight models during communication outages: Maintain prediction and control using locally cached data and real-time collection of key microgrid parameters; After communication is restored, synchronize global data with the cloud and recalibrate model parameters.
[0012] In the preferred embodiment, the CNN-LSTM-AM hybrid prediction model performs model training, including: After data collection and preprocessing, the training set, validation set, and test set are divided into training, validation, and test sets according to a preset ratio. During the training process, the weight coefficient is dynamically adjusted based on the real-time deviation data fed back by the closed-loop control link. The system is automatically optimized based on the validation set performance and online control effect. The loss function uses the dynamically weighted weighted mean square error (WMSE), and the formula is: ; Where, is the mean square error of load power prediction, is the mean square error of photovoltaic output prediction, α is the dynamic weight coefficient; The calculation formula is: ; Where, is the actual load power value, To predict the load power value, is the number of data points; The calculation formula is: ; Where, is the actual photovoltaic output value, To predict the photovoltaic output value, is the number of data points; The Adam optimizer is used and the learning rate is set to 0.001; When the model training reaches the preset number of iterations, the optimal prediction model is saved.
[0013] In the preferred solution, the formula for calculating the geographical distance weight between the photovoltaic array and the load center is: ; Where, is the distance between the ith PV array and the load center, σ is the spatial attenuation coefficient (default value = 1km), is the light intensity at time t, The maximum light intensity of the day.
[0014] The present invention provides a microgrid power load forecasting and dynamic control method based on CNN-LSTM-AM. Aiming at the problems of output intermittency, load fluctuation in seconds, and complex spatiotemporal coupling of multi-source data caused by the access of a high proportion of renewable energy in microgrids, the present invention collects microgrid-specific parameters such as load data, environmental data, grid status data, and energy storage SOC, and performs data preprocessing to construct a CNN-LSTM-AM hybrid prediction model and perform model training. The wide-area spatial characteristics of distributed photovoltaic / wind power are extracted through multi-scale one-dimensional convolution kernels, and the spatiotemporal correlation between load and renewable energy is focused on in combination with a dynamic attention mechanism. The load power and photovoltaic / wind power output are synchronously predicted using dual-task output. The prediction results and the actual state of the grid are fed back in real time through a closed-loop control link, and a multi-level stabilization control strategy is triggered according to the deviation level to achieve dynamic control, enhance the spatiotemporal feature coupling capability, solve the prediction deviation problem of a single data source, improve the control response speed, ensure that the prediction-control closed loop is lag-free, the main task predicts the load, and the auxiliary task predicts the photovoltaic / wind power output, and the scheduling strategy is collaboratively optimized, thereby improving the model's anti-interference ability and the model's comprehensive predictive ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The present invention will be further described below with reference to the accompanying drawings and examples: Figure 1 It is a system architecture diagram of the present invention; Figure 2 This is the structural diagram of the CNN-LSTM-AM model of the present invention; Figure 3 This is a comparison chart of the load mutation response between the present invention and the traditional method Figure 4 Comparison of performance indicators of industrial microgrids using the present invention and traditional methods Figure 5 This is a timing diagram of communication interruption degradation control according to the present invention; Figure 6 This is a flow chart of the multi-stage stabilization strategy of the present invention; Figure 7 This is a real-time response timing diagram of the closed-loop control of the present invention; Figure 8 This is a comparison chart of the training loss function convergence of the present invention and other traditional methods; Figure 9 This is a comparison chart of the prediction errors of the present invention and other traditional methods; Figure 10 It is a comparison chart of the predicted results and actual values of the present invention and other traditional methods; Figure 11 Schematic diagram of multivariate data fusion of the present invention. DETAILED DESCRIPTION
[0016] Example 1 like Figure 1-11 As shown, a microgrid power load forecasting and dynamic control method based on CNN-LSTM-AM includes the following steps: S1: Collect multi-source data, including load data, environmental data, grid status data, photovoltaic / wind power output, energy storage SOC and real-time electricity price, and perform data preprocessing; S2: Construct a CNN-LSTM-AM hybrid prediction model, which includes a sequentially connected input layer, CNN layer, LSTM layer, AM layer, and output layer. The CNN layer includes a dual-branch multi-scale one-dimensional convolution kernel. The outputs of the input layer and LSTM layer are connected to the DSTCW module, which outputs weighted load characteristics and PV / wind power characteristics. S3: Use the pre-processed multi-source data to train the CNN-LSTM-AM hybrid prediction model, use a dynamic weighted loss function to simultaneously optimize the load and renewable energy output forecasts, and save the optimal prediction model; S4: Based on the output of the optimal prediction model, the charging and discharging priorities are optimized based on the energy storage SOC and real-time electricity prices. A multi-level coordinated stabilization strategy is triggered through a closed-loop control link to achieve dynamic control. Specifically: Trigger multi-level stabilization strategy and execute closed-loop optimization process: Statistical forecast deviation every 15 minutes: If the load forecast mean absolute error (MAPE) is greater than 4%, model parameter optimization is triggered.
[0017] Dynamic attention mechanism optimization: Based on the latest 30 days of data, update the spatial attenuation coefficient σ, the formula is: ; Loss function weight adjustment: The weight α is dynamically set according to the real-time electricity price volatility (α=0.8 during peak hours and α=0.4 during low hours).
[0018] Control threshold iteration: If the deviation is still greater than 10% after 5 consecutive control attempts, the trigger threshold will be lowered from 10% to 8%.
[0019] After communication is restored, synchronize global data and calibrate the optimized parameters.
[0020] In this embodiment, CNN stands for Convolutional Neural Network (CNN), LSTM stands for Long Short-Term Memory (LSTM), AM stands for Dynamic Attention Mechanism (AM), and DSTCW stands for Dynamic Spatio-Temporal Coupled Attention Mechanism.
[0021] This embodiment collects multi-source data, performs data preprocessing, constructs a CNN-LSTM-AM hybrid prediction model, and after model training, obtains a power load forecast sequence. Through a closed-loop control link, the prediction results and the actual state of the power grid are fed back in real time, triggering a multi-level stabilization control strategy to achieve dynamic control, enhancing the coupling capability of spatiotemporal features, solving the problem of prediction deviation from a single data source, improving the control response speed, ensuring that the prediction-control closed loop has no lag, the main task predicts load, and the auxiliary task predicts photovoltaic / wind power output, collaboratively optimizing the scheduling strategy, improving the model's anti-interference ability, and improving the model's comprehensive predictive ability.
[0022] like Figure 1-2 As shown in the figure, the composition and data flow of the entire system include a multi-source data acquisition module (smart meter, weather station, WAMS), a data preprocessing module, a CNN-LSTM-AM hybrid prediction model, a closed-loop control module, and a real-time feedback mechanism, reflecting the complete process from data acquisition to prediction and control.
[0023] In the preferred solution, the structure of the CNN-LSTM-AM hybrid prediction model is as follows: Input layer: Receives multi-source data of microgrids with a 24-hour time step, with a feature dimension of 12 (including load power, photovoltaic output, temperature, energy storage SOC, real-time electricity price, etc.); CNN layer: The first branch: a 3×1 one-dimensional convolution kernel is used to extract the local spatial features of the distributed photovoltaic array (such as single array output fluctuation).
[0024] The second branch uses a 5×1 one-dimensional convolution kernel to capture the wide-area correlation of multiple photovoltaic clusters. The outputs of the two branches are fused to generate 64 feature maps, and the activation function is ReLU. The LSTM layer is a recurrent neural network composed of 128 hidden units, which captures the long-term dependency between load and renewable energy output across time periods.
[0025] AM layer: Through the dynamic spatiotemporal coupled attention mechanism (DSTCW), the spatiotemporal feature weights are dynamically assigned based on the geographical distance weight between the photovoltaic array and the load center and the time series light intensity coefficient (for example, the weight is increased to 0.8 during the high light period at noon and reduced to 0.2 at night). The activation function is Softmax. Dual-task output layer: Main task output layer: The fully connected layer outputs the load power forecast value for the next 24 hours (including interruptible load power).
[0026] Auxiliary task output layer: independent fully connected layer synchronously outputs photovoltaic / wind power output forecast values; Figure 2 As shown, in this embodiment, the input shape of the input layer is defined, including the number of time steps (24 hours) and the number of features (such as temperature, light intensity, etc.) of the sequence data.
[0027] CNN layer configuration: A 3×1 temporal convolution kernel is used to extract the spatial local features of the load data. The number of output feature maps is 64, and the activation function is ReLU.
[0028] LSTM layer configuration: contains 128 hidden units to capture long-term temporal dependency features.
[0029] In this example, the primary and secondary tasks share the spatiotemporal features extracted by the CNN-LSTM-AM, but decouple the tasks through independent fully connected layers (i.e., output layers), weight matrices, and bias vectors. The loss function uses a dynamically weighted mean squared error (with an initial weight of α = 0.7).
[0030] like Figure 2 As shown in the figure, the model extracts local and wide-area spatial features through multi-scale CNN branches, the LSTM layer integrates cross-period temporal dependencies, the AM layer focuses on key spatiotemporal correlations, and finally the dual-task output layer achieves synchronous and accurate prediction of load and renewable energy output.
[0031] In the preferred solution, the multi-source data specifically includes: Load data includes active power (such as the power consumed by industrial equipment, air conditioners, lighting systems, etc.), reactive power (such as the reactive power generated by equipment such as transformers and capacitors), and interruptible load identification.
[0032] Environmental data include temperature, humidity, light intensity and photovoltaic array tilt angle.
[0033] Grid status data includes voltage, frequency, phase angle and energy storage SOC.
[0034] Microgrid-specific data: real-time electricity prices, distributed energy location coordinates.
[0035] In this embodiment, a weather station is used to collect temperature, humidity, and light intensity data with a sampling frequency of 1 minute; a WAMS is used to collect voltage, frequency, and phase angle data with a sampling frequency of 10 milliseconds; the data obtained in steps S11-S13 are arranged in chronological order to generate a power load information sequence, and then its original data set is constructed.
[0036] like Figure 2 As shown in the figure, it is the structure diagram of the CNN-LSTM-AM hybrid prediction model. The data passes through the input layer, the CNN layer to extract spatial features, the LSTM layer to capture time dependencies, the AM layer to allocate weights to focus on key features, and finally the power load prediction value is obtained through the output layer.
[0037] In the preferred embodiment, step S1 data preprocessing includes: S101: Collect multi-source data and use a sliding window mechanism to perform time alignment.
[0038] S102: Data cleaning and outlier processing: missing value processing is performed according to the length of the cycle, and outlier detection and correction are performed, and the input data is eliminated using the z-score standardization method.
[0039] S103: Data fusion, arranging the normalized multi-source data in chronological order to generate a power load information sequence. For each time point t, the fused data vector expression is: .
[0040] The fused data vector is expressed as: ; Where: is the load power (active power and reactive power); Producing power for photovoltaics; is temperature; for humidity; is the light intensity; is the voltage; is the frequency; is the phase angle; SOC is the energy storage charge state; Real-time electricity price.
[0041] like Figure 11 As shown in the figure, the feature vector structure after multi-source data fusion is It represents the feature vector at time point t, and provides comprehensive input for model training by fusing multi-source data (such as load data, environmental data, and grid status data) into one feature vector.
[0042] S104: Perform data normalization processing; perform normalization processing on the fused data to eliminate the influence of different dimensions and magnitudes. The z-score normalization method is used. The formula is: ; Where, is the original data, is the mean value of the data, is the standard deviation.
[0043] In this embodiment, time series alignment involves unifying data with different sampling frequencies into a common time series framework. For example, 5-minute sampling data from smart meters, 1-minute sampling data from weather stations, and 10-millisecond sampling data from WAMS can be aligned into a unified time series through interpolation or aggregation, such as one data point per minute or per second.
[0044] In the preferred solution, in step S3, the CNN-LSTM-AM hybrid prediction model performs model training, including: After collecting and preprocessing the data, the training set, validation set, and test set are divided according to the preset ratio. During the training process, the weight coefficient is dynamically adjusted through the real-time deviation data fed back by the closed-loop control link, and automatically optimized according to the validation set performance and online control effect.
[0045] Initialization settings: The weight matrix uses He initialization (He Initialization), which is suitable for the network layer with ReLU activation function; ; Where, the bias vector is initialized to a zero vector (b=0) to avoid interference of the initial bias on the output.
[0046] The loss function uses a dynamically weighted weighted mean square error (WMSE), which is automatically adjusted according to the performance of the validation set. The weight matrix and bias vector are updated through backpropagation and the Adam optimizer.
[0047] The calculation formula of the main task output layer is: ; ; Where: is the load power forecast value; It is the forecast value of renewable energy output; , is the weight matrix; , is the bias vector.
[0048] Parameter optimization includes: Forward propagation: Calculate the predicted values of the main and auxiliary tasks.
[0049] Loss calculation: Calculate the total loss based on the dynamically weighted WMSE.
[0050] Back propagation: Calculate the loss pair gradient.
[0051] Parameter update: Parameters are adjusted using the Adam optimizer, with the learning rate set to 0.001 (consistent with claim 9).
[0052] In this embodiment, the main task outputs a load power forecast sequence for the next 24 hours through a linear activation function; the auxiliary task simultaneously outputs a renewable energy (photovoltaic / wind power) output forecast sequence.
[0053] The weighted mean square error of dynamic weights is used as the loss function, with initial weights of 0.7 and 0.3, which are automatically adjusted according to performance during training.
[0054] The WMSE formula is: ; Where, is the mean square error of load power prediction, is the mean square error of photovoltaic output prediction, and α is the dynamic weight coefficient.
[0055] The calculation formula is: ; Where, is the actual load power value, To predict the load power value, is the number of data points.
[0056] The calculation formula is: ; Where, is the actual photovoltaic output value, To predict the photovoltaic output value, is the number of data points.
[0057] The Adam optimizer is used and the learning rate is set to 0.001.
[0058] When the model training reaches the preset number of iterations, the optimal prediction model is saved.
[0059] In the preferred solution, the formula for calculating the geographical distance weight between the photovoltaic array and the load center is: ; Where, is the distance between the ith PV array and the load center, σ is the spatial attenuation coefficient (default value = 1km), is the light intensity at time t, The maximum light intensity of the day.
[0060] In this embodiment, the data after data preprocessing is divided into a training set, a validation set, and a test set according to preset proportions of 90%, 5%, and 5%.
[0061] The weights and biases of each layer of the model are initialized by the He initialization method, and the training set is input into the CNN-LSTM-AM hybrid prediction model. The preset number of iterations can be set according to the size of the data set, and the loss function is reversely optimized. When the preset number of iterations is reached, the model training ends and the optimal prediction model is saved.
[0062] Figure 8This figure shows the convergence of the loss function during training for the CNN-LSTM-AM model in this example and other models. The horizontal axis represents the number of training runs, and the vertical axis represents the WMSE loss value. The model of the present invention achieves faster convergence and lower loss values due to its attention mechanism and dynamic weight adjustment.
[0063] In the preferred solution, S3: Use the multi-source data after data preprocessing to train the CNN-LSTM-AM hybrid prediction model, and adopt a dual-task output structure: Main task: output load power forecast value;.
[0064] Auxiliary task: Output the predicted value of renewable energy output.
[0065] In this embodiment, the output layer calculates: a linear activation function is used to calculate the one-dimensional time series output by the AM layer to obtain the power load forecast sequence for the next 24 hours.
[0066] In this embodiment, the main task predicts load power, and the auxiliary task predicts renewable energy output. The weighted mean square error of dynamic weights is used as the loss function. The initial weights are 0.7 and 0.3, respectively, and are automatically adjusted according to performance during training.
[0067] In the preferred solution, the closed-loop control link dynamically triggers multi-level control actions by obtaining the deviation between the prediction results and the actual state of the power grid in real time: When the deviation is greater than 10%, the load and energy storage charging and discharging sequence can be adjusted to interrupt within 500ms.
[0068] When the deviation is greater than 15%, energy storage discharge is enabled within 300ms and the backup power priority is optimized based on the real-time electricity price.
[0069] When communication is interrupted, the system switches to a local lightweight model to maintain control (response ≤ 0.5 seconds). At the same time, the model parameters and control thresholds are adaptively adjusted through the online learning module to optimize the response accuracy.
[0070] Furthermore, in the preferred solution, the closed-loop control link includes: based on the wide area measurement system (WAMS), real-time synchronization of the main task load forecast value and the actual state of the power grid, and calculating the absolute percentage deviation of the load power using the formula: ; Where, is the actual load power value, is the predicted load power value.
[0071] In the preferred solution, the execution logic of the multi-level stabilization strategy includes: Deviation detection: real-time calculation of load power deviation, specifically: 1) If the deviation is greater than 10%: adjust the interruptible load (such as reducing the load of a flexible production line), and the response time is ≤ 500ms.
[0072] 2) If the current electricity price is at a valley value and the energy storage SOC is less than 30%, the backup power supply will be activated later and charging will be prioritized.
[0073] Deviation > 15%: Energy storage discharge is triggered (response ≤ 300ms), and the discharge power is dynamically limited according to the SOC (full power discharge when SOC > 80%).
[0074] 3) If the real-time electricity price peaks, priority will be given to using backup power rather than energy storage.
[0075] 4) Island mode: When communication is interrupted, the system switches to a local lightweight model and maintains power supply based on the energy storage SOC and local load forecast (response ≤ 0.5 seconds).
[0076] In this embodiment, the dynamic weight coefficient α is adjusted according to the real-time electricity price fluctuation rate: During peak electricity price period (electricity price ≥ 0.8 yuan / kWh): α = 0.8, focusing on load forecast accuracy.
[0077] During the low electricity price period (electricity price ≤ 0.3 yuan / kWh): α = 0.4, focusing on the economic efficiency of photovoltaic output forecast.
[0078] The adjustment cycle is once every minute, and real-time electricity price data is obtained through the cloud API.
[0079] In the preferred solution, energy storage charging and discharging priority optimization includes: When the energy storage SOC is less than 30% and the electricity price is at a valley value, charging is prioritized and the activation of the backup power supply is delayed.
[0080] When the energy storage SOC is greater than 80% and the deviation is greater than 10%, discharge is prioritized to smooth out load fluctuations.
[0081] like Figure 6 The figure shows the triggering logic and execution process of the multi-level stabilization control strategy. Different control actions are performed according to the size of the predicted deviation. For example, if the deviation exceeds 10%, the interruptible load is adjusted, and if it exceeds 15%, energy storage discharge is enabled. The control effect is dynamically evaluated and the strategy is upgraded to ensure grid stability.
[0082] In the preferred solution, when communication is interrupted, the system switches to the local lightweight model to maintain control. The specific features are: The system relies on the following core microgrid parameters that are collected and cached in real time to maintain prediction and control functions: Energy storage SOC: represents the remaining energy storage capacity and is used for optimizing charging and discharging priorities.
[0083] Local load power: active / reactive power ( ), reflecting the real-time electricity demand; Grid status: voltage (V), frequency (f), phase angle (θ), used for stability assessment.
[0084] Renewable energy output: photovoltaic / wind power real-time output ( ).
[0085] Environmental parameters: light intensity (G), temperature (T), supporting short-term output prediction.
[0086] Real-time electricity prices ( ): Basis for economic regulation (such as valley charging).
[0087] 1) Model structure Input layer: Receives local key parameters (energy storage SOC, local load power, voltage / frequency).
[0088] Lightweight CNN layer: A single-branch 3×1 convolution kernel (the number of channels is reduced to 16) to extract local spatial features.
[0089] Lightweight LSTM layer: 32 hidden units, only predicting load and energy storage demand for the next 5 minutes.
[0090] Output layer: The fully connected layer directly outputs control instructions (such as charging and discharging power).
[0091] 2) Training methods Knowledge distillation: Based on the compression training of the main model parameters, the loss function is the mean square error (MSE).
[0092] Frozen optimization: The CNN layer weights are fixed during training, and only the LSTM and output layer parameters are optimized.
[0093] 3) Performance guarantee Parameter quantity: 20% of the main model, adapted to edge devices; Accuracy: Load forecast MAPE ≤ 3.9% (main model 3.1%), response time ≤ 0.5 seconds.
[0094] 4) Closed-loop update After communication is restored, the incremental data during the local control period is synchronized to the cloud.
[0095] The main model parameters are recalibrated based on the incremental data, and the lightweight model weights are updated.
[0096] like Figure 5 As shown in FIG, the timing process of the system performing degradation control in the case of communication interruption.
[0097] After the system detects an interruption, it triggers a degradation strategy, uses local data to maintain prediction and control, and synchronizes data after communication is restored to ensure stable operation of the system under different communication conditions.
[0098] like Figure 7The figure below shows the real-time response between the predicted results and the actual grid status within the closed-loop control chain. The predicted results are then compared with the actual grid status, and deviation feedback triggers control actions. The response time for each link is annotated, highlighting the system's rapid response capabilities.
[0099] like Figure 9 The figure compares the prediction errors of the proposed method with those of other traditional methods. The results show that the proposed method has significantly lower errors than other methods, especially during periods of drastic load fluctuations, demonstrating that the proposed method is more accurate.
[0100] like Figure 10 The figure compares the prediction results and actual values of the method of the present invention and other traditional methods. The prediction curve of the method of the present invention is highly consistent with the actual value, while the deviation from the actual value of the other methods is large, indicating that the method of the present invention can better capture the dynamic changes of power load and improve the prediction accuracy.
[0101] The following is a practical application case of this embodiment in an industrial microgrid scenario.
[0102] 1. System deployment In a microgrid consisting of 20MW of distributed photovoltaics, a 10MW / 50MWh energy storage system, and a 5MW interruptible load, the following data acquisition modules are deployed: Load data: The active and reactive power of interruptible loads are collected at 1-minute intervals through smart meters.
[0103] Environmental data: The weather station collects temperature, humidity, light intensity, and photovoltaic array inclination at 30-second intervals.
[0104] Grid status: WAMS collects voltage, frequency, phase angle, and energy storage SOC at 10 millisecond intervals.
[0105] Economic parameters: Real-time electricity price data is updated every minute via cloud API.
[0106] 2. Data preprocessing and model training Preprocessing: A 24-hour sliding window (5-minute step) was used for normalization, and 15% Gaussian noise was added to enhance robustness.
[0107] Training: The CNN-LSTM-AM model is trained based on preprocessed data, with dual-task outputs for load power and renewable energy output predictions.
[0108] 3. Effectiveness Evaluation: As shown in Table 2, actual operation and verification show that in industrial microgrid scenarios, this embodiment significantly reduces the mean absolute percentage error (MAPE) from 8.7% of the traditional method to 3.1%. The load mutation response time is significantly shortened from 4.2 seconds to 0.7 seconds. The photovoltaic fluctuation absorption rate is increased from 70% to 92%, effectively improving the operational stability of the microgrid and the utilization efficiency of renewable energy.
[0109] Table 1 Data comparison table
[0110] 4. Comparative Analysis like Figure 3 As shown, the traditional method has a response delay of 4.2 seconds when the load changes suddenly, while the present invention compresses the response time to 0.7 seconds through a real-time prediction-control closed loop.
[0111] like Figure 4 As shown in the figure, the present invention is significantly superior to traditional methods in both MAPE and photovoltaic absorption rate, especially in the scenario with a high proportion of renewable energy. It achieves a breakthrough improvement in exchange for a moderate increase in training time, and significantly improves stability and economy, which can better meet the needs of high proportion of renewable energy access.
[0112] Traditional methods have a long response time of approximately 4.2 seconds when load changes occur, making them unable to cope with rapid load changes in a timely manner. This embodiment reduces the load change response time to 0.7 seconds through the rapid prediction of the CNN-LSTM-AM model and real-time feedback from the closed-loop control link, significantly improving the system's response speed and stability.
[0113] The key performance indicators include mean absolute percentage error (MAPE) and photovoltaic fluctuation absorption rate.
[0114] This embodiment achieves accurate prediction and real-time regulation of microgrids with a high proportion of renewable energy by building a CNN-LSTM-AM hybrid prediction model and a closed-loop control link. The beneficial effects are as follows: Deep coupling of spatiotemporal features: Multi-scale convolution (3×1, 5×1) is used to extract local and wide-area spatial features of the photovoltaic cluster. The dynamic spatiotemporal attention mechanism (DSTCW) is combined with weight assignment (such as a midday sunlight weight of 0.8) to solve the problem of single data source prediction bias, reducing the mean absolute error (MAPE) of load forecasting to 3.1%.
[0115] Dual-task collaborative optimization: The main task is to predict load power, and the auxiliary task is to synchronously output photovoltaic / wind power output. Task decoupling and collaborative optimization are achieved through a dynamic weighted loss function (α=0.7), and the photovoltaic fluctuation absorption rate is increased to 92%.
[0116] Second-level closed-loop response: Multi-level stabilization strategies are triggered based on the deviation level (e.g., when the deviation is greater than 10%, load interruption is adjusted within 500ms; when it is greater than 15%, energy storage discharge is enabled within 300ms). The load mutation response time is shortened from 4.2 seconds to 0.7 seconds.
[0117] Improved economic efficiency: By combining energy storage SOC with real-time electricity prices to optimize charging and discharging priorities, the local lightweight model switching response in island mode is ≤ 0.5 seconds, reducing electricity costs by more than 15%.
[0118] This embodiment improves the grid stability and real-time regulation in scenarios with a high proportion of renewable energy through the "prediction-control" closed-loop linkage, providing an innovative solution for the intelligent control of microgrids. The above embodiments are merely preferred technical solutions of the present invention and should not be construed as limiting the present invention. The scope of protection of the present invention shall be the technical solutions set forth in the claims, including equivalent alternatives to the technical features of the technical solutions set forth in the claims. In other words, equivalent alternatives and improvements within this scope are also within the scope of protection of the present invention.
Claims
1. A microgrid power load forecasting and dynamic control method based on CNN-LSTM-AM, characterized in that: The following steps are involved: S1: Collect multi-source data, including load data, environmental data, grid status data, photovoltaic / wind power output, energy storage SOC and real-time electricity price, and perform data preprocessing; S2: Construct a CNN-LSTM-AM hybrid prediction model, which includes a sequentially connected input layer, CNN layer, LSTM layer, AM layer, and output layer. The CNN layer includes a dual-branch multi-scale one-dimensional convolution kernel. The outputs of the input layer and LSTM layer are connected to the DSTCW module, which outputs weighted load characteristics and PV / wind power characteristics. S3: Use the pre-processed multi-source data to train the CNN-LSTM-AM hybrid prediction model, use a dynamic weighted loss function to simultaneously optimize the load and renewable energy output forecasts, and save the optimal prediction model; S4: Based on the output of the optimal prediction model, the charging and discharging priorities are optimized based on the energy storage SOC and real-time electricity prices. A multi-level collaborative stabilization strategy is triggered through a closed-loop control link to achieve dynamic control.
2. The microgrid power load forecasting and dynamic control method based on CNN-LSTM-AM according to claim 1 is characterized in that: The structure of the CNN-LSTM-AM hybrid prediction model includes: The input layer is used to receive multi-source spatiotemporal series data of microgrids; The CNN layer is used for multi-scale one-dimensional convolution with kernels of 3×1 and 5×1 to extract local and wide-area spatial features of distributed photovoltaic / wind power; The LSTM layer is used to capture the long-term temporal dependency between microgrid load and renewable energy output; The AM layer is used to assign weights through DSTCW, focusing on the temporal and spatial correlation between load and photovoltaic output, and achieving dual-task output synchronization. The dual-task output includes: The main task output layer: The multi-source data is processed through the CNN layer to extract spatial features, the LSTM layer to capture time series features, and the AM layer to dynamically assign attention weights. The feature sequence is then input into the fully connected layer of the main task. The neurons in the fully connected layer linearly combine the feature vectors using the weight matrix and bias vector, and calculate the activation function to output the load power forecast values at multiple future time points. This forms the main task output layer and obtains the load power forecast results for the microgrid park. Auxiliary task output layer: The feature sequence of historical renewable energy output data and related environmental data processed by the CNN layer, LSTM layer, and AM layer is input into the fully connected layer corresponding to the auxiliary task; the neurons in the fully connected layer linearly combine the features and calculate through the activation function to output the output forecast values of photovoltaic and wind power, forming the auxiliary task output layer and obtaining the forecast results of renewable energy output.
3. The microgrid power load forecasting and dynamic control method based on CNN-LSTM-AM according to claim 1 is characterized in that: The multi-source data specifically includes: Load data includes active power, reactive power and interruptible load identification; Environmental data includes temperature, humidity, light intensity and photovoltaic array tilt; Grid status data includes voltage, frequency, phase angle and energy storage SOC; Microgrid-specific data: real-time electricity prices, distributed energy location coordinates.
4. The microgrid power load forecasting and dynamic control method based on CNN-LSTM-AM according to claim 1 is characterized in that: The data preprocessing in S1 includes: S101: Collect multi-source data and use a sliding window mechanism to perform time alignment; S102: Data cleaning and outlier processing: missing values are processed according to the length of the cycle, and outlier detection and correction are performed. The input data is eliminated using the z-score standardization method. S103: Data fusion, arranging the normalized multi-source data in chronological order to generate a power load information sequence. For each time point t, the fused data vector expression is: ; Where: is the load power (active power and reactive power); Producing power for photovoltaics; is temperature; for humidity; is the light intensity; is the voltage; is the frequency; is the phase angle; SOC is the energy storage charge state; is the real-time electricity price; S104: performing data normalization processing; The z-score standardization method is used, and the formula is: ; Where, is the original data, is the mean value of the data, is the standard deviation.
5. The microgrid power load forecasting and dynamic control method based on CNN-LSTM-AM according to claim 1 is characterized in that: The closed-loop control link dynamically triggers multi-level control actions by obtaining the deviation between the prediction results and the actual state of the power grid in real time: When the deviation is greater than 10%, the load and energy storage charging and discharging sequence can be adjusted within 500ms; When the deviation is greater than 15%, energy storage discharge is enabled within 300ms and the backup power priority is optimized based on the real-time electricity price; When communication is interrupted, the system switches to a local lightweight model to maintain control (response ≤ 0.5 seconds). At the same time, the model parameters and control thresholds are adaptively adjusted through the online learning module to optimize the response accuracy.
6. The microgrid power load forecasting and dynamic control method based on CNN-LSTM-AM according to claim 5 is characterized in that: Energy storage charging and discharging priority optimization includes: When the energy storage SOC is less than 30% and the electricity price is at a valley value, charging is prioritized and the backup power supply is delayed; When the energy storage SOC is greater than 80% and the deviation is greater than 10%, discharge is prioritized to smooth out load fluctuations.
7. The microgrid power load forecasting and dynamic control method based on CNN-LSTM-AM according to claim 1 is characterized in that: The execution logic of the multi-level stabilization control strategy includes: Detecting the level of prediction bias; Dynamically trigger interruptible load adjustment, energy storage discharge, or backup power activation based on deviation thresholds; Evaluate control effectiveness and adjust strategies in real time.
8. The microgrid power load forecasting and dynamic control method based on CNN-LSTM-AM according to claim 1 is characterized in that: Maintain prediction and control during communication outages using local lightweight models: Maintain prediction and control using locally cached data and real-time collection of key microgrid parameters; After communication is restored, synchronize global data with the cloud and recalibrate model parameters.
9. The microgrid power load forecasting and dynamic control method based on CNN-LSTM-AM according to claim 8 is characterized in that: The CNN-LSTM-AM hybrid prediction model is trained, including: After data collection and preprocessing, the training set, validation set, and test set are divided into training, validation, and test sets according to a preset ratio. During the training process, the weight coefficient is dynamically adjusted based on the real-time deviation data fed back by the closed-loop control link. The system is automatically optimized based on the validation set performance and online control effect. The loss function uses the dynamically weighted weighted mean square error (WMSE), and the formula is: ; Where, is the mean square error of load power prediction, is the mean square error of photovoltaic output prediction, α is the dynamic weight coefficient; The calculation formula is: ; Where, is the actual load power value, To predict the load power value, is the number of data points; The calculation formula is: ; Where, is the actual photovoltaic output value, To predict the photovoltaic output value, is the number of data points; The Adam optimizer is used and the learning rate is set to 0.001; When the model training reaches the preset number of iterations, the optimal prediction model is saved.
10. The microgrid power load forecasting and dynamic control method based on CNN-LSTM-AM according to claim 1 is characterized in that: The formula for calculating the geographical distance weight between the photovoltaic array and the load center is: ; Where, is the distance between the ith PV array and the load center, σ is the spatial attenuation coefficient (default value = 1km), is the light intensity at time t, The maximum light intensity of the day.
Citation Information
Cited By
Multi-model real-time preferential power load prediction method, system, equipment and medium
CN121146198A
Electric power energy storage scheduling method and device based on artificial intelligence
CN121150128A
Rural microgrid group dynamic optimization method, system, device, medium and product
CN121367209A
Load demand prediction method based on space-time attention LSTM, model and construction method
CN121546554A
Energy control method and device based on heuristic proxy loss function, terminal equipment and storage medium
CN121906534A