Integrated human-machine intelligence for EV charging prediction in 5G smart grid

With the rapid development of the power infrastructures and the increase in the number of electric vehicles (EVs), vehicle-to-grid (V2G) technologies have attracted great interest in both academia and industry as an energy management technology in 5G smart grid. Considering the inherently high mobility and low reliability of EVs, it is a great challenge for the smart grid to provide on-demand services for EVs. Therefore, we propose a novel smart grid architecture based on network slicing and edge computing technologies for the 5G smart grid. Under this architecture, the bidirectional traffic information between smart grids and EVs is collected to improve the EV charging experience and decrease the cost of energy service providers. In addition, the accurate prediction of EV charging behavior is also a challenge for V2G systems to improve the scheduling efficiency of EVs. Thus, we propose an EV charging behavior prediction scheme based on the hybrid artificial intelligence to identify targeted EVs and predict their charging behavior in this paper. Simulation results show that the proposed prediction scheme outperforms several state-of-the-art EV charging behavior prediction methods in terms of prediction accuracy and scheduling efficiency.


Introduction
With the constant change of the global climate and the exhaustion of fossil fuels, the traditional power grid cannot meet the increased demand for energy to support industrial innovation and improvement of people's living standards [1][2][3].Smart grid is evolving as the next-generation electrical grid for addressing these challenges by combining power infrastructures with advanced information, artificial intelligence, sensor, and automatic control technologies [4,5].Supported by above-varied technologies, the smart grid can provide reliable, safe, economical, and efficient power services.Nowadays, the number of electric vehicles (EVs) on the road has risen sharply due to rising price of oil, global warming, development charging facilities, and advances in battery technologies of EVs [6].According to the prediction of the international energy agency (IEA), the number of EVs on the road will be arising to 125 million by 2030 [7].Considering the huge amount of electric energy needed by EVs, smart grid operators need to set an optimal electricity price by analyzing the EV charging behavior.From the charging behavior perspective, EV users can be divided into regular and irregular users [8].The charging behavior of ordinary users has a certain regularity.They charge at a fixed time every day, and the amount of each charge is stable.The charging behavior of irregular users is not regular.For example, due to insufficient electricity during the trip, irregular users simply choose a charging station that is nearby to charge and will not charge at the same charging station for a long time.The charging behavior of ordinary users has a certain regularity.They charge at a fixed time every day, and the amount of each charge is stable.The charging behavior of irregular users is not regular.For example, due to insufficient electricity during the trip, irregular users simply choose a charging station that is nearby to charge and will not charge at the same charging station for a long time.To provide on-demand services for efficient and intentional use of energy, the grid operators need to analyze the charging behavior of electric vehicle users.However, traditional power grids cannot effectively implement resource optimization and advanced charging service guarantee scheduling due to high transmission delays and limited computing capabilities [9].
To achieve an efficient EV charging scheme, many proposals have recently introduced the concept of network slicing [10], which can provide dedicated on-demand services in the case of limited network resources with low operating costs.In [11], the authors proposed a vehicular delay-tolerant network in smart grid to transmit data to EVs by using the edge computing technology.However, with the increasing number of electric vehicles [12][13][14], the demand for low-latency vehicle-to-grid (V2G) services is increasing.Recently, edge computing technology has raised many concerns because it has the potential to provide computing resources for EV users for reducing V2G latency at the edge of the grid [15].Moreover, edge computing can also enable several smart city services, such as video monitoring, urban transport, positioning system, and emergency.In [16], the authors slice the smart grid to provide efficient privacypreserving communication and power injection services for EV users.Supported by network slicing and edge computing technologies, network resources can be allocated to the customized services while meeting the specific demands of EV users, such as charging amount, charging rate, and response latency.Despite all these benefits, the smart grid with network slicing and edge computing still lack the ability to forecast the EV charging behavior, which is essential for providing the on-demand services to EV users.
It is well known that deep learning algorithms can be used to predict time series data, such as network traffic and user behavior [17,18].In recent years, scholars have been trying to use recurrent neural networks (RNNs), which is an important branch of deep learning, to solve time series prediction problem [19].In the EV prediction aspect, researchers have found better performance for RNN than traditional deep learning [20].RNN is an important branch of deep learning used in pattern recognition and time series prediction; it can model time or sequence-dependent behavior, such as speech recognition, financial markets, web traffic, and so on.However, traditional RNN models cannot be ignored on its weakness of long-range dependencies that would cause gradient vanishes [21].As the most common variant of RNN, the long short-term memory (LSTM) is widely used in capturing long-term dependencies.Therefore, LSTM is more suitable for EV charging analysis.In [22], a deep learning-driven EV scheduling strategy is introduced to optimize the EV charging according to the real-time electricity pricing, thereby decreasing the global EV energy cost.In [23], an RNN-based approach is adopted to enhance the energy consumption of EVs by predicting trajectory and delay.However, considering the complex user charging behavior and massive amounts of EVs, the prediction accuracy of the above works cannot meet the requirements of EV charging behavior analysis in the 5G smart grid.
In this paper, we propose an EV charging behavior analysis (EV-CBA) scheme based on hybrid artificial intelligence in the 5G smart grid.The EV-CBA scheme consists of two steps, the first is a novel three-layer smart grid architecture based on network slicing and edge computing technologies, and the second is the hybrid artificial intelligence including the K-means-based EV charging behavior clustering, the knearest neighbor (KNN)-based EV charging behavior classification, and the LSTMbased EV charging behavior prediction.The three-layer smart grid network architecture is the hardware basis of hybrid artificial intelligent algorithms.The first layer is the slice layer, which can provide end-to-end network slices of smart grid for charging services.The second layer is the control layer, which controls network resources of smart grid and provides suitable resources for charging services from different slices.The third layer is the infrastructure layer, which can provide wireless access resources for EV users.This structure can take into account end-to-end computing power and ultra-low transmission latency of edge computing, thereby ensuring the real-time operation of hybrid artificial intelligence.Therefore, applying hybrid artificial intelligence to the prediction of EV charging behavior can improve the efficiency of EV charging schedules.The simulation results and cross-validation evaluation show that the proposed EV-CBA scheme can efficiently cluster, classify, and predict the EV charging behavior.The overall EV traffic scheduling is optimized according to the prediction results.
The rest of this paper is organized as follows.In Section II, we first introduce the three-layer architecture of the 5G smart grid.Then, in Section III, we present the hybrid artificial intelligence in V2G systems for the EV charging behavior analysis.Section IV gives the relevant simulation results and discussion.Finally, we conclude the article in Section V.
2 Smart grid network architecture with network slicing and edge computing

