Unveiling Genetic Reinforcement Learning (GRLA) and Hybrid Attention-Enhanced Gated Recurrent Unit with Random Forest (HAGRU-RF) for Energy-Efficient Containerized Data Centers Empowered by Solar Energy and AI

: The adoption of renewable energy sources has seen a significant rise in recent years across various industrial sectors, with solar energy standing out due to its eco-friendly characteristics. This shift from conventional fossil fuels to solar power is particularly noteworthy in energy-intensive environments such as cloud data centers. These centers, which operate continuously to support active servers via virtual instances, present a critical opportunity for the integration of sustainable energy solutions. In this study, we introduce two innovative approaches that substantially advance data center energy management. Firstly, we introduce the Genetic Reinforcement Learning Algorithm (GRLA) for energy-efficient container placement, representing a pioneering approach in data center management. Secondly, we propose the Hybrid Attention-enhanced GRU with Random Forest (HAGRU-RF) model for accurate solar energy prediction. This model combines GRU neural networks with Random Forest algorithms to forecast solar energy production reliably. Our primary focus is to evaluate the feasibility of solar energy in meeting the energy demands of cloud data centers that utilize containerization for virtualization, thereby promoting green cloud computing. Leveraging a robust German photovoltaic energy dataset, our study demonstrates the effectiveness and adaptability of these techniques across diverse environmental contexts. Furthermore, comparative analysis against traditional methods highlights the superior performance of our models, affirming the potential of solar-powered data centers as a sustainable and environmentally responsible solution.


Introduction
Data centers play a pivotal role in the modern digital landscape, serving as the backbone for an array of critical online services and applications.This centrality has contributed to the surge in energy consumption, underscoring the need for a comprehensive approach to address this growing challenge [1][2][3].
While energy consumption in data centers is often discussed in terms of the electricity required for day-to-day operation, it is essential to delve deeper into the factors driving this phenomenon.Data centers house extensive arrays of servers and networking equipment that operate around the clock to ensure uninterrupted access to digital services [4][5][6][7].In fact, statistics indicate that the energy consumption of data centers alone will rise from 200 TWh in 2016 to a staggering 2967 TWh by the year 2030 [1,8].This substantial increase is driven by the relentless demand for data processing, storage, and transmission, coupled with the escalating volume of digital content and user interactions, all of which rely on the uninterrupted operation of these facilities [1,2,9].Furthermore, the extensive hardware infrastructure within data centers generates significant heat, necessitating robust cooling and conditioning systems [7,10,11].These systems account for a substantial portion of the energy consumption, as they work tirelessly to maintain optimal operating temperatures and prevent overheating of the sensitive electronic components [3,6,10].
As data centers continue to grapple with the increasing demand for computational resources and the escalating energy consumption, the need for sustainable and eco-friendly solutions becomes increasingly urgent [9,12].This is where the integration of solar energy emerges as a promising avenue.Solar energy, harnessed from the sun's heat and radiation, offers a renewable and ecologically sound alternative to conventional energy sources [13][14][15].This energy can be harnessed through various technologies, including solar thermal energy, solar heating, and solar architecture [14,16].The conversion of incident solar radiation into electricity is achieved through the utilization of photovoltaic cells, marking a complex yet essential process [14,16,17].
Solar energy offers a versatile range of applications, including lighting, water heating, and cooling [18][19][20].Its accessibility and straightforward installation make it an appealing choice for users.Moreover, solar energy stands out for its cost-effectiveness when compared to fossil fuel-derived energy sources, relieving environmental and economic burdens, and can reduce energy costs by up to 20% [14,17].It is a renewable, ecologically sound resource, readily available through sunlight [18].
The rising interest in solar energy positions it as a pivotal energy source, with China leading the global market at 35% market share and an impressive 254 gigawatts of installed capacity in 2020 [21][22][23].The United States is a close second, concluding 2020 with a combined installed capacity of 93.2 gigawatts [22,23].Recognized by large corporations and industrial facilities as a competitive advantage, assessing actual energy requirements is essential to ensure an adequate supply for these emerging eco-friendly energy sources [24].Additionally, Germany's renewable energy landscape boasts a significant contribution from solar photovoltaic (PV) energy, representing 42% of the country's renewable energy sources in 2021 [24].This underscores the nation's commitment to sustainable energy practices and highlights the importance of solar energy in diversifying the energy mix towards cleaner alternatives.
Our approach presents a multifaceted novelty that contributes to the advancement of green cloud computing.Notably, we champion the utilization of solar energy to power containerized data centers, positioning this approach at the forefront of environmentally friendly and sustainable energy solutions.The adoption of solar energy carries significant advantages, including substantial cost reduction for data centers, efficient energy use, and a reduced carbon footprint, thereby playing a pivotal role in environmental preservation.
What sets our approach apart is its focus on addressing data centers that employ containers as their virtualization technique-a contemporary approach to resource allocation.Moreover, we introduce the Genetic Reinforcement Learning Algorithm (GRLA), which combines the principles of Genetic Algorithms and Reinforcement Learning to optimize container placement in servers.GRLA adapts and evolves container placement strategies based on dynamic environmental conditions, leading to improved energy efficiency and resource utilization.By integrating Reinforcement Learning principles into the Genetic Algorithm, GRLA enhances the efficiency of the optimization process, allowing for more effective adaptation to changing conditions within the data center environment.This approach enables more realistic and energy-efficient consumption values, contributing to the overall sustainability and performance of containerized data centers.Furthermore, to complement the energy-efficient container placement, we introduce the Hybrid Attention-based GRU-Random Forest (HAGRU-RF) model.This AI model utilizes Deep Learning and Machine Learning techniques to predict solar energy generation using a German photovoltaic dataset.By leveraging AI-driven predictions, data centers can optimize their energy consumption by aligning operational activities with predicted solar energy availability.These novel elements synergize to lay the foundation for a greener and more energy-efficient future for cloud data centers.
The remainder of this paper is structured as follows: Section 2 provides background information, while Section 3 outlines our methodology.Section 4 presents the evaluation of our approach, and finally, Section 5 concludes the paper.

