Electric Mobility: An Overview of the Main Aspects Related to the Smart Grid

: Electric mobility has become increasingly prominent, not only because of the potential to reduce greenhouse gas emissions but also because of the proven implementations in the electric and transport sector. This paper, considering the smart grid perspective, focuses on the ﬁnancial and economic beneﬁts related to Electric Vehicle (EV) management in Vehicle-to-Building (V2B), Vehicle-to-Home (V2H), and Vehicle-to-Grid (V2G) technologies. Vehicle-to-Everything is also approached. The owners of EVs, through these technologies, can obtain revenue from their participation in the various ancillary and other services. Similarly, providing these services makes it possible to increase the electric grid’s service quality, reliability, and sustainability. This paper also highlights the different technologies mentioned above, giving an explanation and some examples of their application. Likewise, it is presented the most common ancillary services veriﬁed today, such as frequency and voltage regulation, valley ﬁlling, peak shaving, and renewable energy supporting and balancing. Furthermore, it is highlighted the different opportunities that EVs can bring to energy management in smart grids. Finally, the SWOT analysis is highlighted for V2G technology. the data obtained from the forecast as a basis for the of The results showed that the scheduling of the the the charging/discharging the


Introduction
Greenhouse Gases (GHG) emission has always been a very relevant problem in the transport sector, where its appearance comes mainly from the excessive consumption of fossil fuels, which causes adverse effects on the climate [1]. According to the European Commission, in 2016, the "transport represents almost a quarter of Europe's greenhouse gas emissions and is the main cause of air pollution in cities" [2]. Thus, in order to mitigate this problem, one of the most appropriate approaches is the integration of electric vehicles (EV) in societies [3], where these, unlike internal combustion engines vehicles (ICEV), have the advantage of not depending on fossil fuels, which consequently enables the reduction of GHG emissions, and also they are more energy efficient [4]. In the EV market, there are different types of EVs that can be categorized into four types: the Battery Electric Vehicle (conventional EV); Fuel Cell Electric Vehicle; Hybrid Electric Vehicle; and Plug-in Hybrid Electric Vehicle. As far as ICEVs are concerned, they are divided into vehicles with compression ignition engines and spark-ignition engines [5].
Since the Paris treaty, several countries, in order to contribute to the reduction of GHG emissions, have taken initiatives to encourage the adoption of EVs, thus reducing the dependence on ICEVs [6]. According to [7], there are already several declarations about the banning of ICEV, where it is predicted that in 2025, Norway will be the first country to start with the ban. Many other countries intend to start the ban around 2030, such as Denmark, Netherlands, Ireland, India, Israel, and Switzerland, while France only around 2040. Recently, England announced that it had intentions to advance the ban on ICEVs from 2040 to 2030 to help trigger the green economic recovery from COVID-19 [8]. scrutinized how electric mobility was progressing and evolving in six smart cities located in Europe. This study itself compared and assessed the documentation associated with the policies and strategies applied to manage electric mobility in each of the smart cities. In [22], it was examined the current state of the factors that influenced the consumers' adoption of electric mobility. Table 1 highlights the contributions of the analyzed review papers to the main topics addressed in this review paper.
From the reviews mentioned above, it can be seen that each one goes into some depth on a variety of topics associated with EVs. However, the mentioned reviews do not examine specific topics in-depth as this paper does, regarding the Vehicle-to-Building (V2B), Vehicleto-Grid (V2G), and Vehicle-to-Home (V2H) technologies, the possible ancillary services that EVs can provide to the SG, the EV charging, and the energy management of the SGs. Focusing on the related reviews with the present paper [18], only highlights, in the context of the bidirectional on-board chargers, the V2G interfaces, and the charging levels, modes, and methods. In [4], the study of the impact of EVs was conducted, where V2G benefits for mitigating the RES uncertainty were presented, highlighting the ancillary services, such as the frequency and voltage regulation and spinning reserve. However, this study does not examine the V2B, V2G, and V2H technologies in detail or provide a SWOT analysis to understand the V2G impact. Moreover, in [17], the different EV charging methods, connectors, modes, and levels were highlighted, disregarding details on V2B, V2G, and V2H technologies or ancillary services. Considering what was said, this paper was not devoted to focusing on all the aspects of electric mobility. Instead, the paper focuses on discussing the most relevant aspects in the SG perspective, including V2X, charging and discharging, ancillary services, and energy management in SG. Opportunities for the participation in ancillary services; 3.
Opportunities to assist SG's energy management systems (EMS); 5.
SWOT analysis of the V2G.
The paper is divided into seven sections. Section 1 introduces the theme of this paper. Section 2 presents the V2X technology, highlighting some of its applications in which it supports. Section 3 describes the EV's different charging levels, modes, and methods. Section 4 highlights the different ancillary services, along with some application examples. Section 5 highlights the influence of EVs in EMS in SG. Section 6 focuses more on V2G technology, where it highlights its SWOT analysis. Finally, Section 7 presents the conclusions of this work as well as possible future investments.

