Abstract
With the growing importance of renewable energy integration and digital energy management, optimizing the coordination between microgrids and the digital economy has become a critical challenge. This study proposes a collaborative planning model based on a double-layer optimization (DLO) framework that combines Non-dominated Sorting Genetic Algorithm II (NSGA-II) with elite strategy in the upper layer and Gurobi solver in the lower layer. The model is designed to jointly optimize investment cost, carbon emissions, and renewable energy utilization. Experimental evaluations using public datasets showed that the proposed model achieved an average accuracy of 0.92 and a root mean square error of 0.28 under low-load conditions. The system maintained high performance under different data volumes, with carbon emissions reduced to 15 kgCO2/h, optimization time of 4.2 seconds, and energy conversion efficiency reaching 90%. These results demonstrate that the DLO framework improves both computational efficiency and environmental sustainability, providing a practical tool for intelligent microgrid planning and carbon-conscious decision-making.
Introduction
With the intensification of the global energy crisis and the increasingly severe environmental pollution problems, how to efficiently utilize renewable energy (RE) and improve the sustainability of the energy system has become a vital research topic in the present energy field. As a new type of energy management system, microgrids can effectively integrate and utilize distributed generation resources, energy storage systems, and smart grid technology to achieve efficient use and management of energy.1,2 The core advantage of microgrids lies in their ability to optimize power distribution and management, as well as their strong flexibility and autonomy. They can operate independently of the main grid, ensuring the reliability and stability of energy. Especially in the context of the increasingly widespread application of RE, microgrids have become an important means to promote the transition to green energy. However, there are many challenges in the operation of microgrids, especially in achieving optimal planning and scheduling under dynamic environmental conditions and balancing the contradiction between the volatility of RE and electricity demand.3,4 Traditional energy management methods often rely on manual experience or a single optimization algorithm, making it difficult to achieve optimal scheduling in multi-objective and multi-constraint environments. Moreover, when faced with complex big data and ever-changing operating environments, the computational efficiency is low and it is easy to fall into local optimal solutions. Zhang et al. proposed a multi-objective optimization (MOO) design of a track ring resonant cavity sensor based on the Back Propagation Non-dominated Sorting Genetic Algorithm II (BP-NSGA-II) to improve the performance of optical resonators in anemia detection and overcome the constraints of sensitivity and quality factor. This method achieved dual optimization of sensitivity and quality factor, with advantages such as small error and short learning time, providing a novel optimization method for designing track ring resonators. 5 Despite these advances, current models typically run in a single-layer architecture, either optimizing investment plans or short-term operations, but rarely run simultaneously in a unified structure. Moreover, few works address the integration of elite-preserving evolutionary strategies with high-efficiency solvers such as Gurobi. This study addresses these gaps by proposing a double-layer optimization (DLO) model that hierarchically decouples strategic and operational decisions, improves convergence via elite retention, and enables robust optimization under data variability. This integrated architecture offers both interpretability and scalability, making it a practical alternative to existing microgrid planning solutions. This paper provides a novel optimization planning approach for microgrid systems by introducing a DLO framework. Unlike conventional NSGA-II-based methods that typically rely on a single-layer structure to handle multi-objective trade-offs, the proposed DLO model explicitly decouples long-term strategic planning from short-term operational decision-making. This hierarchical separation enables more targeted optimization in each layer, improves computational tractability, and ensures better solution generalization under dynamic data environments. In addition, the integration of Gurobi as the bottom-level exact solver and NSGA-II, which retains elites at the upper level, ensures diversity and convergence speed, solving common problems such as premature convergence and local optimality in traditional metaheuristic methods.
Collaborative planning model for microgrid
Modeling of intelligent microgrid system
The intelligent microgrid system consists of multiple components such as a distributed generation system, energy storage system, operation and maintenance management system, and power transmission system. Distributed generation systems mainly utilize RE such as solar and wind power to achieve on-site energy production and reduce traditional energy consumption. Energy storage systems are used to balance the fluctuations between power supply and demand, especially in the uncertain situation of RE power generation, and can store excess electricity and release it when demand is high.6–8 The operation and maintenance management system adopts intelligent technology to monitor, detect, and predict the operation status of the power grid in real-time, thereby ensuring the reliability of the system. The power transmission system is responsible for transporting electrical energy from the power generation end to the power consumption end, usually combined with smart grid technology, to achieve precise scheduling and distribution of electricity. This study selects data center microgrids as the research object and establishes a planning collaborative model. The microgrid framework of the data center is displayed in Figure 1. Microgrid structure of data center.
In Figure 1, the data center microgrid consists of an RE system, energy storage system, power distribution unit, server cluster, cooling system, and other components. Firstly, RE systems such as solar and wind energy generate electricity through different channels, which are then transmitted to energy storage systems to regulate and store energy. Energy storage systems can not only store energy, but also release electricity into the grid according to demand.9,10 The power distribution unit system, as a power distribution unit, distributes energy to different parts of the data center to ensure the required power supply for each part. In addition, the server cluster is connected to the cooling system, which controls the temperature of the servers to prevent equipment damage caused by overheating. The control signal and request queue section is responsible for managing and coordinating the operation of the entire microgrid system. They receive instructions from the energy management system in the data center and process user task requests and operation instructions. The energy flow, data flow, and information flow of the system are closely connected to modules through different paths, thereby achieving dynamic regulation and efficient management of energy use. Figure 2 shows the power consumption structure of the data center. Power consumption structure of data center.
In Figure 2, the power consumption of the data center mainly comes from three parts, namely, servers, cooling equipment, and internal power distribution systems. The server is the core component of the data center and is responsible for executing various computing tasks and data processing work, therefore its power consumption is relatively high. With the increasing demand for data processing, the number of servers and power requirements are also constantly growing.
11
Cooling equipment is used to maintain the temperature of internal equipment in data centers and prevent equipment from overheating and causing malfunctions. The internal power distribution system is responsible for distributing power from external sources to various devices within the data center, ensuring the stable operation of each part. The peak power of a single server in a data center is shown in equation (1).
In equation (1),
In equation (2),
In equation (3),
In equation (4),
Collaborative planning model of microgrid based on DLO
After completing the modeling of the smart microgrid system, it is necessary to optimize many parameters to achieve collaborative planning of microgrids. This study uses a DLO strategy and NSGA-II and Gurobi to handle the issue. NSGA is an evolutionary algorithm for handling MOO problems. Its core is to sort individuals in the population, determine the superiority relationship of each individual on multiple objectives, and select the optimal solution based on these relationships. In NSGA, individuals are classified based on their dominance relationships in the target space. In MOO, if a solution is not inferior to another solution in all objectives and is at least better in one objective, then that solution is considered to dominate the other solution.
12
NSGA divides the population into multiple levels through Non-Dominated Sorting (NDS), with the first level being the optimal solution set, meaning that these solutions are not dominated by other solutions. The second level refers to the solutions that are dominated by the solutions in the first level but not by other levels, etc. Through this approach, NSGA can balance multiple objectives and select a set of non-dominated solutions. However, NSGA also has some limitations, such as a lack of understanding of spatial diversity and high computational costs when the population becomes large. To overcome these issues, NSGA-II is later proposed, which optimizes NSGA, particularly in terms of computational efficiency and maintaining diversity in solution space. The important innovation of NSGA-II is the introduction of elite strategies, ensuring that the best individuals from each generation can be passed on to the next generation. The introduction of an elite strategy ensures that the optima is not lost due to crossover or mutation operations, which helps to improve the quality of the solution and accelerate convergence speed. Its structure is shown in Figure 3. Schematic diagram of elite strategy.
In Figure 3, the current generation parent population divides individuals in the parent population into different dominant sets through NDS. These dominating sets represent different Pareto frontiers. The purpose of NDS is to divide the population according to dominance relationships and prioritize the selection of non-dominated individuals. Next, individuals in each frontier are further sorted by crowding degree ranking. Individuals that are relatively sparse in the target space are selected to keep the diversity of solutions. Then, suitable individuals are selected from the parent population and subjected to crossover and mutation operations to generate novel offspring populations. Through the elite strategy, it ensures that the best individual of each generation can be directly passed on to the next generation, avoiding the loss of the optimal solution. The elimination step refers to selecting the better individuals from the new population formed by merging the parent and child generations to form a new parent generation. This step selects through NDS and crowding distance to ensure the quality and diversity of the population. The basic process of NSGA-II is exhibited in Figure 4. NSGA-II algorithm flow.
In Figure 4, step 1 is to initialize the population and generate the first-generation population of individuals. The next step is to determine whether to generate a new generation population. If not, it is needed to perform NDS and select crossover and mutation operations to generate new individuals. If a new generation population is generated, it will enter the iterative step and gradually optimize. After generating new individuals, it is necessary to merge the parent and child individuals and perform fast NDS. After sorting, suitable individuals are selected for crossover and mutation operations based on their fitness.13–15 The next step is to determine whether to continue generating new individuals until the maximum number of generations is reached or the stopping condition is met. If the number of generated new individuals is less than the maximum number of generations, iteration will continue until the condition is met. The fitness function is shown in equation (5).
In equation (5), Collaborative planning model for microgrid based on DLO.
The upper layer (NSGA-II) handles strategic planning variables such as wind/solar capacity and battery sizing, while the lower layer (Gurobi) solves real-time operational variables such as load dispatch and charging strategies. Arrows represent the data flow between layers, while legends distinguish between planning inputs and optimization outputs. In Figure 5, the top layer consists of planning variables, including wind turbine power generation, photovoltaic power generation, battery capacity, etc. The goal is to maximize annual investment returns and minimize carbon emissions.19,20 Next, the NSGA-II is utilized for optimization. On the basis of this algorithm, the objective function is continuously iterated and updated to optimize the planning variables to achieve the optima. In this framework, the operational strategy is the core, which involves dynamic adjustment of the power output and proportion of wind and photovoltaic power generation, and batteries. These variables are influenced by factors such as actual operating conditions, historical data, and scenario inputs. The model needs to develop the optimal operating strategy based on these variables to achieve the goals of minimizing annual investment costs and carbon emissions. The operational strategy of the middle layer provides a detailed list of input and output variables related to power generation, such as current load capacity, battery charging and discharging efficiency, and power demand. Scene input includes multiple aspects of input data, such as historical load, lighting intensity, wind speed, etc., and is further optimized for model decision-making through data processing methods such as classification, clustering, and calculating scene probabilities.21,22 Ultimately, through mixed variable linear programming and operational objective optimization strategies, the framework can help achieve specific operational goals of the power system, reduce the burden on the system in practical operations, and improve operational efficiency. To further clarify the internal mechanics of the DLO framework, it is essential to distinguish the roles of the upper and lower layers and describe their interaction. The upper layer is implemented through the NSGA-II algorithm, focusing on long-term strategic planning by generating candidate solutions for macro-level planning variables such as RE capacity, battery storage size, and initial scheduling strategy. These candidate solutions, represented as chromosomes in the evolutionary algorithm, are then passed to the lower layer, which is responsible for executing detailed operational optimization through the Gurobi solver. The lower layer interprets each upper-layer candidate as a set of constraints and inputs and then solves a deterministic optimization problem subject to real-time load profiles, renewable fluctuations, and operational constraints. It returns objective function values such as investment cost, carbon emissions, and system losses back to the upper layer. These values are used to evaluate the fitness of each solution in the NSGA-II population, guiding the selection, crossover, and mutation steps in the next generation. This bidirectional flow (decision variables top-down, performance feedback bottom-up) ensures that the model can capture both global planning efficiency and local operational feasibility.
To ensure tractable optimization, the proposed DLO model makes several key assumptions: Energy demand profiles are assumed to be known in advance and follow historical load distributions derived from public datasets. These profiles do not account for extreme fluctuations due to sudden failures or emergency events. RE generation is modeled based on typical diurnal patterns of solar and wind energy, using statistical distributions derived from historical meteorological data. The stochastic variability of generation is simplified by selecting representative scenarios through clustering. System constraints include battery storage capacity, charging/discharging limits, maximum load-carrying capacity, and minimum operational thresholds. These are kept fixed for each simulation period. Grid interaction is assumed to be possible at all times with no curtailment or outages, and grid electricity prices remain stable during the optimization period.
Performance of collaborative planning model for microgrid
Performance analysis of intelligent microgrid system model
This study chose to use a computer equipped with Windows 10 system and 8 GB memory, and equipped with Intel Core i5-6300 CPU to fully meet the computational needs of the experiment. In the implementation of the upper-layer NSGA-II algorithm, the following hyperparameters were applied based on a combination of standard practices in the literature and preliminary tuning experiments. The population size was set to 100, which provided a good balance between maintaining diversity and ensuring convergence stability. The crossover probability was configured at 0.9 using a Simulated Binary Crossover (SBX) operator, which was commonly adopted in real-coded genetic algorithms for its ability to explore new regions in the solution space. By conducting grid searches on [0.01, 0.1, 0.25], the mutation probability was set to 0.1, where lower values led to premature convergence and higher values led to excessive randomness. This setting was also consistent with the results of the elite strategy ablation experiment. The total number of generations was set to 100, ensuring sufficient evolutionary iterations without excessive computational burden. Tournament selection with a size of 2 was used as the parent selection strategy, and polynomial mutation was adopted to introduce localized variations. Elitism was enabled to ensure that the best individuals in each generation were preserved. In this study, two publicly available datasets were adopted to support model training and performance evaluation: the UCI Data Center Energy Consumption Dataset and the Kaggle Open Power System Data. The UCI dataset contained fine-grained measurements from server rooms and cooling systems, including features such as CPU utilization, workload intensity, ambient temperature, cooling equipment power, and real-time energy usage. The Kaggle dataset included hourly RE generation profiles, grid-side load demand, and system voltage data across several European microgrids. The pretreatment steps were as follows: first, all numeric features were normalized to the [0,1] range using min-max scaling to maintain consistency across different measurement units. Missing values in the time series, particularly those due to sensor dropout or logging anomalies, were addressed using linear interpolation and forward-filling techniques. Redundant or low-variance features were removed through Pearson correlation analysis and variance thresholding to improve model efficiency and generalizability. To simulate the variability of RE generation, historical daily profiles of solar and wind output were clustered into 10 representative scenarios using the K-means algorithm, which were then used as stochastic inputs in the upper-level planning layer of the DLO model. The selection of these datasets was based on their high granularity, public availability, and relevance to the simulation of hybrid microgrid systems. Their comprehensive coverage of both energy consumption and renewable generation made them ideal benchmarks for validating the performance and generalization of the proposed planning model.
Parameter analysis.
According to Table 1, the sensitivity analysis indicated that the DLO model was relatively robust within a practical range of parameter settings. Optimal performance was observed when the NSGA-II population size was set to 100, mutation probability to 0.1, and Gurobi optimality gap tolerance to 0.05. These settings were adopted for all subsequent experiments in this study to ensure consistency and performance reliability. This study selected ACC and root mean square error (RMSE) as evaluation metrics, as shown in Figure 6. Comparison of ACC and RMSE under different experimental conditions. (a) ACC, (b) RMSE.
Comprehensive performance analysis table.
In Table 2, as the operating load decreases, the performance of the model gradually improves. Under high load conditions, the ACC of the model is 0.79, RMSE is 0.45, MAE is 0.42, and MSE is 0.31, validating that the prediction ACC is relatively low, the error is large, and the performance of the model under high load is limited. Under medium load conditions, ACC increases to 0.88, and RMSE, MAE, and MSE also significantly decrease to 0.35, 0.31, and 0.25, respectively, indicating that the model’s adaptability to medium load conditions has been enhanced and the prediction performance is good. Under low-load conditions, the ACC of the model reaches its highest value of 0.92, the RMSE drops to 0.28, the MAE is 0.25, and the MSE is 0.21, showing the best performance. This indicates that under low load conditions, the model has the best prediction ACC and the smallest error. The Area Under the Curve (AUC) and F1 values also show similar trends with changes in operating conditions. This indicates that the proposed model can adapt to most situations.
Performance analysis of collaborative planning model for microgrid based on DLO
To further validate the performance of the model, NSGA-II and Gurobi are selected as comparison models in this study, as shown in Figure 7. Comparison of ACC and RMSE of various models. (a) ACC, (b) RMSE.
In Figure 7(a), with increasing iterations, the ACC of all three algorithms tends to improve. Notably, the DLO algorithm demonstrates significant advantages in the early stages, with ACC rising sharply from 0.5 to nearly 1.0, indicating robust optimization capabilities. In contrast, the ACC improvement for the NSGA-II and Gurobi algorithms is more gradual, particularly for the Gurobi algorithm, which exhibits only a modest increase. Figure 7(b) shows that the RMSE gradually decreases with continued iterations, suggesting that the error is effectively mitigated through iterative optimization. The DLO algorithm achieves the most rapid error reduction in the initial iterations, while the other two algorithms display a comparatively slower rate of decrease. After approximately 80 iterations, the RMSE of the DLO algorithm is significantly lower than that of the others, implying that it more effectively approximates the optimal solution. These results collectively demonstrate that the proposed model exhibits superior performance across both ACC and error minimization metrics. The performance of each model is analyzed under various data volumes, as shown in Figure 8. ACC and optimization time analysis under different data volumes. (a) Accuracy analysis under different data volumes, (b) optimization time analysis under different data volumes.
Analysis of ablation experiment results.
In Table 3, the complete DLO model achieves the best performance across all metrics. Specifically, its classification ACC reaches 0.92, the RMSE is minimized at 0.28, and the optimization time is 4.2 seconds. The calculated resource utilization rate is 85%, the number of iterations is 30, the carbon emissions are 15 kgCO2/h, the RE utilization rate is 82%, the system reliability is 98%, and the energy conversion efficiency reaches 90%. By comparison, the single-layer optimization model exhibits a reduced ACC of 0.85 and an increased RMSE of 0.35. Although the optimization time is slightly shorter at 3.8 seconds, the remaining metrics deteriorate. When NSGA-II is excluded from the model, the ACC drops to 0.88, the RMSE rises to 0.32, and the optimization time increases to 5.1 seconds. The resource utilization decreases to 80%, the iteration count increases to 40, the carbon emissions are 17 kgCO2/h, the RE utilization rate drops to 78%, the system reliability to increases 96%, and the energy conversion efficiency increases to 88%. Upon removal of the Gurobi solver, performance further declines: ACC falls to 0.84, RMSE climbs to 0.37, optimization time becomes 4.5 seconds, resource utilization drops to 75%, iterations increase to 35, carbon emissions rise to 20 kgCO2/h, RE utilization reduces to 72%, system reliability decreases to 94%, and energy conversion efficiency falls to 83%. These results confirm that the complete DLO model consistently outperforms other configurations across all evaluation metrics, validating its design effectiveness and superiority. To further evaluate the effectiveness and generality of the proposed DLO framework, two additional state-of-the-art MOO algorithms are incorporated into the experimental comparisons: Multi-Objective Particle Swarm Optimization (MOPSO) and Multi-Objective Differential Evolution (MODE). These algorithms are widely used in energy scheduling, resource allocation, and load scheduling problems, representing alternative evolutionary paradigms for solving complex optimization tasks. All methods are implemented under consistent parameter settings and evaluated using identical datasets and optimization targets, including minimizing carbon emissions, maximizing RE utilization, and reducing investment cost.
Comparative performance of optimization algorithms.
Conclusion
This study proposed a DLO-based microgrid collaborative planning model for RE and microgrid systems, and combined NSGA-II algorithm with Gurobi solver to solve the model. Through verification, the model has shown excellent performance in ACC, RMSE, optimization time, carbon emissions, and RE utilization. Under high load conditions, the ACC of the model was 0.79 and the RMSE was 0.45. Under medium load conditions, ACC increased to 0.88 and RMSE decreased to 0.35. Under low load conditions, the ACC of the model reached its highest value of 0.92, and the RMSE further decreased to 0.28. In addition, in the ablation experiment, the complete DLO model performed better than the single layer optimization model in terms of computational resource utilization, convergence speed, and system reliability. The increase of ACC from 0.84 to 0.92 indicated a significant reduction in scheduling bias, which means that the load forecasting and energy allocation plans generated by the DLO model are more in line with the actual system requirements. This enhanced operational stability and reduced the risk of overloading or under-supplying critical loads. Similarly, the reduction in RMSE indicated improved precision in energy dispatch decisions, leading to tighter control of battery charging cycles and better alignment between generation and demand, thereby extending equipment lifespan. Research has shown that DLO models can effectively improve the economy and sustainability of microgrid systems. However, the model has several limitations. First, its performance heavily depends on the ACC and resolution of the input datasets, especially regarding energy demand forecasts and RE generation profiles. Inaccurate or coarse-grained input may lead to suboptimal or non-generalizable solutions. Second, although the DLO framework is modular, its scalability for national scale or multi-microgrid configurations has not been validated and requires additional adjustments to adapt to the interdependence and regulatory constraints of the power grid. Third, although the NSGA-II and Gurobi combination improves performance, it increases the computational complexity, which may pose challenges for real-time applications or edge deployments with limited resources. In future work, the deployment of the DLO model in real-time microgrid environments will be further explored. Key challenges include reducing computational latency for real-time response, ensuring interoperability with existing control platforms, and handling uncertainties in input data streams. Addressing these practical aspects will be essential for transitioning the proposed optimization framework from research to real-world microgrid operation. Although current experiments utilize the open source datasets of UCI and Kaggle to provide valuable insights into system behavior under standard conditions, they may not fully capture real-world complexities. However, these datasets may not fully capture the random variability and dynamic disturbances found in actual microgrid deployments. The future work plan is to use real-world on-site data to validate the proposed model, such as peak values caused by weather, irregular battery degradation patterns, or load distribution of grid supply price fluctuations for utility companies. Possible data sources include industrial smart microgrid pilot zones, university energy management systems, and urban demonstration projects. Incorporating such datasets will allow for stress-testing the DLO framework under more realistic, noisy, and uncertain environments, thereby enhancing the robustness and generalization of the optimization strategy for practical deployment scenarios.
In terms of sustainability, the DLO model contributes to carbon emission reductions through multiple integrated mechanisms. Firstly, by optimizing the temporal dispatch of RE, the model prioritizes clean generation over grid imports, effectively reducing the reliance on fossil-fuel-based electricity. Secondly, the model dynamically adjusts energy storage usage to absorb surplus renewable generation and shift load demand, reducing peak-time grid dependency. This strategy minimizes the carbon intensity of each unit of energy consumed. Furthermore, the improved precision in scheduling leads to a decrease in standby losses and unnecessary battery cycling, thereby reducing indirect energy waste. However, these environmental benefits may be accompanied by certain trade-offs. For instance, maximizing renewable penetration often requires oversizing storage systems or accepting less economically optimal dispatch strategies to maintain carbon goals. In some scenarios, the model must choose between lower investment costs and lower emissions, depending on objective weight settings. This reflects a broader policy challenge in balancing sustainability and financial feasibility. By adjusting objective function weights and scenario preferences, the DLO model allows decision-makers to fine-tune this balance according to environmental regulations or carbon pricing signals.
Footnotes
Funding
The authors received no financial support for the research, authorship, and/or publication of this article.
Declaration of conflicting interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