Energy Consumption in Data Centers
Efficient energy management stands as a paramount concern within the realm of data centers, given its profound impact on various equipment types.This necessity for meticulous attention to electricity provisioning and monitoring arises from the imperative to mitigate power wastage.The continuous monitoring of energy consumption within data centers empowers cloud providers to detect energy losses and pinpoint hosts experiencing inefficiencies in resource utilization, thereby offering valuable insights into hourly and daily energy consumption patterns.
Energy consumption within a data center is a multifaceted process with distinct contributors.To comprehend the intricate dynamics of data center energy utilization, it can be categorized into two primary aspects [1,2,4,7,11].

•
IT Equipment Energy Consumption: Approximately 40% of the total energy consumption in a data center can be attributed to the operation of IT equipment, encompassing servers, networks, and storage infrastructure [2,7,11].The continuous operation and efficient functioning of these components are essential for providing the computational and networking services that data centers offer [4][5][6][7].

•
Cooling and Conditioning Systems: The remaining portion, constituting roughly 45% to 50% of the total energy usage, is dedicated to cooling and conditioning systems [6,7].These systems are indispensable in maintaining the appropriate temperature and humidity levels, ensuring the optimal performance and longevity of the IT equipment [7,11].High-density servers and networks generate considerable heat, necessitating robust cooling mechanisms [10,11].
Within this framework, multiple methodologies have been developed to estimate the energy consumption within specific data centers, each introducing new and innovative approaches to enhance accuracy and efficiency.These methodologies often center around the number of active hosts, though they differ in their representations of a host's energy footprint [1,3].Hosts can be depicted by considering their entire hardware resources, encompassing elements like RAM and CPU [1,4].Alternatively, some methodologies focus on specific subsets of these components.
For instance, some recent approaches utilize machine learning models, such as Random Forests and gradient boosting, to predict energy consumption based on various hardware and workload parameters, offering a more data-driven approach to estimation [1,7].The cumulative power consumption is then calculated by summing the power requirements of all these resources, yielding a comprehensive overview of energy utilization [1].
In the modeling of data center energy consumption, a plethora of advanced techniques has emerged to capture the intricacies of this multifaceted process.While some models adhere to linear mathematical representations, with their objective functions primarily reliant on CPU resource utilization, others opt for non-linear models [1].In these models, energy consumption is portrayed as a quadratic function of CPU usage [1].These models play a pivotal role in predicting energy demands and optimizing resource allocation strategies to enhance data center energy efficiency, presenting a dynamic landscape for energy management in modern data centers.

Solar Energy
Numerous approaches have been proposed to model and predict solar energy production.Many of these approaches rely on various parameters, including temperature, atmospheric conditions, and more.In a notable example, as described in [15], an approach was developed based on the LASSO (Least Absolute Shrinkage and Selection Operator) technique.This particular model incorporates multiple factors, such as temperature, weather patterns, and total sunlight, to formulate mathematical formulas.These formulas serve the purpose of creating statistical representations for a dataset, enabling the accurate prediction of solar energy production.Overall, this method provides an efficient estimation of the anticipated solar energy output.
As elucidated in [15], several studies have investigated strategies employing mathematical expressions reliant on multiple attributes or factors to forecast solar energy production.However, this approach often introduces a high level of complexity.In response to this challenge, researchers have endeavored to enhance prediction accuracy through alternative methods, exemplified by the approach delineated in [14].This method introduces solar prediction reconciliation techniques aimed at refining prediction accuracy.Similarly, in [25], a regression modeling technique was deployed to achieve optimal predictions one day in advance, yielding significant improvements compared to those reported in [15].
A novel approach centered around Convolutional Neural Networks (CNNs) was introduced by [26], contrasting with prior methods.This approach employed CNNs to forecast solar panel energy production across intervals of 1 h, 1 day, and a week.The prediction model incorporates various factors, including temperature, wind speed, and irradiation, among others.To enhance its performance, this approach integrated additional techniques such as multi-head CNN and Long Short-Term Memory (LSTM), aiming to create diverse CNN architectures.The results underscored the effectiveness of precise prediction, particularly with the CNN-LSTM architecture.

GRLA-Based Energy-Efficient Container Placement
In this subsection, we address the critical task of estimating energy consumption within data centers that utilize containerization as their primary virtualization technique.Our investigation focuses on integrating containerization with a Genetic Algorithm (GA) and Reinforcement Learning Algorithm (RLA) to optimize energy-efficient placement.We introduce the novel Genetic Reinforcement Learning Algorithm (GRLA) approach for optimizing energy consumption in containerized data centers.The following discussion will elaborate on the methods and techniques employed to estimate energy consumption in containerized data centers, laying the foundation for subsequent sections where we delve into the specifics of containerized data centers and the GRLA-based energy-efficient container placement approach.

Containerized Data Centers
Containerization has emerged as a compelling virtualization technique, distinguishing itself from traditional virtual machines (VMs) by offering a lightweight and resourceefficient approach to running applications [27].Unlike VMs, which often impose significant resource demands, containers are notably lightweight, consuming minimal resources [28][29][30].This efficiency extends to rapid deployment, rendering containers an attractive choice for cloud environments.
Prominent containerization technologies, such as Docker, have played a pivotal role in revolutionizing the virtualization landscape [28].Docker, in particular, stands out for providing cloud users with a unified hardware environment that simplifies application management while sharing the same physical machine kernel [27,29].This unified approach streamlines the deployment of applications within process containers, empowering cloud users with a versatile platform [29,30].
Containers offer significant advantages over heavyweight VMs, which are typically resource-intensive and require longer setup times.As depicted in Figure 1, VMs operate on hypervisors and necessitate manual resource allocation for each instance, often involving individual virtual operating systems [27][28][29].In contrast, containers excel in efficiency gains regarding resource utilization and management simplicity.This makes them an ideal choice for modern data centers, driving enhanced efficiency and resource optimization.Containerized data centers, in particular, have gained attention for their ability to deliver improved efficiency compared to those relying on VM technology.The lightweight nature and rapid deployment capabilities of containers contribute significantly to this efficiency, offering a compelling solution for optimizing cloud infrastructure.

Genetic Reinforcement Learning Algorithm (GRLA) Genetic Algorithm
The Genetic Algorithm (GA) stands as a powerful optimization technique inspired by the principles of natural selection and genetics.Essentially, GA operates on the premise of evolution, iteratively improving solutions through processes such as selection, crossover, and mutation [31].In optimization problems, GA explores a population of potential solutions, favoring individuals with higher fitness, and progressively refining them over successive generations [32].This evolutionary approach enables GA to efficiently navigate complex solution spaces, rendering it a popular choice for addressing a wide range of optimization challenges.

