Energy Trading with Electric Vehicles in Smart Campus Parking Lots

: Energy trading with electric vehicles provides opportunities to eliminate the high peak demand for electric vehicle charging while providing cost saving and proﬁts for all participants. This work aims to design a framework for local energy trading with electric vehicles in smart parking lots where electric vehicles are able to exchange energy through buying and selling prices. The proposed architecture consists of four layers: the parking energy layer, data acquisition layer, communication network layer, and market layer. Electric vehicles are classiﬁed into three different types: seller electric vehicles (SEVs) with an excess of energy in the battery, buyer electric vehicles (BEVs) with lack of energy in the battery, and idle electric vehicles (IEVs). The parking lot control center (PLCC) plays a major role in collecting all available offer/demand information among parked electric vehicles. We propose a market mechanism based on the Knapsack Algorithm (KPA) to maximize the PLCC proﬁt. Two cases are considered: electric vehicles as energy sellers and the PLCC as an energy buyer, and electric vehicles as energy buyers and the PLCC as an energy seller. A realistic parking pattern of a parking lot on a university campus is considered as a case study. Different scenarios are investigated with respect to the number of electric vehicles and amount of energy trading. The proposed market mechanism outperforms the conventional scheme in view of costs and proﬁts. Based on the battery status, each vehicle decides its role for buying/selling energy from/to the PLCC. We developed a market mechanism for the PLCC based on the Knapsack Algorithm. We considered a real case study with a realistic parking pattern of a parking lot on a university campus. The simulation results showed that our proposed market mechanism can achieve better performance and cost saving for all participants including selling vehicles, buying vehicles, and the parking lot operator.


Introduction
The grid integration of electric vehicles represents a unique and complex problem for the distribution power system. This is due to the fact that electric vehicles act as loads while charging, energy storage systems during the idle state, and distributed energy sources while discharging. Different schemes have been considered in order to coordinate the charging/discharging process of electric vehicles including grid control using incentives and time-varying prices supported by the grid operator [1]. In South Korea, Korea Electric Power Corporation (KEPCO) is the sole electric power provider. The current process of energy transactions in KEPCO prohibits direct energy trading between prosumers and consumers. Therefore, all energy transactions among consumers and prosumers must go through KEPCO [2]. As the penetration rate and the grid integration of renewable energy sources (RES) such as photovoltaic, energy storage systems, and electric vehicles are continuously increasing, more and more energy consumers are becoming energy prosumers. Energy prosumers are able to generate part of their usage energy locally using RES while sharing the surplus energy with other consumers [3]. Considering RES and the surplus energy of prosumers, the excess energy of prosumers • A framework for energy trading with electric vehicles in smart parking lots is designed. • A four-layered architecture for energy trading in smart parking lots is proposed. It consists of a parking energy layer, a data acquisition layer, a communication network layer, and a market layer. • A market mechanism based on the Knapsack Algorithm is proposed to maximize the profit of the parking lot operator. • A real case study with a realistic parking pattern of a parking lot on a university campus is considered.
This paper is structured as follows. We propose a four-layered architecture for energy trading with electric vehicles in smart parking lots in Section 2. In Section 3, we develop a market mechanism for energy trading based on the Knapsack Algorithm (KPA). Section 4 provides the performance evaluation of a real case study of a university campus. Finally, Section 5 concludes the paper and gives directions for future work.

Proposed System Architecture for Energy Trading in a Smart Parking Lot
Smart parking is considered to be a typical cyber and physical system. In order to manage the grid integration of electric vehicles and minimize the impact of charging/discharging on the power grid, reliable communication and data exchange among electric vehicles, charging stations and distribution power system are needed. Based on the smart grid reference architecture [11] and the framework for cyber-physical system [12], we propose a four-layered architecture for energy trading in a smart parking lot, as shown in Figure 1. The proposed architecture consists of a parking energy layer, a data acquisition layer, a communication network layer, and a market layer. new framework for energy trading between electric vehicles and the parking lot operator to facilitate the new parking lot market operation. The main contributions of this work are: • A framework for energy trading with electric vehicles in smart parking lots is designed. • A four-layered architecture for energy trading in smart parking lots is proposed. It consists of a parking energy layer, a data acquisition layer, a communication network layer, and a market layer.

