A microgrid scheduling control optimization method and system based on deep learning

By combining deep learning and reinforcement learning, a microgrid scheduling and control system was constructed, which solved the problems of multi-source information fusion and dynamic scenario adaptability in microgrid scheduling and control, and achieved high-precision prediction and optimized scheduling, thereby improving the utilization rate of clean energy and operation and maintenance efficiency.

CN122437123APending Publication Date: 2026-07-21NINGDE POWER SUPPLY COMPANY STATE GRID FUJIAN ELECTRIC POWER +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NINGDE POWER SUPPLY COMPANY STATE GRID FUJIAN ELECTRIC POWER
Filing Date
2026-04-17
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing microgrid scheduling and control methods fail to effectively integrate multi-source information, resulting in low accuracy of new energy output and load forecasting, weak anti-interference capabilities, difficulty in coping with dynamic uncertainties and fixed weights in multi-objective optimization, and inability to adapt to scenario requirements.

Method used

By employing a deep learning-based approach, a microgrid scheduling and control system is constructed through a dual-model architecture that integrates data acquisition, preprocessing, a Transformer time-series prediction model, and attention mechanism features, combined with a deep reinforcement learning scheduling decision model. This system enables high-precision prediction of renewable energy output and load, as well as scheduling optimization in dynamic scenarios.

Benefits of technology

It maintains low error under extreme weather conditions, improves the utilization rate of clean energy, reduces operation and maintenance costs, ensures power supply continuity, and supports automatic scheduling strategies for diverse application scenarios, enabling unattended operation and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122437123A_ABST
    Figure CN122437123A_ABST
Patent Text Reader

Abstract

The present application relates to a kind of microgrid scheduling control optimization method and system based on deep learning, belong to microgrid scheduling control technical field.The method includes through data acquisition unit, microgrid full-scene multi-source data is collected, and the multi-source data is preprocessed optimization;Through deep learning model unit, construct the double model architecture of Transformer time series prediction model and attention mechanism feature fusion, respectively realize the prediction of new energy output and load;Through scheduling decision unit, construct the scheduling decision model based on deep reinforcement learning, realize the scheduling optimization under dynamic scene;Through execution monitoring unit, build the closed-loop process of scheduling decision, execution feedback and strategy revision.Under the action of deep learning algorithm, even in extreme weather conditions such as rainstorm, typhoon, error can still be strictly controlled, so as to reserve sufficient response time for microgrid scheduling, cooperate rolling optimization strategy, significantly improve clean energy utilization rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of microgrid scheduling and control technology, specifically relating to a microgrid scheduling and control optimization method and system based on deep learning. Background Technology

[0002] Microgrids, as an integrated carrier of distributed energy resources (photovoltaics, wind power, and energy storage) and loads, are the core unit for achieving "dual carbon" goals and energy transition. They are widely used in industrial parks, remote areas, islands, and other scenarios. The core requirement for their dispatch and control is to address three major challenges while ensuring power supply reliability, economy, and environmental protection. However, existing microgrid dispatch and control technologies have significant bottlenecks and are unable to meet the needs of complex scenarios. The specific problems are as follows:

[0003] Existing microgrid dispatch and control methods rely solely on historical power generation data, failing to integrate multi-source information such as meteorological conditions, load characteristics, and equipment status. This results in large prediction errors, poor model generalization ability in the face of extreme weather or sudden load surges, and a tendency to trigger wind and solar power curtailment or power shortages. Furthermore, existing microgrid dispatch and control methods often employ model predictive control or rule-based dispatching, requiring the pre-establishment of microgrid mathematical models and relying on manually set fixed weights, making dynamic adjustments impossible based on the specific scenario. Therefore, a new technical solution is needed to address these issues. Summary of the Invention

[0004] The purpose of this invention is to provide a microgrid scheduling and control optimization method and system based on deep learning, so as to solve the technical problems of current microgrid scheduling and control optimization methods, such as low accuracy of new energy output and load prediction, weak anti-interference ability, scheduling decision relying on fixed models, difficulty in coping with dynamic uncertainty, fixed weights for multi-objective optimization, and inability to adapt to scenario requirements.

[0005] To achieve the above objectives, the technical solution of the present invention is: a microgrid scheduling and control optimization method based on deep learning, comprising:

[0006] The data acquisition unit collects multi-source data from the entire microgrid scenario and performs preprocessing and optimization on the multi-source data from the entire microgrid scenario.

[0007] A dual-model architecture, consisting of a Transformer time-series prediction model and an attention mechanism feature fusion model, is constructed using deep learning model units to achieve prediction of new energy output and load, respectively.

[0008] By constructing a scheduling decision model based on deep reinforcement learning through a scheduling decision unit, scheduling optimization in dynamic scenarios can be achieved.

[0009] A closed-loop process of scheduling decision-making, execution feedback, and strategy correction is established by implementing a monitoring unit.

[0010] Furthermore, the multi-source data of the microgrid across all scenarios includes:

[0011] New energy data: photovoltaic inverter output power, irradiance, module temperature, wind turbine speed, wind speed, and blade pitch angle;

[0012] Load data: user-side voltage, current, power, load type, and historical power consumption patterns;

[0013] Meteorological data: real-time light intensity, wind speed, temperature, and probability of precipitation;

[0014] Equipment status data: Energy storage SOC, PCS charge and discharge efficiency, photovoltaic panel cleanliness, and equipment fault alarms;

[0015] External interactive data: large grid purchase and sale electricity prices, carbon emission trading prices, and backup power start-up and shutdown costs.

[0016] Furthermore, preprocessing and optimization are performed on multi-source data across all microgrid scenarios, including:

[0017] By using sliding window technology to locate abnormal data points, and targeting power anomalies caused by sensor failures and communication interruptions, a hybrid repair model based on bidirectional long short-term memory network and attention mechanism is constructed by mining the time series correlation of normal data at adjacent times and combining it with equipment operating status parameters.