Reinforcement Learning
Reinforcement Learning (RL) represents a paradigm in machine learning where agents learn to make decisions by interacting with an environment to maximize cumulative rewards [33,34].Unlike supervised learning, which relies on labeled data for training, RL agents learn through trial and error, receiving feedback in the form of rewards or penalties based on their actions.Through this process of exploration and exploitation, RL agents discover optimal strategies for achieving desired outcomes, often referred to as policies [33,35].RL finds applications in diverse domains, spanning from robotics and game playing to finance and healthcare, owing to its adaptability to dynamic environments and its capacity to learn complex decision-making policies.The core components of RL include an agent, which takes actions in an environment, and a reward signal, which the agent seeks to maximize over time.By interacting with the environment and learning from feedback, RL agents autonomously acquire the ability to perform tasks and make decisions in complex, uncertain, and dynamic environments [35].

Problem Modeling
The primary objective of this study is to address concerns regarding energy consumption and environmental impact in data centers.Specifically, our aim is to minimize the number of active hosts while efficiently allocating containers within the data center infrastructure.This optimization task is crucial for reducing energy consumption.
To achieve this objective, we propose an adaptation of the genetic algorithm tailored to the unique requirements of data center resource management.The Genetic Reinforcement Learning Algorithm (GRLA) integrates reinforcement learning principles with the traditional genetic algorithm to enhance its decision-making capabilities and adaptability, as depicted in Figure 2. The main challenge lies in dynamically optimizing resource allocation within a heterogeneous and dynamic data center environment.Factors such as fluctuating workload demands, varying resource availability, and the imperative for continuous operation necessitate a flexible and efficient optimization approach.
The problem at hand involves optimizing two primary objectives: (1) minimizing the number of active servers and (2) maximizing the load balancing of active servers.However, the second objective is incorporated into the first one as one of its constraints, as presented in Equation (1).
The objective function F obj (X) is aimed at minimizing the total number of active hosts, and X H is a binary variable indicating whether host H is active (1) or inactive (0).This objective function is subject to the following constraints: • All containers must be allocated to one or more hosts, ensuring that no container remains unassigned at the end of the allocation process.• Each container must be uniquely assigned to a single host, preventing multiple hosts from containing the same container simultaneously.

•
The cumulative resource usage (RAM, CPU, BW, and Storage) of containers hosted on any given server should not surpass 80% of the capacity limit of that server, leaving 20% of the capacity for task operation of cloud users to ensure smooth functioning without any performance issues.
Following the presentation of the problem constraints, the optimization process involves three key phases: generation of the initial population, selection, crossover, and mutation.
In the selection phase, individuals are evaluated based on a fitness function, which measures their adherence to constraints and objectives.Specifically, the fitness function f (I) is defined as the reciprocal of the number of active hosts in an individual I.This criterion selects the most promising individuals for further genetic operations.
The crossover phase involves exchanging genetic information between selected parents to create offspring with novel combinations of traits.This process promotes the exploration of the solution space by integrating successful characteristics from multiple parents.
Subsequently, the mutation phase introduces diversity by making small, random adjustments to individual offspring.Primarily serving a corrective role, mutation ensures adherence to problem constraints and fine-tunes solutions for improved fitness and adaptability.
Together, these phases enable the genetic algorithm to iteratively optimize container placement within data center infrastructures, balancing resource utilization and operational efficiency.

Integration of RL with GA in GRLA
The integration of Reinforcement Learning (RL) with the Genetic Algorithm (GA) to form the Genetic Reinforcement Learning Algorithm (GRLA) represents a significant advancement in optimization methodologies, particularly in the domain of container placement within data centers.One primary motivation for enhancing GA with RL lies in the proven effectiveness of GA in optimizing container placement for resource utilization and load balancing.After rigorous experimentation and comparison with other metaheuristics, GA has demonstrated its prowess in finding near-optimal solutions to complex placement problems.
However, the traditional GA process, characterized by its three main phases-Selection, Crossover, and Mutation-can benefit from the adaptive decision-making capabilities of RL.By leveraging RL principles, GRLA can dynamically select the most promising individuals for reproduction (Selection phase), explore more effective crossover strategies (Crossover phase), and adaptively adjust mutation rates (Mutation phase) based on the evolving dynamics of the solution space.This synergy between GA and RL enables GRLA to harness the strengths of both approaches, resulting in more robust and efficient container placement strategies tailored to the dynamic nature of containerized environments.
State Representation: In the integration of Reinforcement Learning (RL) with the Genetic Algorithm (GA) for container placement in data centers, the state representation encompasses relevant parameters describing the current state of the GA.This includes the population of solutions, the fitness values of these solutions, and other pertinent parameters.We define a data structure or class to represent the state, equipped with methods to update the state based on actions taken during the GA phases.
Action Space: The action space within each phase of the GA is defined to accommodate the decisions made by the RL agent.Actions include adjustments to selection pressure, crossover probability, and mutation rate.By allowing the RL agent to influence these parameters, the GA can adapt its behavior to achieve better container placement outcomes.
Reward Design: A reward function is designed to provide feedback to the RL agent based on the performance of the GA.This function considers metrics such as resource utilization, energy efficiency, and overall performance improvements achieved by the GA.By optimizing for these metrics, the RL agent learns to make decisions that lead to better container placement strategies.
Integration with GA Phases: • Selection Phase: The selection phase is modified to incorporate the decisions of the RL agent.Based on the RL agent's actions, the selection pressure is adjusted to favor individuals with higher fitness values, as indicated in Algorithm 1, promoting the selection of more promising solutions.Compute the state S based on the current population and crossover parameters 5: Select an action A using the RL agent based on state S 6: Adjust crossover parameters (e.g., crossover probability) based on action A 7: Divide I into two parts, f irst1 and second1, based on adjusted crossover parameters 8: Assign f irst1 and second1 to parents 1 and 2, respectively 9: end for 10: return Crossover as the offspring resulting from crossover