•
A market mechanism based on the Knapsack Algorithm is proposed to maximize the profit of the parking lot operator.

•
A real case study with a realistic parking pattern of a parking lot on a university campus is considered.
This paper is structured as follows. We propose a four-layered architecture for energy trading with electric vehicles in smart parking lots in Section 2. In Section 3, we develop a market mechanism for energy trading based on the Knapsack Algorithm (KPA). Section 4 provides the performance evaluation of a real case study of a university campus. Finally, Section 5 concludes the paper and gives directions for future work.

Proposed System Architecture for Energy Trading in a Smart Parking Lot
Smart parking is considered to be a typical cyber and physical system. In order to manage the grid integration of electric vehicles and minimize the impact of charging/discharging on the power grid, reliable communication and data exchange among electric vehicles, charging stations and distribution power system are needed. Based on the smart grid reference architecture [11] and the framework for cyber-physical system [12], we propose a four-layered architecture for energy trading in a smart parking lot, as shown in Figure 1. The proposed architecture consists of a parking energy layer, a data acquisition layer, a communication network layer, and a market layer.

Parking Energy Layer
The parking energy layer includes the distribution power system, transformers, feeders, and charging stations. The distribution power system delivers electric power to charging stations at parking lots in residential, commercial, and industrial areas. Electric vehicles are connected to the distribution power system to charge/discharge their batteries through charging stations. There are three basic types of charging stations: slow charging, moderate charging, and fast charging.

Data Acquistion Layer
The data acquisition layer is responsible for collecting data from different electric vehicle subsystem through sensor nodes and monitoring devices. Based on the application requirement, slow/fast data acquisition modules are used. Taken the electric vehicle battery as an example, there are a variety of sensor nodes that are used for monitoring the battery status, such as voltage, current, and temperature.

Communication Network Layer
Information and communication technologies aim to support and manage the energy transfer between electric vehicles and the power grid. The communication network layer enables real-time data exchange between different components in the electric vehicle system. The communication infrastructure consists of communication devices, wired/wireless communication connections, routers, switches, servers, etc.

Market Layer
The market Layer represents the business view of the smart parking lot. It consists of two parts: the wholesale market and the retail market. The main participants in the market domain are selling vehicles, buying vehicles, the parking lot operator (PLO) and the distribution system operator (DSO). The main processes of the market layer include bidding, decision, energy exchange, and settlement.