Vehicle-to-Everything
Electric vehicles change their location during different periods of the day, where different energy exchange opportunities arise [29]. The V2X concept supports different applications, as shown in [16,30], being the most common Vehicle-to-Vehicle, V2H, V2B, and V2G. V2X concept represents a strategy considering all these interactions, as well as the technological means to support them. This paper focuses on V2H, V2B, and V2G, as these have been more prominent today [16].
In fact, the shifting toward electric mobility can provide several opportunities to societies, namely reducing GHG emissions and energy consumption [21]. However, electric mobility involves many aspects such as communication, computation, architecture, protocols, battery modeling, charging, and discharging, etc. This shifting is a complex process since the electric mobility system depends on the interoperability of several layers, namely components, communication, information, function, and business [31]. This paper focuses on discussing the most relevant aspects in the SG perspective, which fits the V2X scope. Figure 1 illustrates a framework of the V2X system architecture, where the aggregator is responsible for interacting with the households, parking lots, and energy resources, while the distribution system operator (DSO)/independent system operator (ISO) interacts with the respective Electricity grid. In this way, the DSO/ISO can interact with an aggregator to request vehicle charging and discharging behaviors according to the best energy management in their electric grids. For example, if DSO/ISO verifies that additional energy is needed, it communicates with the aggregator, which then interacts with the buildings and parking lots to mitigate that overload, considering the available energy resources. If the grid has excess energy, it communicates with the aggregator to schedule the charging of EVs to make the most of the excess.
According to Figure 1, it is possible to identify the different technologies supported by V2X, such as V2B, V2H, and V2G, where they will be explored in detail in the following subsections.

Vehicle-to-Grid
Regarding V2G technology, this consists of the bidirectional transfer of energy, where the EVs can discharge the energy stored in the batteries to the grid, thus serving to regulate the energy system, as can be seen at [14,23]. This technology is complex, where for it to work correctly, it requires the coexistence of several components, which can only be achieved through charging and communication protocols. Thus, the aggregator is crucial for this technology since it creates business models according to the interests of EVs' owners [32]. In this way, the aggregator allows the link between EV owners and energy market participants to be maintained. Another notable aspect of this technology is the ancillary services that allow the electricity grid's quality and efficiency to be preserved [33,34]. Figure 1 also illustrates another way to present the structure of the V2G system, which focuses more on the respective connection between the EV and the electric grid through the charging station from the parking lot. In general, depending on whether the EV is charging/discharging, a voltage conversion must occur to level the voltage entering or leaving the EV battery. In case the EV is charging, the voltage coming from the grid first goes through the AC/DC conversion process, and then the voltage is reduced by means of a downward converter. In case the EV is discharging, the voltage coming out of the EV battery is first increased through an upward converter, and then the DC/AC conversion is carried out to level with the mains voltage. In both cases mentioned above, the respective converter is aided by a reference signal that enables it to perform the respective conversions accurately, regardless of the direction of the conversion [24].
In the context of V2G systems, there are several works of literature where they report that these systems can contribute in various ways. For example, ref. [35] uses a Mixed Integer Linear Programming (MILP) model that supports the bidirectional capabilities of V2G to reduce the degradation of EVs' batteries and increase the participation payoff. In [36], the study on the optimization of EVs at small charging stations was elaborated. Through the V2G technology, the respective optimization model allows the improvement of the EV charging/discharging processes, consequently reducing the energy costs of the respective EVs and minimizing the charge-discharge cycles of the EV batteries.
There are also studies that focus on energy resource management, as can be seen in [37,38]. In [37], a linear optimization model is studied, where it combines V2G with other technologies, such as smart charging, to control the penetration of EVs and PV production into electric systems. The respective simulations have shown that the respective linear optimization model can provide flexibility to deal with the uncertainty resulting from the penetration of EVs and PV production. In [38], a model was proposed to minimize the operating cost of the distributed energy resources available in a grid that benefits from V2G through a hybrid metaheuristic algorithm. This study considers different energy resources, such as biomass, PV, wind, mini-hydro, and others, as well as a fleet of 2000 EVs, where the requirements of the EV owners were taken into account. The results show that, with EVs' help, the operating cost of the distributed energy resources decreased by 1.94%.
Other works focused more on ancillary services, giving the participants of these systems the possibility to be remunerated. One example is the reference [34], where the simulation of frequency regulation services carried out in Italy was analyzed. Three types of frequency regulation simulation were highlighted, each of which has its remuneration model. These regulations were influenced by the types of users used and the capacity of the batteries, and EV specifications.
EV owners can also be compensated if they participate in V2G programs that have the scope of coordinating their charging/discharging processes. In the case of [39], a model was developed that allows the development of an optimized charging/discharging schedule that maximizes the respective participant's remuneration.
V2G technology can also cooperate with other systems, as shown in [40]. In this study, a control system was developed to be applied to a bidirectional inductive power transfer charger. This charger can operate either in G2V mode or V2G mode, where the respective simulations performed on this charger have shown that it works well in both modes.
Energy providers can also benefit from V2G. In [41], a hybrid computing architecture is highlighted to be applied in 5G-based V2G networks, which improves the quality of service of energy providers through the bidirectional flow of energy and information between the SG and the schedulable EVs.