Network slicing and edge computing in 5G smart grid
The network slicing in a 5G network defines logical subnets, which consists of a series of customized network resources and virtual network functions, such as radio resources and spectrum resources.This virtual network function allows separate functions from the smart grid to provide the resources needed for each EV charging service.Therefore, different EV charging demands can be met for many cases (such as irregular charging and regular charging).Thus, the optimized resources are allocated without resource waste.The network slicing technology can achieve virtual network functions on the physical infrastructure and has the guarantee of customized virtual network resources.In other words, the network slicing technology coordinates different users to customize charging services and make sure that adding new users will not affect the customized virtual network resource.However, in the case of EV charging, the EV charging requirements in the smart grid with low transmission latency is increasing, and the explosive number of artificial intelligence services including smart home, smart buildings, autonomous vehicles, etc.Thus, to meet the demands of evolving EV charging services, the smart grid requires the V2G system to be centralized control, intelligent configurable, and low cost.
In future 5G smart grid, edge computing will play an important role to address ultralow charging delay requirements.Edge computing can help the smart grid operators to provide on-demand services at the edge of the smart grid near the EV users to meet the low latency transmission requirements.Moreover, for smart grid operators, it is essential to combine and deliver customized network resources for services according to the demands of EV users.The standard of edge computing has been proposed by ITU-T, which is the logical isolated network partition (LINP).Considering each slice of the smart grid is the combination of serval virtual networks based on dynamic requests, network slicing technology is an important element of edge computing.That means the edge computing can guarantee extensibility by importing EV charging information into controllers at the edge of smart grid; thus, we can avoid resource waste and charging wait time that would cause traffic congestion.
To sum up, the combination of network slicing and edge computing can provide ondemand services and control functions at the edge of the smart grid.They enable customized charging services for heterogeneous charging demands by slicing the physical network to several customized slices at the same time.With edge computing, more computing and analysis of data may be performed in EVs, edge clouds, or at charging stations.Meanwhile, the use of edge computing also promotes computing and storage resources that are very close to the end-use, ensures ultra-low transmission latency and ultra-high response rates, and offers the potential for calculating at the edge of the smart grid and providing customized EV charging services.