[0018] A three-layer feature extraction strategy is adopted to construct a three-level feature system that includes basic features, derived features, and scene features;

[0019] The maximum-minimum normalization method is used to map data of different dimensions to the [0,1] interval to eliminate scale differences. Furthermore, based on this, the exponential weighted moving average algorithm is introduced to perform time-series smoothing on the normalized data. By dynamically adjusting the smoothing coefficient, short-term data fluctuations are effectively suppressed.

[0020] Furthermore, the three-layer features specifically include:

[0021] Time series characteristics: The daily fluctuation period, weekly load characteristics and seasonal trend of photovoltaic power output are extracted through Fourier transform and wavelet decomposition.

[0022] Correlation features: Based on the XGBoost algorithm, nonlinear mapping relationships between environmental parameters including irradiance, temperature, and humidity and photovoltaic power are mined, and a dynamic feature mapping matrix is ​​established;

[0023] Scene features: Natural Language Processing (NLP) technology is introduced to parse weather forecast text, automatically generate extreme weather labels such as high temperature warning and orange rainstorm signal, and combine calendar information to construct a scene classification system for weekdays, weekends and holidays, forming a high-dimensional vector space containing 120 features.

[0024] Furthermore, the formula for the exponentially weighted moving average algorithm is as follows:

[0025] Let the time series data sequence be x1, x2, ..., x t The EWMA value y at time t t The calculation is as follows:

[0026] y t =α*x t +(1-α)*y t -1

[0027] Where: α is the smoothing coefficient, ranging from 0 to 1, which determines the weight of recent data: the larger α is, the more the weight is tilted towards recent data, and the more sensitive the response to sudden changes; the smaller α is, the stronger the smoothing effect and the more obvious the noise suppression; y t -1 represents the EWMA value at time t-1. The initial value is set to the first term x1 of the sequence or the mean of the first 3-5 terms to avoid initial bias.

[0028] Furthermore, a dual-model architecture is constructed that integrates a Transformer temporal prediction model and an attention mechanism feature fusion, including:

[0029] The unified encoding of multi-source features maps continuous features, including photovoltaic output and irradiance, to the model dimension d_model=128 through a linear layer. At the same time, EWMA smoothing is added to reduce sensor noise. Then, extreme weather labels and time period labels are transformed into low-dimensional vectors of d_model=128 through an embedding layer to avoid dimensionality expansion caused by one-hot encoding. Finally, the processed continuous features and discrete features are concatenated at time steps to form a unified input tensor, ensuring that the encoder can capture both temporal patterns and scene influences simultaneously.

[0030] To optimize multi-scale temporal dependencies and feature weights, we first designed multi-head attention parameters with 8 heads (h=8) and each head having a dimension of d_k=d_v=d_model / h=16 to avoid computational efficiency degradation due to excessively high single-head dimensions. Then, we added a lower triangular temporal mask before attention calculation to ensure that when calculating the feature at the i-th time step, it only associates the data from the previous i time steps, which conforms to the causal logic of microgrid temporal sequences. Finally, through the attention weight matrix of multi-head attention, we automatically assigned higher weights to high-impact features, thereby achieving useful feature enhancement and redundant feature suppression.

[0031] By adding layer normalization and residual connections before and after FFN, gradient vanishing during training is avoided, overfitting is suppressed, and the generalization of the Encoder in the multi-sample scenario of microgrid is ensured, thereby achieving nonlinear feature transformation and enhancement.

[0032] It is adapted to photovoltaic / wind power output prediction, effectively captures 72-hour long-term time dependence, and the training time for a single round is less than 2 hours. It is also adapted to load prediction. An additional layer is used to mine more fine-grained feature associations. The final output feature matrix contains all the time-series patterns and feature association information of historical data, providing core support for the decoder prediction.

[0033] The construction of the attention mechanism feature fusion layer includes the following steps:

[0034] Let the temporal feature matrix be Q, the static feature matrix be K=V, and the attention weight formula be:

[0035]

[0036] Where Q is the query matrix, representing the target feature that the model is currently focusing on. Other related features need to be found through Q. K is the key matrix, representing the index features used to match Q. The similarity between the column vectors of K and the row vectors of Q is calculated to determine the feature correlation. V is the value matrix, representing the original feature values ​​to be weighted and fused. The contribution of V is ultimately adjusted using attention weights. T is the transpose of the matrix, and d... k The feature dimension of Q / K is used for scaling. This avoids the Softmax gradient from disappearing due to excessively large values;

[0037] The output of the new energy prediction encoder is used as K and V, and the output of the load prediction encoder is used as Q to calculate the attention weight.

[0038] If the predicted value of photovoltaic output is high, the model automatically increases the weight of air conditioning load in the load forecast, adapts the coupling relationship between the two, and reduces the load forecast error by 0.5 to 1 percentage point.

[0039] Heatmaps are used to display attention weights, assisting manual identification of key features and elimination of redundancy.

[0040] Based on the feedback of prediction errors, the number of attention heads and dimensions are adjusted in real time.

[0041] Furthermore, the constructed model is trained and optimized, including:

[0042] One year of historical data from the microgrid was collected and divided into training, validation, and test sets in a 7:2:1 ratio, including data from special scenarios such as extreme weather and equipment failures.

[0043] Temporal shifting and noise injection are applied to the training set to improve the model's generalization ability;

[0044] The composite loss function using MAE and temporal smoothing loss is as follows:

[0045]

[0046] in, The mean absolute error, This is the predicted value at time step t. Let t be the predicted value at time step t+1, T be the length of the predicted sequence, and β be the weighting coefficient of the time series smoothing loss.

[0047] Furthermore, a scheduling decision model based on deep reinforcement learning is constructed, including:

[0048] Modeling is performed to address the scheduling requirements and problems in microgrids.

