## 2 Background and Related Work  
### Datacenters Power Consumption and Renewable Energy Generation  
With the rapid development of information technology and the coming of the Internet era, especially the development of cloud computing around the world, the proportion of datacenters with more than 100 racks is increasing year by year. Hence, the problems of high energy consumption, high cost and high pollution are increasingly prominent. For example, for a datacenter with a construction scale of 2000 racks, the electricity consumption per hour will be around 6000 kWh and the annual electricity consumption will be about 52,560 MWh. Then, its total annual cost could reach up to $105 million including the electricity cost, the air conditioning, fresh air, lighting and other power consumption of the datacenter, with a PUE (power usage effectiveness) of 2 [3]. In addition, the impact of datacenters on the environment is attracting increasing attention from the public. According to the current development trends, the average annual electricity consumption of datacenters will account for 1% of the total global value in 2020 as predicted in Reference [9]. The IT industry emits about 35 million tons of carbon dioxide per year, accounting for 2% of global emissions. In order to reduce energy consumption and carbon emissions of datacenters, it is important to maintain sustainable datacenters and make full use of green energy [10; 11]. Meanwhile, governments all over the world have also published laws and policies to encourage energy conservation and the reduction of emissions. The cost of deploying equipment to build new energy sources, such as photovoltaic panels and wind turbines, has dropped as manufacturing costs have decreased, along with massive investment and government incentives. More and more IT enterprises and organizations are gradually realizing full or partial new energy-driven datacenters, such as the wind power datacenters that the Green House Data built in Wyoming [12], and the solar datacenters that the Facebook built in Oregon [13]. Early in April 2012, eBay decided to use 30 Bloom Energy fuel cells to power its datacenter in Utah [14]. Apple will utilize 60% power from photovoltaic generation and battery station to drive their datacenters in Southern California [15]. On the other hand, datacenter energy efficiency is usually low, with huge energy waste. According to statistics of the Ministry of Industry and Information Technology, the average PUE value for datacenters in China is between 2.2 and 3.0, while the actual energy consumption may be much higher. For enterprises, electricity for datacenters has become a big expense, greatly eroding the operating profits of enterprises. According to data reported in Reference [3], the total electricity consumption of datacenters all over China was more than 110.8 billion kWh in 2016, and in 2017 it was 120-130 billion kWh, which is more than the total generating capacity of the Three Gorges dam in the whole year of 2017 (97.605 billion kWh) together with the Gezhouba dam power plant (19.05 billion kWh in 2017). At the same time, with the rapid development of the world's economy, the demand for energy is enhancing day by day, while traditional energy sources are drying up gradually. People have begun to focus on new types of clean energy, hoping that it could change the current energy structure and realize more sustainable development. In recent years, photovoltaic power generation and wind power generation have developed quickly. By the end of 2015, the total installed capacity of solar cells had reached 20,000 MW all over the world [16]. In 2017, the cumulative installed capacity of photovoltaic generation in China reached 130 million kW with 69% year-on-year growth, accounting for 7.3% of the total power generation capacity of the whole country. Among them, the cumulative installed capacity of centralized photovoltaic is 100 million kW and the distributed photovoltaic is 29.66 million kW.