Proposed Market Mechanism
There are two main parts that are needed in order to enable energy trading in a smart parking lot: a physical energy network and a virtual energy market platform [13]. The physical energy network is required for energy transfer among electric vehicles and the parking lot operator, while the virtual energy market platform is needed to enable a local energy market for energy selling and buying. Communication networks are used to exchange information among different components of the smart parking lot. Figure 2 shows an overview of the proposed energy trading system in a smart parking lot. The main components are input data, collecting bids, auction, declare and notification, energy exchange, and settlement.
We assume that each charging station is capable of collecting information regarding the vehicles' arrival time, departure time, and participation in the energy trading market. The parking lot control center monitors the status of all charging stations and coordinates the charging (parking lot-to-vehicles (PL2V)) and discharging (vehicles-to-parking lot (V2PL)) operations of each station. Different wired/wireless communication technologies could be used for communication between the parking lot control center (PLCC) and charging stations. Table 1 shows an overview of the proposed energy trading in a smart parking lot.      In this work, the market mechanism for the smart parking lot was implemented based on the Knapsack Algorithm (KPA) [14] and deployed in the PLCC. The main objective of the PLCC is to coordinate the energy trading among SEVs, BEVs, and PLCC. Each SEV can submit an energy request R SEVi for selling energy at time t. R SEVi is represented by (SEV ID , SEV SA , SEV SP ) where SEV ID , SEV SA , SEV SP are the vehicle identification, the amount of energy to be exchanged, and the suggested price of energy, respectively. Also, BEVs request the amount of energy for charging from the PLCC. Each BEV can submit an energy demand request (R BEVj ) at time t. R BEVj is represented by (BEV ID , BEV BA , BEV BP ) where BEV ID , BEV BA , BEV BP are the vehicle identification, the amount of demand energy for charging, and the offered price of energy, respectively. The PLCC gathers all offer/demand requests and selects a set of electric vehicles to trade with. The main objective of PLCC is to maximize the total profit as given in Equation (1). The PLCC aims to maximize energy selling to charging vehicles and minimize purchasing/buying energy from discharging vehicles while respecting vehicles' requirements.
Buying amount of energy by BEV j at time t   In this work, the market mechanism for the smart parking lot was implemented based on the Knapsack Algorithm (KPA) [14] and deployed in the PLCC. The main objective of the PLCC is to coordinate the energy trading among SEVs, BEVs, and PLCC. Each SEV can submit an energy request RSEVi for selling energy at time t. RSEVi is represented by (SEVID, SEVSA, SEVSP) where SEVID, SEVSA, SEVSP are the vehicle identification, the amount of energy to be exchanged, and the suggested price of energy, respectively. Also, BEVs request the amount of energy for charging from the PLCC. Each BEV can submit an energy demand request (RBEVj) at time t. RBEVj is represented by (BEVID, BEVBA, BEVBP) where BEVID, BEVBA, BEVBP are the vehicle identification, the amount of demand energy for charging, and the offered price of energy, respectively. The PLCC gathers all offer/demand requests and selects a set of electric vehicles to trade with. The main objective of PLCC is to maximize the total profit as given in Equation (1). The PLCC aims to maximize energy selling to charging vehicles and minimize purchasing/buying energy from discharging vehicles while respecting vehicles' requirements. The main objective of PLCC is to maximize its profits (PROFIT PLCC ) by selling/buying energy to/from electric vehicles as well as the power grid, as given in Equation (2).
where Revenue PLCC,t Total revenue earned by PLCC COST PLCC,t Total cost paid by the PLCC T Number of scheduling intervals per day The total revenue of PLCC (Revenue PLCC,t ) includes selling energy to the grid as well as selling energy for charging EVs, as given in Equation (3).
7 of 17 where Revenue STG,t Revenue earned by providing power from SEVs to the grid (selling to grid) Revenue STV,t Revenue earned by supporting power to charging BEVs (selling to BEVs) P STG,t Power sold to the grid in kW p STG,t Electricity price in money unit per kWh ∆t Length of scheduling interval K Number of BEVs P STV,i,t Power used to charge BEV i in kW p STV,i,t Electricity price in money unit per kWh The total cost of PLCC (COST PLCC,t ) includes buying energy from the grid as well as buying energy from SEVs, as given in Equation (6).
where COST BFG,t Cost of energy purchased from the grid COST BFV,t Cost of energy purchased from SEVs P BFG,t Power bought from the grid in kW p BFG,t Electricity price in money units per kWh ∆t Length of scheduling interval N Number of SEVs P BFV,i, Discharge power from SEV i in kW p BFV,i Electricity price in money unit per kWh

Simulation Results
This section evaluates the performance of the proposed market mechanism for campus parking lots at Chonbuk National University, Jeonju Campus, South Korea. The market mechanism was evaluated from the PLCC perspective. There are 8 parking lots distributed around the campus (CBNU-PL1~CBNU-PL8), as shown in Figure 4.