•
Mutation Phase: Similarly, the mutation phase integrates the decisions of the RL agent, as shown in Algorithm 3. The RL agent can adapt the mutation rate or mutation strategies based on the current state of the GA, facilitating the exploration of diverse solution spaces.
Exploration vs. Exploitation: A strategy is implemented to balance exploration and exploitation within the RL agent.This ensures that the RL agent explores different parameter settings while exploiting learned knowledge to improve performance.By striking a balance between exploration and exploitation, the RL agent can discover optimal container placement strategies.
Training and Learning: An RL algorithm suitable for the problem, such as Q-learning or Deep Q Networks, is chosen.The RL agent is trained using interactions with the GA environment, receiving rewards based on its actions and updating its policy to maximize cumulative rewards over time.Through training, the RL agent learns to make decisions that lead to improved container placement outcomes.
Integration in the Main Function: The RL agent is integrated into the existing Java code responsible for container allocation with the GA.As depicted in Algorithm 4, the main function is modified to allow the RL agent's decisions to influence parameters and decisions made during each phase of the GA.By integrating RL into the main function, the GA benefits from adaptive decision-making capabilities, resulting in more efficient container placement in data centers.Compute the state S based on the current offspring and mutation parameters 5: Select an action A using the RL agent based on state S 6: Adjust mutation parameters (e.g., mutation probability) based on action A Apply mutation operations based on adjusted parameters to modify the offspring

Solar Panel Energy Forecasting with AI
In this subsection, we introduce the Hybrid Attention-enhanced Gated Recurrent Unit and Random Forest (HAGRU-RF) model for solar panel energy forecasting.This innovative approach combines the interpretability of Random Forest with the sequential learning capabilities of Attention-based GRU, promising superior prediction accuracy and robustness.The model architecture, developed using Keras, harnesses the strengths of both components to capture complex temporal dynamics and enhance prediction performance.

Dataset
Our initial efforts involved contacting the Noor Ouarzazate Solar Complex, a prominent Moroccan solar project, to obtain access to their datasets.This complex, situated in Morocco, represents a significant endeavor in solar energy production and management.However, despite our attempts to acquire their data for analysis, we have not yet received a response.
Given the importance of our research goals and the necessity for comprehensive datasets, we turned our attention to alternative sources of solar energy data.In this regard, we utilized a dataset from Germany, as depicted in Table 1, spanning the years from 2010 to 2018 across nine distinct CSV files.This dataset offers a detailed overview of photovoltaic energy generation in Germany, providing valuable insights into temporal trends and fluctuations in solar energy production.As an illustrative example, let us examine the dataset from 2010.Each line in the dataset represents a 15 min interval and contains essential information such as the date, precise time intervals ('From' and 'To'), and the corresponding power capacity in megawatts ('MW').For instance, consider the interval from 10:15 to 10:30 on 1 January 2010, during which the recorded power capacity peaked at 11 MW.This data point vividly illustrates the variability in solar energy generation, representing a significant surge in energy production.Such granularity allows us to discern not only daily and seasonal patterns in solar energy production but also transient changes that occur throughout the day.
In our dataset analysis, we have computed key summary statistics for the 'MW' attribute, representing power capacity in megawatts, as presented in Table 2.These statistics offer valuable insights into the characteristics and distribution of the data, as depicted in Figure 3.The dataset comprises 3287 data points, with an average (mean) power capacity of approximately 8960.66 MW and a standard deviation of approximately 5223.10 MW, indicating significant variability in power generation.The power capacity ranges from a minimum of 33 MW to a maximum of 36,412 MW.Additionally, quartile values reveal that 25% of the data falls below approximately 5496.75 MW (first quartile), 50% below 7392.60 MW (median), and 75% below 11,316.41MW (third quartile).These statistics provide a comprehensive overview of the 'MW' attribute, crucial for understanding the dynamics of solar energy generation.
The richness of this dataset enables us to conduct rigorous testing and validation of our predictive models, as it encompasses diverse scenarios of solar energy production.This variety of data points, ranging from high-power surges to lower production levels, serves as an invaluable asset in training and fine-tuning our models for solar energy forecasting.By leveraging this robust dataset, we anticipate that our research can yield more accurate predictions, thereby significantly impacting the application of solar energy in powering data centers and similar infrastructure.The extensive scope of this dataset ensures that our research is well informed, reliable, and poised to contribute to the advancement of sustainable energy solutions.
We conducted a thorough analysis of the Germany Photovoltaic Dataset to gain insights into its attributes and data characteristics.This dataset comprises recorded electrical energy values in megawatts (MW) generated by solar panels at 15 min intervals, spanning the years from 2010 to 2018.
To enhance the clarity and precision of our energy predictions, we adopted a data aggregation approach.Specifically, we aggregated the energy values on a daily basis, as indicated in Equation ( 2), simplifying the energy forecasting process for longer timeframes such as weeks or months, as required.In Equation ( 2), S j (x) represents the sum of energy values in MW for one day j, where x ij denotes the energy value in MW for each 15 min interval i in day j.
x ij = Energy value (MW) for each 15 min interval i in day j.This preprocessing step not only optimizes our energy forecasting models but also facilitates more efficient analysis and prediction of solar energy production trends.
Another significant observation relates to the non-standardized nature of the datasets.Specifically, variations in data distribution and scale among individual data points may lead to overfitting during model operations, especially when weight values are high.To address this issue, we implemented the min-max scaling technique to standardize energy production quantities.This method can be applied using the built-in MinMaxScaler function available in Python libraries.This function efficiently scales the data to a specified range, typically between 0 and 1, ensuring uniformity in feature scaling.Alternatively, the min-max scaling can also be performed by applying a custom implementation.
This standardization process serves to ensure consistent and uniform data scaling, mitigating the risk of overfitting and enhancing the overall robustness of our energy prediction models.

