A Novel Closed-Loop System for Vehicle Speed Prediction Based on APSO LSSVM and BP NN

: Vehicle speed prediction plays a critical role in energy management strategy (EMS). Based on the adaptive particle swarm optimization–least squares support vector machine (APSO-LSSVM) algorithm with BP neural network (BPNN), a novel closed-loop vehicle speed prediction system is proposed. The database of a vehicle internet platform was adopted to construct a speed prediction model based on the APSO-LSSVM algorithm. Furthermore, a BPNN is established according to the local high-precision nonlinear ﬁtting relationship between the predicted value and error so as to correct the prediction value. Then, the results are returned to the APSO-LSSVM model for calculating the minimum ﬁtness function, thus obtaining a closed-loop prediction system. Finally, equivalent fuel consumption minimization strategy (ECMS) based EMS was performed. According to the simulation results, the RMSE performance is 0.831 km/h within 5 s, which is over 20% higher than other performances. Additionally, the training time is 15 min within 5 s, which is advantageous over BPNN. Furthermore, fuel consumption increases by 6.95% compared with the dynamic-programming algorithm and decreased by 5.6%~10.9% compared with the low accuracy of speed prediction. Overall, the proposed method is crucial for optimizing EMS as it is not only effective in improving prediction accuracy but also capable of reducing training time.


Introduction
Currently, electric passenger cars have been increasingly popularized, which aim to reduce oil consumption while simultaneously addressing air pollution [1]. However, for electric heavy trucks, the main downside of short endurance mileage results in declining sales. Despite the capability of advanced battery storage system to ensure the sufficient mileage of heavy trucks, this type of battery remains immature and has not been verified in real-world conditions [2]. As a promising direction of transport electrification, fuel cell hybrid vehicle (FCHV) has been drawing widespread attention for research studies across the automotive industry due to advantages such as zero emission, low noise and high efficiency [3]. Therefore, fuel cell and electric battery technologies are considered as practical solutions for zero emission.
As far as heavy trucks are concerned, the diversity of region, time and environment results in complex driving conditions, which presents new challenges to the implementation of an adaptable and optimal energy management strategy (EMS) [4]. Particularly for FCHV, given the immaturity of existing technology and the high cost of fuel, high-efficiency EMS can not only minimize fuel consumption but also extends the service life of components [5].
Currently, rule-based EMS and optimization-based EMS have been widely adopted [6]. For the former, its development relies heavily on engineering experience, which makes it difficult to develop a better rule for adapting to different driving habits and conditions. For the latter, an attempt was made to solve the problem with energy management from the conditions were identified by LSSVM as optimized by grid search and cross validation (CV). Unfortunately, the parameters used to optimize LSSVM are time consuming.
To sum up, there are two perspectives from which this problem can be addressed. One is the accuracy of prediction. The other is training time. It seems that all of the prediction models proposed so far have the advantages and disadvantages of their own. It is worth noting that a potential solution to these issues is to explore the effective methods of prediction that can incorporate their merits while compensating for the weakness of each other. Focusing on the characteristics of LS-SVM and BP neural networks, this paper proposes a novel closed-loop system intended for vehicle speed prediction based on the adaptive particle swarm optimization-least squares support vector machine (APSO-LSSVM) and BP neural network (BPNN). In order to achieve this goal, firstly, a vehicle speed prediction model was first established using LS-SVM based on the historical driving conditions as collected by a vehicle-mounted TBOX. Then, an adaptive particle swarm algorithm was applied as the rolling optimization strategy to identify the optimal parameter for the LS-SVM algorithm. Afterwards, a BP neural network was constructed to establish a local high-precision nonlinear fitting relationship between the predicted value and deviation, thus achieving a correction of prediction value. Finally, the results were returned to the APSO model for calculating the minimum fitness function so as to obtain the best γ and σ. According to the simulation results, the closed-loop system used for vehicle speed prediction system can achieve higher prediction accuracy with reasonable training time required. The main contributions of this paper are reflected in the following two points. On the one hand, a novel closed-loop system intended for vehicle speed prediction was proposed according to APSO-LSSVM and BPNN, which laid the foundation for designing and optimizing energy management strategies. On the other hand, the conflict arising between LSSVM and BPNN toolboxes, which were used repeatedly in MATLAB, was resolved.
The remainder of this article is organized as follows. In Section 2, an introduction will be made for the source of driving cycle data experiments. In Section 3, an introduction is provided for the novel closed-loop prediction model on the basis of APSO LSSVM and BP-NN. Meanwhile, ECMS-based EMS with vehicle speed prediction is presented. The simulation is carried out in Section 4, which is followed by comparative analysis and discussion. Finally, conclusions are presented in Section 5.