Electric Vehicle Model
Real data for vehicles' arrivals and departures were collected on a weekday (Tuesday 15 May 2018) from 6:00 a.m. until 18:30 p.m. at the parking lot of engineering building 2-7 (CBNU-PL3), as shown in Figure 5. CBNU-PL3 serves faculty members, employees, and students. The arrival and departure times were based on working hours and student class schedules.
Different brands for electric vehicles in South Korea were considered based on Ref. [15]. The specifications of electric vehicles are given in Table 2. The amount of selling/buying energy of each vehicle was considered to be 50 percentage of the battery capacity. 2018) from 6:00 a.m. until 18:30 p.m. at the parking lot of engineering building 2-7 (CBNU-PL3), as shown in Figure 5. CBNU-PL3 serves faculty members, employees, and students. The arrival and departure times were based on working hours and student class schedules.
Different brands for electric vehicles in South Korea were considered based on Ref. [15]. The specifications of electric vehicles are given in Table 2. The amount of selling/buying energy of each vehicle was considered to be 50 percentage of the battery capacity.    Table 3 shows the electric vehicle charging tariff by KEPCO. The electric vehicle charging tariff is different based on the time period (off-peak, mid-peak and on-peak) and the season (summer, spring, fall and winter) [14]. We assumed that selling/buying prices were randomly selected based on KEPCO electric vehicle charging tariff in the range of [50, 200] KRW.    Table 3 shows the electric vehicle charging tariff by KEPCO. The electric vehicle charging tariff is different based on the time period (off-peak, mid-peak and on-peak) and the season (summer, spring, fall and winter) [14]. We assumed that selling/buying prices were randomly selected based on KEPCO electric vehicle charging tariff in the range of [50, 200] KRW. Different scenarios were considered for energy trading with respect to the load profile of engineering building 2-7 shown in Figure 6, and the minimum and maximum power consumption given in Table 4. These scenarios were as follows:  Table 5 shows a list of the simulation scenarios. We assumed that the excess energy from electric vehicles could support the peak demand of university buildings. The feeding of excess power from electric vehicles to the grid was not considered in this work.   Table 5. Simulation scenarios.

Standalone Parking Lot: Electric Vehicles as Sellers and the PLCC as a Buyer
All vehicles in case (1) were considered to be selling vehicles. The energy bought from SEVs could be used to support the load demand of engineering building 2-7 or used to charge other electric vehicles. Considering a local demand of 50 kWh, the PLCC selected a set of electric vehicles to satisfy the local demand, as given in Algorithm 1. Tables 6 and 7 compare the proposed energy trading mechanism using the Knapsack Algorithm (KPA) with the first-come-first-serve (FCFS) scheme. In the FCFS scheme, the PLCC selects electric vehicles that request selling first. In KPA, the PLCC sorts the revenue in an ascending order in order to minimize the cost of buying energy from SEVs. The PLCC selects a set of electric vehicles with lower selling prices to trade with. The simulation results of Figure 7 show that the proposed energy trading mechanism based on KPA outperforms the FCFS scheme with a reduction in costs of about 47%. For a single parking lot with 10 electric vehicles as sellers, the average parking lot costs would be about 4334 KRW and 2508 KRW for FCFS and KPA, respectively.

Standalone Parking Lot: Electric Vehicles as Buyers and the PLCC as a Seller
All vehicles in Case (2) were considered to be buying vehicles. Each vehicle requests the amount of buying energy that is required for charging and the buying price that vehicle owner is willing to pay. In order to maximize the PLCC profit from buying vehicles, the PLCC sorts profit in a descending order, as shown in Algorithm 2. Table 8 and Table 9 compare the proposed energy trading mechanism using KPA with the FCFS scheme. In KPA, the PLCC selects a set of electric vehicles with higher buying prices to trade with. Figure 8 compares the total profits of the proposed energy trading mechanism based on the KPA and FCFS schemes. The proposed energy trading  if weight + SA[i] ≤ W then 9: x

Standalone Parking Lot: Electric Vehicles as Buyers and the PLCC as a Seller
All vehicles in Case (2) were considered to be buying vehicles. Each vehicle requests the amount of buying energy that is required for charging and the buying price that vehicle owner is willing to pay. In order to maximize the PLCC profit from buying vehicles, the PLCC sorts profit in a descending order, as shown in Algorithm 2. Tables 8 and 9 compare the proposed energy trading mechanism using KPA with the FCFS scheme. In KPA, the PLCC selects a set of electric vehicles with higher buying prices to trade with. Figure 8 compares the total profits of the proposed energy trading mechanism based on the KPA and FCFS schemes. The proposed energy trading mechanism based on KPA outperforming the FCFS scheme with a profit increase of about 44%. For a single parking lot with 10 electric vehicles as buyers, the average parking lot profits would be about 4334 KRW and 5964 KRW for FCFS and KPA, respectively.