HAGRU-RF-Based Forecasting Model Gated Recurrent Unit (GRU)
The Gated Recurrent Unit (GRU), an advanced iteration of the Recurrent Neural Network (RNN), is specifically designed to maintain an internal state throughout recurring processes [36].Its implementation effectively addresses long-term dependencies while also optimizing computational efficiency.Similar to the Long Short-Term Memory (LSTM), GRU plays a pivotal role in enhancing the accuracy of time series predictions [37], while concurrently mitigating issues related to gradient vanishing and explosion-significant challenges encountered during the training of RNN models [36].
To overcome these challenges, the GRU architecture incorporates two critical gating mechanisms: the update gate, denoted as z t , and the reset gate, represented by r t , as depicted in Equations ( 3) and (4).These gates, expressed as vectors, play a pivotal role in determining which information is pertinent for transmission to the output, thereby facilitating the seamless operation of the GRU network [36,37].
Examining the process in detail, we observe that the input x t undergoes a transformation through multiplication with its respective weight matrix W (z) .Similarly, the previous time step's information h t−1 is subject to a similar transformation, with its weight matrix denoted as U (z) .Subsequently, a sigmoid activation function is applied to the summation of these two transformed inputs.The same procedure applies to the reset gate r t , where the weights are adjusted accordingly.These two gate mechanisms, comprising the update gate z t and reset gate r t , collaborate to generate the final output as the current time step's memory state h t , as presented in Equation (5).
The core of the HAGRU-RF model lies in the Gated Recurrent Unit (GRU), a sophisticated variant of the Recurrent Neural Network (RNN) architecture.GRU architecture is adept at capturing temporal dependencies in sequential data, making it well suited for time series forecasting tasks.In our implementation, the GRU consists of three stacked layers, as described in Table 3, each comprising a unique configuration of units and activation functions to capture hierarchical features within the input sequence.
The first GRU layer consists of 64 units with a hyperbolic tangent (tanh) activation function, facilitating the extraction of high-level temporal features.Subsequently, a dropout layer with a dropout rate of 0.2 is employed to mitigate overfitting by randomly dropping 20% of the units during training.The second GRU layer, comprising 32 units, further refines the learned representations, augmenting the model's capacity to capture nuanced patterns in the data.Similar to the preceding layer, a dropout layer is incorporated to regulate model complexity and enhance generalization performance.The final GRU layer consists of 16 units, culminating in the synthesis of temporal features learned across the preceding layers.The output of the GRU architecture serves as the foundation for subsequent processing steps, facilitating seamless integration with the attention mechanism and Random Forest component of the HAGRU-RF model.

Self-Attention Mechanism
To enhance the discriminative power of the model and prioritize informative temporal features, we incorporate a self-attention mechanism.This mechanism enables the model to selectively attend to relevant segments of the input sequence, effectively capturing longrange dependencies and salient patterns.The attention mechanism operates by computing attention scores for each element in the input sequence based on its relevance to the current context.These attention scores are then used to compute a weighted sum of the input sequence, with higher weights assigned to more informative elements.
In our implementation, the attention mechanism is seamlessly integrated with the GRU architecture, allowing the model to dynamically adapt its focus during the prediction process.This attention-enhanced representation serves as a robust foundation for subsequent processing by the Random Forest component, enabling the model to capture complex nonlinear relationships and improve prediction accuracy.

Random Forest (RF) Integration
In addition to the recurrent architecture, the HAGRU-RF model leverages the robustness of Random Forest (RF) for enhanced prediction.Random Forest operates on the principle of ensemble learning, aggregating predictions from multiple decision trees to mitigate overfitting and improve model generalization.
In our implementation, the Random Forest component is trained on the features extracted by the HAGRU architecture, providing a complementary framework for capturing complex nonlinear relationships within the data.By combining the strengths of HAGRU and RF, the model achieves a synergistic effect, resulting in superior prediction accuracy and robustness.The integration of RF further enhances the model's capacity to capture temporal dynamics and adapt to varying input conditions, making it well suited for the challenging task of solar panel energy forecasting.
The architecture of the HAGRU-RF model for solar panel energy forecasting is depicted in Figure 4, providing a comprehensive schematic overview of its components and functionality.The HAGRU-RF model represents a significant advancement in the field of solar panel energy forecasting, offering a robust and effective solution for capturing complex temporal dynamics and improving prediction accuracy.By seamlessly integrating attentionenhanced GRU and Random Forest components, the model demonstrates remarkable performance in capturing long-term dependencies, nonlinear relationships, and salient features within the data, making it a valuable tool for renewable energy prediction and resource management.
The decision to create this hybrid model stems from the unique nature of the solar panel energy forecasting problem.Solar energy production exhibits intricate temporal patterns influenced by various factors such as weather conditions, time of day, and seasonality.While traditional machine learning methods like Random Forest excel at capturing nonlinear relationships, they may struggle with capturing temporal dependencies inherent in time series data.On the other hand, Recurrent Neural Networks like GRU are well suited for modeling sequential data but may lack the ability to capture complex nonlinear relationships effectively.
By combining the strengths of both GRU and Random Forest in the HAGRU-RF model, we leverage the temporal modeling capabilities of GRU to capture sequential dependencies and the nonlinear modeling capabilities of Random Forest to capture complex patterns in the data.This hybrid approach enables the model to achieve superior performance compared to standalone methods, providing accurate forecasts essential for effective solar energy management and resource allocation.