Vehicle-to-Home
V2H technology makes it possible to offer greater energy efficiency to a given residence by combining local renewable energy sources (RES), such as wind or solar, with storage systems, i.e., EV batteries [42]. In this way, the EV batteries can facilitate the local integration of the RES, storing their excesses and later discharging in situations where the price of energy is high or where the domestic demand is higher or even in emergencies. Likewise, these excesses can be sold to the energy market if the price is justified. Thus, this technology allows optimizing the energy consumption of the house [24]. Figure 1 also shows the V2H system, where the energy management system, which supervises energy transfers, and the home load manager are connected in parallel to the charging station installed in the residence. If there is a greater demand on the home's electric grid, the EMS allows the respective EV to transfer energy to the domestic loads, thus supporting the home.
Several kinds of literature have conducted studies on the application of this technology. For example, in [43,44], they studied the combined coordination of V2H technology with renewable and non-renewable distributed generation, together with DR programs. In [43,44], they considered wind and PV production, together with a diesel generator, where in these studies its verified that the combination of V2H technology with the others permits significantly reduce the energy cost. Another example of applying this technology was illustrated in [45], where the study focused on coordinating the EV batteries with the PV production installed in the homes. In this one, it was verified that in Japan, in 2030, the combination of "PV + EV" was quite promising. In [46], a model was presented based on the V2H system, which aims to minimize the energy cost of a smart home that takes advantage of wind and PV generation. Considering the charging/discharging processes of the batteries of EVs and smart equipment, this model seeks to optimize the planning of energy resources through MILP. The simulations demonstrate that EVs' participation allows reducing the energy cost significantly.
This technology also allows using the batteries of EVs as additional storage, as shown in [47]. This paper presents a model for a V2H system that uses an EV battery and a stationary battery as additional energy storage for a residence. This paper aims to develop a system capable of managing the energy resources of the residence through the charging and discharging processes of both available batteries. For this purpose, in this study, models for different subsystems of the V2G system were highlighted, such as the energy demand of the residence, the additional energy storage, and the energy converters used to perform the respective long-term simulations and obtain data.

Vehicle-to-Building
V2B technology is very similar to V2H, where it also combines storage systems with power generation technology, such as RES. The main difference between these technologies is the magnitude of energy consumption involved in the problem in which these technologies are inserted. In V2B technology, the energy transferred between the non-residential building and the set of EVs is higher than in V2H. Likewise, the amount of EVs involved in these technologies is different [24].
In the example in [48], a method based on linear programming is developed, where the objective of this one is to minimize the operational cost of the building in question, where it benefits from PV production and the EV charging station that collaborated. With this method, it is concluded that the collaborative strategy between the building and the EV charging station is more economical than the non-collaborative strategy. A similar example was [49], wherein this study still considered the degradation of the building's storage system. It was verified that the total costs can reduce up to 7.2%.
In [50], the study on the peak-shaving and valley-filling problem of consumption in the Spanish university building was considered. In this study, in the context of V2B technology, EVs parked in the university parking lot were used to regulate the building's energy consumption in question through the optimized scheduling of EV's charging/discharging process. Furthermore, this study used linear programming, where the results obtained from it proved its viability.
Microgrids can benefit from V2B technology, as shown in [51][52][53]. In [52], it aimed to develop an optimization framework to reduce/shave the peak load of a building incorporated in a microgrid, considering the EV owners' preferences. In this context, by taking advantage of V2B technology, the microgrid can increase its efficiency and performance while ensuring the high quality of services provided to the EV owners through bidirectional energy flow. The studies of [51,53] investigated EVs' impact on an office building embedded in a microgrid. The studies demonstrated that scheduling the charging of EVs made it possible to attenuate the energy flow of the grid at times of most significant stress.