[0049] Model design for DQN and core components of multi-objective reward function;

[0050] Train and optimize the designed model;

[0051] Deploy and run the trained and optimized model for verification.

[0052] Furthermore, a closed-loop process of scheduling decision-making, execution feedback, and strategy correction is established through the execution monitoring unit, including:

[0053] Scheduling decision: The scheduling strategy is converted into equipment control commands and sent to the equipment in real time via industrial Ethernet, with a command execution delay of ≤100ms;

[0054] Execution feedback: The execution results of the equipment are collected in real time through sensors, compared with the target value of the scheduling strategy, and the deviation is calculated;

[0055] Strategy correction: If the deviation is ≥5%, the scheduling strategy will be automatically fine-tuned. The closed-loop correction frequency is 10 seconds / time to ensure that the deviation rate between the plan and the execution is ≤3%.

[0056] This invention also provides a deep learning-based microgrid scheduling control optimization system for implementing the above-described method, comprising:

[0057] The data acquisition unit is used to collect multi-source data from the entire microgrid scenario;

[0058] A data preprocessing unit, connected to the data acquisition unit, is used to preprocess and optimize the multi-source data.

[0059] The deep learning model unit, connected to the data preprocessing unit, is used to run the prediction model and the scheduling decision model;

[0060] The scheduling decision unit, connected to the deep learning model unit, is used to generate scheduling strategies;

[0061] The execution monitoring unit is connected to the scheduling decision unit and is used to execute the scheduling strategy and achieve closed-loop control.

[0062] Furthermore, the data acquisition unit transmits the collected data to the cloud or edge computing nodes via 5G or LoRa networks. The data acquisition frequency is: once per second for new energy and load data, and once every 5 minutes for meteorological data. The data preprocessing unit includes an edge computing node, a data cleaning engine, and a feature engineering module, used to complete outlier repair, feature extraction, and data normalization in real time, with a processing latency of no more than 500 milliseconds. The execution monitoring unit includes a device control unit, a monitoring screen, and an alarm module. The device control unit is used to convert scheduling strategies into control commands and send them to the execution devices, with a command execution latency of no more than 100 milliseconds. The system automatically triggers strategy fine-tuning when the deviation rate between planning and execution is greater than or equal to 5%, with a closed-loop correction frequency of once every 10 seconds.

[0063] Compared with the prior art, the present invention has the following beneficial effects:

[0064] 1. Even under extreme weather conditions such as heavy rain and typhoons, the error of this invention can still be strictly controlled, thus reserving sufficient response time for microgrid scheduling. Combined with rolling optimization strategies, it significantly improves the utilization rate of clean energy.

[0065] 2. This invention achieves synergistic optimization of electricity purchase costs and operation and maintenance costs, reduces operation and maintenance costs, and is conducive to improving environmental and economic benefits.

[0066] 3. When faced with extreme disturbances such as sudden shutdown of the energy storage converter or a sharp drop in wind power caused by gusts, the distributed collaborative control algorithm of this invention can quickly restore system stability and effectively ensure the continuity of power supply to critical loads.

[0067] 4. This invention supports diverse application scenarios such as industrial parks, islands, and remote areas. By adjusting the scenario labels, the optimal scheduling strategy can be automatically matched, and the system upgrade threshold can be greatly reduced, ensuring the sustainable development of microgrid technology.

[0068] 5. This invention enables unattended operation of the entire daily scheduling process, requiring manual intervention only in rare and extreme failures. This reduces the workload of maintenance personnel and allows for the early detection of potential hazards compared to manual inspections, thereby improving maintenance response efficiency and significantly reducing maintenance costs and safety risks. Attached Figure Description

[0069] Figure 1 This is a flowchart of the microgrid scheduling and control optimization method of the present invention;

[0070] Figure 2 This is a flowchart of the microgrid scheduling and control optimization system of the present invention. Detailed Implementation

[0071] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings.

[0072] This invention provides a microgrid scheduling and control optimization method based on deep learning, comprising:

[0073] The data acquisition unit collects multi-source data from the entire microgrid scenario and performs preprocessing and optimization on the multi-source data from the entire microgrid scenario.

[0074] A dual-model architecture, consisting of a Transformer time-series prediction model and an attention mechanism feature fusion model, is constructed using deep learning model units to achieve prediction of new energy output and load, respectively.

[0075] By constructing a scheduling decision model based on deep reinforcement learning through a scheduling decision unit, scheduling optimization in dynamic scenarios can be achieved.

[0076] A closed-loop process of scheduling decision-making, execution feedback, and strategy correction is established by implementing a monitoring unit.

[0077] This invention also provides a deep learning-based microgrid scheduling control optimization system for implementing the above-described method, comprising:

[0078] The data acquisition unit is used to collect multi-source data from the entire microgrid scenario;

[0079] A data preprocessing unit, connected to the data acquisition unit, is used to preprocess and optimize the multi-source data.

[0080] The deep learning model unit, connected to the data preprocessing unit, is used to run the prediction model and the scheduling decision model;

[0081] The scheduling decision unit, connected to the deep learning model unit, is used to generate scheduling strategies;

[0082] The execution monitoring unit is connected to the scheduling decision unit and is used to execute the scheduling strategy and achieve closed-loop control.

[0083] The following are specific implementation examples of the present invention.

[0084] Example 1:

[0085] A deep learning-based microgrid scheduling and control optimization method, see [link to relevant documentation]. Figure 1 The optimization steps include the following:

[0086] S1. First, the data acquisition unit collects multi-source data from the entire microgrid scenario to cover all dimensions of information required for scheduling.

[0087] Microgrid full-scenario multi-source data:

[0088] New energy data: photovoltaic inverter output power, irradiance, module temperature, wind turbine speed, wind speed, and blade pitch angle;

[0089] Load data: user-side voltage, current, power, load type, and historical power consumption patterns;