Results and Analysis of the GRLA
In this subsection, we present the outcomes and analysis of the Genetic Reinforcement Learning Algorithm (GRLA) developed for optimizing energy-efficient container placement in cloud data centers.The GRLA was implemented using JAVA Eclipse with CloudSim for simulating cloud environments.Additionally, we incorporated a reinforcement learning agent using the RL4J package in Java Eclipse to enhance the decision-making process and adapt container placement strategies based on environmental changes.
We employed our Genetic Reinforcement Learning Algorithm (GRLA) in conjunction with the Power model implemented in CloudSim.This model calculates the energy consumption of active servers by considering various resource factors.Our experimentation involved the utilization of eight distinct cloud systems, encompassing both homogeneous and heterogeneous configurations, as delineated in Table 4. Previous research indicates that the energy consumption of a data center is divided into three classes, with active servers consuming between 36% and 40% of the total energy.The cooling system accounts for a significant proportion, ranging between 45% and 50%, while other systems such as lighting and communication equipment consume the remaining 15%.
The energy calculated is directly linked to container operation in active servers and is measured in watt-hours (Wh).This unit represents the amount of energy consumed by the servers over one hour of container operation.From this energy consumption of active servers, we will derive the predicted total energy consumed by the data center, considering the contribution of other components like cooling systems and auxiliary equipment.
Table 5 presents the results obtained from the application of the Genetic Reinforcement Learning Algorithm (GRLA) in both homogeneous and heterogeneous data center environments from Table 4, alongside comparative metrics from traditional metaheuristic techniques: A Genetic Algorithm (GA) [38], Ant Colony Optimization (ACO) [39], and Simulated Annealing (SA) [40].Additionally, we include results from the First Fit Decreasing (FFD) heuristic [38] for a comprehensive comparison.The evaluation metrics include energy consumption, energy saved, and computational efficiency, providing insights into the algorithm's performance across diverse scenarios.Through comprehensive analysis and comparison, we aim to assess the effectiveness of the GRLA in optimizing container placement strategies for energy-efficient operation in cloud data centers.Firstly, focusing on the energy consumption aspect, the Genetic Reinforcement Learning Algorithm (GRLA) consistently outperforms traditional metaheuristic techniques and the First Fit Decreasing (FFD) heuristic in terms of energy efficiency across all cloud systems.GRLA achieves lower energy consumption values compared to the other algorithms and FFD, highlighting its effectiveness in optimizing container placement for energy conservation.This superiority stems from GRLA's unique approach, which combines genetic algorithms with reinforcement learning to iteratively optimize container placements based on dynamic environmental factors and historical performance data.By leveraging reinforcement learning, GRLA adapts container placement strategies over time, maximizing energy efficiency while ensuring optimal resource utilization.In contrast, traditional metaheuristic techniques and FFD lack the adaptive capabilities of GRLA, leading to less efficient container placements and higher energy consumption.
Secondly, examining the metric of energy saved provides deeper insights into the effectiveness of each algorithm in optimizing energy utilization within cloud systems.Energy saved represents the difference between the energy consumed by a system when all servers are active with 50% resource utilization and the energy consumed after applying an algorithm for container placement.GRLA consistently demonstrates significant energy savings compared to traditional techniques.This substantial energy saving can be attributed to GRLA's ability to dynamically adjust container placements based on real-time data and feedback, resulting in more efficient resource allocation and reduced energy waste.
In contrast, traditional metaheuristic techniques and FFD exhibit lower energy savings, indicating suboptimal container placement strategies and, consequently, higher energy consumption.Additionally, while GA shows some improvement over traditional techniques, it still falls short of GRLA's energy-saving capabilities.This highlights the importance of adaptive optimization approaches, like GRLA, in achieving substantial energy savings and enhancing overall energy efficiency in cloud data centers.Furthermore, considering the execution time metric insights into the computational efficiency of each algorithm.Although GRLA may exhibit slightly longer execution times compared to other algorithms and FFD, its ability to achieve significant energy savings justifies the additional computational overhead.GRLA's optimization process involves iteratively evaluating and refining container placement strategies, leveraging historical data and reinforcement learning to guide decision-making.Despite the marginally longer execution times, GRLA's adaptive nature and superior energy-saving capabilities make it a preferred choice for energy-efficient container placement in cloud systems.In contrast, traditional metaheuristic techniques and FFD may offer faster execution times but sacrifice energy efficiency and overall performance.Therefore, the slight increase in execution time with GRLA is outweighed by the substantial benefits it provides in terms of energy savings and operational efficiency.
In summary, the results underscore the effectiveness of the Genetic Reinforcement Learning Algorithm (GRLA) in optimizing container placement for energy conservation in cloud systems.By achieving significant energy savings and outperforming traditional metaheuristic techniques and heuristic methods like FFD, GRLA emerges as a promising solution for enhancing energy efficiency and reducing operational costs in cloud data centers.This highlights the importance of leveraging adaptive optimization approaches, like GRLA, to address the evolving challenges of energy management in cloud computing environments.

Results and Analysis of the HAGRU-RF
In this subsection, we delve into the outcomes and analysis of the Hybrid Attentionenhanced GRU with Random Forest (HAGRU-RF) model for solar energy prediction.The model was trained on a system featuring an Intel(R) Core(TM) i7-10700K CPU @ 3.80 GHz and NVIDIA GeForce RTX 3090 GPU, leveraging Keras with TensorFlow backend for implementation.
In this segment, we present the performance evaluation of the HAGRU-RF model in predicting solar energy production and its potential to inform energy management decisions in cloud data centers.Additionally, we provide a detailed analysis of three different forecasting horizons: 1-day forecast, 1-week forecast, and 1-month forecast.Each forecast horizon is examined in a separate segment, where we compare the performance of HAGRU-RF with both traditional machine learning and deep learning approaches.All models were trained and tested on the same training set (70% of the dataset) and the testing set (30% of the dataset).

One-Day Solar Energy Forecasting
Table 6 presents the results obtained for the 1-day forecast.The HAGRU-RF model, a fusion of Hybrid Attention-enhanced Gated Recurrent Unit (HAGRU) with Random Forest (RF) algorithms, stands out as the pinnacle of predictive prowess in our analysis.Across diverse hyperparameter configurations, it consistently yields the lowest Mean Absolute Error (MAE), Mean Squared Error (MSE), and Root Mean Squared Error (RMSE) compared to its counterparts, as illustrated in Figures 5 and 6.Notably, increasing the number of epochs/rounds bolsters its predictive accuracy, with MAE ranging from approximately 0.0287 to 0.0304, MSE from 0.0042 to 0.0045, and RMSE from 0.0646 to 0.0674.While it demands longer training times relative to certain models like LSTM and GRU, its unmatched performance justifies this computational investment.In contrast, models based on Recurrent Neural Networks (RNNs) and Transformers, namely LSTM, GRU, and Transformers, present respectable performance but consistently fall short in comparison to HAGRU-RF.Despite the potential for performance enhancement with more epochs/rounds, they lag behind in predictive accuracy.
Similarly, gradient boosting methods such as XGBoost, LightGBM, and CatBoost exhibit competitive yet inferior performance to HAGRU-RF.Despite their relatively shorter training times, they fail to match the predictive prowess of our novel model.
Traditional time series models like ARIMA and SARIMA, while widely used, struggle to capture the intricate temporal nuances inherent in our data, leading to higher forecasting errors.This limitation, coupled with longer training times, diminishes their appeal compared to more advanced approaches.
Among classical machine learning methods, KNN and SVM perform adequately but fail to surpass the predictive finesse of HAGRU-RF.KNN's sensitivity to distance metrics and the number of neighbors, along with SVM's longer training times with certain kernels, pose challenges in achieving optimal predictive accuracy.
In essence, the HAGRU-RF model emerges as the unrivaled champion in our 1-day forecast analysis.Its exceptional predictive accuracy, albeit with longer training times, solidifies its position as the preferred choice for energy consumption forecasting in containerized data centers leveraging solar energy and AI technologies.