Charging Levels, Modes, and Methods
Currently, in the transportation sector, it is possible to verify two charging methods, the unidirectional, where this consists of the grid transferring energy to the batteries of the EVs, and the bidirectional. The latter allows the EVs to transfer the energy stored in the batteries to the electric grid. On the one hand, it should be noted that the EVs' batteries are charged by charging systems that can be in AC or DC. According to the American model SAE J1772 Standard, developed by the Society of Automotive Engineers, these systems have three charging power levels [25,54], as shown in Table 2. On the other hand, these charging's can be elaborated in four ways [25,55], taking into account the respective individual characteristics of each EV. These charging modes are formalized by the International Electrotechnical Commission through the IEC 61851-1 model, where they are illustrated in Table 3.  In general, Mode 1 is usually installed in homes, and in this mode, the charging cable does not allow communication between the EV and the mains socket, nor does it protect the EV itself against overloads. On the contrary, Mode 2 already has a cable that allows communication and protects the EV against overload.
As for Mode 3, it is similar to the previous one; however, it allows charging the EVs more quickly. Finally, Mode 4, as a rule, is associated with fast charging, where the EV is charged in less than one hour by a DC power supply. Considering the unidirectional and bidirectional charging methods presented in [5], these are described in Table 4. It is essential to highlight that in order to charge or discharge EV batteries, the battery state of charge (SOC) level must first be estimated. At present, there is a variety of battery SOC estimation methods, where the most commonly known are machine learning-based methods, electromechanical model-based methods, Ah Integration, Equivalent Circuit Model, Extended Kalman Filter, and Open Circuit Voltage [56]. Each of these has its advantages and disadvantages. However, Ah Integration is the most widely used method mentioned above due to its simplicity compared to the others.

Ancillary Services
The versatility of the supply and demand of energy present in the electric grid makes it necessary to implement methods that avoid or, at least, attenuate the appearance of grid failures. Thus, considering the V2G context, EV's participation is crucial since they can flow energy in a bidirectional way, thus providing the ancillary services present in power systems.

Frequency and Voltage Regulation
The possible system services provided by implementing the V2G system, frequency, and voltage regulation have the highest priority since they cause little stress on the EVs' electric systems and the interest coming from the market.
Regarding frequency regulation, this service allows for correcting the fast and short frequency variations that occur, thus maintaining the electric grid's stability and quality. The grid frequency regulation can be performed with generators' help. However, this method can easily be expensive due to fuel usage. Considering a V2G system, which has a set of EVs at its disposal, this can provide a fast response to the frequency variations in the grid through the fast charging and discharging rates of the EVs' batteries. In general, in this service, the EVs discharge electricity when the frequency is low and charge when the frequency is high. Therefore, it is considered that frequency regulation is beneficial and economical for the EVs present in the V2G system. In [35], it presents a model based on linear programming to make grid frequency regulation with a set of EVs. This model aims at minimizing frequency deviations while maximizing the remuneration of the EV and reducing battery degradation. Another example was the study presented in [57], which highlighted a V2G control strategy for an industrial microgrid, which controls the primary frequency through the active participation of EVs, ensuring that these EVs have the appropriate SOC level. This control was conducted with the coordination between the EVs, the EV aggregator, and the respective charging station operator, where according to the simulations performed in this study, it was found that this strategy allowed for improving the respective primary frequency.
As far as voltage regulation was concerned, this service compensated for the variations that resulted from the balance between demand and supply of electricity in the grid and facilitated the integration of distributed generation in the grid. In this service, as in frequency regulation, EV, through its fast charging and discharging rates, charges the battery when there are more supply and discharges in the cases where there is more demand. An example of this service's application is illustrated in [33], where it presents a new configuration of a multi-functional grid-connected inverter to be applied in V2G systems. In general, in the respective inverter was added switches connected in series or shunt with the electric grid, allowing the same to work in different modes that allow voltage regulation. Another example of the voltage regulation service application is [58], where this study presented a predictive control model implemented in a 19-bus radial distribution system. This model enables EVs to compensate reactive power of the grid, thus keeping it stable. Similarly, the model maintains the batteries of the EVs charged. The simulation results show that EVs can perform a good role in controlling the grid voltage.
Some studies address both types of regulation mentioned, as shown in [59]. This study presents a model that allows day-ahead scheduling of the charging/discharging processes of the respective EVs in order to support the electric grid through frequency and voltage regulation services. Likewise, this study considers the EV battery degrading cost and the EV charging cost, where it seeks to minimize them. The respective simulations of this study demonstrate that this model obtains satisfactory and feasible results.