Vehicle Structure and Paramerter
As the research objective in this paper, the configuration of the FCHV heavy-duty truck is illustrated in Figure 1. The parallel FCHV consists of a fuel cell engine system, DCDC, hydrogen system, power distribution (PDU), battery, motor controller unit (MCU), motor, vehicle controller unit (VCU) and other components. DCDC converter plays a significant role in addressing the voltage difference between the output voltage of the fuel cell engine system and the battery system, which ensures not only that the vehicle drive motor always works in the best working range but also that the fuel cell output voltage is unaffected by other external conditions. The working principle is detailed as follows. Hydrogen and oxygen in the air undergo an electrochemical reaction in the fuel cell engine system. Then, the generated electric energy is boosted by DCDC, which is combined with the power battery and transmitted to the driving motor, thus driving the vehicle. At this time, the excess electric energy is transferred to the power battery for storage. The main parameters of the vehicle are listed in the Table 1.

Data Acquisition Based on Internet of Vehicles
The hydrogen fuel cell hybrid (FCHV) heavy-duty truck studied in this paper is intended specifically for an enterprise based in Shanghai to carry out cargo transportation. A representative operating route that involves urban roads, expressway and highway was selected as the test object for acquiring the original driving conditions. Given peak traffic and external environments that result in diverse and complex driving conditions, it is crucial to ensure the accuracy of driving data. Therefore, a telematics box (TBOX) fitted with a global positioning system (GPS) was used to collect the current instantaneous speed driving conditions from the wheel speed sensor by CAN bus in the FCHV vehicle, and the collected data are uploaded to the background databases through a wireless network, which can reflect line traffic conditions and the characteristics of vehicle driving. In addition, the better the quality of the data, the more complete the data information becomes, and the more objective the characteristics it indicates.
Based on the above-mentioned methods, it is necessary to monitor and manage the vehicles for at least one month in order to capture sufficient characteristics of vehicle speed along the route. In this paper, the database of five vehicles was downloaded from the Internet of Vehicles, and the vehicle daily driving route in Shanghai is shown in Figure 2. The driving route of the vehicle stretches between two points, such as A and B; A and C; A and E; and A and F. A denotes the starting point, which is in Baoshan district, while B, C, D, E and F refer to the different destination points of the five vehicles, respectively. More details about the five-point vehicles can be found in Table 2, including urban road distance, expressway and highway distance, traffic lights, vehicle license plate and vehicle position.

Data Acquisition Based on Internet of Vehicles
The hydrogen fuel cell hybrid (FCHV) heavy-duty truck studied in this paper is intended specifically for an enterprise based in Shanghai to carry out cargo transportation. A representative operating route that involves urban roads, expressway and highway was selected as the test object for acquiring the original driving conditions. Given peak traffic and external environments that result in diverse and complex driving conditions, it is crucial to ensure the accuracy of driving data. Therefore, a telematics box (TBOX) fitted with a global positioning system (GPS) was used to collect the current instantaneous speed driving conditions from the wheel speed sensor by CAN bus in the FCHV vehicle, and the collected data are uploaded to the background databases through a wireless network, which can reflect line traffic conditions and the characteristics of vehicle driving. In addition, the better the quality of the data, the more complete the data information becomes, and the more objective the characteristics it indicates.
Based on the above-mentioned methods, it is necessary to monitor and manage the vehicles for at least one month in order to capture sufficient characteristics of vehicle speed along the route. In this paper, the database of five vehicles was downloaded from the Internet of Vehicles, and the vehicle daily driving route in Shanghai is shown in Figure 2. The driving route of the vehicle stretches between two points, such as A and B; A and C; A and E; and A and F. A denotes the starting point, which is in Baoshan district, while B, C, D, E and F refer to the different destination points of the five vehicles, respectively. More details about the five-point vehicles can be found in Table 2, including urban road distance, expressway and highway distance, traffic lights, vehicle license plate and vehicle position.  The driving data collected for six days are shown in Figure 3, which includes working time and speed information of the vehicle in a week. It can be observed from the figure that the average daily working time is 10 h. The mean speed does not exceed 40 km/h on urban roads. Moreover, the mean speed does not exceed 65 km/h on the expressway and highway. Obtained by using the vehicle speed integration process, driving mileage can reach up to 350 km. By using an analysis of the six-day driving data collected from different vehicles, it can be observed that a fixed speed characteristic is reflected in different road sections. In the next section, collected data are processed by using data analysis as preparation for the subsequent prediction of speed.  The driving data collected for six days are shown in Figure 3, which includes working time and speed information of the vehicle in a week. It can be observed from the figure that the average daily working time is 10 h. The mean speed does not exceed 40 km/h on urban roads. Moreover, the mean speed does not exceed 65 km/h on the expressway and highway. Obtained by using the vehicle speed integration process, driving mileage can reach up to 350 km. By using an analysis of the six-day driving data collected from different vehicles, it can be observed that a fixed speed characteristic is reflected in different road sections. In the next section, collected data are processed by using data analysis as preparation for the subsequent prediction of speed.