Network architecture design
In this subsection, we design a novel smart grid network architecture based on network slicing and edge computing, which provides a hardware foundation for implementing hybrid artificial intelligence algorithms.
As shown in Fig. 1, this paper proposes a smart grid network architecture based on network slicing and edge computing to abstract or share substrate resources.The proposed architecture consists of three layers including the slice layer, the control layer, and the infrastructure layer.Firstly, the slice layer can provide end-to-end network slices of the smart grid for charging services.Secondly, the control layer can control network resources of smart grid and provides suitable resources for charging services from different slices.Thirdly, the infrastructure layer can provide wireless access resources for EV users.This structure can take into account end-to-end computing power and ultra-low transmission delay of edge computing, thereby ensuring the realtime operation of hybrid artificial intelligence.The charging stations in this layer are used to collect the charging information.The smart grid network architecture based on network slicing and edge computing is the hardware basis, which is proposed to realize hybrid artificial intelligent algorithms.
The smart grid network architecture is driven by technologies based on billing services, distributed control, and coordinated control theory.The EV charging service is  optimize the charging schedule.The infrastructure layer can supply a user interface for EVs to interact with the charging station and obtain the charging behavior data of EVs, and then upload data to the control layer.The control layer is the bridge of the infrastructure layer and the slice layer.The control layer can process the EV charging requests, optimize the charging schedule, and globally control the V2G system.
In particular, we collect the charging behavior data by serval different types of sensors deployed in EVs and charging stations, which includes driving behavior of user collected by EV sensors, battery usage data uploaded by the internally installed sensors, and EV charging data collected by sensors installed in charging stations.These rich data sources make it easier for the smart grid to collect EV charging behavior information, such as remaining vehicle mileage, availability of charging stations, and battery charging status.All the charging information can be used to analyze and predict the EV charging behavior by artificial intelligence algorithms.
After obtaining the prediction charging results, EVs send the charging service requirements to the controller through the user interface in the infrastructure layer, then the controller updates the EV charging ID in the EV information module and receives information packets from the EV.When EVs try to access the charging station, the PLC and the controller are responsible for information interaction, and the charging service requirements are uploaded to the edge computing module through wireless communication networks.When the EVs are driving, the data collected by EV sensors and battery sensors are sent to the edge computing module via vehicular wireless communication networks.When the charging service requirements on the EV side changes sharply, the charging station accesses charging data via multicast communication network to obtain the battery usage state, upload the charging service requirements, and assign the status of charging station in the V2G system.
Considering the heterogeneous environments of the smart grid, edge computing can provide low latency on-demand charging services at the edge of the smart grid.The use of edge computing promotes computing and storage resources that are very close to the end-use, ensuring high data rates.

Data set introduction and data preprocessing
To ease the burden of EV charging on the power grid, one possible solution is to predict the charging behavior of EV users.From a macro perspective, EV users can be divided into regular and irregular users.The charging behavior of regular users has a certain regularity while the charging behavior of irregular users has no regularity.It is meaningful to predict the charging behavior of regular users, but the charging behavior of irregular users will increase the prediction error.
Generally, the standard deviation is calculated according to the time and amount of each charging, and the stability of charging behavior is judged according to the standard deviation.However, we cannot get a reasonable threshold.To this end, we use a machine learning method to solve this problem, we choose K-means to classify data sets.
We use one year's charging record of a charging station in Los Angeles as a data set for simulation.Each record stores the user ID, charging connection time, charging completion time, disconnection time, charging amount, and other variables.The data set contains 26,000 charging records of 318 users.
Before clustering, we preprocess the dataset.Firstly, for users whose records is less than 3, we think they are not local users, so we delete them from the dataset.To distinguish regular and irregular users better, we choose the average charging time, the standard deviation of the charging time, and the standard deviation of the connection time as the clustering vector.As shown in Eq. ( 1), we use the linear normalization method to normalize the data.

The K-means-based EV charging behavior clustering
K-means is one of the unsupervised learning algorithms suitable for classifying unlabeled data sets.It can divide the data into K clusters.There are many methods that can be used to calculate the distance between vectors, and the most common of which is the Euclidean distance.Specifically, the first K clustering objects are randomly chosen from n objects as the initial points.Then, the distance between n objects and K clustering objects can be calculated.According to the calculation results, each object with minimum distance can be classified.Next, the average value of each clustering object is calculated as a new initial point and iteratively is continued until the classification of each data belongs to remains unchanged.Among them, the update of the nth iteration cluster center is as Eq. ( 2).
The main drawback of the K-means algorithm is that the random selection of initial K clustering objects might cause local optimum.Therefore, we use a hybrid artificial intelligence algorithm to improve the accuracy of the results.After clustering the objects calculated by the K-means algorithm, we use the machine learning method to refine and relabel the data to get better results.The pseudocode of the K-means-based EV charging behavior clustering algorithm is shown below.
After clustering, we standardize the results and import the user data into the same tuple structure, which shown in Eq. (3).
As shown in Fig. 2, machine learning algorithm divides users into three categories.Through analysis, we believe that the red and blue users have regular and predictable charging behavior because their standard deviation is low.On the contrary, some users have irregular charging behavior, which is classified into green spots in Fig. 2. Such users have no value in taking part in the centralized scheduling of the power grid because the standard deviation is large.Therefore, we adopt the hybrid artificial intelligence algorithm to classify red and blue users into one category and green users into another.