[0090] Meteorological data: real-time light intensity, wind speed, temperature, and probability of precipitation;

[0091] Equipment status data: Energy storage SOC, PCS charge and discharge efficiency, photovoltaic panel cleanliness, and equipment fault alarms;

[0092] External interactive data: power grid purchase and sale prices, carbon emission trading prices, and backup power start-up and shutdown costs;

[0093] Then, the collected multi-source data is preprocessed and optimized to reduce noise, format, and missing rate. The specific steps include:

[0094] M1. First, the sliding window technique is used to locate abnormal data points. For power anomalies caused by sensor failure and communication interruption, the time series correlation of normal data at adjacent times is mined and combined with equipment operating status parameters for joint repair, thereby constructing a hybrid repair model based on bidirectional long short-term memory network and attention mechanism.

[0095] M2. It adopts a three-layer feature extraction strategy to construct a three-level feature system that includes basic features, derived features, and scene features;

[0096] M3. The maximum-minimum normalization method is used to uniformly map data of different dimensions to the [0,1] interval to eliminate scale differences; and on this basis, the exponential weighted moving average algorithm is introduced to perform time-series smoothing on the normalized data. By dynamically adjusting the smoothing coefficient, short-term data fluctuations are effectively suppressed.

[0097] In M2, the three-layer features specifically include:

[0098] Time series characteristics: The daily fluctuation period, weekly load characteristics and seasonal trend of photovoltaic power output are extracted through Fourier transform and wavelet decomposition.

[0099] Correlation features: Based on the XGBoost algorithm, the nonlinear mapping relationship between environmental parameters such as irradiance, temperature, and humidity and photovoltaic power is mined, and a dynamic feature mapping matrix is ​​established;

[0100] Scene features: Natural language processing (NLP) technology is introduced to parse weather forecast text, automatically generate extreme weather labels such as high temperature warning and orange rainstorm signal, and combine calendar information to build a scene classification system for weekdays, weekends and holidays, forming a high-dimensional vector space containing 120 features;

[0101] In M3, the formula for the exponentially weighted moving average algorithm is:

[0102] Let the time series data sequence be x1, x2, ..., x t (e.g., microgrid photovoltaic output, load power), EWMA value y at time t. t The calculation is as follows:

[0103] y t =α*x t +(1-α)*y t -1

[0104] Where: α is the smoothing coefficient (range 0-1), which determines the weight of recent data: the larger α is, the more the weight is tilted towards recent data, and the more sensitive the response to sudden changes; the smaller α is, the stronger the smoothing effect and the more obvious the noise suppression; y t -1 is the EWMA value at time t-1. The initial value can be set to the first term of the sequence x1 or the mean of the first 3-5 terms to avoid initial bias.

[0105] In summary, thanks to deep learning algorithms, even under extreme weather conditions such as heavy rain and typhoons, the error can still be strictly controlled, thus reserving sufficient response time for microgrid scheduling. Combined with rolling optimization strategies, this significantly improves the utilization rate of clean energy.

[0106] S2. After step S1 is completed, a dual-model architecture of Transformer time-series prediction model and attention mechanism feature fusion is constructed through deep learning model unit to realize high-precision prediction of new energy output and load respectively.

[0107] Building a Transformer time series prediction model includes the following steps:

[0108] X1. First, the multi-source features are uniformly encoded. Continuous features such as photovoltaic power output and irradiance are mapped to the model dimension d_model=128 through a linear layer. At the same time, EWMA smoothing is added to reduce sensor noise. Then, extreme weather labels and time period labels are transformed into low-dimensional vectors of d_model=128 through an embedding layer to avoid dimensionality expansion caused by one-hot encoding. Then, the processed continuous features and discrete features are concatenated according to time steps to form a unified input tensor, ensuring that the Encoder can capture both temporal patterns and scene influences at the same time.

[0109] X2. Next, optimize the multi-scale temporal dependency and feature weights. In this process, first design the multi-head attention parameters, with the number of heads h=8 and the dimension of each head d_k=d_v=d_model / h=16 to avoid the computational efficiency decrease due to the excessively high dimension of a single head. Then, add a lower triangular temporal mask (mask[i][j]=0 if i≥j, otherwise -∞) before attention calculation to ensure that when calculating the feature of the i-th time step, only the data of the previous i time steps are associated, which conforms to the causal logic of the microgrid temporal sequence. Then, through the attention weight matrix of the multi-head attention, higher weights are automatically assigned to high-impact features, thereby realizing the enhancement of useful features and the suppression of redundant features.

[0110] X3. Then, layer normalization and residual connections are added before and after FFN. The layer normalization parameter ε=1e-5 to avoid gradient vanishing during training and suppress overfitting, thereby ensuring the generalization of the Encoder in the micro-network multi-sample scenario and realizing non-linear feature transformation and enhancement.

[0111] X4. Further adaptation to photovoltaic / wind power output prediction can effectively capture 72-hour long-term time-series dependence, while the training time for a single round is less than 2 hours. Adaptation to load prediction, with an additional layer for mining finer-grained feature associations, the final output feature matrix contains all the time-series patterns and feature association information of historical data, providing core support for Decoder prediction.

[0112] The construction of the attention mechanism feature fusion layer includes the following steps:

[0113] X5. First, let the temporal feature matrix be Q, and the static feature matrix be K=V. The attention weight formula is:

[0114]

[0115] Where Q is the target feature currently being focused on by the model, and other related features need to be found through Q; K is the index feature used to match Q, and the similarity between the column vector of K and the row vector of Q is calculated to determine the feature correlation; T is the transpose of the matrix; V is the original feature value that needs to be weighted and fused; and finally, the contribution of V is adjusted through attention weights. k The feature dimension is Q / K, used to scale the result of QK^T to avoid the softmax gradient from disappearing due to excessively large values;

[0116] X6. Using the output of the new energy prediction encoder as K and V, and the output of the load prediction encoder as Q, calculate the attention weights.