Data Processing
High-quality data are considered a prerequisite for the discovery and acquisition of knowledge. In this paper, the quality of various devices, such as sensors, CAN buses and communication networks, is susceptible to the impact of different factors including working environment, hardware conditions and operating costs. Therefore, the acquired driving data suffer quality problems to varying degrees. By conducting analysis on driving data, it was found that data noise is the main quality problem. In the following part, a discussion is conducted about processing data quality.
Wavelet filtering can be performed to obtain the low-frequency and high-frequency components at a preset scale. This method is effective in decomposing noise data while retaining all of original information. Therefore, wavelet filtering was performed in this paper to achieve data denoising.
The discrete wavelet transform (DWT) function can be expressed as Equation (1): where j, k ∈ Z; the step size a 0 is a fixed value that is greater than 1; and b 0 is a fixed value that is greater than 0. The DWT coefficients can be expressed as Equation (2).
According to the famous Mallat algorithm, scale coefficients (c j,k ) and wavelet coefficients (d j,k ) can be obtained using the scale coefficient of c j+1,k+1 and the following Equation (3): where h(k) is the low-pass wavelet filter coefficient, while g(k) is the high-pass filter coefficient. g(k) can be confirmed by g(k) = (−1) k h(n − 1 − k) [33]. The reconstruction of DWT is shown in Equation (4).
According to the above-mentioned step, vehicle speed and acceleration compared with the reference data curve are determined by wavelet decomposition, respectively. Figure 4 shows a certain section of the entire working condition. The red curves are the original vehicle speed and acceleration, respectively. The blue curves (WF) are the results based on wavelet filtering. It is evident that most of the vehicle speed spikes have been blunted, with the acceleration reflected in real time. Finally, the signal was reconstructed, and complete driving conditions were obtained.  Figure 4 shows a certain section of the entire working condition. The red curves are the original vehicle speed and acceleration, respectively. The blue curves (WF) are the results based on wavelet filtering. It is evident that most of the vehicle speed spikes have been blunted, with the acceleration reflected in real time. Finally, the signal was reconstructed, and complete driving conditions were obtained.

Vehicle Speed Prediction Method
In the previous section, the acquisition and processing of driving cycle data based on the Internet of Vehicles have been completed. Therefore, a description is made in this section of the characteristics and environment under which APSO-LSSVM and BP-NN are designed for vehicle speed prediction. Moreover, an introduction is made in detail of the novel closed-loop system built for vehicle speed prediction model on the basis of APSO LSSVM and BP-NN. Furthermore, ECMS is introduced to construct the energy management strategy.

