## 1 Introduction  
In recent years, with the increasing demand for energy, fossil fuel shortage and environmental aggravation are becoming more and more serious. Renewable energy can effectively solve the above issues as potential alternatives to fossil fuel, which have wide attention [1; 2]. Building integrated photovoltaic (BIPV) is a system that integrates building and photovoltaic (PV) power generation by deploying photovoltaic arrays on the surface of a building, which intends to harvest power that is used for the building. Recently, BIPV is one of the most efficient ways to utilize renewable energy. In Europe, the potential of BIPV is estimated at more than 22% of the expected 2030 electricity demand, and other countries, including India, China, and Brazil, consider it to be an important option for generating electricity [3]. Government bodies in Germany, Spain, and France are promoting the BIPV by executing feed-in tariff systems, other developed countries such as Japan, USA, Australia have adopted financial subsidies as the main policy to develop BIPV [4]. The microgrid system based on BIPV shows the advantage of easy to control and with high energy utilization rate, which can provide reliable and high-quality electric energy for the electrical equipment in building [5]. Therefore, BIPV has become one of the most widely used forms of renewable energy in buildings. However, there is often a mismatch between the peak of photovoltaic (PV) generation and the pinnacle of the electricity demand for the building's power system. More specifically, peak PV generation occurs at noon, while peak load demand generally occurs at other time-spans of a day [6]. Thus, the benefits of BIPV microgrid is reduced due to the phenomenon of solar curtailment or selling electricity to the main grid at a lower price. Furthermore, PV power generation shows the characteristics of randomness and intermittence, which may affect the stable operation and real-time power balance of the main grid [7]. The above problems can be effectively solved by installing a battery energy storage system. However, the battery shows the disadvantages of high investment cost and short life span [8]. Therefore, the concept of virtual energy storage (VES) has been widely researched. As a generalized form of energy storage, VES intends to make the controllable loads show a similar regulation function with the traditional energy storage system through proper dispatch of some controllable loads. For instance, an air conditioner (AC) can convert electrical energy into heat/cold energy that stored in buildings, and an electric water heater (EWH) can convert electrical energy into a heater that is stored in the water tank of EWH. The stored heat/cold energy could be changed by regulating the working states of these controllable loads. Therefore, these controllable loads can be treated as VES equipment in a microgrid. The working state of these controllable loads can be directly controlled by a dispatching center or guided by economic measures (e.g., real-time electricity price). Generally, the power consumption of AC accounts for 30-55% of the whole building [9], EWH and refrigerators are also essential electrical appliances in every home, hence VES has a wide range of applications. For example, in residential communities, the controllable loads of AC, refrigerators, and EWH can be aggregated and regulated by smart meters to provide VES utility. In commercial buildings, central AC and EWH can also be directly controlled to provide VES utility. On the premise of ensuring user comfort and privacy, VES shows great practical value as they can bring huge social and economic benefits. The optimal scheduling of the microgrid, considering controllable load, is also known as demand response (DR). DR is a significant way for the new-generation energy systems to cope with the randomness and intermittence of renewable energy generation as well as load fluctuation.