Chunxi LI ,Yingying FU ,Xiangke CUI ,Quanbo GE
1Logistics Engineering College,Shanghai Maritime University,Shanghai 200135,China
2School of Economics and Management,Beijing Jiaotong University,Beijing 102603,China
3School of Automation,Nanjing University of Information Science and Technology,Nanjing 210044,China
4Jiangsu Collaborative Innovation Center of Atmospheric Environment and Equipment Technology (CICAEET),Nanjing University of Information Science and Technology,Nanjing 210044,China
5Jiangsu Key Laboratory of Big Data Analysis Technology (B-DAT),Nanjing University of Information Science and Technology,Nanjing 210044,China
Abstract: Overcharging is an important safety issue in the charging process of electric vehicle power batteries,and can easily lead to accelerated battery aging and serious safety accidents.It is necessary to accurately predict the vehicle’s charging time to effectively prevent the battery from overcharging.Due to the complex structure of the battery pack and various charging modes,the traditional charging time prediction method often encounters modeling difficulties and low accuracy.In response to the above problems,data drivers and machine learning theories are applied.On the basis of fully considering the different electric vehicle battery management system(BMS) charging modes,a charging time prediction method with charging mode recognition is proposed.First,an intelligent algorithm based on dynamic weighted density peak clustering (DWDPC) and random forest fusion is proposed to classify vehicle charging modes.Then,on the basis of an improved simplified particle swarm optimization(ISPSO) algorithm,a high-performance charging time prediction method is constructed by fully integrating long short-term memory (LSTM) and a strong tracking filter.Finally,the data run by the actual engineering system are verified for the proposed charging time prediction algorithm.Experimental results show that the new method can effectively distinguish the charging modes of different vehicles,identify the charging characteristics of different electric vehicles,and achieve high prediction accuracy.
Key words: Charging mode;Charging time;Random forest;Long short-term memory (LSTM);Simplified particle swarm optimization (SPSO)
With steady growth in the number of electric vehicles (EVs) in the automobile market,the running problems and charging safety of EVs are important issues to be solved at present.Among many battery problems,overcharging of EVs is one of the most frequently encountered safety problems(Zhu XQ et al.,2019).Due to aging,inconsistency,battery management system (BMS) failures,and other reasons,EV batteries are prone to overcharging,which leads to the loss of anode and cathode materials and excessive electrolyte decomposition.This deterioration leads to thermal runaway of the battery,which causes an explosion and fire(Li CX et al.,2020).The charging pile is the main charging device for EVs,and can directly affect the EV charging behavior.The accurate prediction of charging time by the charging pile can effectively prevent battery from overcharging.Therefore,the prediction of EV charging time is of great significance in the operation and charging safety of EVs.Data used in this study are obtained from charging piles,and the EV charging time is also predicted from the perspective of charging piles to prevent overcharging.
The traditional method of predicting remaining charging time calculates the required charging time per unit state of charge (SOC) according to the total charging time,and calculates the remaining charging time according to the required charging SOC (Sun et al.,2021).This method is not suitable for studying the charging time of EVs because of the uneven distribution of EV charging time.An equivalent circuit model can be established to study the charging condition of the battery and reflect its charging behavior (Frendo et al.,2020).However,the establishment of an equivalent circuit model requires detailed knowledge of battery parameters and battery pack structure,which is difficult to obtain by charging pile,and it is challenging to determine battery parameters through experiments,which requires considerable engineering work (Frendo et al.,2020).Moreover,due to battery inconsistency,when an electric car has not reached the full charge state,the phenomenon of overcharging may have occurred.EV BMSs charge according to the unique EV charging mode,and the charging voltage and current are different in different charging modes,which leads to great differences in charging time.All these factors increase the difficulty in predicting EV charging time(Zhang QS and Zhao,2020).
With the development of artificial intelligence,machine learning algorithms have been applied to various prediction methods (Altché and de la Fortelle,2017;Roondiwala et al.,2017;Chang et al.,2020;Liu WW et al.,2022;Yang et al.,2022).Compared with the physical battery model,the machine learning method has a lower computational cost.The data-driven machine learning model represents the latest development in prediction methods.In Liu YY (2018),a battery model with adaptive online parameters based on Lyapunov’s law was used to evaluate the SOC of the lithium battery,but the relationship between it and the charging time was not explained.The charging time of the battery can be predicted according to the charging temperature (Zhu ZC and Zheng,2017).The empirical model established by this method can predict the battery charging time at different temperatures,but the model is strongly dependent on data features and thus has weak generalization ability.In Cheng et al.(2019),fuzzy information granulation(IG)was combined with a support vector regression (SVR)model to predict the remaining charging time of the lithium battery.This method improves the training efficiency,but it has limited ability to represent complex functions when there are limited samples.The remaining time can be predicted using the unit charging power method (Han et al.,2014);however,this method requires a large amount of collection and calculation work,and thus is not suitable for practical engineering applications.In Lin (2018),a threestage SVR model was used to predict the remaining charging time of the lithium battery;it divides the charging process into an early stage,middle stage,and late stage.In Zhou et al.(2019),the estimation of battery capacity was converted into the estimation of the time required for full charging of the battery.The real-time full charging time of the battery can be predicted using an extended Kalman filter and Gaussian process regression(EKF-GPR)algorithm.Still,the error will gradually increase with the increase of the number of cycles.Independent long shortterm memory (IndyLSTM) was used to predict the remaining charging time of the lithium battery in Liu X (2020),but the charging methods of various batteries were not considered,and the parameters on which the algorithm depends needed to be selected artificially.
At present,most research studies only the charging time of a single battery,and does not consider the impact of vehicle charging mode,so it cannot be applied well to the EV industry.It is necessary to propose an intelligent charging time prediction algorithm that can identify different EV charging patterns.To fill this research gap,in this paper we add a charging mode recognition module to the prediction algorithm,and study the constant current constant voltage(CC-CV)mode and multistage constant current (MCC) mode.These are the main modes used by EVs in the market,making the research content more universal.Different from other work,we use real charging vehicle data,and thus the situation is more realistic and the model is more suitable for the general vehicle type.
As is commonly known,predicting the charging time of EVs is a time series prediction problem.LSTM performs well in time series data and is often used as a charging time prediction method.An LSTM schematic and the calculation equations are shown in Fig.1 and Eqs.(1)–(6) (Zhang YF et al.,2021):
Fig.1 Unit structure of long short-term memory(LSTM)
Eqs.(1)–(6)are the equations for predicting the charging time of traditional LSTM,wherexis the charging input data,his the output forecasting data,“⊙” represents the inner product of vectors,cis the state of the unit,andtis the time.f,i,andoare the forgetting gate,input gate,and output gate,respectively.σdenotes the sigmoid activation function,and tanh denotes the tangent function.Wandbrepresent the weight matrix and the deviation vector,respectively (the subscripts “f,” “i,” “c,” and “o”refer to the forgetting gate,input gate,state of the unit,and output gate,respectively).
In the actual charging scenario,due to the complexity of vehicle models and the great differences in charging methods,for a large number of different vehicles,using a single LSTM method cannot obtain better prediction accuracy or solve the problem of preventing overcharge.In addition,LSTM model parameters must be determined,such as the number of neurons,the learning rate,and the number of iterations.The learning rate controls the learning speed of LSTM.If the learning rate is too low,the convergence time of the algorithm will be too long.If the learning rate is too high,the learning speed of the algorithm will be too high,and the model may miss the optimal value,which makes it diffi-cult to achieve sufficient accuracy.Similarly,too few or too many neurons and iterations will affect the convergence speed and prediction accuracy of the algorithm.These problems make it difficult to determine the parameters of the prediction algorithm.In Liu B (2020),the parameters of the LSTM prediction model were determined by particle swarm optimization (PSO).PSO is a simple optimization algorithm,and has been used for parameter optimization of various algorithms because of its being simple and efficient.The LSTM method improved by PSO is shown in Fig.2.
Fig.2 Flowchart of PSO-LSTM(PSO:particle swarm optimization;LSTM: long short-term memory)
Generally,the particlelin the particle swarm represents the parameters of LSTM,including the number of units in the hidden layer,number of iterations,time step,and learning rate.Hu and Li(2007) proved that the PSO evolution process is independent of particle velocity,and that the ultimate goal of the algorithm is to make the current solution infinitely close to the optimal solution.Therefore,they proposed a simplified PSO (SPSO) algorithm,whose calculation equation is
In Eq.(7),lidis the position of theithparticle in dimension,pidis the current local optimal position of the particle,andgbdis the global optimal position of the particle swarm.c1andc2are learning factors,andr1andr2are random numbers between 0 and 1.ωis a non-negative inertia weight andkrepresents the moment.
However,in the face of solving complex multipeak and multi-local problems,the particle optimization ability of SPSO will be reduced due to the lack of speed constraints,which will affect the rate of convergence and the accuracy of the algorithm.
Different EVs have different BMSs and charging modes.At present,other research has not considered the identification of charging mode when studying the charging behavior of EV batteries.The EV charging mode represents the change of charging current with time.The CC-CV and MCC modes are the most common charging modes,as shown in Fig.3.
Fig.3 Mainstream charging modes of an electric vehicle (EV): (a) constant current constant voltage (CCCV) charging mode;(b) multistage constant current(MCC) charging mode
To improve the accuracy of charging time prediction,the charging mode should be considered and a clustering method can be used to classify modes.Density peak clustering (DPC) is a density-based clustering method proposed by Rodriguez and Laio(2014);it can classify similar data into the same cluster and realize efficient clustering among arbitrary data.However,DPC is not sensitive to the local set of data and performs poorly,especially when the internal data change greatly.Althoughknearest neighbors (KNN) can be used to improve DPC (Du et al.,2016),its Euclidean distance cannot reflect the importance of each indicator.In this study we propose a new KNN-DWDPC(dynamic weight density peak clustering) method,which can solve the problem of local insensitivity of DPC to data,and increase the attribute differentiation among data.
LSTM is selected to predict EV charging time in this study.To solve the problem that the LSTM accuracy is affected by manual parameter setting,it is necessary to select an intelligent optimization algorithm to determine the appropriate parameters.We propose a new improved simplified particle swarm optimization(ISPSO)algorithm based on SPSO and the velocity mean.This method not only enlarges the scope of particle search,but also makes it easier for the particle to approach the global optimal value.To eliminate the problem that ISPSO falls into a local optimum due to the lack of a velocity term,a strong tracking filter is used to improve the updating position of the particle swarm.Compared with existing prediction algorithms,the improved fusion algorithm can effectively avoid the shortcoming of the PSO algorithm,which cannot provide suitable parameters for LSTM due to local optimization.Finally,the improved fusion algorithm is applied to the charging vehicles in different charging modes to predict charging time in real time.
The proposed EV charging time prediction method (Fig.4) is divided mainly into three modules,i.e.,the data collection module,classification module,and prediction module.The main contributions of this study are as follows:
Fig.4 Electric vehicle (EV) charging time prediction based on charging pattern recognition (RF: random forest;STF: strong tracking filter;CC-CV: constant current constant voltage;MCC: multistage constant current)
1.To reduce the large classification error caused by the significant variation in charging current in the same charging mode,an improved DWDPC method is proposed based on KNN.This method can improve the poor performance of DPC caused by different local data densities,and can make the classification samples more representative by dividing the charging data into several similar data sets.
2.Focusing on the multi-mode charging characteristics of EVs and the fact that prediction of charging time is not accurate in a single mode,a charging pile charging mode feature recognition method based on KNN-DWDPC and random forest(RF) fusion is proposed.This method considers the influence of charging modes and designs intelligent charging pattern recognition for different vehicles.
3.Focusing on the problem that PSO in a traditional PSO-LSTM algorithm can easily fall into a local optimum,an improved ISPSO method is proposed to determine the LSTM parameters.The method introduces the idea of using the mean value to improve the global optimal particle leadership.
4.Focusing on the problem that the convergence time of the algorithm is affected by the omission of the velocity term,the ISPSO-LSTM-STF charging time prediction method is proposed.This method can effectively improve the algorithm’s prediction accuracy and reduce the convergence time.
In this section,we introduce an intelligent model classification algorithm that can identify the characteristics of different charging modes,which is the prerequisite of the prediction in the next section.
The classification of charging modes is closely related to charging current.However,in a complete charging process,the variation of current data in the same charging mode is very different,which may lead to deterioration of classification and prediction effects.Therefore,before classification,we cluster all model data and classify charging modes after we cluster similar charging data into one data set.DPC is used in this study.DPC is based on two important quantities: the local densityρiof each pointi,and its distanceδifrom points of higher density.DPC takes the points with largerρiandδias the cluster center,and assigns the remaining data points to the cluster nearest to the center.Du et al.(2016) used the KNN idea to calculate the local density of DPC,and its calculation equation is as follows:
wheredis the Euclidean distance and NNk(xi) represents thekthpoint nearest toxiaccording tod.ρicalculates the average distance ofknearest data points toxi,representing the inverse measure of distance.ρiuses the Euclidean distance as the measure of distance,andXis the data set.
In the DWDPC method,the Euclidean distance in local density (Eqs.(8) and (9)) is improved to the weighted Euclidean distancedw(xi,xj),which is calculated as follows:
wherexiandxjrepresent the sample points to be calculated,xifis the value of thefthcomponent of theithdata point,nis the number of data points,mrepresents the sample dimension,andωi,j,frepresents the distance weight.
The traditional Euclidean distance does not consider the distribution characteristics of data and cannot distinguish data attributes well.To increase the degree of distinction between data attributes,Wang et al.(2020)proposed the weighted Euclidean distance,but they considered only the distribution characteristics of the current point when calculating the distance between two points.Because the data distribution characteristics of relative points were not considered,the change of relative points was static in this method,and the weight of the distance between the same data points and different relative data points remained unchanged,which is obviously unreasonable.Compared with the existing methods and traditional Euclidean distance,the proposed dynamic weighted Euclidean distance simultaneously considers the distribution characteristics of reference points and sample points in the sample,and different weights can be assigned.
The flowchart of the improved classification algorithm in this study is shown in Fig.5.
Fig.5 Flowchart of KNN-DWDPC-RF
The flow of KNN-DWDPC-RF is as follows:
Step 1: Import the historical charging data of various models from the charging pile database.
Step 2: Preprocess the data,including the completion and normalization of missing values.The input data of KNN-DWDPC-RF are obtained,consisting of charging current and charging SOC.
Step 3: CalculateK(xi),ωi,j,f,dw(xi,xj),δi,andρi.δirepresents the distance between a data point and the nearest point with a higher density.The cluster center distanceδiof a data point is expressed as(Du et al.,2016)
Step 4: Determine the cluster center.
Step 5: Sort the data points in descending order according to the density.
Step 6: Perform random sampling and determine the characteristics for each data set.
Step 7: Use the Gini coefficient to divide the property-generated nodes and establish the CART decision tree.
Step 8: Determine whether the number of decision trees is sufficient.If the requirements are met,random forest classifiersR1,R2,...,Rnare generated.If not,continue the iteration.
Step 9: Multiple random forest classifiers are used to classify multiple data sets,and the classification results are obtained.
Usually,there will be outlier data in the normal EV charging process.Compared with other works,the KNN-DWDPC method based on DPC,which can identify cluster classes and find outliers easily(Huang and Wu,2005),is first used to cluster the charging data.It can improve the classification accuracy of RF and remove noise data,such as outliers in the data.
After the classification of charging modes,it is necessary to predict the charging time of the data.When LSTM is used to predict complex charging history data,setting algorithm parameters is very complicated,and the parameter quality directly affects the final prediction results.In this study,based on the traditional SPSO (Eq.(7)),a new ISPSO is proposed to determine the LSTM parameters,and ISPSO is proved to have better convergence effect in principle.The expression of ISPSO is as follows:
whereωis the inertia weight,which can prevent the particle from falling into local optima.lidis the position of theithparticle in dimension,pidis the current local optimal position of the particle,andgbdis the global optimal position of the particle swarm.c1andc2are learning factors,andr1andr2are random numbers between 0 and 1.
Assuming that the particle positions of SPSO and ISPSO at the current time are the same,the comparison diagram of the updated positions of particles at the next time point is shown in Fig.6.andare the current positions of the particles,is the updated position of SPSO,andis the update position of the new ISPSO.gbdis the global optimal position andpidis the local optimal position.It can be seen that the updated direction of particles is closer to the direction of the global optimal particle using the ISPSO method proposed in this study.
Fig.6 Comparison diagram of position update
Theorem 1Whenφ <ω <φ+1,ISPSO finally converges,and the convergence speed is higher than that of the SPSO method.ProofSummarize Eq.(13):
Define the parameters in the equation:c1r1=φ1,c2r2=φ2,φ1+φ2=φ,(pid+gbd)/2=β0.
Put the defined parameters into Eq.(14) and sort them out to obtain Eq.(15):
whereβ=(c1r1β0+c2r2gbd)/φ.
Eq.(15) can be written in the form of a differential equation(Hu and Li,2007):
The solution of the differential equation is
whereCis a constant.
To makel(t) converge,whenT → ∞,and 0<ω-φ <1.
Obtain the final solution: whenφ <ω <φ+1,
Suppose that the particle objective is to find the minimum position,and thengbd≤pid,and
From the above proof,whenφ <ω <φ+1,ISPSO finally converges,and the performance is better than that of SPSO.Therefore,ISPSO is a better LSTM parameter optimization method for charging time prediction.
The previous subsection proved that the ISPSO proposed in this study can approach the global optimal particle more accurately and has better convergence performance.Therefore,using ISPSO to optimize the parameters of the LSTM prediction model can improve the charging time prediction accuracy.Because the speed term is omitted,ISPSO is not limited by speed.So,a large amount of training data may lead to a local optimum at the later stage of training.To solve this problem,we use a strong tracking filter to improve the ISPSO position updating algorithm.After iteratively updating the position of each particle in the population,the algorithm will calculate their fitness and then judge whether the particle is good or bad by the fitness value.If the fitness of the particle’s current location is better than that of the historical global optimum,the new location will replace the original global optimum and make the particle jump out of the local optimum,so that ISPSO can find the optimal parameter of LSTM and improve the prediction accuracy.Different from other improved PSO methods,we estimate the position and fitness of the particle rather than modeling and estimating the speed and position of the particle.
After thekthiteration,the fitness value of a particle at thexposition is as follows:
The filtering state equation is as follows(Li YY,2020):
wherelis ann-dimensional state sequence representing the position state of each particle,Φk,k-1is the state transition matrix of the system,uk,k-1is ann-dimensional input sequence,andsis the sequence of process noise withE(s)=0 andE(ssT)=Qk.
After each position update,the particle position is adjusted to improve the search efficiency.For each particle,afterkiterations,the current fitness value of the particle can be expressed as follows (Li YY,2020):
wherezkis the series of observations for the system,vkis the observation noise,andE(v)=0,E(vvT)=Rk.The strong tracking filter (STF)estimation model can be constructed according to Eqs.(20)and(21)(Li YY,2020):
whereHk=ηis the weakening factor whose function is to reduce the possibility of overregulation,λkis the fading factor which can effectively suppress the divergence of the filter,is the estimate of the state,kis the moment,Kkis the gain matrix,andPk|kis the prediction error covariance matrix.
After each iteration,the particle position estimated by the filter is calculated and compared with the fitness of the particles in the population.If the fitness value of the position estimated by the STF estimation model is better than the values of the global best and local best of the current population,the estimated model particle position is used instead.Vkis the new information covariance matrix,and the calculation equation is as follows(Xu et al.,2019):
whereρ(0<ρ <1)represents the forgetting factor.
The algorithm flowchart is given in Fig.7.
Fig.7 Flowchart of ISPSO-LSTM-STF
In this study,the steps of the charging time prediction method of ISPSO-LSTM-STF are as follows:
Step 1: Import the historical charging data of different models from the charging pile database.
Step 2: Preprocess data,including normalization and completion of missing values.
Step 3: Initialize the ISPSO algorithm parameters and strong tracking filter parameters,including the population size,the number of iterations,and the limited interval of the particle position.
Step 4:Use STF to estimate the particle position and fitness value of ISPSO.The number of neurons(h1andh2for each layer) for LSTM,the learning rater,and the number of iterationsnare taken as the optimization objects of the particle.
Step 5: Compare the fitness values of the local best advantage of ISPSO and the local best advantage estimated by a strong tracking filter.The particle with the smallest fitness value is selected as the best local advantage.
Step 6:Train the LSTM model with the optimal parameters obtained.
Step 7:Use the trained LSTM model to predict the real charging data set.
The algorithms used in this study are all run in the MATLAB 2019b programming environment.All EV data used in this work came from a charging point operating company in Shenzhen.So far,the company has accumulated >3 million charging instances.The main charging pile types are Winline Technology YLCE-120750 and INFY POWER IDS120K750D-X5,both following the national standard: GB/T 27930-2015 Communication Protocols Between Off-board Conductive Charger and Battery Management System.The charging pile transmits the message to the company’s charging safety monitoring platform through a controller area network(CAN) bus and Ethernet,and saves the data in a time-series database.
To minimize the impact of external temperature,the vehicles selected in this study are all continuously charged in the same time period every day.The interval for each packet is about 5–10 s.Due to the time interval during packet transmission,several packets may belong to the same SOC.Therefore,we average the voltage and current values of the corresponding messages of each SOC,and obtain the corresponding SOC and the corresponding electric quantity,average current,and average voltage,which are used as data input.
However,in data transmission,there may be false positives,missing positives,delays,and so on.Therefore,missing values and outliers in the charging data set need to be identified and processed.In this study,we consider that the charging data that exceed the upper limit of charging power are incorrect and can be deleted.Finally,the interpolation method is used to fill in the deleted and missing data.
The min-max normalization method is applied to charging data in this experiment(Ge et al.,2022).
Charging current and SOC are used in charging mode classification.The charging data randomly extracted from the company database are divided into seven groups,and each group contains 299 test samples and 299 training samples.Every group is two-dimensional data composed of charging time and charging current.The parameters are set as follows:k=15,the number of decision trees is 150,and the number of iterations is 250.To verify the effectiveness of the improved classification algorithm,the algorithm is compared with RF and DPC-RF.Classification accuracyPis used to evaluate the effect of mode classification(Li B et al.,2020):
TP is the correct number of CC-CV samples,TN is the correct number of MCC samples,FP is the number of classification errors in CC-CV samples,and FN is the number of classification errors of MCC samples.The experimental results classified in this study are shown in Fig.8.It can be clearly seen that clustering and then classifying the data can effectively reduce the classification error.In addition,among the seven data groups,the accuracy of KNN-DWDPC-RF is better than those of DPC-RF and RF,and the classification effect is more stable.
Fig.8 Comparison of accuracy under different classification methods
SOC,charging voltage,charging current,and electric quantity are used to predict charging time.Parameters are set as follows: particle swarm inertia weightω=0.9,learning factorc1=2,c2=2,numbers of iterations of ISPSO and PSO are both 100,and the population size is 20.In LSTM,the numbers of two hidden layers areh1,h2∈[1,200],the learning rate isr ∈[0.001,0.01],and the number of training times isn ∈[1,500].In strong trace filtering,Q=0.001,R=10.
Four vehicles with two CC-CV and two MCC charging modes are selected in this study.Their SOC changes are all >60%during charging to make results more credible.
The prediction algorithm in this study uses the relative error (RE),absolute error (AE),and mean absolute percentage error(MAPE) as evaluation indexes in the experiments (Ge et al.,2022).
1.Vehicle 1
Vehicle 1 is a vehicle in MCC charging mode.Fig.9a is the LSTM charging time prediction without charging mode classification.Figs.9b–9e are the charging time predictions that classify charging mode first and then forecast using LSTM,PSO-LSTM,ISPSO-LSTM,and ISPSO-LSTM-STF methods,respectively.As shown in Fig.9,charging mode classification can effectively improve the accuracy when the charging time has a sudden change.Compared with ISPSO-LSTM and PSOLSTM,ISPSO-LSTM-STF is more accurate in the early and late stages of charging.
Fig.9 Charging time prediction of vehicle 1 under different methods: (a) LSTM without mode classification;(b) LSTM with mode classification;(c) PSO-LSTM with mode classification;(d) ISPSO-LSTM with mode classification;(e) ISPSO-LSTM-STF with mode classification (SOC: state of charge)
As can be seen from Table 1,the real full charging time of vehicle 1 is 76.0851 min,and the predicted values of the full charging time are 68.6775 min for LSTM (unclassified),71.2542 min for LSTM (classified),72.1804 min for PSO-LSTM,72.5088 min for ISPSO-LSTM,and 73.7123 min for ISPSO-LSTM-STF.The corresponding REs are 9.74%,6.35%,5.14%,4.70%,and 3.12%.The error after mode classification is smaller than that without classification.The RE of ISPSO-LSTM-STF is the smallest.
2.Vehicle 2
Vehicle 2 is a vehicle in MCC charging mode.Fig.10a is the LSTM method without charging mode classification.Figs.10b–10e are the charging time predictions that classify charging mode first and then forecast using LSTM,PSO-LSTM,ISPSO-LSTM,and ISPSO-LSTM-STF methods,respectively.
Fig.10 Charging time prediction of vehicle 2 under different methods: (a) LSTM without mode classification;(b) LSTM with mode classification;(c) PSO-LSTM with mode classification;(d) ISPSO-LSTM with mode classification;(e) ISPSO-LSTM-STF with mode classification (SOC: state of charge)
In Table 2,the prediction of charging time in the unclassified model has a large error in the overall prediction time.After charging mode classification,the accuracy of medium-term charging prediction is improved,but for the abrupt change data,the prediction error is still large.Compared with other methods,ISPSO-LSTM-STF performs best in the face of data mutation.Although the RE in the early stage is large,the charging time in the early stage is generally only a few seconds or tens of seconds.
Table 1 Comparison of relative errors of vehicle 1 under different methods
3.Vehicle 3
Vehicle 3 is a vehicle in CC-CV charging mode.Fig.11a is the LSTM without charging mode classification.Figs.11b–11e are the charging time predictions that classify charging mode first and then forecast using LSTM,PSO-LSTM,ISPSO-LSTM,and ISPSO-LSTM-STF methods,respectively.
Fig.11 Charging time prediction of vehicle 3 under different methods: (a) LSTM without mode classification;(b) LSTM with mode classification;(c) PSO-LSTM with mode classification;(d) ISPSO-LSTM with mode classification;(e) ISPSO-LSTM-STF with mode classification (SOC: state of charge)
As can be seen from Table 3,the real full charging time of vehicle 3 is 83.9672 min;the predicted values of the full charging time are 75.7101 min for LSTM(unclassified),80.5296 min for LSTM(classified),81.7740 min for PSO-LSTM,85.9869 min for ISPSO-LSTM,and 83.9812 min for ISPSO-LSTMSTF.Accordingly,the REs are 9.83%,4.09%,2.61%,2.41%,and 0.02%,respectively.
Table 2 Comparison of relative errors of vehicle 2 under different methods
4.Vehicle 4
Vehicle 4 is a vehicle in CC-CV charging mode.Fig.12a is the LSTM charging time prediction of vehicle 4 without charging mode classification.Figs.12b–12e are the charging time predictions that classify charging mode first and then forecastusing LSTM,PSO-LSTM,ISPSO-LSTM,and ISPSO-LSTM-STF methods,respectively.
Fig.12 Charging time prediction of vehicle 4 under different methods: (a) LSTM without mode classification;(b) LSTM with mode classification;(c) PSO-LSTM with mode classification;(d) ISPSO-LSTM with mode classification;(e) ISPSO-LSTM-STF with mode classification (SOC: state of charge)
In Table 4,the real full charging time of vehicle 4 is 54.8786 min,and the predicted values of the full charging time are 49.8475 min for LSTM (unclassified),51.9700 min for LSTM(classified),52.1182 min for PSO-LSTM,55.7403 min for ISPSO-LSTM,and 54.9682 min for ISPSO-LSTM-STF.Corresponding REs are 9.17%,5.30%,5.03%,1.57%,and 0.16%,respectively.
Table 5 summarizes the MAPE of the four electric vehicles under different methods.It can be seen that in two different charging modes,the prediction effect of charging data after classification is farbetter than that without classification.The proposed ISPSO-LSTM has a slightly better result than the PSO-improved LSTM.Meanwhile,the mean absolute percentage error of ISPSO-LSTM-STF has been reduced by 61% compared to that of ISPSOLSTM.
Table 3 Comparison of relative errors of vehicle 3 under different methods
Table 4 Comparison of relative errors of vehicle 4 under different methods
Table 5 Mean absolute percentage error (MAPE)under different methods
In this paper,a novel charging time prediction method,i.e.,ISPSO-LSTM-STF,has been proposed to solve the problem of low accuracy encountered by traditional methods due to the lack of charging mode recognition.First,an improved DWDPC method based on KNN has been used to classify EV charging modes according to charging voltage and current.Then charging time has been predicted by an LSTM algorithm whose parameters were optimized by ISPSO and STF.It has been proved by experiments that this ISPSO-LSTM-STF method,based on charging pattern recognition,can effectively improve the charging time prediction accuracy and has real engineering value.
Contributors
Chunxi LI designed the research and gave the main frame.Chunxi LI and Yingying FU processed the data.Yingying FU tested the MATLAB program and drafted the paper.Xiangke CUI and Quanbo GE helped organize the paper and gave a lot of suggestions.Chunxi LI,Xiangke CUI,and Quanbo GE revised and finalized the paper.
Compliance with ethics guidelines
Chunxi LI,Yingying FU,Xiangke CUI,and Quanbo GE declare that they have no conflict of interest.
Data availability
Data are not available due to commercial restrictions.
Frontiers of Information Technology & Electronic Engineering2023年2期