LSSVM Prediction Method
LSSVM refers to a machine learning process commonly used as an effective prediction tool in engineering settings. The training samples of the prediction model are set as T = {(x i , y i )|x i , y i ∈ R n , i = 1, 2, . . . , l}, where x i represents the input vector of the ndimensional samples, while y i refers to output vector. In the high dimensional feature space of Hilbert, the LSSVM model can be expressed as Equation (5): where w represents weight vector, b indicates bias vector and ϕ(x) denotes mapping performed from low dimensional space to high dimensional space. According to the principle of structural risk minimization, the optimal regression estimation of the LSSVM is conducted by calculating the minimization functional with certain constraints. The minimization functional can be expressed as Equation (6): where e i is the error vector, and γ is a positive penalty term. In order to solve the optimization problem, the Lagrange multiplier (λ i ) is introduced to construct the function, as shown in Equation (7).
Energies 2022, 15, 21 The best λ and best b can be obtained under Karush-Kuhn-Tucker (KKT) conditions. Moreover, the final linear equations can be obtained as Equation (8): where . . , y l ] T , and E is the unit matrix. Ω represents the square matrix, which is constructed by the kernel function.
The prediction model of LSSVM can be expressed as Equation (9): where K(x, x i ) represents the radial basis function, which was treated as the kernel function, and σ refers to the width of Gaussian kernel.

Parameter Optimization of APSO-LSSVM
The values of penalty parameter (γ) and kernel width parameter (σ) in LSSVM are related to its generalization ability. However, the traditional search process can be performed only on grid points, which is time consuming as a result. In order to resolve this nonlinear optimization problem, the adaptive particle swarm optimization (APSO) algorithm was applied in this paper, with a large-scale global search and quasi-Newton local search method adopted to find the best parameters.
In the APSO algorithm, , where x i represents the position vector of the particle, and p i = (p i1 , p i2 , · · · , p im ), where p i represents the best position of the particle.
The speed and position should be updated using Equation (10): where c 1 and c 2 represent learning factors, usually c 1 = c 2 = 1.49445, w indicates the inertia weight, p im represents the best individual position and p gm refers to the best global position.
The inertia weight (w) adaptive strategy can be expressed as Equation (11): where w max represents the max inertia weight, w min indicates the min inertia weight, t max denotes the maximum number of iterations run and t stands for the current number of iterations.
In order to keep population diversity effective, the following method expressed as Equation (12) was used to determine whether the particle mutated: where δ represents the Euclidean distance of particle i and j, as shown in Equation (13): where S indicates similarity, which is supposed to follow the judgment criteria: if δ → 0 , Finally, some parameters of the APSO-LSSVM model used in this paper are listed in Table 3.

BP Neural Network Prediction Method
As a feed forward neural network based on the correction of errors, a BP neural network can be applied as a suitable model for dealing with relevant issues by adjusting the number of hidden layers, the number of the neurons and the learning algorithm. In general, it includes three or more layers, namely, the input layer, the hidden layer and the output layer. A three-layer BP neural network model was adopted in this paper to ensure high performance in predicting nonlinear relationships.
The output layer neuron can be expressed as Equation (14): where L represents the number of input layer nodes; M indicates the number of hidden layer nodes; F denotes the activation function, F(x) = 2/ 1 + e 2x ; X = (x 1 , x 2 , · · · , x n ) refers to the state vector which is passed from the input layer;α 0 and β 0j denote the thresholds of the output layer and hidden layer, respectively; α j stands for the synapse weight between the hidden layer and the output layer; and β ij indicates the synapse weight between the input layer and the hidden layer.
Obtained by comparing the expected output (y k ) with the actual output (y r ), the error e can be expressed as e k = |y k − y r |. The synapse weight represented by α j and β ij is re-updated by the error layer-by-layer until the error falls within an acceptable range. Figure 5 shows the structure of the vehicle prediction model based on the BP neural network. The left diagram shows the learning procedure, while the right diagram shows the prediction procedure, and v * (t + k + 1) indicates the final results of the prediction. The parameters of the BP model used in this paper are listed in Table 4. is re-updated by the error layer-by-layer until the error falls within an acceptable range. Figure 5 shows the structure of the vehicle prediction model based on the BP neural network. The left diagram shows the learning procedure, while the right diagram shows the prediction procedure, and * ( + + 1) indicates the final results of the prediction. The parameters of the BP model used in this paper are listed in Table 4.