Valley Filling and Peak Shaving
In the electric grid, the load profile can be defined by an interval where there are moments with and without load peaks, where the difference between these, depending on demand and season, can be in substantial quantities. Therefore, this unevenness has to be mitigated or treated to maintain the electric grid's quality. Similarly, if the load peaks are above normal in relation to historical data, they may jeopardize the electric grid's reliability since the grid may not support these peaks. In this way, the V2G system, through the batteries of the EVs, can provide help, wherein the moments that load peaks occur, the EVs discharge, while in the moments outside the load peaks (during the night and dawn), the EVs charge. Thus, by leveling the load profile of the electric grid, it causes valley filling. These services can be implemented in a V2G system, as shown in [50][51][52][60][61][62].
In the case of [60], it proposes an aggregator-based DR mechanism for the EVs that participate in V2G systems to regulate the peak of the electric grid in the valley time. In this one, it is verified that the participation of the EVs allows reducing the total cost as well as the peak-valley difference ratio. The study [61] presents a price-based DR strategy that considers that the EV charger installed in a smart home operates in different modes, such as V2G, V2H, and grid-to-vehicle. Furthermore, the study took into account the different seasons of the year, where it found that the strategy allows mitigating the peak loads of the respective home and reducing the energy cost.
In [62], a study based on the aggregation and coordination of EVs was elaborated. This study aimed to minimize the peak load and fill the demand valley of a distribution system located in Seoul, South Korea, through discharging and charging the EVs' batteries, respectively. In this way, using V2G technology, EVs can support the distribution grid, allowing it to function reliably. The results demonstrate that through this aggregation and coordination of EVs, the load on the distribution system is smoothed.
In [50], the study considered a university parking lot in Spain. This study showed that the model allowed reducing 19.7% of the building's peak power consumption by scheduling the charging/discharging processes of the EVs in a V2B system, which consequently reduced the total energy cost of the building. Similarly, in [51], a study on the impact of EVs on a small-scale ESM that considers V2B was elaborated. The results showed that the contributions of EVs to ESMs were promising, where the peak was reduced. In [52], a predictive control strategy was highlighted that, through the V2B concept, makes it possible to reduce/shave the peak loads of a building integrated in a microgrid. This study, considering the EV owners' preferences, demonstrates that the active contribution of EVs in the peak load reduction/shaving process is promising.

Renewable Energy Supporting and Balancing
At present, it is clear that the implementation of RES is not always used to its full potential as there are cases where excess production is being wasted. A V2G system with a set of EVs can use its batteries to store excess photovoltaic or wind production to support RES. Afterward, the EVs can use the stored excesses to make their journeys or assist the electric grid in the moments where load peaks occur. This way, the V2G system facilitates the integration of RES into the electric grid, thus increasing RES's flexibility. There is some diversity of literature dealing with this type of service. In [35], a model is developed that optimizes EVs operation in 10 small charging stations supported by photovoltaic panels. Through the V2G technology, this optimization reduces the energy cost of the grid and mitigates the impact of photovoltaic production. In [37], the impact of EV penetration and PV production is presented, where it tries to combine them through smart charging and V2G strategies. With the implementation of V2G strategies, it was found that grid power peaks can be reduced by up to 35% at times of high PV penetration. In [42], it aims to manage an Italian rural residence's energy resources that benefit from PV production by applying the V2H and V2G technologies. This study, taking into account the driver's behavior, seeks to use the V2H technology to increase the PV self-consumption while the V2G technology is used to reduce the energy cost of the residence. With the application of the model presented in this study, it was found that it is possible to make better use of PV production and also reduces the energy cost of the dwelling. In [46], a model based on V2H was presented, aiming to minimize smart homes' energy costs. The model starts by forecasting renewable resources, such as wind energy and PV, to make more efficient management. Then, the data obtained from the forecast served as a basis for the scheduling of energy resources. The results showed that the scheduling of the energy resources, namely the loads and the charging/discharging processes of the EVs, was efficient, where on the one hand, it takes advantage of the renewable resources, and on the other hand, it decreases the energy costs. In [63], a model was presented that seeks to coordinate the EV charging processes to make the most of the periods of higher PV generation that are installed in several buildings. The respective results showed that this model allows for intelligently coordinating the charging of EVs, where it was verified that the PV generation was fully used, thus promoting the reduction of energy consumption. In this way, this model, in general, encourages EV owners, on the one hand, to charge their EVs at peak generation times, and, on the other hand, it also encourages the adoption of more sustainable energy sources.