One-Week Solar Energy Forecasting
The outcomes for the 1-week forecast are displayed in Table 7.In the realm of 1-week forecasting, the HAGRU-RF model reigns supreme as the pinnacle of predictive capability.This amalgamation of Hybrid Attention-enhanced Gated Recurrent Unit (HAGRU) with Random Forest (RF) algorithms consistently outshines its counterparts across a spectrum of hyperparameter configurations.Demonstrating a steadfast commitment to precision, HAGRU-RF achieves the lowest Mean Absolute Error (MAE), Mean Squared Error (MSE), and Root Mean Squared Error (RMSE) metrics, as evidenced by Figures 7 and 8, showcasing its unparalleled predictive prowess.An intriguing observation is the model's propensity for heightened accuracy with an increase in the number of epochs/rounds.Throughout various configurations, the MAE ranges from approximately 0.0335 to 0.0366, the MSE from 0.0064 to 0.0074, and the RMSE from 0.0799 to 0.0862.Although HAGRU-RF demands extended training times compared to some models, its superior performance substantiates this computational investment.
Conversely, models rooted in Recurrent Neural Networks (RNNs) and Transformers, such as LSTM, GRU, and Transformers, while displaying respectable performance, consistently trail behind HAGRU-RF.Despite the potential for enhancement with additional epochs/rounds, these models fail to match the predictive finesse exhibited by HAGRU-RF.
Likewise, gradient boosting methods like XGBoost, LightGBM, and CatBoost present competitive yet inferior performance compared to HAGRU-RF.Despite their shorter training times, they fall short in delivering the level of predictive accuracy achieved by our novel model.
Traditional time series models like ARIMA and SARIMA, although prevalent, grapple with capturing the intricate temporal nuances inherent in the data, leading to higher forecasting errors.Coupled with longer training times, these limitations diminish their appeal compared to more advanced approaches.
Among classical machine learning methods, KNN and SVM demonstrate satisfactory performance but fail to surpass the predictive finesse of HAGRU-RF.KNN's sensitivity to distance metrics and the number of neighbors, alongside SVM's longer training times with certain kernels, pose challenges in achieving optimal predictive accuracy.

One-Month Solar Energy Forecasting
Table 8 illustrates the results obtained for the 1-month forecast.In the realm of forecasting for a month-long horizon, the HAGRU-RF amalgam emerges as a beacon of predictive prowess, marrying the nuanced capabilities of Hybrid Attention-enhanced Gated Recurrent Unit (HAGRU) with the robustness of Random Forest (RF) algorithms.Notably, augmenting the number of epochs/rounds correlates with enhanced accuracy, with MAE ranging from approximately 0.0359 to 0.0421, MSE from 0.0047 to 0.0099, and RMSE from 0.0688 to 0.0996 across configurations.As illustrated in Figures 9 and 10, despite its appetite for longer training times relative to certain models, the unparalleled performance of HAGRU-RF underscores its worthiness as a computational investment.In contrast, models hinged on Recurrent Neural Networks (RNNs) and Transformers, including LSTM, GRU, and Transformers, while exhibiting commendable performance, consistently trail behind HAGRU-RF.Despite the potential for improvement with increased epochs/rounds, these models fail to match the predictive finesse of HAGRU-RF.
Similarly, gradient boosting techniques such as XGBoost, LightGBM, and CatBoost, although competitive, fall short of the benchmark set by HAGRU-RF.Despite their shorter training times, they lack the precision achieved by our novel model.
Traditional time series methodologies like ARIMA and SARIMA, while widely employed, grapple with capturing the intricate temporal dynamics inherent in the data, resulting in elevated forecasting errors.Coupled with longer training durations, these shortcomings diminish their appeal relative to more sophisticated approaches.
Among classical machine learning paradigms, KNN and SVM demonstrate acceptable performance but lag behind the predictive finesse of HAGRU-RF.KNN's susceptibility to distance metrics and neighbor counts, coupled with SVM's lengthier training times under certain kernels, pose obstacles to achieving optimal predictive accuracy.
In the realm of forecasting solar energy, our model, HAGRU-RF, emerges as the unequivocal champion for both short and long-term predictions.Despite its occasionally lengthier training periods compared to alternative methods, HAGRU-RF consistently delivers superior predictive accuracy, outperforming its counterparts across various performance metrics.The minimal values of Mean Absolute Error (MAE), Mean Squared Error (MSE), and Root Mean Squared Error (RMSE) achieved by HAGRU-RF underscore its effectiveness in forecasting solar energy with precision and reliability.
In this context, the importance of minimizing prediction errors outweighs concerns about training time, as the primary objective is to obtain predictions that closely align with actual solar energy values.Thus, the slight trade-off in training duration is inconsequential when weighed against the unparalleled accuracy and effectiveness of HAGRU-RF in solar energy prediction, making it the optimal choice for energy forecasting applications.