A Closed-Loop Vehicle Speed Prediction System
The prediction models, as mentioned above, can rely on the predicted road driving conditions; it remains necessary to improve the accuracy of prediction models. By analyzing the characteristics of each prediction model, it can be found that a potential solution is to explore effective prediction methods, which can incorporate their intrinsic advantages while compensating for the drawbacks of each other. Therefore, a novel closed-loop vehicle speed prediction system based on APSO-LSSVM and BP neural network was proposed, as shown in Figure 6. The details are shown below.

A Closed-Loop Vehicle Speed Prediction System
The prediction models, as mentioned above, can rely on the predicted road driving conditions; it remains necessary to improve the accuracy of prediction models. By analyzing the characteristics of each prediction model, it can be found that a potential solution is to explore effective prediction methods, which can incorporate their intrinsic advantages while compensating for the drawbacks of each other. Therefore, a novel closed-loop vehicle speed prediction system based on APSO-LSSVM and BP neural network was proposed, as shown in Figure 6. The details are shown below.
where represents the input vector of the vehicle speed predictive model; indicates the output vector; and and denote the number of the input and output vector, respectively. For the nonlinear system, the system output is ( ) when the input control variable is ( ). With the history vehicle speed substituted into the LSSVM prediction model, the estimated output of the system can be obtained as * ( ). In order to optimize system input ( + 1), the output value of the system * ( + 1) is estimated. Due to noise interference or model mismatch and other reasons, however, it is common for deviation to occur between the predicted model output * ( ) and the actual output ( ). The prediction deviation at time can be written as ( ) = ( ) − * ( ). BP-NN was adopted to establish a nonlinear fitting relationship between the predicted value * ( + 1) and the deviation ( ), thus achieving feedback correction of the predicted value. The correction function is expressed as Equation (14). Then, APSO was used to calculate the minimum value of the fitness function, as shown in Equation (16). Then, the best and best Based on the proposed method, the nonlinear prediction model is established, as shown in Equation (15): where x represents the input vector of the vehicle speed predictive model; y indicates the output vector; and n x and n y denote the number of the input and output vector, respectively. For the nonlinear system, the system output is y(k) when the input control variable is x(k). With the history vehicle speed substituted into the LSSVM prediction model, the estimated output of the system can be obtained as y * (k). In order to optimize system input x(k + 1), the output value of the system y * (k + 1) is estimated. Due to noise interference or model mismatch and other reasons, however, it is common for deviation to occur between the predicted model output y * (k) and the actual output y(k). The prediction deviation at time k can be written as e(k) = y(k) − y * (k). BP-NN was adopted to establish a nonlinear fitting relationship between the predicted value y * (k + 1) and the deviation e(k), thus achieving feedback correction of the predicted value. The correction function is expressed as Equation (14). Then, APSO was used to calculate the minimum value of the fitness function, as shown in Equation (16). Then, the best γ and best σ were obtained to support the LS-SVM predictive model. Processing was repeated until the minimum fitness was achieved. Considering a conflict between the toolbox of BP and LSSVM in the MATLAB, the command of 'addpath' and 'rmpath' should be a looping execution for avoiding wrong pauses in operation.
The predictive control algorithm based on APSO LSSVM and BPNN involves the following steps: Calculation of the fitness functions and updating the best parameters by APSO algorithm. The parameters γ and σ of LSSVM are set as the position vectors of the particles in the PSO. The fitness value of each particle is calculated using Equation (16), while the individual optimal p id and global optimal p gd of the particle are compared and updated; 5.
Update the velocity and position. Use Equation (10) to recalculate the velocity and position of the particles; 6.
Randomly mutate position. Calculate the similarity between each particle x id and the optimal particle p gd , with the particle position randomly mutated according to Equation (12); 7.
Compared and update. Perform comparison with the fitness of each particle and update the optimal value of the particle p id and p gd ; 8.
APSO algorithm termination criteria. If the number of iterations is smaller than the set maximum value or the error parameter is lower than the set error value, the best output parameters γ and σ should be acted on LSSVM model. Then, the BP-NN output is treated as the prediction result. Otherwise, revert to step 4 until the end of the control.