Summary of Ancillary Services Approaches
This section is to summarize the references used as examples of the application of ancillary services, as can be seen in Table 5. Table 5. Summary of ancillary services approaches.

Ref.
Summary Topic [24] Model based on linear programming that aims at minimizing frequency deviations.
Frequency and Voltage Regulation [57] V2G strategy that permits control of the grid's primary frequency through the active participation of EVs.
[33] New configuration of a multi-functional grid-connected inverter, which allows voltage regulation.
[58] Model based on predictive control that enables EVs to compensate reactive power of the grid. [59] Model that schedules the charging/discharging of the EV supporting the grid through frequency and voltage regulation. [50] Model that allows reducing 19.7% of the building's peak power consumption.

Valley Filling and Peak Shaving
Valley Filling and Peak Shaving [51] Model for small-scale ESM that performs peak shaving of a microgrid.
[52] Strategy based on predictive control that makes it possible to reduce/shave the peak loads of a building.
[60] Aggregator-based DR program for the EVs that participate in V2G systems to regulate the grid's peak. [61] Price-based DR strategy that reduces the energy cost and mitigates the peak loads of the respective home.
[62] Multi-agent system framework to analyze the performance of the EMS to perform the peak shaving and valley filling. [36] Model that reduces the energy cost of the grid and mitigates the impact of photovoltaic production.
Renewable Energy Supporting and Balancing [37] V2G strategy that allows reducing the grid power peak up to 35%. [42] V2H and V2G strategies that improves the PV self-consumption and reduce the energy cost of the residence.
[46] V2H-based model that aims to minimize the energy costs of smart homes that benefit. [63] Model that coordinates the charging of EVs, which takes advantage of periods of higher PV generation.

