# EV Charging Behavior Analysis Using Hybrid Intelligence for 5G Smart Grid
## 4 Simulation  
We used real charging records of electric vehicles, released by Adaptive Charging Network (ACN)-Data as a data set to analyze user charging behavior. The ACN-Data is a dynamic dataset of workplace EV charging which currently includes over 30,000 sessions with more added daily. We compiled 26,000 charge records for 318 electric car users, including the user's charge connection time, charge completion time, charge disconnect time, and charging amount [28].  
The data suggest that, for the vast majority electric car users, their charging behavior is predictable, e.g., starting to charge after work every day and disconnecting the electric car and charging pile before work the next morning. However, the charging behavior of a small number of users is not regular. Even if only those users with regular charging behavior can be scheduled, the stability of the power grid will be greatly improved. As a result, we use the HITL-based K-Means clustering and k-NN algorithm to predict the charging behavior of EV. The AI algorithm flow chart based on hybrid artificial intelligence is shown in Figure 5. In this simulation we used MATLAB R2016a as the simulation software. The computer's CPU is Intel core i5 5200U and the memory is 4 GHz.  
Clustering analysis is a crucial analytical algorithm in data mining [29]. Clustering is to divide similar objects into different groups or more subsets by static classification so that the member objects in the same subset have similar properties. The K-means algorithm has been widely used for its simple algorithmic design, faster clustering speed, and good clustering effect. Hence, in this article, we used K-means to analyze the uncertainty of EV user charging behavior.  
In order to analyze the users' charging behavior, we first clustered the users' behavior. When selecting variables as the basis for user behavior clustering, we mainly considered the following ideas: (1) The user mainly affects the grid in their choice of charging start time, charging end time, charging amount, and charging scene. (2) The amount of charge is roughly positively related to the charging time. (3) Some users have regular charging behavior and some users have no regular charging behavior. Combining the above points, in order to achieve better clustering results, we chose the average charging time, the standard deviation of the charging time, and the connection time as the basis for clustering user behavior.  
Before clustering the data, we preprocessed the data. We manually screened and removed low-quality data from the raw data set. For example, we removed users with fewer than three records,  
Figure 5: Artificial intelligence (AI) algorithm flow chart based on hybrid artificial intelligence.  
which were random and not useful to determining patterns of behavior. Then, the user data was normalized using the linear normalization method, with specific rules:  
\[X^{*}=\frac{X-X_{\text{min}}}{X_{\text{max}}-X_{\text{min}}}. \tag{1}\]  
We used the K-means algorithm to classify EV user charging behavior, however, for data at cluster boundaries, the clustering effect may not be ideal [30]. Drawing on the idea of HTTL, after clustering the data with the K-means algorithm, we used manual methods to check and re-mark data at the boundary.  
Finally, for the new user data, we used the k-NN algorithm to for classification. This allowed us to filter out users with unstable behavior for further processing.