Energy Management Strategy (EMS) with Speed Prediction
In order to meet the demands of driver power while simultaneously achieving the optimum vehicle fuel economy, EMS must be designed to adjust the distribution of power between the fuel cell engine and the battery electrical energy at any time under the realworld road conditions. Combined with closed-loop vehicle speed prediction, an equivalent fuel consumption minimization strategy (ECMS) was introduced in this section to achieve the optimum fuel economy.
Based on Pontryagin's maximum principle (PMP) [34], EMCS is a local real-time optimization method that can be applied to convert electric energy consumption into equivalent hydrogen fuel consumption by using an equivalent factor when the global driving condition is unknown. On the basis of meeting the constraints of the fuel cell hybrid power system, the instantaneous equivalent fuel consumption of the fuel cell hybrid power system can be minimized. The core idea of PMP is to make the optimal control variable satisfy the Hamiltonian function that is minimized. The Hamiltonian function can be defined as Equation (17): where H(SOC, P b , λ, t) represents hydrogen consumption, which involves equivalent hydrogen consumption by the fuel cell and battery, SOC refers to the state of charge of the battery, which is the state variable, P b stands for the power of battery, which is control variable, λ denotes the co-state, . m H 2 indicates the hydrogen consumption rate by fuel cell, . m b represents the equivalent hydrogen consumption rate by battery, f (SOC(t) and P b (t)) represents a function of the state variable (SOC) and the control variable (P b ), which can be expressed as Equation (18): where E indicates the open circuit voltage of battery, R b denotes internal resistance, η b represents the battery efficiency and Q b refers to the capacity of the battery. Both . m H 2 and . m b have an energy conversion relationship with power, which can be expressed as Equation (19): (19) where P dem indicates the driver's demand power, η DC refers to the DCDC efficiency, η f c denotes the fuel cell engine efficiency, LHV is the low heat value of the hydrogen and LHV = 120 MJ/kg.
According to the principle of PMP, the optimal control sequence with constraint conditions can be formulated as Equation (20): where SOC tf refers to the terminal state of the battery, SOC t0 denotes the initiate state of battery, P f c indicates the power of the fuel cell engine power, ∆P f c denotes the rate of the fuel cell power change and min and max stand for the minimum and maximum values of the corresponding parameters, respectively. The partial derivatives of SOC and λ can be expressed as Equation (21).
In order to resolve the nonlinear optimization problem as mentioned above, the dynamic programming (DP) algorithm based on the Behrman optimization principle is employed. The process of DP is detailed in Figure 7. Herein, s indicates the state variable (SOC), u denotes the control variable (P b ) and J * N−k (s(k)) refers to the cost function of the k-th step time, which can be calculated by Equation (17). In order to resolve the nonlinear optimization problem as mentioned above, the dynamic programming (DP) algorithm based on the Behrman optimization principle is employed. The process of DP is detailed in Figure 7. Herein, s indicates the state variable (SOC), u denotes the control variable ( ) and − * ( ( )) refers to the cost function of the k-th step time, which can be calculated by Equation (17).

Performance of Prediction Evaluation
In order to validate the novel closed-loop vehicle speed prediction system based on APSO-LSSVM and BP neural networks, simulation was performed with the assistance of MATLAB. The training sample sets are one of the six-day driving conditions, while the information collected on the other days is treated as the test sample sets for verifying the prediction effect. Figure 8 shows speed prediction results and prediction error of four methods, including BP-NN, LSSVM, APSO-LSSVM and the closed-loop prediction system based on APSO-LSSVM and BP-NN. In order to visualize the above prediction performance more intuitively, these images were partially enlarged, as shown in Figure 9. Table 5 shows the performances of these four methods in different time domains.