Energy Management in Smart Grids
As already seen in previous sections, currently, EVs can be seen as a relevant entity that enables the implementation of innovative technologies that support the grid. In other words, EVs are entities that allow the opening of new horizons regarding the energy management of SGs, where, currently, it is already verified in the literature in different studies that, through the help of EVs and RES, develop efficient energy management methodologies, as can be seen in [38,46,[63][64][65][66][67].
Some of the studies develop SG energy management strategies based on energy markets. For example, in [64], this paper proposes a strategy based on a two-stage stochastic model that aims to maximize the profit obtained by the retailer in the day-ahead market. Besides considering the uncertainty of different elements such as distributed generation, pool market, and forward contracts, this strategy also applies DR programs to determine the possible incentives that EV owners may receive. The respective results demonstrate that the participation of EVs allows smoothing the power peaks of the grid, thus improving the energy management of the SG. Consequently, it is also found that the retail market makes profits, which can quickly increase as the number of participating EVs also increases. In [65], stochastic energy management model was presented that considered the participation of diverse micro-grids in the energy market. The objective of this study was to minimize the costs of microgrids through participation in energy markets. In this way, this study, firstly, through the Copula method, tried to model the uncertainties of distributed generation, such as wind and PV, and the participation of EVs to determine the possible additional costs. Subsequently, it determines the market-clearing price through game theory and Cournot equilibrium models. This methodology was tested in three microgrids, where the results showed that microgrids, when they participate in the energy market, can improve their performance and minimize their total cost, improving the efficiency of their energy management. Some studies focus on local energy markets, as shown in [66]. This study, considering EU ambitions, presents a new local energy market model based on stochastic programming, which allows modeling the energy resource management problem and the scheduling and bidding problem in local and wholesale energy markets. The model has been tested in an energy community with a large number of participants, such as EVs, distributed generation, energy storage systems and households. The respective results show that the model is effective, whereby considering the local energy market, energy costs can be reduced up to 75%, thus optimizing the SG's energy management.
Other studies, such as [38,46,63,67], present methodologies that allow the energy management of SGs, through models based on the control of distributed generation. In the case of the study [46], considering the participants' comfort and using day-ahead energy forecasting presents a strategy based on MILP that makes it possible to manage the energy resources of the grid efficiently. The MILP is used to schedule EVs' charging and discharging processes and intelligent appliances. Similarly, this study implements forecasting algorithms to improve energy management, used to forecast distributed generation produced by PV panels and wind turbines. Simulations have been carried out, showing that the cost of electricity is reduced, thus proving the efficiency of the strategy. In [38], also considering the EV owners' needs, it proposes a model that combines the simulated annealing and ant colony optimization algorithms to minimize the operation cost of distributed generation. This model's logic consists of, firstly, using the ant colony optimization to conduct the EVs planning, that is, to determine the loads and unloads of the EVs fleet. Then, considering the planning resulting from the ant colony optimization, the simulated annealing performs the available distributed generation planning. The case study used represents a 33-bus distribution network that considers 66 distributed generation units, a fleet of 2000 EVs, and 218 consumers that have to be supplied. The results demonstrated that this methodology allowed decreasing the respective operation cost of the distributed generation and satisfies the EV owners' requirements.
Another example was [63], wherein this study, to benefit from the increased integration of EVs and buildings with integrated PV panels, presented a strategy based on aggregators that encourages charging EVs in periods where there is PV generation. In this way, this study presents a mathematical model that maximizes the use of PV energy to charge EVs, considering the energy needs of EV owners and the energy consumption of the respective buildings. This strategy was tested in a case study with 510 EVs and 17 buildings with integrated PV panels, where the results showed that the strategy allowed using all the PV generation to satisfy the energy needs of the EVs and the buildings, optimizing the energy management of the SG efficiently.
Some studies focus on virtual power plants, such as [67], wherein this one presents a three-phase energy management model that considers the participation of EVs and the uncertainty of RES, and the demand of several microgrids. The first two phases are microgrid oriented, where the first consists of determining each microgrid's respective service areas. As for the second phase, this, taking into account the costs of various factors, such as the cost of using storage equipment and the cost of using controllable loads, seeks to determine the day-ahead schedule with the lowest cost and then sends it to the virtual power plants. Finally, the third phase consists in determining, for the next day, the schedule of virtual power plants to maximize its profit. This schedule encompasses the whole area for which the virtual power plants is responsible and considers the schedules of the respective microgrids. Thus, the respective final model consists of a MILP, which was simulated in five different case studies that address the operating modes of microgrids, i.e., coordinated and uncoordinated modes. From the simulations, it is concluded that the coordination of microgrids makes it possible to reduce supply costs and optimize their energy management.
In the literature, other studies can also be found that present models that are not in the context of EVs. However, the adaptation of these studies to integrate EVs could efficiently benefit the energy management of SGs, as shown in [68,69]. In the case of the study presented in [68], it highlights a DR-based model that aims to decrease the aggregator's operation cost and help it to manage the energy resources of a small local community efficiently. For this, the authors consider that each consumer has a reliability rate that is constantly updated. This rate indicates the probability of a consumer participating in a DR event. Considering now the context of EVs, this rate could be interesting, as it could be helpful to find out which EVs are more reliable to participate in V2G events or provide ancillary services, for example. In other words, this reliability rate could improve the efficiency of different models, making it possible to obtain more reliable results.
Similarly, ref. [69] also presents a DR model that, considering several constraints, has the scope of optimizing the planning of distributed energy resources. This study includes complex contracts, where consumers and producers establish these contracts with the virtual power player. These contracts, in general, guarantee that the expectations and limitations of different entities are respected, making the response of these entities to a DR event closer to the response expected by the virtual power player. In this way, the distributed energy resource planning performed by the virtual power player is more reliable. These complex contracts can bring advantages to both the EV owners and the network operating entities from the EV context. From the EV owners' perspective, these complex contracts can guarantee that several requirements, such as SOC level, battery degradation, remuneration, number of times participating, among others, are respected during V2G events. In this way, these contracts can encourage EV owners to participate in the network. Regarding grid operators, regardless of whether they implement models to optimize the energy resource management or models for coordinating EV charging/discharging processes, they can obtain more reliable solutions since, with complex contracts, they can, in a certain way, guarantee the participation of grid entities.

SWOT Analysis of V2G Technology
Considering the impact that V2G technology has nowadays, it becomes necessary to make the SWOT analysis of this technology to investigate different aspects.

•
This technology provides advantages to both EV users and the electric grid, and the application of this technology is compatible with smart and microgrids [70]; • Due to the occurrence of high demand moments, it is necessary to have some supporting technology, being the implementation of V2G technology cheaper than increasing the production capacity of the available energy sources in the grid or than preparing new energy sources [71]; • This technology increases the quality and stability of the electric grid by providing ancillary systems [72]; • It allows EV owners to profit from buying and selling energy on the grid, where they buy when energy is cheapest, especially at night, and sell it in periods of higher demand, where energy is expensive [73]; • This technology helps the integration of RES, such as wind and solar energy, into the grid [26].

Weaknesses
• The most significant disadvantage of this technology is the negative impact on the EV battery, causing a reduction in its life cycle, with various charging and discharging processes [27]

Threats
• With the successive uses of EV batteries, their capacity decreases, which consequently influences the energy that the owner of the EV can sell to the grid, decreasing the profit and influencing the amount of energy he can transfer to the grid itself [79]; • Like all those that depend on communication systems, this technology is subject to cyberattacks, damaging the EVs themselves and the grid itself. For these reasons, it is necessary to apply certain precautions to prevent cyber-attacks as much as possible [80].

Discussion and Conclusions
EVs have become increasingly prominent in today's world, especially in V2G, V2H, and V2B systems. In these systems, the EVs, on the one hand, can provide different ancillary services that allow increasing the electric quality of the power systems and, on the other hand, can also obtain remuneration for the services provided. This paper illustrates the different benefits that ancillary services can provide, the opportunities that the EVs can provide to the energy management systems of the SGs, and SWOT analysis of the V2G technology alone since it is more abrupt than those mentioned above.
Summarizing the contributions of the related literature to the features addressed in the present paper, Table 6 organizes the existing works regarding resources, methods, and case studies. Through the analysis of the table, it can be seen that most of the literature focused on the optimization methods, where a total of 34 references were used. Furthermore, most of the literature considered data from a public park as a case study. This gave room to further exploration of case studies focusing on buildings and homes. In fact, obtaining data from individual consumers at home can have privacy issues, which should not be disregarded. On the resources side, it can be seen that the battery aspects were not much explored in the selected literature. That derives from the fact that the selected literature focused on SG aspects. --

Ancillary Services
For V2B, V2H, and V2G systems to become more effective, it is necessary to invest in EV batteries, making them more robust, durable, and with greater capacities. In this way, on the one hand, it allows the EVs to have better performances in the participation of ancillary services, and, on the other hand, it allows to delay the degradation of the batteries, prolonging their lifetime. Furthermore, another possible investment in the future would be promoting these technologies to people who do not know them. Thus, it would allow them to understand the advantages that these technologies can bring to themselves and the local electric grid.
Considering the study carried out in this paper and the different kinds of literature explored on this topic, it is possible to verify that there are still some challenges in disseminating EVs. Thus, to face this situation, some possible recommendations for policymakers and also future topics are pointed: • Nowadays, we can see that the prices of EVs are decreasing and that EVs' autonomy is increasing. However, the price of EVs is still not affordable for most people. Therefore, developing new policies that encourage EV purchase, e.g., free parking or subsidies that help mitigate the investment made, especially in the initial phase when people are adapting to EV technology. Likewise, develop policies that improve charging infrastructure and penalize ICEVs as well. Thus, through the combination of these policies, the dissemination and the option of EVs become more accessible; • The battery is one of the most important aspects of EVs and one of the most soughtafter by users. However, battery degradation is influenced by several factors such as the charging/discharging processes carried out, the ambient temperature, and the driving cycles, making it difficult to inform the battery status to the respective user and consequently making people unconvinced to opt for EVs. Therefore, developing models and systems that can extract information from the battery in more detail and in real-time is crucial to enable monitoring and control of all phases of battery life, thus keeping users well-informed; • EVs usage should be conducted in the context of optimal energy management in distribution networks and buildings in order to avoid user discomfort in the charging and discharging profiles, as well as to minimize energy costs.
Funding: This article is a result of the project RETINA (NORTE-01-0145-FEDER-000062), supported by Norte Portugal Regional Operational Programme (NORTE 2020), under the PORTU-GAL 2020 Partnership Agreement, through the European Regional Development Fund (ERDF), and CEECIND/02887/2017 from FCT. We also acknowledge the work facilities and equipment provided by GECAD research center (UIDB/00760/2020) to the project team.

Conflicts of Interest:
The authors declare no conflict of interest. Vehicle-to-Building V2G

AS
Vehicle-to-Grid V2H Vehicle-to-Home V2X Vehicle-to-Everything