[0117] X7. If the photovoltaic output forecast is high (e.g., at noon), the model automatically increases the weight of air conditioning load in the load forecast to adapt to the coupling relationship between the two (e.g., when photovoltaic output is high at noon in summer, residential air conditioning load is also high), thus reducing the load forecast error by 0.5 to 1 percentage point.

[0118] X8. Display attention weights through heatmaps (e.g., in new energy prediction, the attention weight of irradiance features is 0.4, and temperature is 0.2) to assist manual identification of key features and elimination of redundancy (e.g., wind direction feature weight < 0.05, which can be removed later).

[0119] X9. Based on prediction error feedback, adjust the number and dimensions of attention heads in real time (e.g., under extreme weather conditions, increase the number of temporal attention heads from 8 to 10 to improve the model's ability to capture sudden temporal changes);

[0120] The steps for training and optimizing the constructed model include:

[0121] W1. Collect one year of historical data (8760h) of microgrid, and divide it into training set (6132h), validation set (1752h), and test set (876h) in a 7:2:1 ratio. It includes special scenario data such as extreme weather (rainstorm, typhoon) and equipment failure (accounting for 10%).

[0122] W2. Apply time-series shifting (e.g., shifting data for a specific day by ±2 hours) and noise injection (e.g., adding ±1% Gaussian noise to power data) to the training set to improve model generalization (avoid overfitting to data for specific dates).

[0123] W3. Employ a composite loss function combining MAE (Mean Absolute Error) and time-series smoothing loss:

[0124]

[0125] Where β=0.1, the time-series smoothing loss suppresses oscillations in the prediction curve (such as fluctuations in adjacent time steps of the new energy output prediction curve), T is the length of the prediction sequence (number of time steps), and y t Let y^ be the actual value at time step t. t Let t be the predicted value at the t-th time step, and β be the weighting coefficient of the time series smoothing loss;

[0126] W4. The AdamW optimizer is selected, the initial learning rate is set to 1e-4, and cosine annealing learning rate scheduling is used (the learning rate is reduced in the later stage of training to avoid parameter oscillation). The weight decay coefficient is set to 1e-5 (to suppress overfitting).

[0127] S3. After step S2 is completed, the scheduling decision unit constructs a scheduling decision model of DQN and multi-objective reward function to achieve real-time optimization in dynamic scenarios. The construction of the scheduling decision model of DQN and multi-objective reward function includes the following steps:

[0128] V1. First, modeling is performed to analyze and address the scheduling requirements and problems of the microgrid.

[0129] First, a survey of microgrid scenarios and physical parameters was conducted, including the following key parameters of microgrids such as distributed energy (PV / wind power capacity), energy storage systems (rated capacity / charge and discharge efficiency), load type (industrial / residential proportion), and interaction constraints with the main power grid (electricity purchase and sale limit);

[0130] Next, the economic, environmental, and reliability objectives of microgrid scheduling are transformed into calculable quantitative indicators, and the priority and constraint thresholds of each objective are determined, thereby quantifying the multi-objective optimization requirements.

[0131] Then, the microgrid scheduling problem is mapped into a reinforcement learning agent-environment interaction framework, thereby modeling the reinforcement learning problem;

[0132] The environment includes the microgrid physical system, encompassing dynamic disturbances such as fluctuations in renewable energy output, load changes, and equipment failures;

[0133] Intelligent agents include microgrid energy management systems, which are responsible for outputting dispatch actions such as energy storage charging and discharging, and large grid power purchase and sale;

[0134] V2. Next, we will design the model for the core components of DQN and the multi-objective reward function.

[0135] First, we screen the key variables that affect scheduling decisions and construct a high-dimensional, fully informative state vector. The steps are as follows:

[0136] Twelve core variables were selected from the multi-source data of the microgrid (e.g., the preceding state-space definition: P). pv ,P wind ,P load (e.g., SOC), excluding redundant variables (such as wind direction, which has a negligible impact on photovoltaic output and can be excluded).

[0137] Design specific calculation formulas for each variable

[0138] To ensure that the status can be collected and calculated in real time.

[0139] Using S norm =2*(S−S) min / S max -S min-1 maps all variables to the interval [-1,1] to avoid DQN training imbalance caused by differences in units (such as kW-level power versus ℃-level temperature).

[0140] Redesign a set of discrete actions that conform to the physical constraints of the device to ensure that the actions output by the agent can be executed by the microgrid device. The steps are as follows:

[0141] First, five core dispatch actions were identified (energy storage charging and discharging, new energy output restriction, large grid power purchase and sale, and diesel generator start-up and shutdown).

[0142] Next, based on equipment constraints, the continuous actions are discretized into a finite number of levels (e.g., energy storage charging and discharging power is divided into five levels: -3000kW, -1500kW, 0, 1500kW, and 3000kW, corresponding to maximum discharge → stop → maximum charging), and the total number of actions is controlled to be between 400 and 500 (balancing accuracy and computational efficiency).

[0143] Then, safety boundaries are set for each action (e.g., when SOC=20%, energy storage discharge actions are prohibited; when the power grid sales limit is 2MW, -3000kW power sales actions are prohibited) to avoid invalid or dangerous actions;

[0144] Next, a reward function with dynamic weights is constructed to achieve multi-objective adaptive optimization. The steps are as follows:

[0145] Economic incentives: C max The maximum daily cost (e.g., 8000 yuan). , In this example, the different types of operating costs are electricity purchase cost and equipment operation and maintenance cost. For system revenue, in this example, it is electricity sales revenue. The lower the cost, the closer the reward is to 0;

[0146] Environmental incentives: E max This represents the maximum environmental loss in a single day (e.g., 2000 kWh). , These represent the amount of electricity wasted and the amount of carbon emissions, respectively. , These are the corresponding weights; the less electricity wasted and the less carbon emissions, the closer the reward is to 1.

[0147] Reliability Bonus: R max Penalty represents the maximum daily reliability loss (e.g., 300), indicating a reliability penalty caused by events such as power outages or voltage exceeding limits. The penalty coefficient is 1 when there is no interruption;

[0148] Dynamic weight adjustment: Design scene label recognition rules (e.g., industrial daytime: load > 4.8MW and time period 8:00-18:00), and assign weights to different scenes (e.g., industrial daytime α=0.3, β=0.2, γ=0.5).

[0149] Develop a weight switching module to identify the current scene and update α, β, and γ in real time with a response time of <1 second;

[0150] Overall reward calculation: R = α * R eco +β*R env +γ*R pen This ensures that the reward value is within the range of [-1, 1], which facilitates DQN learning;

[0151] Finally, a neural network adapted to the micronetwork state and action scale was designed to ensure Q-value prediction accuracy and training efficiency. The steps are as follows:

[0152] First, a 3-layer fully connected and BatchNorm structure is adopted, with a 12-dimensional input layer (state), a hidden layer of 128→256→128 dimensions (ReLU activation), and a 450-dimensional output layer (action Q value), thus designing the network topology;

[0153] Then add the experience replay pool: capacity 10 5 Store "state-action-reward-new state" interaction samples, and randomly sample them during training (batch_size=64) to reduce sample correlation;

[0154] Target network: Consistent with the evaluation network structure, network parameters are evaluated synchronously every 1000 steps to avoid oscillations in Q-value estimation;

[0155] ε-greedy strategy: ε starts at 0.9 and decreases linearly to 0.1, balancing exploration (new actions) and exploitation (known superior actions).

[0156] Loss function: Temporal difference (TD) error loss;

[0157] γ = 0.9 (discount factor);

[0158] Optimizer: Adam optimizer, learning rate 1e-4, weight decay 1e-5, ensuring stable convergence of the network;

[0159] V3. Then, the designed model is trained and optimized.

[0160] First, historical data from the microgrid was collected and preprocessed to build a training sample library covering multiple scenarios.

[0161] Data collection: Collect at least 1 year of microgrid operation data (8760h), including normal weather (85%), extreme weather (10%), and equipment failure (5%) scenarios, with data types covering 12 variables in the state space;

[0162] Data cleaning: Interpolation and attention mechanisms are used to repair outliers (such as power jumps caused by sensor failures) and fill in missing values ​​(linear interpolation is used for meteorological data, and similar day migration is used for equipment status).

[0163] Data augmentation: Time-series shifting of the training set (e.g., shifting data for a given day by ±2 hours) and noise injection (adding ±1% Gaussian noise to power data) to improve the model's robustness against interference;

[0164] Dataset partitioning: Divide the dataset into a training set (6132h), a validation set (1752h), and a test set (876h) in a 7:2:1 ratio to ensure that each set contains the complete scene.

[0165] Next, a DQN model was implemented based on the PyTorch / TensorFlow framework, and the model training and iteration were carried out according to the process of initial training → iterative optimization → convergence verification.

[0166] Initial training:

[0167] Load the training dataset and initialize the DQN network parameters (Xavier normal initialization).

[0168] Set the number of training episodes to 5000, and the training duration for each episode to 24 hours (microgrid daily scheduling cycle).

[0169] Each step (10s) executes the process of state acquisition → action selection → reward calculation → sample storage → network update, and monitors the training loss in real time (target loss < 0.05).

[0170] Iterative optimization:

[0171] Validation set monitoring: Every 100 rounds, the model performance (such as scheduling cost and power abandonment rate) is evaluated using the validation set. If there is no performance improvement for 50 consecutive rounds, hyperparameter adjustment is triggered (such as reducing the learning rate to 5e-5).

[0172] Extreme scenario optimization: For extreme weather samples in the test set (such as a sudden drop in photovoltaic output due to heavy rain), the number of training rounds was increased (1000 rounds) to improve the robustness of the model;

[0173] Convergence verification:

[0174] Convergence criteria: The multi-objective comprehensive reward fluctuation of the validation set for 100 consecutive rounds is less than 1%, and the scheduling indicators meet the preset thresholds (such as cost ≤ 6500 yuan / day, curtailment rate ≤ 3%).

[0175] Test set validation: Evaluate the model using a test set (historical data not used in training) to ensure that scheduling metrics meet the requirements and that generalization ability is good;

[0176] V4. Finally, the trained and optimized model is deployed and run for verification.

[0177] Includes the following steps:

[0178] Standard scenario testing: Monitor dispatch indicators (cost, curtailment rate, interruption rate) under normal weather conditions to ensure that the average daily cost is ≤6500 yuan, the curtailment rate is ≤3%, and there is no power outage;

[0179] Extreme scenario testing: Artificially simulate extreme disturbances (such as photovoltaic inverter failure shutdown, load surge of 20%), record the model response time (≤1s) and recovery stabilization time (≤1min), and evaluate the anti-interference capability;

[0180] Multi-scenario switching test: Verify the model's weight adaptation capability in scenarios such as industrial daytime → industrial nighttime → weekend, and ensure a smooth transition of scheduling strategies when switching scenarios;

[0181] By constructing a dynamic cost function and a multi-objective adaptive weighting mechanism, the synergistic optimization of power purchase cost and operation and maintenance cost is achieved, reducing operation and maintenance cost and improving environmental and economic benefits.

[0182] S4. After step S3 is completed, the closed-loop process of the scheduling decision system, execution feedback system and strategy correction system is built through the execution monitoring unit.

[0183] The closed-loop process includes:

[0184] Dispatch Decision System: Transforms dispatch strategies into equipment control commands (such as energy storage PCS charging and discharging commands, photovoltaic inverter output limiting commands), and sends them to the equipment in real time via industrial Ethernet, with a command execution delay of ≤100ms;

[0185] Execution feedback system: Collects the execution results of the equipment in real time through sensors, compares them with the target value of the scheduling strategy, and calculates the deviation (e.g., the target charging is 200kW, the actual charging is 180kW, the deviation is 10%).

[0186] Strategy Correction System: If the deviation is ≥5%, the system will automatically trigger a fine-tuning of the scheduling strategy (such as increasing the energy storage charging current to bring the actual power closer to the target value). The closed-loop correction frequency is 10 seconds / time to ensure that the deviation rate between the plan and the execution is ≤3%.

[0187] By adopting a transfer learning architecture, it supports diverse application scenarios such as industrial parks, islands, and remote areas. By adjusting the scenario labels, the optimal scheduling strategy can be automatically matched, and the system upgrade threshold is greatly reduced, ensuring the sustainable development of microgrid technology.

[0188] like Figure 2 As shown, a microgrid scheduling and control optimization system based on deep learning includes a data acquisition unit: it collects multi-source data through edge sensors (voltage / current / power), weather stations, cameras and SCADA systems, and transmits the data to the cloud via 5G / LoRa. The data acquisition frequency is: 1 second / time for new energy / load data and 5 minutes / time for meteorological data.

[0189] Data preprocessing unit: Through edge computing nodes (GPU module), data cleaning engine and feature engineering module, it completes outlier repair, feature extraction and data normalization in real time, and outputs standardized feature vectors to the model layer with a processing latency of ≤500ms;

[0190] Deep learning model unit: Runs dual-model prediction through the prediction model server (Transformer model) and outputs 24-hour renewable energy / load prediction curves;

[0191] The scheduling model server (DQN model) runs reinforcement learning scheduling and outputs real-time control strategies;

[0192] Scheduling Decision Unit: Through the microgrid EMS main controller and multi-objective weight adaptive module, it integrates prediction results and real-time status to generate scheduling strategies and supports manual intervention;

[0193] Execution monitoring unit: Through equipment control units (PCS, inverters, circuit breakers), monitoring screens and alarm modules, it executes control commands, displays the microgrid's operating status (SOC, output, load) in real time, and triggers audible and visual alarms when abnormalities occur (response time ≤10s).

[0194] In summary, an automated operation and maintenance system driven by deep learning enables unattended operation of the entire daily scheduling process, requiring manual intervention only in rare and extreme failures. This reduces the workload of operation and maintenance personnel, allows for the early detection of potential hazards compared to manual inspections, improves operation and maintenance response efficiency, and significantly reduces operation and maintenance costs and security risks.

[0195] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the scope of the invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

[0196] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

Claims

1. A microgrid scheduling and control optimization method based on deep learning, characterized in that, include: The data acquisition unit collects multi-source data from the entire microgrid scenario and performs preprocessing and optimization on the multi-source data from the entire microgrid scenario. A dual-model architecture, consisting of a Transformer time-series prediction model and an attention mechanism feature fusion model, is constructed using deep learning model units to achieve prediction of new energy output and load, respectively. By constructing a scheduling decision model based on deep reinforcement learning through a scheduling decision unit, scheduling optimization in dynamic scenarios can be achieved. A closed-loop process of scheduling decision-making, execution feedback, and strategy correction is established by implementing a monitoring unit.

2. The microgrid scheduling and control optimization method based on deep learning according to claim 1, characterized in that, The microgrid's multi-source data across all scenarios includes: New energy data: photovoltaic inverter output power, irradiance, module temperature, wind turbine speed, wind speed, and blade pitch angle; Load data: user-side voltage, current, power, load type, and historical power consumption patterns; Meteorological data: real-time light intensity, wind speed, temperature, and probability of precipitation; Equipment status data: Energy storage SOC, PCS charge and discharge efficiency, photovoltaic panel cleanliness, and equipment fault alarms; External interactive data: large grid purchase and sale electricity prices, carbon emission trading prices, and backup power start-up and shutdown costs.

3. The microgrid scheduling and control optimization method based on deep learning according to claim 1, characterized in that, Preprocessing and optimization of multi-source data across all microgrid scenarios includes: By using sliding window technology to locate abnormal data points, and targeting power anomalies caused by sensor failures and communication interruptions, a hybrid repair model based on bidirectional long short-term memory network and attention mechanism is constructed by mining the time series correlation of normal data at adjacent times and combining it with equipment operating status parameters. A three-layer feature extraction strategy is adopted to construct a three-level feature system that includes basic features, derived features, and scene features; The maximum-minimum normalization method is used to map data of different dimensions to the [0,1] interval to eliminate scale differences. Furthermore, based on this, the exponential weighted moving average algorithm is introduced to perform time-series smoothing on the normalized data. By dynamically adjusting the smoothing coefficient, short-term data fluctuations are effectively suppressed.

4. The microgrid scheduling and control optimization method based on deep learning according to claim 3, characterized in that, The three-layer features specifically include: Time series characteristics: The daily fluctuation period, weekly load characteristics and seasonal trend of photovoltaic power output are extracted through Fourier transform and wavelet decomposition. Correlation features: Based on the XGBoost algorithm, nonlinear mapping relationships between environmental parameters including irradiance, temperature, and humidity and photovoltaic power are mined, and a dynamic feature mapping matrix is ​​established; Scene features: Natural Language Processing (NLP) technology is introduced to parse weather forecast text, automatically generate extreme weather labels such as high temperature warning and orange rainstorm signal, and combine calendar information to construct a scene classification system for weekdays, weekends and holidays, forming a high-dimensional vector space containing 120 features.

5. The microgrid scheduling and control optimization method based on deep learning according to claim 3, characterized in that, The formula for the exponentially weighted moving average algorithm is as follows: Let the time series data sequence be x1, x2, ..., x t The EWMA value y at time t t The calculation is as follows: y t =a*x t +(1-a)*y t -1 Where: α is the smoothing coefficient, ranging from 0 to 1, which determines the weight of recent data: the larger α is, the more the weight is tilted towards recent data, and the more sensitive the response to sudden changes; the smaller α is, the stronger the smoothing effect and the more obvious the noise suppression; y t -1 represents the EWMA value at time t-1. The initial value is set to the first term x1 of the sequence or the mean of the first 3-5 terms to avoid initial bias.

6. The microgrid scheduling and control optimization method based on deep learning according to claim 1, characterized in that, A dual-model architecture is constructed, consisting of a Transformer temporal prediction model and an attention mechanism feature fusion, including: The unified encoding of multi-source features maps continuous features, including photovoltaic output and irradiance, to the model dimension d_model=128 through a linear layer. At the same time, EWMA smoothing is added to reduce sensor noise. Then, extreme weather labels and time period labels are transformed into low-dimensional vectors of d_model=128 through an embedding layer to avoid dimensionality expansion caused by one-hot encoding. Finally, the processed continuous features and discrete features are concatenated at time steps to form a unified input tensor, ensuring that the encoder can capture both temporal patterns and scene influences simultaneously. To optimize multi-scale temporal dependencies and feature weights, we first designed multi-head attention parameters with 8 heads (h=8) and each head having a dimension of d_k=d_v=d_model / h=16 to avoid computational efficiency degradation due to excessively high single-head dimensions. Then, we added a lower triangular temporal mask before attention calculation to ensure that when calculating the feature at the i-th time step, it only associates the data from the previous i time steps, which conforms to the causal logic of microgrid temporal sequences. Finally, through the attention weight matrix of multi-head attention, we automatically assigned higher weights to high-impact features, thereby achieving useful feature enhancement and redundant feature suppression. By adding layer normalization and residual connections before and after FFN, gradient vanishing during training is avoided, overfitting is suppressed, and the generalization of the Encoder in the multi-sample scenario of microgrid is ensured, thereby achieving nonlinear feature transformation and enhancement. It is adapted to photovoltaic / wind power output prediction, effectively captures 72-hour long-term time dependence, and the training time for a single round is less than 2 hours. It is also adapted to load prediction. An additional layer is used to mine more fine-grained feature associations. The final output feature matrix contains all the time-series patterns and feature association information of historical data, providing core support for the decoder prediction. The construction of the attention mechanism feature fusion layer includes the following steps: Let the temporal feature matrix be Q, the static feature matrix be K=V, and the attention weight formula be: Where Q is the query matrix, representing the target feature that the model is currently focusing on. Other related features need to be found through Q. K is the key matrix, representing the index features used to match Q. The similarity between the column vectors of K and the row vectors of Q is calculated to determine the feature correlation. V is the value matrix, representing the original feature values ​​to be weighted and fused. The contribution of V is ultimately adjusted using attention weights. T is the transpose of the matrix, and d... k The feature dimension of Q / K is used for scaling. This avoids the Softmax gradient from disappearing due to excessively large values; The output of the new energy prediction encoder is used as K and V, and the output of the load prediction encoder is used as Q to calculate the attention weight. If the predicted value of photovoltaic output is high, the model automatically increases the weight of air conditioning load in the load forecast, adapts the coupling relationship between the two, and reduces the load forecast error by 0.5 to 1 percentage point. Heatmaps are used to display attention weights, assisting manual identification of key features and elimination of redundancy. Based on the feedback of prediction errors, the number of attention heads and dimensions are adjusted in real time.

7. The microgrid scheduling and control optimization method based on deep learning according to claim 1, characterized in that, The model is trained and optimized, including: One year of historical data from the microgrid was collected and divided into training, validation, and test sets in a 7:2:1 ratio, including data from special scenarios such as extreme weather and equipment failures. Temporal shifting and noise injection are applied to the training set to improve the model's generalization ability; The composite loss function using MAE and temporal smoothing loss is as follows: in, The mean absolute error, This is the predicted value at time step t. Let t be the predicted value at time step t+1, T be the length of the predicted sequence, and β be the weighting coefficient of the time series smoothing loss.

8. The microgrid scheduling and control optimization method based on deep learning according to claim 1, characterized in that, Construct a scheduling decision model based on deep reinforcement learning, including: Modeling is performed to address the scheduling requirements and problems in microgrids. Model design for DQN and core components of multi-objective reward function; Train and optimize the designed model; Deploy and run the trained and optimized model for verification.

9. A microgrid scheduling control optimization system based on deep learning, used to implement the method of any one of claims 1-8, characterized in that, include: The data acquisition unit is used to collect multi-source data from the entire microgrid scenario; A data preprocessing unit, connected to the data acquisition unit, is used to preprocess and optimize the multi-source data. The deep learning model unit, connected to the data preprocessing unit, is used to run the prediction model and the scheduling decision model; The scheduling decision unit, connected to the deep learning model unit, is used to generate scheduling strategies; The execution monitoring unit is connected to the scheduling decision unit and is used to execute the scheduling strategy and achieve closed-loop control.

10. A microgrid scheduling and control optimization system based on deep learning according to claim 9, characterized in that, The data acquisition unit transmits the collected data to the cloud or edge computing nodes via 5G or LoRa networks. The data acquisition frequency is: once per second for new energy and load data, and once every 5 minutes for meteorological data. The data preprocessing unit includes an edge computing node, a data cleaning engine, and a feature engineering module, used to complete outlier repair, feature extraction, and data normalization in real time, with a processing latency of no more than 500 milliseconds. The execution monitoring unit includes a device control unit, a monitoring screen, and an alarm module. The device control unit is used to convert scheduling strategies into control commands and send them to the execution devices, with a command execution latency of no more than 100 milliseconds. The system automatically triggers strategy fine-tuning when the deviation rate between planning and execution is greater than or equal to 5%, with a closed-loop correction frequency of once every 10 seconds.