Multiple Parking Lots
We investigated the impact on costs and profits for multiple parking lots with respect to the number of electric vehicles and the amount of energy trading. Four scenarios were considered as given in Table 5. Figure 9 shows the average parking lot costs with different numbers of selling vehicles (10, 20, 40 and 80) for the four considered scenarios. The results show that the market mechanism using KPA decreases the costs compared with the FCFS scheme. in Scenario 4, with 80 electric vehicles, the average parking lot costs are about 17,410 KRW with a cost reduction of about 46.6% compared with 32,622 KRW in the case of FCFS, as shown in Figure 10.

Multiple Parking Lots
We investigated the impact on costs and profits for multiple parking lots with respect to the number of electric vehicles and the amount of energy trading. Four scenarios were considered as given in Table 5. Figure 9 shows the average parking lot costs with different numbers of selling vehicles (10, 20, 40 and 80) for the four considered scenarios. The results show that the market mechanism using KPA decreases the costs compared with the FCFS scheme. in Scenario 4, with 80 electric vehicles, the average parking lot costs are about 17,410 KRW with a cost reduction of about 46.6% compared with 32,622 KRW in the case of FCFS, as shown in Figure 10.   (7): demand 400 kW, 80 EVs. Figure 11 shows the average parking lot profits with different numbers of buying vehicles (10, 20, 40 and 80). The market mechanism using KPA increases the profits compared with the FCFS scheme. The average parking lot profits are about 47,990 KRW with a profit increase of about 32% compared with 32,622 KRW in the case of FCFS with 80 electric vehicles, as shown in Figure 12.    (7): demand 400 kW, 80 EVs. Figure 11 shows the average parking lot profits with different numbers of buying vehicles (10, 20, 40 and 80). The market mechanism using KPA increases the profits compared with the FCFS scheme. The average parking lot profits are about 47,990 KRW with a profit increase of about 32% compared with 32,622 KRW in the case of FCFS with 80 electric vehicles, as shown in Figure 12.

Conclusions
We proposed a framework for energy trading in a smart parking lot. The proposed architecture consists of four layers: a parking energy layer, a data acquisition layer, a communication network layer, and a market layer. Electric vehicles were classified into three different types: seller vehicles, buyer vehicles, and idle vehicles. Based on the battery status, each vehicle decides its role for buying/selling energy from/to the PLCC. We developed a market mechanism for the PLCC based on the Knapsack Algorithm. We considered a real case study with a realistic parking pattern of a parking lot on a university campus. The simulation results showed that our proposed market mechanism can achieve better performance and cost saving for all participants including selling vehicles, buying vehicles, and the parking lot operator.
Author Contributions: Both authors contributed equally to this work.

Conflicts of Interest:
The authors declare no conflict of interest.

SEVs
Seller Parking lot-to-vehicles V2PL Vehicles to-parking lot

Conclusions
We proposed a framework for energy trading in a smart parking lot. The proposed architecture consists of four layers: a parking energy layer, a data acquisition layer, a communication network layer, and a market layer. Electric vehicles were classified into three different types: seller vehicles, buyer vehicles, and idle vehicles. Based on the battery status, each vehicle decides its role for buying/selling energy from/to the PLCC. We developed a market mechanism for the PLCC based on the Knapsack Algorithm. We considered a real case study with a realistic parking pattern of a parking lot on a university campus. The simulation results showed that our proposed market mechanism can achieve better performance and cost saving for all participants including selling vehicles, buying vehicles, and the parking lot operator.
Author Contributions: Both authors contributed equally to this work.

Conflicts of Interest:
The authors declare no conflict of interest. Revenue earned by providing power from SEVs to the grid Revenue STV,t

Nomenclature
Revenue earned by supporting power to BEVs charging P STG,t Power sold to the grid in kW p STG,t Electricity price in money unit per kWh ∆t Length of scheduling interval P STV,i,t Power used to charge BEV i in kW p STV,i,t Electricity price in money unit per kWh COST BFG,t Cost of energy purchased from grid COST BFV,t Cost of energy purchased from SEVs P BFG,t Power bought from grid in kW p BFG,t Electricity price in money unit per kWh P BFV,i, Discharge power from SEV i in kW p BFV,i, Electricity price in money unit per kWh CBNU Chonbuk National University PL Parking lot FCFS First-come-first-serve