Performance of Prediction Evaluation
In order to validate the novel closed-loop vehicle speed prediction system based on APSO-LSSVM and BP neural networks, simulation was performed with the assistance of MATLAB. The training sample sets are one of the six-day driving conditions, while the information collected on the other days is treated as the test sample sets for verifying the prediction effect. Figure 8 shows speed prediction results and prediction error of four methods, including BP-NN, LSSVM, APSO-LSSVM and the closed-loop prediction system based on APSO-LSSVM and BP-NN. In order to visualize the above prediction performance more intuitively, these images were partially enlarged, as shown in Figure 9. Table 5 shows the performances of these four methods in different time domains.  The red line in Figure 8 indicates the reference vehicle's speed, while the blue and black lines represent prediction results and absolute value of the prediction error, respectively. Upon a comparison between (a) and (b), it can be found that BP-NN has more significant errors than LSSVM. Obviously, the LSSVM prediction model had higher accuracy when the vehicle was in the deceleration phase (259 s-288 s), which indicates that LSSVM exhibited greater sensitivity to the change in speed. Distinctly, the BP neural network prediction model produced a better effect when the vehicle was in the fluctuation phase (800 s-864 s), indicating that BP neural network performed better in fitting  The red line in Figure 8 indicates the reference vehicle's speed, while the blue and black lines represent prediction results and absolute value of the prediction error, respectively. Upon a comparison between (a) and (b), it can be found that BP-NN has more significant errors than LSSVM. Obviously, the LSSVM prediction model had higher accuracy when the vehicle was in the deceleration phase (259 s-288 s), which indicates that LSSVM exhibited greater sensitivity to the change in speed. Distinctly, the BP neural network prediction model produced a better effect when the vehicle was in the fluctuation phase (800 s-864 s), indicating that BP neural network performed better in fitting given the local variation. Thus, it can be judged that both of the prediction models have the advantages of their own. As for the overall effect of the error simulation, however, LSSVM algorithm had a less significant error, suggesting better generalization ability than the BP neural network. Figure 8c shows APSO-LSSVM optimization results. Upon a comparison between Figure 8b,c, it can be found that the effect of error simulation is basically the same. Both of them can follow the reference speed strictly. Figure 8d presents a diagram showing closed-loop vehicle speed prediction effects. Compared with other diagrams, it can be clearly observed that the predicted curve almost overlaps with the reference curve, with the error falling below 1 km/h. By comparing high-speed area with the low-speed area, it can be discovered that the accuracy of high-speed predictions is higher than the low-speed predictions in all methods and all vehicle speed horizons, which is attributed to the fact that low-speed conditions are mostly caused by external environmental restrictions, which result in highly complex calculations and lower accuracy of the prediction. Therefore, it can be concluded that the accuracy of the prediction by BP-NN is the worst among all methods. The novel closed-loop vehicle speed prediction system has better generalization ability than others, while there is no significant prediction accuracy difference between LSSVM and APSO-LSSVM. Figure 9 shows a partial enlargement of the images. The number ranging from one to five represents the reference speed, the BP neural network, the LSSVM, the APSO LSSVM and the APSO LSSVM and BP NN, respectively. As shown in the figure, BP-NN has a strong capability of training prediction as the speed changes. The detailed view of LSSVM and APSO-LSSVM has more regular prediction results compared with BP-NN, which is due to the fact that they belong in supervised learning. The novel closed-loop vehicle speed prediction system can master acceleration variations of the vehicle more precisely and is more sensitive to changes in speed, which results in smoother prediction curves than compared to other methods. It can be concluded that not only does the novel closed-loop system perform better in generalization ability, it also reduces the range of fluctuation for the error than compared to others prediction models. That is to say that the proposed prediction model can improve prediction accuracy by incorporating the advantages of the single model and compensating for the weakness of each other.
The difference in time domain of prediction has a significant impact on the accuracy of prediction. Therefore, in order to further evaluate the accuracy of prediction and the training time for these four methods, the evaluation indexes of the parameters in different time domains of prediction were compared, as shown in Table 5. According to the horizontal comparison performed in the first set of the predictions, the MAE in the BPNN, LSSVM and the APSO LSSVM prediction model within 5 s is 1.011 km/h, 0.9243 km/h and 0.923 km/h, respectively. Comparatively, it is 0.714 km/h in the closed-loop vehicle speed prediction system, which indicates the better generalization ability of the proposed method than others. Relative to RMSE performance, the closed-loop prediction model achieves an improvement by 30%, 23% and 23%, respectively. By comparison with training times, it can be discovered that BPNN requires a longer training time due to the slow pace of convergence. Moreover APSO-LSSVM can produce a better performance, and eliminates the risk of lengthiness and blindness encountered by the conventional cross-validation method. Statistically, the proposed method takes 15 min, which is 30% shorter than BPNN. As revealed by a longitudinal comparison in the closed-loop system, with the increase in time domain, the error increases progressively. Meanwhile, the cost of the training time increases as well, which is because the increasing model output quantity results in complex processes of model training.

