An Energy Consumption Prediction Method for Electric Buses Based on Feature Analysis and Machine Learning
By using feature analysis and machine learning methods to screen energy consumption-related features of electric buses and combining multiple model training methods, the problem of incomplete or cumbersome feature extraction in existing technologies has been solved, achieving accurate prediction and universal applicability of energy consumption for electric buses.
Patent Information
- Application Number
- CN202311664868.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-06
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2043-12-06
AI Technical Summary
Existing technologies for predicting the energy consumption of electric buses suffer from incomplete or complex feature extraction, resulting in unsatisfactory prediction results. Furthermore, the models have limited applicability and cannot make accurate predictions before the trip begins.
By using feature analysis and machine learning methods, features with high correlation to energy consumption are selected. The feature selection is carried out using the inflation factor (VIF) and stepwise regression algorithm. Combined with multiple machine learning models, an energy consumption prediction model for electric buses is trained, taking into account traffic conditions, environment, vehicle status and driver behavior, to achieve accurate prediction of energy consumption.
It improves the accuracy and universality of energy consumption prediction for electric buses, enabling accurate prediction of energy consumption before the trip begins, simplifying the feature extraction process, and eliminating reliance on specialized knowledge.
Smart Images

Figure CN117851806B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electric vehicle energy consumption monitoring technology, specifically involving a method for predicting the energy consumption of electric buses based on feature analysis and machine learning. Background Technology
[0002] With the increasing prevalence of electric buses, their energy consumption characteristics, which differ significantly from traditional buses, are attracting growing attention. Currently, existing research on energy consumption prediction for electric buses can be categorized into rule-based methods and data-driven methods, based on their model construction approaches. Rule-based methods require dynamic simulation modeling of the vehicle's operation, demanding expertise in vehicle dynamics. Furthermore, the parameters used in dynamic modeling vary considerably depending on the vehicle model and operating environment. While this method can achieve good results under specific conditions, it suffers from significant limitations in general applicability. For example, Chinese patent application CN115730746A discloses a method for predicting the travel energy consumption of electric vehicles based on vehicle model parameter determination and vehicle dynamics model construction. The biggest drawback of this method is the significant differences in the constructed vehicle dynamics models for different vehicle models, resulting in models applicable only to specific scenarios and exhibiting considerable limitations. Data-driven methods, on the other hand, eliminate the need for expertise in vehicle dynamics and instead utilize extensive historical vehicle operating data to extract energy consumption-related information. This information is then used to train a regression model, thereby enabling energy consumption prediction. However, most existing technologies belonging to this category suffer from incomplete feature extraction or complex features, resulting in less than ideal prediction results. For example, Chinese patent application CN115759347A discloses a method for rapid prediction of electric bus trip energy consumption based on feature data. Although this method considers the impact of traffic conditions and driver behavior on the energy consumption of electric vehicles, it ignores the impact of air conditioning use and weather conditions on energy consumption. Furthermore, this method can only estimate the energy consumption of electric buses after the trip is over and cannot predict the energy consumption of the entire trip before it begins. Summary of the Invention
[0003] In view of this, and to address the technical problems existing in this field, the present invention provides a method for predicting the energy consumption of electric buses based on feature analysis and machine learning, specifically including the following steps:
[0004] Step 1: Consider the impact of traffic conditions, environment, vehicle status and driver behavior on the energy consumption of electric buses during their trips, and select and extract several features corresponding to each aspect from the historical operation data of electric buses in each trip.
[0005] Step 2: Use the inflation factor (VIF) test to initially screen the features extracted in Step 1, retaining those features that are highly correlated with energy consumption; in the process of calculating the VIF of each feature, specifically based on other extracted features and using the least squares regression method to interpret the feature.
[0006] The stepwise regression algorithm is used to further filter the features obtained from the initial screening. In each iteration, the algorithm selects the feature that contributes the most to the energy consumption rate prediction from the feature set of the initial screening, adds it to the output feature set, and deletes the feature from the feature set of the initial screening. Then, it enters the next iteration until all features in the feature set of the initial screening have no contribution to the energy consumption rate prediction or have a negative effect. At this point, the final filtered feature set is output and the algorithm stops.
[0007] Step 3: For each trip of the electric bus, directly extract the features that can be obtained directly or indirectly from the feature set, and predict the features that cannot be obtained directly or indirectly from the feature set by selecting appropriate methods respectively.
[0008] Step 4: Select multiple machine learning models to establish energy consumption prediction models for electric buses, and train them using the feature data obtained in Step 3; evaluate the energy consumption prediction effect of each trained model, and determine the best model to predict the energy consumption of the electric bus trip before it begins.
[0009] Furthermore, the features extracted in step one specifically include: time, congestion level, average speed, month, week, and total travel time characteristics corresponding to traffic conditions; travel distance, route name, driving direction, outside temperature, inside temperature, and temperature difference between inside and outside the vehicle characteristics corresponding to the environment; air conditioning status and initial SOC characteristics corresponding to vehicle status; and average acceleration, average acceleration / deceleration, and driver ID corresponding to driver behavior.
[0010] Furthermore, the VIF for each feature in step two is specifically calculated based on the following formula:
[0011]
[0012] Among them, R 2 The coefficient of determination is the regression coefficient for multiple explanatory variables.
[0013] During the initial screening, only features with a VIF less than 10 are retained.
[0014] When using the stepwise regression algorithm to further screen the initial feature set, the XGBoost algorithm is specifically used as the feature evaluation model, and MAPE with 5-fold cross-validation is used as the evaluation index of the XGBoost algorithm results.
[0015] Furthermore, in step three, the following predictions are made for the three characteristics of the electric bus trip that cannot be directly or indirectly obtained: air conditioning status, congestion level, and average speed:
[0016] a. Based on the characteristics of the air conditioning status, the air conditioning status at the beginning of each trip is used as the predicted air conditioning status for the entire trip.
[0017] b. Based on the characteristics of congestion levels, firstly, four levels are divided: smooth traffic, slow traffic, congestion, and severe congestion. Then, the corresponding level is determined by the congestion prediction released by map software.
[0018] c. For the average velocity feature, use it as the model output, and use other features that can be obtained directly or indirectly as the model input, and use a machine learning model based on the XGBoost algorithm to make predictions.
[0019] Furthermore, the electric bus energy consumption prediction model established in step four based on machine learning algorithms is specifically used to predict the trip energy consumption rate, and its definition is as follows:
[0020]
[0021] Among them, E c This refers to energy efficiency, measured in kWh / km, E. BMS This refers to the total energy consumption of the trip recorded by the BMS system, which can be directly obtained from the vehicle trip energy consumption data, and the unit is kWh or L. travel This is the distance traveled, in kilometers.
[0022] The selected machine learning algorithms include: multiple linear regression, support vector regression, random forest, multilayer perceptron, XGBoost, and LightGBM; MAPE, RMSE, and MAE are used as evaluation metrics for each trained model, and their definitions are as follows:
[0023]
[0024]
[0025]
[0026] Where N is the total number of trips, y i Let be the actual energy consumption rate of the i-th trip. Let be the predicted energy consumption rate for the i-th trip.
[0027] The electric bus energy consumption prediction method based on feature analysis and machine learning provided by this invention comprehensively considers multiple features that may affect the energy consumption of bus trips. It performs two rounds of feature selection by sequentially executing the VIF test and stepwise regression, and then uses the selected features to train various machine learning models. The optimal model is obtained by evaluating the training effect and used for electric bus trip energy consumption prediction. This method effectively overcomes the shortcomings of incomplete or overly complex feature extraction in existing technologies, and eliminates the dependence on professional knowledge. The feature extraction process is relatively simple and can accurately represent bus trip energy consumption. The multi-round selection and evaluation process of the model algorithm also greatly improves the accuracy of energy consumption prediction. Attached Figure Description
[0028] Figure 1 This is a general flowchart of the method provided by the present invention;
[0029] Figure 2 This is a flowchart of the feature selection process based on the stepwise regression algorithm. Detailed Implementation
[0030] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0031] The energy consumption prediction method for electric buses based on feature analysis and machine learning provided in this invention, such as... Figure 1 As shown, the specific steps include:
[0032] Step 1: Consider the impact of traffic conditions, environment, vehicle status and driver behavior on the energy consumption of electric buses during their trips, and select and extract several features corresponding to each aspect from the historical operation data of electric buses in each trip.
[0033] Step 2: Use the inflation factor (VIF) test to initially screen the features extracted in Step 1, retaining those features that are highly correlated with energy consumption; in the process of calculating the VIF of each feature, specifically based on other extracted features and using the least squares regression method to interpret the feature.
[0034] The stepwise regression algorithm is used to further filter the features obtained from the initial screening. In each iteration, the algorithm selects the feature that contributes the most to the energy consumption rate prediction from the feature set of the initial screening, adds it to the output feature set, and deletes the feature from the feature set of the initial screening. Then, it enters the next iteration until all features in the feature set of the initial screening have no contribution to the energy consumption rate prediction or have a negative effect. At this point, the final filtered feature set is output and the algorithm stops.
[0035] Step 3: For each trip of the electric bus, directly extract the features that can be obtained directly or indirectly from the feature set, and predict the features that cannot be obtained directly or indirectly from the feature set by selecting appropriate methods respectively.
[0036] Step 4: Select multiple machine learning models to establish energy consumption prediction models for electric buses, and train them using the feature data obtained in Step 3; evaluate the energy consumption prediction effect of each trained model, and determine the best model to predict the energy consumption of the electric bus trip before it begins.
[0037] In a preferred embodiment of the present invention, the features extracted in step one specifically include: time, congestion level, average speed, month, day of the week, and total travel time characteristics corresponding to traffic conditions; travel distance, route name, driving direction, outside temperature, inside temperature, and temperature difference between inside and outside the vehicle characteristics corresponding to the environment; air conditioning status and initial SOC characteristics corresponding to vehicle status; and average acceleration, average acceleration / deceleration, and driver ID corresponding to driver behavior. Detailed definitions of each feature are shown in Table 1 below:
[0038] Table 1 shows the 17 extracted features and their definitions.
[0039]
[0040] Most of the features mentioned above are extracted from real-time vehicle data, while some are directly obtained from vehicle trip energy consumption data, such as time, month, day of the week, route length, direction of travel, route name, and driver ID. All 17 extracted features were added to the corresponding trip energy consumption data. Time, vehicle / indoor temperature difference, and air conditioning status require further explanation. Time refers to the time at the start of the trip, accurate to the hour; vehicle / indoor temperature difference refers to the temperature difference between the inside and outside of the vehicle at the start of the trip; air conditioning status refers to the air conditioning's on / off status during the trip, indicated by 1 in the data table when the air conditioning is on, and 0 when the air conditioning is off. Adding the energy consumption rate to the trip energy consumption data results in the dataset format shown in Table 2.
[0041] Table 2 shows an example of a dataset containing 17 features. In a preferred embodiment of the present invention, the VIF of each feature in step 2 is specifically calculated based on the following formula:
[0042]
[0043] where R 2 is the coefficient of determination of the auxiliary regression of multiple explanatory variables; the calculated VIF of each feature is shown in Table 3 below:
[0044] Table 3 VIF of each feature
[0045] It is generally accepted that 0<VIF<5 indicates no collinearity, 5<VIF<10 indicates weak multicollinearity, 10<VIF<100 indicates moderate collinearity, and VIF>100 indicates strong collinearity. In the preliminary screening of this embodiment, only features with a VIF less than 10 are retained, and the following 13 features are obtained: travel distance, day of week, direction, initial SOC, time, air conditioning state, driver ID, total travel time, average speed, route name, congestion level, month, and temperature difference between inside and outside the vehicle.
[0046] When the stepwise regression algorithm is used to re-screen the initially screened feature set, the XGBoost algorithm is specifically adopted as the feature evaluation model, and the MAPE of 5-fold cross-validation is used as the evaluation index for the result of the XGBoost algorithm. The execution process of the stepwise regression algorithm is as Figure 2 shown.
[0047] In a preferred embodiment of the present invention, in step 3, the following predictions are respectively performed for the three features of air conditioning state, congestion level and average speed that cannot be directly or indirectly obtained during the travel of the electric bus:
[0048] a. For the air conditioning state feature, this variable characterizes the on-state of the air conditioning system during the entire trip. After statistics on more than 40,000 bus trips, it is found that trips with P=0 account for 97% of the samples where the air conditioning state is 0, and trips with P>0.9 account for 88% of the trips where the air conditioning state is 1 (P refers to the ratio of the air conditioning on-time to the total operation time of the trip in a single trip). That is to say, for most electric bus trips, the air conditioning system is either always on or always off. Therefore, the air conditioning on-state at the start of each trip is taken as the predicted air conditioning on-state for the entire trip;
[0049] b. For the congestion level feature, four levels of unobstructed, slow-moving, congested and severely congested are first divided, and then the corresponding one of the four levels is determined through the congestion prediction released by map software such as Baidu Maps;
[0050] c. For the average speed feature, it is used as the model output. Other features that can be obtained directly or indirectly, such as travel distance, driving direction, time, month, weekday, temperature difference between inside and outside the vehicle, outside temperature, route name and driver ID, are used as model inputs and predicted using a machine learning model based on the XGBoost algorithm.
[0051] The electric bus energy consumption prediction model established in step four based on machine learning algorithms is specifically used to predict the trip energy consumption rate, and its definition is as follows:
[0052]
[0053] Among them, E c This refers to energy efficiency, measured in kWh / km, E. BMS This refers to the total energy consumption of the trip recorded by the BMS system, which can be directly obtained from the vehicle trip energy consumption data, and the unit is kWh or L. travel This is the distance traveled, in kilometers.
[0054] The selected machine learning algorithms include: multiple linear regression, support vector regression, random forest, multilayer perceptron, XGBoost, and LightGBM; MAPE, RMSE, and MAE are used as evaluation metrics for each trained model, and their definitions are as follows:
[0055]
[0056]
[0057]
[0058] Where N is the total number of trips, y i Let be the actual energy consumption rate of the i-th trip. Let be the predicted energy consumption rate for the i-th trip.
[0059] Furthermore, to prevent overfitting and ensure the stability of the results, this embodiment employed 10-fold cross-validation when evaluating the model's prediction performance, repeating it 10 times. The average of the 10 10-fold cross-validation results was used as the final evaluation metric for the model. Ultimately, XGBoost was confirmed as the optimal machine learning model for predicting the energy consumption rate of electric buses, achieving accurate prediction of bus trip energy consumption before the start of the trip.
[0060] It should be understood that the sequence number of each step in the embodiments of the present invention does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0061] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for predicting the energy consumption of electric buses based on feature analysis and machine learning, characterized in that: Specifically, the following steps are included: Step 1: Consider the impact of traffic conditions, environment, vehicle status and driver behavior on the energy consumption of electric buses during their trips, and select and extract several features corresponding to each aspect from the historical operation data of electric buses in each trip. Step 2: Use the VIF test to initially screen the features extracted in Step 1, retaining those features that are highly correlated with energy consumption; in the process of calculating the VIF of each feature, specifically based on other extracted features and using the least squares regression method to interpret the feature. The stepwise regression algorithm is used to further filter the features obtained from the initial screening. In each iteration, the algorithm selects the feature that contributes the most to the energy consumption rate prediction from the feature set of the initial screening, adds it to the output feature set, and deletes the feature from the feature set of the initial screening. Then, it enters the next iteration until all features in the feature set of the initial screening have no contribution to the energy consumption rate prediction or have a negative effect. At this point, the final filtered feature set is output and the algorithm stops. Step 3: For each trip of the electric bus, directly extract the features that can be obtained directly or indirectly from the feature set, and predict the features that cannot be obtained directly or indirectly from the feature set by selecting appropriate methods respectively. Step 4: Select multiple machine learning models to establish energy consumption prediction models for electric buses, and train them using the feature data obtained in Step 3; verify and evaluate the energy consumption prediction effect of each trained model, and determine the best model to predict the energy consumption of the electric bus trip before the trip begins.
2. The method as described in claim 1, characterized in that: The features extracted in Step 1 specifically include: time, congestion level, average speed, month, week, and total travel time characteristics corresponding to traffic conditions; travel distance, route name, driving direction, outside temperature, inside temperature, and temperature difference between inside and outside the vehicle characteristics corresponding to the environment; air conditioning status and initial SOC characteristics corresponding to vehicle status; and average acceleration, average acceleration / deceleration, and driver ID corresponding to driver behavior.
3. The method as described in claim 1, characterized in that: In step two, the VIF of each feature is calculated based on the following formula: Among them, R 2 The coefficient of determination is the regression coefficient for multiple explanatory variables. During the initial screening, only features with a VIF less than 10 are retained. When using the stepwise regression algorithm to further screen the initial feature set, the XGBoost algorithm is specifically used as the feature evaluation model, and MAPE with 5-fold cross-validation is used as the evaluation index of the XGBoost algorithm results.
4. The method as described in claim 1, characterized in that: In step three, the following predictions are made for the three characteristics of the electric bus that cannot be directly or indirectly obtained during its journey: air conditioning status, congestion level, and average speed. a. Based on the characteristics of the air conditioning status, the air conditioning status at the beginning of each trip is used as the predicted air conditioning status for the entire trip. b. Based on the characteristics of congestion levels, firstly, four levels are divided: smooth traffic, slow traffic, congestion, and severe congestion. Then, the corresponding level is determined by the congestion prediction released by map software. c. For the average velocity feature, use it as the model output, and use other features that can be obtained directly or indirectly as the model input, and use a machine learning model based on the XGBoost algorithm to make predictions.
5. The method as described in claim 1, characterized in that: The electric bus energy consumption prediction model established in step four based on machine learning algorithms is specifically used to predict the trip energy consumption rate, and its definition is as follows: Among them, E c This refers to the energy efficiency, E. BMS This refers to the total energy consumption of the trip recorded by the BMS system, L travel It is the length of the journey; The selected machine learning algorithms include: multiple linear regression, support vector regression, random forest, multilayer perceptron, XGBoost, and LightGBM; MAPE, RMSE, and MAE are used as evaluation metrics for each trained model, and their definitions are as follows: Where N is the total number of trips, y i Let be the actual energy consumption rate of the i-th trip. Let be the predicted energy consumption rate for the i-th trip.
Citation Information
Patent Citations
Method for predicting energy consumption required for electric vehicle to run on actual road
CN115730746A
Electric bus travel energy consumption rapid prediction method based on characteristic data
CN115759347A
Energy consumption analysis and optimization method for oil and gas gathering and transportation system
CN113379093A
Process industry quality data prediction algorithm based on model pool
CN114186878A