Integration of GRLA and HAGRU-RF for Green Cloud Computing
The main objective of our approach is to demonstrate the feasibility of using solar energy to power cloud data centers, thereby fostering green cloud computing.In this subsection, we present a comprehensive analysis integrating the results obtained from the Genetic Reinforcement Learning Algorithm (GRLA) for energy-efficient containerized data centers and the Hybrid Attention-enhanced GRU with Random Forest (HAGRU-RF) model for solar energy prediction.
We aim to provide evidence supporting the notion that solar energy can effectively meet the energy demands of cloud data centers, thereby reducing reliance on conventional power sources and mitigating environmental impact.To achieve this, we compare the energy consumption obtained from the GRLA for the eight systems previously presented in Table 5 with the solar energy predicted by the HAGRU-RF model.Through this analysis, we seek to demonstrate the potential of integrating artificial intelligence techniques to facilitate the transition towards sustainable and eco-friendly cloud computing infrastructure.
The comparison of predicted solar energy generated by the HAGRU-RF model and the predicted energy consumption of eight data centers using the GRLA model provides valuable insights into the dynamics of renewable energy integration into data center operations.The energy consumption of each system represents the predicted energy consumed in Mw/h for container operation in active servers, assuming continuous operation to keep cloud services available for users.
For the 1-day forecast demonstrated in Figure 11, the HAGRU-RF model predicts solar energy generation ranging from approximately 0.09 MW to 0.89 MW over a 24-h period.This variability in solar energy output reflects the intermittent nature of sunlight and its impact on energy generation.However, it is worth noting that the peak solar energy generation is sufficient to meet the energy needs of the eight data center systems, demonstrating the potential for renewable energy to satisfy operational demands.
Analyzing the data reveals instances where solar energy generation exceeds data center consumption, indicating potential opportunities for utilizing renewable energy to power data center operations efficiently.However, there are also periods where solar energy generation falls short of meeting data center demands, underscoring the importance of supplementary energy sources or energy storage solutions to ensure uninterrupted operations.
Expanding the forecast to a 1-week period reveals a wider range of predicted solar energy generation, spanning from approximately 0.03 MW to 0.92 MW.This increased variability reflects the influence of factors such as weather patterns and seasonal changes on solar energy output over a longer duration.Despite fluctuations as revealed in Figure 12, the data center energy consumption remains dynamic, highlighting the need for adaptive energy management strategies to align with varying energy supply.Further extending the forecast to 1 month provides insights into long-term trends in solar energy generation and data center energy consumption.The predicted solar energy generation maintains a diverse range, indicating the influence of seasonal variations and climatic factors on renewable energy availability.Importantly, the consistent presence of solar energy generation that can meet or exceed the energy needs of the eight data center systems underscores the potential of renewable energy sources to support sustainable and resilient data center operations, as portrayed in Figure 13.By leveraging insights from these forecasts, organizations can make informed decisions regarding energy procurement, infrastructure planning, and sustainability initiatives.Strategic integration of renewable energy sources, such as solar power, coupled with efficient energy management practices driven by AI strategies, can enhance the resilience and sustainability of data center operations.This holistic approach to energy management not only reduces environmental impact and operating costs but also ensures reliable and secure data center services for a digitally connected world.

Conclusions and Future Work
In this study, we have demonstrated the feasibility of utilizing solar panel-generated energy to meet the power demands of large data centers equipped with substantial infrastructure.Our investigation introduced two innovative models, the Genetic Reinforcement Learning Algorithm (GRLA) and the Hybrid Attention-enhanced GRU with Random Forest (HAGRU-RF), each contributing to the advancement of data center energy management.The GRLA offers a pioneering approach in data center management by optimizing energy-efficient container placement.We showcased its effectiveness in optimizing energy consumption across homogeneous and heterogeneous data center environments.Comparative analysis against traditional metaheuristic algorithms further solidifies its efficacy, demonstrating significant energy savings.On the other hand, the HAGRU-RF model excels in accurately forecasting solar energy production.It outperforms traditional machine learning and deep learning approaches, providing accurate predictions across different forecasting horizons-1-day forecast, 1-week forecast, and 1-month forecast-and informing energy management decisions in cloud data centers effectively.In future work, we aim to further validate our approach by testing it on Moroccan Solar Energy Datasets from projects like the "Noor Ouarzazate Solar Complex".This real-world validation will provide valuable insights into the scalability and applicability of our models in diverse environmental contexts, paving the way for the adoption of sustainable energy solutions in cloud computing infrastructures.

7 : 8 :
for each Container C in the offspring O do Compute the state S C based on the current VM and mutation parameters 9: Select an action A C using the RL agent based on state S C 10: Adjust mutation parameters (e.g., Container migration) based on action A C

Figure 4 .
Figure 4. Overview of the HAGRU-RF model architecture.

Figure 5 .
Figure 5.Comparison of performance metrics for the 1-day forecast across different models.

Figure 6 .
Figure 6.Training and validation loss evolution for the HAGRU-RF Model (1-day forecast).

Figure 7 .
Figure 7.Comparison of performance metrics for the 1-week forecast across different models.

Figure 8 .
Figure 8. Training and validation loss evolution for the HAGRU-RF Model (1-week forecast).

Figure 9 .
Figure 9.Comparison of performance metrics for the 1-month forecast across different models.

Figure 11 .
Figure 11.Comparison of predicted solar energy by HAGRU-RF and predicted energy consumption of data centers by GRLA (1-day forecast).

Figure 12 .
Figure 12.Comparison of predicted solar energy by HAGRU-RF and predicted energy consumption of data centers by GRLA (1-week forecast).

Figure 13 .
Figure 13.Comparison of predicted solar energy by HAGRU-RF and predicted energy consumption of data centers by GRLA (1-month forecast).
Sort individuals in Population P based on their Fitness Score in descending order 7: for i from 1 to PopulationSize/2 do Add the ith individual to BestSolutions 9: end for 10: return BestSolutions as the selected parents • Crossover Phase: The crossover phase is adapted to reflect the influence of the RL agent.The RL agent can adjust the crossover probability or select appropriate crossover strategies based on its learned policy, leading to more effective genetic recombination, as presented in Algorithm 2.
Algorithm 1: Selection Phase with RL Require: Population P, RL Agent Ensure: Selected Individuals 1: Initialize an empty list BestSolutions 2: for each individual I in Population P do Algorithm 2: Crossover Phase with RL Require: Population P, Crossover Case, RL Agent Ensure: Crossover Offsprings 1: Initialize an empty map Crossover 2: Define a RL agent with action space and policy 3: for each individual I in Population P do 4:

Algorithm 3 :
Mutation Phase with RL Require: Crossover Offsprings, Host List, Container List, RL Agent Ensure: Mutated Offsprings 1: Initialize an empty map Mutation 2: Define a RL agent with action space and policy 3: for each offspring O in Crossover Offsprings do

Table 2 .
Summary statistics for the 'MW' attribute.

Table 3 .
Configuration of GRU layers in the HAGRU-RF model.

Table 4 .
System configuration details for hosts and containers in cloud data centers.

Table 5 .
Comparison of energy consumption prediction algorithms for cloud systems.

Table 6 .
Performance metrics for the 1-day forecast.

Table 7 .
Performance metrics for the 1-week forecast.

Table 8 .
Performance metrics for the 1-month forecast.