The KNN-based EV charging behavior classification
When new users join, they need to be classified based on their behavior.However, it is a great challenge to re-cluster the whole dataset each period when a new EV accesses to the charging station.Therefore, we use the k-nearest neighbors (KNN) method to classify new users based on existing clustering results.KNN is one of the supervised learning methods used to classify samples by measuring the distance between new objects and the labeled objects.Inside the KNN algorithm, all the chosen objects have been accurately classified, the training samples of the first K new objects can be chosen, and the new chosen objects are assigned to the classification that the largest number of data categories among the K nearest neighbor belongs.A detailed description of the KNN-based EV charging behavior classification is shown below.The training error rate is defined as the ratio of the K-nearest training sample marker to the input marker, which is expressed as follows: Moreover, if we choose the appropriate K value, we can maximize the coefficient in the training set.1=K

LSTM-based EV charging behavior prediction
The RNN algorithm is adopted to identify nature language because it was able to remember a long time sequence.However, as the sequence length increases, the gradient disappearance problem is highlighted by unfolding RNNs into ultra-deep structures.To solve the problem of the vanishing gradient, some structures of RNNs with forget units were proposed like LSTM and GRU.In this way, the memory cells could decide when it can forget certain charging information and thus determine the optimal time.LSTM was proposed for language models in 1997 and was used for EV aspect prediction until 2015.Figure 3 illustrates the typical architecture of the LSTM predictor.A representative LSTM neural network cell mainly contains four gates with different functions including the input gate, the input modulation gate, the forget gate, and the output gate.The input gate receives the input training data and processes the new coming information.The input modulation gate transmits the input data to the output gate for the last iteration.The forget gate selects the value data and decides when to forget the unnecessary information for the input sequence.The output gate obtains the entire calculation results and creates output for the LSTM model.In our prediction model, a soft-max layer and a linear regression layer are added to determine the final output of the LSTM.
We recognize the input data as X = (x 1 , x 2 , …, x n ), hidden state of LSTM as H = (h 1 , h 2 , …, h n ), and output results as Y = (y 1 , y 2 , …, y n ), and LSTM has the computation as follows: in which the weights are denoted as W, and biases are represented as b.The hidden state of LSTM is calculated as follows: where σ stands for the standard sigmoid function as shown in Eq. ( 13), * denotes the scalar product of two vectors or matrices, g and h represent the extend of standing sigmoid function with the ranges of [-2, 2] and [-1, 1], respectively.
The objective function of our prediction model is given by the following formula: in which y denotes the real value, and p is the predicted results.To reduce the training error and avoid local optimal, an adaptive learning rate-based stochastic gradient descent (SGD) optimizer, Adam optimizer, is adopted in back propagation through time (BPTT) algorithm.Neural networks have been known for their powerful expressive abilities and are particularly prone to overfitting.Neural network training has been a difficult problem for long, and a lot of regularization methods have been proposed to reduce overfitting.In 2012, dropout [24] was proposed as a very effective algorithm for training neural networks to obtain better image features.However, due to the recurrent property of RNNs, dropout has been difficult to apply to language models of RNNs.Until 2014, it was reported that the dropout methods were successfully applied to RNNs.
4 Experiments and results

Data description and experiment design
We use one year's charging record of a charging station in Los Angeles as a data set for simulation.Each record stores the user ID, charging connection time, charging completion time, disconnection time, charging amount, and other variables.
The data set contains 26,000 charging records of 318 users.We have divided the EV users into regular and irregular users through above hybrid artificial intelligence.The regular users have regular and predictable charging behavior, while the behavior of irregular users is unpredictable.
In our experiment, we deployed the RNN composed of one LSTM cell to process the classified EV user's data.Then, we compared the predicted user charge with the real user charge to test the performance of our proposed model.Besides, to test our model prediction accuracy better, we used the mean square error (MSE) defined as follows:

Cross-validation of the hybrid artificial intelligence algorithm
Cross-validation is used to verify the effectiveness of the proposed hybrid artificial intelligence algorithm.There are 223 user data after filtering; we divided them into 6 groups.The first 5 groups are used for cross-validation, and the last group is used for final validation, as shown in Fig. 4. In cross-validation, 4 groups of data are used for training prediction model, and another group of data is used for testing.In addition, the last 48 data are used for validation.After training, the prediction accuracy is 98.41%.
To fully consider the general performance of the model, we draw a receiver operating characteristic curve (ROC) curve to fitting the number of the partition type.ROC curve is usually more effective when the classification distribution is not uniform.There are two important values inside the ROC curve, the first is the true- positive rate (TPR) and the other one is the false-positive rate (FPR).The definitions of them are as shown below: The area under the ROC curve (AUC) is a widely used indicator of the classification performance of supervised algorithm.The AUC is calculated the proportion of area under the ROC curve compared with the total area.The ROC curve of the k-nearest neighbor (KNN)-based EV charging behavior classification algorithm is shown in Fig. 5.It is obvious that the ROC curve is close to the upper boundary of the coordinates, and the AUC is 0.995, which indicates that the classification performance of our model is effective.Thus, by adopting the KNN-based EV charging behavior classification model, we can classify the behavior of new users to figure out whether their behavior is regular or irregular.Electric power companies can use these classification results to predict future loads to timely dispatch the grid and enhance the stability of the grid.

EV charging prediction
In this experiment, the hybrid artificial intelligence-based prediction model is trained, and the performance is measured.Figures 6 and 7 demonstrate the prediction results of irregular charging data and regular charging data, respectively.According to the results, the predicted value of regular users is very similar to the real data, while the charging behavior of irregular users are difficult to predict.The experimental results are basically in line with our expectations, which means that our proposed method is effective.Experimental results show that hybrid artificial intelligence has good performance on regular charging data, but the irregular charging data are hard to predict.Therefore, predicting the charging behavior of regular EV users is meaningful to formulate an optimal electricity price, and considering the prediction, the irregular EV charging data can be neglected.

Conclusions
To effectively provide on-demanding charging services for EV users in the 5G smart grid, we propose an electric vehicle charging behavior analysis (EV-CBA) scheme based on hybrid artificial intelligence in 5G smart grid.There are two main innovations in the EV-CBA scheme including a novel three-layer smart grid architecture and a hybrid artificial intelligence algorithm.The proposed smart grid network architecture adopts network slicing and edge computing technologies to meet the heterogeneous EV charging demands, such as irregular charging and regular charging, in 5G smart grid.In addition, the proposed three-layer smart grid architecture is the hardware foundation for implementing hybrid artificial intelligent algorithms.The hybrid artificial intelligence is proposed to obtain accurate prediction results of future charging demands, which consists of the K-means-based EV charging behavior clustering, the knearest neighbor (KNN)-based EV charging behavior classification, and the LSTMbased EV charging behavior prediction.The multi-step hybrid prediction process contributes to analyzing the EV charging behavior.Simulation experiments show that the proposed EV-CBA scheme can predict EV charging behavior with excellent clustering capacity and classification performance.The prediction results can be used as the basis for EV charging scheduling in the 5G smart grid.

Sun
et al.EURASIP Journal on Wireless Communications and Networking (2020) 2020:139 based on irregular or regular EV charging requirements and charging information collected from actual networks.Charging data transmission and cross-layer control can be realized through network visualization and OpenFlow protocol.The information interaction between EVs and charging stations can be realized via power line communication (PLC) and wireless communication networks.The charging behavior information collected from EVs is stored and processed in the edge cloud to

Fig. 1
Fig. 1 Three-layer architecture of smart grid with network slicing and edge computing.As shown in this figure, it provides a smart grid network architecture based on network slicing and edge computing to abstract or share substrate resources

Sun
et al.EURASIP Journal on Wireless Communications and Networking (2020) 2020:139

Fig. 2
Fig. 2 The clustering results under K-means-based EV charging behavior clustering algorithm.As shown in this figure, machine learning algorithm divides users into three categories

Fig. 3
Fig.3The structure of the LSTM predictor.This figure illustrates the typical architecture of LSTM predictor.A representative LSTM neural network cell mainly contains four gates with different functions including the input gate, the input modulation gate, the forget gate, and the output gate

Fig. 4
Fig.4The demonstration of cross-validation for EV charging behavior grouping.As shown in this figure, there are 223 user data after filtering; we divided them into 6 groups.The first 5 groups are used for crossvalidation, and the last group is used for final validation

Fig. 5 Fig. 6 Fig. 7
Fig.5The demonstration of cross-validation for EV charging behavior grouping.The ROC curve of the knearest neighbor (KNN)-based EV charging behavior classification algorithm is shown in this figure