Simulation for EMS
The simulation of EMS validation was conducted on the Matlab/Simulink platform. In this paper, a DP-based EMS and the ECMS-based EMS with the vehicle speed prediction methods of APSO-LSSVM, BP-NN and a closed-loop prediction system were constructed. Figure 10 show driving speed and driving distance. Figure 11 shows the state of charge SOC. Figure 12 shows the changes in equivalent hydrogen fuel consumption. Table 6 lists the results of EMS simulation.
In this paper, a DP-based EMS and the ECMS-based EMS with the vehicle speed prediction methods of APSO-LSSVM, BP-NN and a closed-loop prediction system were constructed. Figure 10 show driving speed and driving distance. Figure 11 shows the state of charge SOC. Figure 12 shows the changes in equivalent hydrogen fuel consumption. Table 6 lists the results of EMS simulation.   quantity results in complex processes of model training.

Simulation for EMS
The simulation of EMS validation was conducted on the Matlab/Simulink platform. In this paper, a DP-based EMS and the ECMS-based EMS with the vehicle speed prediction methods of APSO-LSSVM, BP-NN and a closed-loop prediction system were constructed. Figure 10 show driving speed and driving distance. Figure 11 shows the state of charge SOC. Figure 12 shows the changes in equivalent hydrogen fuel consumption. Table 6 lists the results of EMS simulation.       Figure 10 shows speed and distance, from which it can be observed that the driving distance is 16.49 km. Figure 11 shows the state of charge. Obviously, the SOC trajectory of DP-EMS is based on a global optimization algorithm for the global planning of power usage, in addition to the optimal SOC trajectory, is obtained, with a relatively slight variation. In contrast, other methods alternately utilize the charge depleting mode and the charge sustaining mode, which is attributed to the fewer global information about the driving cycle. Closed-loop-based EMS and APSO-LSSVM-based EMS show a gentle curve when the fuel cell engine runs with maximum efficiency. Since BPNN-based EMS has a relatively large variation, there is a nearly linear decrease. As can be observed in Figure 12 and Table 6, with a global optimal algorithm used, DP achieves the best hydrogen economy with an equivalent fuel consumption of only 10.5 kg/100 km. The closed-loop vehicle speed prediction system based ECMS, which has the best accuracy of the prediction, achieved an equivalent fuel consumption of 11.23 kg/100 km, which is 6.95% higher than the DP algorithm and decreased by 5.6~10.9% compared with the low accuracy of speed prediction. Since BP-NN performs worst in speed prediction, the equivalent fuel consumption is 12.6 kg/100 km, and the APSO-LSSVM is better than BP-NN, with an equivalent fuel consumption of 11.9 kg/100 km.

Conclusions
In this paper, a novel closed-loop vehicle speed prediction system based on the APSO-LSSVM and BP NN was proposed to improve the EMS of the fuel cell hybrid heavy truck. Firstly, with the fixed route of a special truck operated by a company in Shanghai as the research object, vehicle driving cycle information was collected from the Internet of Vehicles platform. Then, a wavelet filtering algorithm was applied for the purpose of data denoising. Afterwards, the advantages of APSO-LSSVM and BP neural network were incorporated to design the closed-loop vehicle speed prediction model. Furthermore, ECMS was conducted to verify fuel economy. Finally, simulation was conducted using different methods, which resulted in results suggesting that RMSE performance of the closed-loop vehicle speed prediction system is 0.831 km/h within 5 s, which is more than 20% higher than others. Moreover, the training time is 15 min within 5 s, which is superior to BPNN. In addition, with the time domain increasing, the error increases as well. While the accuracy of prediction decreases. Furthermore, the equivalent hydrogen fuel consumption increases by only 6.95% when compared with the dynamic-programming algorithm and decreased by 5.6~10.9% when compared with the low accuracy of speed prediction. In summary, the closed-loop system intended for vehicle speed prediction model can take full advantage of the BP neural network and APSO LSSVM while compensating for the defects of each other, which is essential for vehicle speed prediction and energy optimization of the FCHV.
In the future, more deep-learning models intended for vehicle speed prediction will be combined to further improve the accuracy of prediction and reduce training time.