Energy consumption prediction and optimization method and system based on interpretive machine learning

An interpretable machine learning method is used to interpret the energy consumption model of electric buses. An energy consumption prediction and optimization system is built using low-resolution data, which solves the problems of high data collection cost and poor model interpretability, and realizes energy consumption optimization decision support.

CN121745778APending Publication Date: 2026-03-27HEFEI UNIV OF TECH
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-15
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing energy consumption prediction models for electric buses suffer from high data collection costs, poor model interpretability, and an inability to effectively support energy consumption optimization decisions.

Method used

By using interpretable machine learning methods, Shapley values ​​and local dependency graphs are used to interpret various preset models of electric buses, and an energy consumption prediction and optimization system is constructed. Simulations are performed based on low-resolution historical data to generate an energy consumption dataset. Operating scenarios are generated through full factorial experimental design, and the optimal hyperparameters are determined using grid search and cross-validation to construct the energy consumption prediction and optimization system.

Benefits of technology

While reducing data collection costs, it improves the interpretability and reliability of the model, provides energy consumption optimization decision support, and expands the application scope of the model.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The invention relates to the field of electric vehicle energy consumption prediction, in particular to an energy consumption prediction and optimization method and system based on explanatory machine learning, and the method comprises the steps: presetting a plurality of working condition characteristic parameters based on historical data of an electric bus; constructing an energy consumption data set of the electric bus in various scenes based on the working condition characteristic parameters; training a plurality of preset models based on the energy consumption data set to obtain a plurality of energy consumption prediction models; explaining the plurality of energy consumption prediction models based on an explanatory machine learning method to obtain contribution information of each working condition characteristic parameter to energy consumption; and an energy consumption prediction system and an energy consumption optimization system are constructed based on the contribution information, and the problems that in the prior art, the data collection cost is high, the model interpretability is poor, and energy consumption optimization decisions cannot be effectively supported can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of electric vehicle energy consumption prediction, in particular, to an energy consumption prediction and optimization method and system based on interpretive machine learning. BACKGROUND

[0002] The energy consumption of electric buses is influenced by a variety of variables related to the working conditions and the vehicle itself. To achieve accurate energy consumption prediction, existing technologies mainly propose the following categories of solutions: The first category is based on physical models. For example, in the Chinese patent application with publication number CN116956568A, an energy consumption model is established through a vehicle longitudinal dynamics model, and recursive least squares method is used for online parameter identification. Although this method has strong interpretability, it has high modeling cost and is difficult to accurately depict the influence of all complex variables (such as environment, driving behavior) through formulas.

[0003] The second category is based on data-driven machine learning models. For example, in the Chinese patent applications with publication numbers CN117493843A and CN117493842A, historical operation data is used to perform energy consumption prediction through various machine learning algorithms (such as random forest, XGBoost). Although this type of method may have high prediction accuracy, the model is usually a "black box", i.e., only a mapping relationship between energy consumption and influencing variables is established, and the specific influence mechanism of different influencing factors on energy consumption cannot be revealed, making it difficult to use the prediction results for actual energy consumption reduction, route optimization, and driver training decisions. In addition, this type of method usually relies on high-frequency, high-precision real vehicle operation data for model training, which has high data collection costs and increases the burden on public transportation companies.

[0004] The third category of methods is based on similarity search of historical data. For example, in the Chinese patent application with publication number CN115759347A, the mean value of historical energy consumption is used as the prediction value by finding the historical data closest to the new trip characteristics. Although this method reduces the dependence on complex models, its prediction accuracy is heavily dependent on the coverage of historical data, and it also cannot provide in-depth insights into the energy consumption influence mechanism, making it difficult to effectively optimize.

[0005] In addition, although the Chinese patent application with publication number CN115952899B attempts to reduce the dependence on high-precision data based on general public transportation data specifications (such as GTFS), it is still essentially in the physical modeling category and is limited by the model itself, unable to explore complex influencing factors beyond the given physical formulas.

[0006] In summary, the data-driven energy consumption prediction model generally requires high-precision and high-frequency real vehicle operation and energy consumption data, which has high data collection cost. At the same time, although the data-driven model has improved prediction accuracy, it is limited by the characteristics of the black box model and cannot obtain the specific influence of different influencing factors on energy consumption, which limits its application in energy consumption reduction, route optimization and driver training. The third method, although it has broken away from the dependence on high-precision and high-frequency data, the physical modeling method has high cost, and the influence of some variables is complex, which cannot be modeled by formula and physical model. It is limited by the specified data characteristics. SUMMARY

[0007] In view of the defects in the prior art, the present application provides an energy consumption prediction and optimization method and system based on interpretive machine learning, which can solve the problems of high data collection cost, poor model interpretability and inability to effectively support energy consumption optimization decision in the prior art.

[0008] To solve the above technical problems, the present application is solved by the following technical solutions: An energy consumption prediction and optimization method based on interpretive machine learning, comprising: S1, presetting a plurality of working condition characteristic parameters based on historical data of electric buses; S2, constructing an energy consumption dataset of electric buses in multiple scenarios based on the working condition characteristic parameters; S3, training a plurality of preset models based on the energy consumption dataset to obtain a plurality of energy consumption prediction models; S4, interpreting the plurality of energy consumption prediction models based on an interpretive machine learning method to obtain contribution information of each working condition characteristic parameter to energy consumption; S5, constructing an energy consumption prediction system and an energy consumption optimization system based on the contribution information.

[0009] Through the present application, considering that most electric buses cannot obtain high-frequency operating condition data due to cost and equipment limitations, the present application models based on a low-resolution data set, simulates the energy consumption of electric buses on a simulation platform through simple and easily observable low-resolution operating conditions and environmental data, constructs a simulation data set, and obtains a prediction model between electric bus driving operating conditions and energy consumption through a data-driven method. Further, in order to break the black box feature of the previous energy consumption prediction model, i.e., the model cannot provide the prediction mechanism, the influence of various factors, the present application uses the interpretability method of machine learning, i.e., the combination of the Shapley value method and the local dependence graph method to explain the model results, obtains the specific influence relationship between variables and energy consumption, the importance ranking of features, the interactive influence relationship of multiple influencing factors on energy consumption, the mechanism of energy consumption prediction, and simultaneously constructs an energy consumption prediction system and an energy consumption optimization suggestion system to provide decision support for energy consumption optimization for electric bus companies and departments.

[0010] Preferably, S1 specifically comprises: Based on the historical data of the electric bus, a plurality of operating condition characteristic parameters are preset, and the historical data of the electric bus includes vehicle parameters, running parameters, road parameters and external parameters; Based on full-factorial experimental design, the plurality of operating condition characteristic parameters are combined at levels to generate a plurality of operating condition scenarios.

[0011] Through the present application, referring to previous modeling research, based on simple and easily observable variables, real-world data is used as the basis for variable level setting, full-factorial experimental design is used to obtain operating condition scenarios of different variables and their level combinations, and the observation of the public bus energy consumption scenario library is expanded.

[0012] Preferably, S2 specifically comprises: Based on the plurality of operating condition scenarios, the running of the electric bus in different operating condition scenarios is simulated through a simulation platform; The energy consumption values of the electric bus in the plurality of operating condition scenarios are calculated to construct an energy consumption data set.

[0013] Through the present application, the model is constructed in the simulation platform, the simulated electric bus model is constructed based on the simulation platform and the dynamics model, the variable level combinations set in the previous step are input, the energy consumption in different scenarios is calculated through the simulation platform, the energy consumption is expressed as the power consumption per kilometer, and the unit is kwh / km, and finally the energy consumption data set of the electric bus is obtained.

[0014] Preferably, S3 specifically comprises: Based on the energy consumption data set, a plurality of preset models are trained; Based on grid search and cross-validation, the optimal hyperparameter combination of each preset model is determined; Based on the preset performance index, the model with the best performance is determined from the trained multiple preset models as the energy consumption prediction model.

[0015] Through the present application, based on the data set of the simulated working condition and the predicted energy consumption obtained in the previous step, a data-driven method is used to construct the relationship between the working condition and the energy consumption. A variety of data-driven models can be selected as alternative models. Since most data-driven models have multiple hyperparameters, a multi-step grid search is used to obtain the best combination of hyperparameters in five-fold cross-validation as the hyperparameter setting of the data-driven model.

[0016] As a preferred, based on grid search and cross-validation, the optimal hyperparameter combination of each preset model is determined, including: For discrete hyperparameters, based on the preset discrete candidate set, the hyperparameter value with the best performance in cross-validation is determined; For continuous hyperparameters, based on the preset initial range and step size to form a candidate set, the hyperparameter value with the best performance in cross-validation is determined, and the range and step size are iteratively adjusted based on the value until the optimal hyperparameter value is determined.

[0017] As a preferred, S4 specifically includes: Based on the Shapley value method, the contribution value of each working condition feature parameter to the energy consumption is determined to obtain the feature importance ranking and the interaction between features; Based on the local dependence graph method, the influence relationship between each working condition feature parameter and the energy consumption is determined.

[0018] Through the present application,

[0019] As a preferred, based on the Shapley value method, the contribution value of each working condition feature parameter to the energy consumption is determined to obtain the feature importance ranking and the interaction between features, including: Based on the marginal contribution calculation and weighted average of the feature subset, the Shapley value of each working condition feature parameter is determined; Based on the Shapley value, the importance of each working condition feature parameter is ranked; Based on the interaction value calculation of the feature pair, the contribution of the interaction between any two working condition feature parameters to the energy consumption is determined.

[0020] Through the present application, the performance of different data-driven models is compared, and the best-performing data-driven model is selected as the target of the machine learning model to be explained. The Shapley value method is used to explain the importance of the features affecting the energy consumption, and the Shapley value method and the local dependence graph are used to explain the linear and nonlinear influence relationship between the affecting features and the energy consumption. The Shapley value method is used to explain the prediction process of the model.

[0021] As a preferred method, the influence relationship between characteristic parameters of each operating condition and energy consumption is determined based on the local dependency graph method, including: Select any operating condition feature as the observation operating condition feature, and confirm the value range of the corresponding observation operating condition feature parameter; Keeping other operating condition characteristic parameters unchanged, calculate the predicted energy consumption values ​​of the observed characteristic parameters under different values ​​based on the energy consumption prediction model; Based on the different values ​​of the characteristic parameters of the observed operating conditions and their corresponding predicted energy consumption values, the influence relationship between the characteristic parameters of the observed operating conditions and energy consumption is determined. Each operating condition characteristic is used as an observation characteristic in turn to determine the influence relationship between each operating condition characteristic parameter and energy consumption.

[0022] As a preferred option, S5 specifically includes: An energy consumption prediction system is constructed based on contribution information. The energy consumption prediction system is used to determine and return the corresponding energy consumption prediction value and the contribution value of each operating condition feature parameter to the energy consumption prediction value based on the specific operating condition feature parameters input by the user. Based on contribution information, an energy consumption optimization system is constructed. The energy consumption optimization system is used to determine and return the combination of operating condition characteristic parameters with the lowest energy consumption value within a range of partial operating condition characteristic parameters set by the user.

[0023] This invention uses the Shapley value method to calculate the predicted energy consumption for each scenario, as well as the contribution of each feature to the predicted energy consumption. The contribution value represents the influence. Simultaneously, the interaction effects between variables are calculated, ultimately forming an explanatory dataset. Based on this explanatory dataset, the system is constructed. The system includes two functions: First, the user selects a specific bus operating condition, and the system returns the predicted energy consumption for each condition, along with the contribution of each feature to energy consumption. Second, an optimization function: the user inputs a defined operating condition range, and the system returns the combination of feature values ​​that achieves the lowest energy consumption within that range, providing guidance for bus route design and driver training.

[0024] The present invention also provides an energy consumption prediction and optimization system based on interpretive machine learning for implementing the above method, comprising: The parameter preset module is used to preset multiple operating condition characteristic parameters based on historical data of electric buses. The dataset construction module is used to build energy consumption datasets for electric buses under various scenarios based on operating condition characteristic parameters; The model training module is used to train various preset models based on the energy consumption dataset to obtain various energy consumption prediction models; The model interpretation module is used to interpret various energy consumption prediction models based on interpretive machine learning methods, and obtain the contribution information of characteristic parameters of each operating condition to energy consumption. The system building module is used to build energy consumption prediction and energy consumption optimization systems based on contribution information.

[0025] This invention interprets a black-box energy consumption prediction model using interpretable machine learning methods. It analyzes the model from three levels: feature importance, the influence of features on energy consumption, and the model's energy consumption prediction process, thereby improving the model's interpretability, reliability, and application scope. The interpretation method used in this invention is model-independent, meaning it can be interpreted after the model is fully built, regardless of the preceding model construction methods. Therefore, any electric bus energy consumption prediction model already built based on existing data can be interpreted using the interpretation method provided by this invention, further enhancing its interpretability, reliability, and application scope. Based on the interpretation results of the data-driven model, this invention constructs an energy consumption prediction and optimization system for specific operating conditions, providing a reliable, trustworthy, and easy-to-operate tool for electric bus energy consumption prediction and optimization. This invention uses easily obtainable and observable variables and variable levels obtained from real-world operating conditions to conduct simulation experiments to obtain electric bus energy consumption, significantly reducing data collection costs for bus companies and expanding the scope of observable operating conditions.

[0026] The beneficial effects of this invention are as follows: 1. It can predict the energy consumption of electric vehicles with low data collection costs, i.e., only by collecting data on the level of external variables.

[0027] 2. It can break through the limitations of previous prediction models that could not be explained and whose prediction mechanisms were unclear. Through interpretable machine learning methods, it can explain the model from four aspects: the importance of features, the influence relationship of features, the interaction between features, and the prediction process of the model, which helps to improve the credibility and applicability of the model.

[0028] 3. It breaks through the limitation of previous interpretable models that could only interpret the model but could not provide guidance for energy consumption optimization. Through a user-friendly human-computer interaction system, it provides users with energy consumption optimization tools for electric buses under specific operating conditions, and the operation is simple. Detailed Implementation

[0029] To further understand the content of this invention, the invention will be described in detail with reference to the embodiments. It should be understood that the embodiments are merely illustrative and not limiting of the invention.

[0030] The difference between high-resolution and low-resolution data lies in three aspects: data collection frequency, collection granularity, and data volume. High-resolution data is collected frequently, even per second or more, over a short period, yielding continuous data points that provide detailed information about the bus's performance and operating conditions. Low-resolution data, on the other hand, is collected over longer time intervals, per minute or even longer. Due to the low frequency of data point recording, it provides a broad overview of each trip. This embodiment uses low-frequency data collection of driving and operating information for the entire trip, rather than high-frequency real-time data. Regarding collection granularity, high-resolution data captures changes in vehicle status and operating conditions every minute, while low-resolution data, due to its lower collection frequency, typically uses long-term aggregated data or averages. For example, the speed data used in this invention would require capturing the transient time and rapid changes in the driver's speed at each point in time if it were high-resolution data, whereas this invention uses the average speed over the entire driving process. In terms of data volume, high-resolution data requires substantial storage capacity and powerful data processing tools, making data management and analysis complex and resource-intensive. Low-resolution data, on the other hand, generates less data, making it easier to store, manage, and analyze. It requires less computing power and simpler data processing tools. For example, in this embodiment, one sample can represent a single driving condition, while high-resolution data requires multiple data points to depict the specific details of the driving condition. Therefore, for bus companies with limited resources such as cost and technology, low-resolution data collection is easier to implement and less costly, eliminating the need to install complex and expensive data collection equipment on the buses, making it more user-friendly.

[0031] This embodiment provides an energy consumption prediction and optimization method based on interpretive machine learning, which includes: S1, based on historical data of electric buses, preset multiple operating condition characteristic parameters; S2, based on operating condition characteristic parameters, constructs energy consumption datasets for electric buses under various scenarios; S3, based on the energy consumption dataset, trains multiple preset models to obtain multiple energy consumption prediction models; S4, based on interpretive machine learning methods, interprets various energy consumption prediction models to obtain information on the contribution of characteristic parameters of each operating condition to energy consumption; S5, based on contribution information, constructs an energy consumption prediction system and an energy consumption optimization system.

[0032] This embodiment addresses the limitation that most electric buses cannot obtain high-frequency operating condition data due to cost and equipment constraints. It proposes a modeling approach based on low-resolution datasets. By using simple, easily observable low-resolution operating condition and environmental data, the energy consumption of electric buses is simulated on a simulation platform, constructing a simulated dataset. A data-driven method is then used to obtain a predictive model of the relationship between variables such as electric bus driving conditions and energy consumption. Furthermore, to overcome the black-box nature of previous energy consumption prediction models—that is, the inability to provide the model's prediction mechanism and the influence of various factors—this invention utilizes interpretive methods from machine learning. Specifically, it combines the Shapley value method and the local dependency graph method to interpret the model results, obtaining the specific influence relationship between variables and energy consumption, the importance ranking of features, the interactive influence relationship of multiple influencing factors on energy consumption, and the mechanism of energy consumption prediction. Based on this analysis, an energy consumption prediction system and an energy consumption optimization suggestion system are constructed to provide decision support for energy consumption optimization for electric bus companies and departments.

[0033] In this embodiment, S1 specifically includes: Based on historical data of electric buses, multiple operating condition characteristic parameters are preset. The historical data of electric buses includes vehicle parameters, operating parameters, road parameters, and external parameters. Based on full factorial experimental design, multiple working condition characteristic parameters are combined horizontally to generate multiple working condition scenarios.

[0034] This embodiment, referencing previous modeling studies, uses simple and easily observable variables and real-world data to set variable levels. Based on a full factorial experimental design, it obtains operating scenarios with different combinations of variables and their levels, thus expanding the observation database of public transportation energy consumption scenarios.

[0035] Specifically as follows: Based on the vehicle itself, operating parameters, road parameters, and external parameters, a full-factor experiment was used to define all possible scenarios during the operation of an electric bus. Several variables that are easily collected and evaluated during electric bus driving were selected for scenario setting. Referring to real-world electric bus operating scenarios, the variable levels for driving conditions were preset. The basic method of the full-factor design experiment is to change the level of one factor at a time, ultimately obtaining all possible combinations of scenarios.

[0036] In this embodiment, S2 specifically includes: Based on multiple operating scenarios, the operation of electric buses in different operating scenarios is simulated through a simulation platform; Calculate the energy consumption of electric buses under multiple operating conditions and construct an energy consumption dataset.

[0037] In this embodiment, a model is constructed in a simulation platform. Based on the simulation platform and the dynamic model, a simulated electric bus model is built. The variable level combination set in the previous step is input, and the energy consumption in different scenarios is calculated through the simulation platform. The energy consumption is expressed as the electricity consumption per kilometer, with the unit being kWh / km. Finally, the energy consumption dataset of the electric bus is obtained.

[0038] Specifically as follows: The simulation model can be any proven simulation model. In this embodiment, the Matlab Simulink platform is selected, based on the component design used in the advanced vehicle simulator ADVISOR. During operation, the energy generated by the electric bus is primarily produced by the battery and transmitted directly to the wheels through the vehicle's powertrain components (motor, gearbox, and inverter). The energy in the battery is consumed during the bus's longitudinal dynamic motion and is subject to many external influences. To assess energy consumption, Newton's second law of motion is used to estimate the energy consumed to overcome corresponding resistances during motion. The vehicle can only move forward if the traction force is equal to or greater than the sum of four resistances: rolling friction resistance, aerodynamic drag, gradient drag, and the force required to accelerate the vehicle.

[0039] Rolling friction resistance is related to the rolling friction coefficient of the wheel, vehicle speed, vehicle load weight, gravitational acceleration, and road slope; aerodynamic drag is related to air density, vehicle frontal area, aerodynamic drag coefficient, and vehicle speed; slope dynamic drag is related to vehicle load weight, gravitational acceleration, and road slope; the force required to accelerate the vehicle is related to the vehicle and its load weight, acceleration, or deceleration.

[0040] The vehicle's initial input power is transferred to the electric drive system via the energy storage system's discharge process. Then, electrical energy is converted into mechanical energy through electromechanical conversion. Finally, through the mechanical system, the output power is distributed as wheel output power. Energy losses occur at various stages throughout this process. The wheel output power equals the initial input power multiplied by the energy storage efficiency from the energy storage system to the electric drive system, the efficiency of the electric drive system, and the transmission efficiency of the mechanical system. This embodiment calculates the final required total power by reversing the energy transfer process, starting with the wheel output power, using a reverse estimation method. Specifically, it first calculates the required input power to the mechanical system, then infers the input power to the electric drive system, and finally the input power to the energy storage system, ultimately obtaining the total power.

[0041] Subsequently, factorial design was used to generate all possible combinations of scenarios. This involved writing a loop in MATLAB software to simulate the simulation model, changing only one parameter each time the energy consumption of the electric bus under the given conditions was estimated, while keeping the others constant. This resulted in datasets for both simulated and predicted energy consumption.

[0042] In this embodiment, S3 specifically includes: Based on the energy consumption dataset, various preset models were trained; Based on grid search and cross-validation, the optimal combination of hyperparameters for each preset model is determined; Based on preset performance indicators, the model with the best performance is determined from a variety of preset models after training as the energy consumption prediction model.

[0043] In this embodiment, based on the dataset of simulated operating conditions and predicted energy consumption obtained in the previous step, a data-driven approach is used to construct the relationship between operating conditions and energy consumption. Multiple data-driven models can be selected as candidate models. Since most data-driven models have multiple hyperparameters, a multi-step grid search is used to obtain the hyperparameter combination with the best performance in five-fold cross-validation, which is then used as the hyperparameter setting for the data-driven model.

[0044] In this embodiment, the optimal hyperparameter combination for each preset model is determined based on grid search and cross-validation, including: For discrete hyperparameters, the optimal hyperparameter values ​​for cross-validation are determined based on a pre-set set of discrete candidates. For continuous hyperparameters, a candidate set is formed based on a preset initial range and step size. The hyperparameter value with the best performance in cross-validation is determined, and the range and step size are iteratively adjusted based on this value until the optimal hyperparameter value is determined.

[0045] The rules for setting up the multi-step grid search are as follows: For discrete hyperparameters, discrete data is used directly as the candidate set of hyperparameters. The parameter value that performs best in five-fold cross-validation is found in the candidate set. For continuous hyperparameters, a candidate set of hyperparameters with a longer step count and a larger range is first selected. The parameter value that performs best in five-fold cross-validation is found in the candidate set. Then, based on this parameter value, the range is expanded and the step count is reduced to form a new candidate set of hyperparameters until the optimal parameter value is found. Each time an optimal hyperparameter is searched, when searching for the next optimal hyperparameter value, the best-performing hyperparameter is set as the optimal value, and the hyperparameter value to be searched is set as the default value, until the optimal combination of hyperparameters for the model is found.

[0046] Grid search is a technique for parameter tuning. Its basic logic is exhaustive search: among all candidate parameter choices, it iterates through them, trying every possibility, and the parameter that performs best is the final result. The principle is similar to finding the maximum value in an array.

[0047] In five-fold cross-validation, the average mean squared error (MSE) of the model will be used as a performance metric.

[0048] The default model is a data-driven model, including: Multiple regression models, also known as multivariate regression models, are used to analyze the relationship between two or more independent variables and one dependent variable. Decision tree models construct a tree-like structure where each internal node represents a decision based on feature attribute values, and each leaf node represents an outcome or prediction. Decision tree methods recursively partition the dataset into subsets based on feature values, aiming to maximize the homogeneity of the target variable within each subset. The process of building a decision tree involves selecting the best feature at each node to split the data. This selection is typically based on criteria such as maximizing information gain or minimizing impurities. Once features are selected, the dataset is partitioned into subsets, and this process is recursively repeated for each subset until a stopping criterion is met, such as reaching the maximum tree depth or minimizing the number of samples in a node. Then, the prediction results for new instances are derived by summarizing the prediction results for the corresponding regions. Random forest model, or random forest regression, is an ensemble learning method that combines the predictions of multiple decision trees to improve the accuracy and robustness of the regression model. It works by building multiple decision trees during training and outputting the average prediction of each individual decision tree. Gradient ascent regression builds a strong predictive model by combining multiple weak models (usually decision trees). It optimizes the model using a gradient descent strategy, setting an objective function and using gradient descent to optimize the predictions. It first uses a simple pattern, typically a constant value, as the initial prediction for all instances in the dataset. Then, it trains subsequent models to predict the residuals of the dataset up to this point. Each new model is trained based on these residuals, aiming to minimize the loss function. Finally, it aggregates the predictions from all models in the dataset to obtain the final prediction result. XGBoost (Extreme Gradient Boosting) regression belongs to the gradient boosting algorithm family and aims to optimize computational speed and model accuracy. The model starts with a simple initial prediction, typically the average of the target variable. Trees are then added sequentially to the ensemble, each new tree attempting to correct the errors of the previous one. XGBoost employs gradient-based optimization techniques to learn the optimal parameters for each tree. It also includes several regularization techniques to prevent overfitting and improve generalization performance. These techniques include tree pruning to remove low-importance nodes and regularization terms in the objective function. The final prediction of the XGBoost regression model is the sum of the predictions from all individual trees, typically processed using a weighted average. ANN (Analog-Neural Network) is a popular deep learning algorithm. It's based on a parallel, multi-layered information processing structure. An ANN typically consists of three layers: an input layer that receives the model's input, hidden layers that process the input data, and an output layer that generates the result. The number of hidden layers can be adjusted depending on the problem. Each neuron or information processing unit in each layer receives many inputs, processes them, and provides a weighted sum of input activations and an output. Support Vector Machine (SVM) regression works by finding the hyperplane that best fits the data while maximizing the margin between the hyperplane and the nearest data point. It allows the use of different kernel functions, such as linear, polynomial, or radial basis function (RBF) kernels. The choice of kernel depends on the features of the dataset and the required complexity of the model. The goal of training an SVM regression model is to find a hyperplane that maximizes the margin between the data point and the hyperplane while minimizing the prediction error. This optimization problem is often formulated as a quadratic programming problem and solved using optimization techniques. Kernel tricks are used to map the input features to a higher-dimensional space where linear separations are more easily found. This allows SVM regression to capture complex nonlinear relationships between features and the target variable. Once the model is trained, new instances can be predicted by calculating the distance to the hyperplane, and then the predicted value is determined based on the distance and the kernel function used.

[0049] In this embodiment, at least two of the above models are selected as preset models and trained based on the energy consumption dataset.

[0050] In this embodiment, S4 specifically includes: Based on the Shapley value method, the contribution of each operating condition characteristic parameter to energy consumption is determined, and the importance ranking of the features and the interaction between the features are obtained. Based on the local dependency graph method, the influence relationship between characteristic parameters of each operating condition and energy consumption is determined.

[0051] Through this embodiment,

[0052] In this embodiment, based on the Shapley value method, the contribution value of each operating condition characteristic parameter to energy consumption is determined, and the importance ranking of features and the interaction effects between features are obtained, including: The Shapley value of each working condition characteristic parameter is determined based on the marginal contribution calculation and weighted average of the feature subsets. Based on the Shapley value, the characteristic parameters of each working condition are ranked by importance; Based on the interaction value calculation of feature pairs, the contribution of the interaction between any two operating condition feature parameters to energy consumption is determined.

[0053] This embodiment compares the performance of different data-driven models and selects the best-performing data-driven model as the target machine learning model to be explained. The importance of energy consumption impact features is explained using the Shapley value method. Combining the Shapley value method and local dependency graphs, the linear and nonlinear relationships between impact features and energy consumption are explained. The prediction process of the model is also explained using the Shapley value method.

[0054] The Shapley value method is used to interpret the model's output. The main calculation steps are as follows: 1) Feature subset contribution calculation: For each feature, calculate its marginal contribution in different feature subsets; 2) Marginal contribution weighted average: Calculates the weighted average of the marginal contributions of the feature across all subsets, with the weights determined based on the size of the subsets; 3) Provide the contribution of each feature to the model prediction, thereby explaining the model's output. The overall prediction value can be decomposed into the sum of the contributions of each feature. The model's prediction value for a certain sample is determined based on the model's baseline value and the contribution values ​​of all features to the prediction model.

[0055] For tree-based models, the following steps simplify and accelerate the calculation of the Sharpe ratio.

[0056] 1) Tree path traversal: Traverse each tree from the root node to the leaf node, and record the impact of each feature on the path decision.

[0057] 2) Path probability calculation: Calculate the probability of each path, that is, the probability of reaching the leaf node along the path when the feature takes different values.

[0058] 3) Marginal contribution accumulation: For each feature, the marginal contribution on all paths is accumulated and weighted averaged.

[0059] In addition, the Shapley value also provides information on the interaction effects between features. The calculation steps for the Shapley interaction value are as follows: 1) Calculation of individual feature contribution values: First, calculate the Shapley values ​​of the two features separately according to the previous steps; 2) Calculation of interaction value: The Shapley value of the interaction between two features is the interaction value. 3) Total contribution decomposition, i.e. decomposing interaction effects, the model prediction value can be obtained by decomposing the individual contribution and interaction contribution of features. The model prediction value is the sum of the individual feature contribution value and the interaction contribution value of all paired features.

[0060] For a tree model, the steps for calculating the Shapley interaction value are as follows: 1) Tree path traversal and path probability calculation: First, traverse each tree from the root node to the leaf node, record the influence of each feature on the path decision, and then calculate the probability of each path, that is, the probability of reaching the leaf node along the path when the feature takes different values.

[0061] 2) Marginal contribution accumulation and interaction effect calculation. For each path, calculate the individual marginal contribution and interaction marginal contribution of the two features, then accumulate these contributions across all paths and perform a weighted average.

[0062] In this embodiment, the influence relationship between characteristic parameters of each operating condition and energy consumption is determined based on the local dependency graph method, including: Select any operating condition feature as the observation operating condition feature, and confirm the value range of the corresponding observation operating condition feature parameter; Keeping other operating condition characteristic parameters unchanged, calculate the predicted energy consumption values ​​of the observed characteristic parameters under different values ​​based on the energy consumption prediction model; Based on the different values ​​of the characteristic parameters of the observed operating conditions and their corresponding predicted energy consumption values, the influence relationship between the characteristic parameters of the observed operating conditions and energy consumption is determined. Each operating condition characteristic is used as an observation characteristic in turn to determine the influence relationship between each operating condition characteristic parameter and energy consumption.

[0063] The principle of calculating local dependency graphs is as follows: when other features are fixed, the average influence of a certain feature or combination of features on the model's predicted output is obtained by changing the value of the feature while keeping the values ​​of other features constant, and observing the changes in the model's predicted value. This yields the dependency relationship between the model's predicted value and the observed feature, and a dependency graph is then drawn.

[0064] The steps for calculating the local dependency graph of a single feature are as follows: 1) Select the feature and range of values: Select the feature to be observed and its range of values; 2) Calculate the model's predicted value. For each value, keep other features unchanged and calculate the model's predicted value. 3) Calculate the expected value, average it across all samples, and obtain the local dependency value for each value; 4) Draw a local dependency graph by plotting the observed feature values ​​on the x-axis and the local dependency values ​​on the y-axis.

[0065] The local dependency graph of two features can reveal the interaction effect. The steps to calculate the local dependency graph of two features are as follows: 1) Select features and value ranges: Choose two features to observe and their value ranges; 2) Calculate the model prediction value. For each combination of the two features, keep the other features unchanged and calculate the model prediction value. 3) Average all samples to obtain the local dependency value for each combination of the two features.

[0066] 4) Draw a local dependency graph. Plot the graph with the values ​​of the two features as the x and y coordinates, and the local dependency values ​​as the vertical coordinates or contour line values. This will give you a local dependency graph of the two features, which is usually represented by a 3D graph or contour line graph.

[0067] In this embodiment, S5 specifically includes: An energy consumption prediction system is constructed based on contribution information. The energy consumption prediction system is used to determine and return the corresponding energy consumption prediction value and the contribution value of each operating condition feature parameter to the energy consumption prediction value based on the specific operating condition feature parameters input by the user. Based on contribution information, an energy consumption optimization system is constructed. The energy consumption optimization system is used to determine and return the combination of operating condition characteristic parameters with the lowest energy consumption value within a range of partial operating condition characteristic parameters set by the user.

[0068] This embodiment uses the Shapley value method to calculate the predicted energy consumption for each scenario, as well as the contribution of each feature to the predicted energy consumption. The contribution value represents the impact. Simultaneously, the interaction effects between variables are calculated, ultimately forming an explanatory dataset. Based on this explanatory dataset, the system is constructed. The system includes two functions: First, the user selects a specific bus operating condition, and the system returns the predicted energy consumption for each condition, along with the contribution of each feature to energy consumption. Second, an optimization function: the user inputs a defined operating condition range, and the system returns the combination of operating condition feature values ​​that achieves the lowest energy consumption within that range, providing guidance for bus route design and driver training.

[0069] The model interpretation results are divided into three parts: the interpretation of the impact of each feature value on energy consumption, the interpretation of the relationship between the impact of each feature on energy consumption, and the interaction between features.

[0070] Interpretation of the impact of each feature value on energy consumption: Calculate the sum of the importance of each feature under each driving condition, and interpret the importance of the features by the magnitude and ranking of the feature values; at the same time, calculate the marginal contribution of each feature in each sample. When the marginal contribution is negative, it will reduce the energy consumption under that condition.

[0071] Explanation of the influence of each feature on energy consumption: The results are given by combining the Shapley method and the local dependency method. The Shapley value shows the specific influence of the feature on energy consumption under each specific operating condition, indicating the details of the influence of the feature on energy consumption. The local dependency graph provides the trend of the influence of the feature on energy consumption. By combining the two, we can know the influence of the feature value on energy consumption under specific operating conditions (Shapley value), as well as the possible trend of energy consumption after the feature value changes.

[0072] Interactions between features: By traversing all feature pairs and averaging the absolute values ​​of their interactions on energy consumption, a heatmap can be created to visually represent the magnitude of the impact of feature interactions on energy consumption. Since the same feature pair is located diagonally across the table, their values ​​are equal, meaning the values ​​in the table are symmetrical with the diagonal as the dividing line. Furthermore, the heatmap allows selection to observe only feature pairs with significant interactions and perform specific analyses.

[0073] The predictive model predicts energy consumption under a specific operating condition by using the average energy consumption under all operating conditions as a benchmark, progressively calculating the values ​​of different features and the interactions between features, and finally obtaining the predicted energy consumption value for the specific operating condition through the benchmark value and the combined influence of individual features and feature interactions.

[0074] Based on contribution information, a human-computer interaction model is constructed to provide decision-makers with energy consumption prediction and energy consumption optimization decision support under specific operating conditions.

[0075] The prediction system can be configured as follows: Users select operating condition characteristic value levels by dragging buttons on the system interface. After selecting all characteristics, they submit the selection. The system returns an operating condition ID based on the characteristic value entered by the user for each characteristic. Based on the operating condition ID, the system looks up the predicted energy consumption value for the specific operating condition in the interpretation table and provides the contribution of each characteristic to energy consumption. Users can compare up to three sets of specific operating conditions on the same page.

[0076] The system optimization settings can be configured as follows: Users can select the levels of five operating condition characteristics—road gradient, HVAC, station density, passenger load, and road conditions—by dragging buttons on the system interface, and specify the maximum and minimum values ​​for average speed and initial SOC. Finally, the system narrows down the dataset through conditional search and finds the operating condition with the lowest energy consumption value. The system then returns the average speed value, initial SOC value, and driver impulse level value of the operating condition with the lowest energy consumption value, providing users with energy consumption optimization suggestions.

[0077] This embodiment also provides an energy consumption prediction and optimization system based on interpretive machine learning to implement the above method, which includes: The parameter preset module is used to preset multiple operating condition characteristic parameters based on historical data of electric buses. The dataset construction module is used to build energy consumption datasets for electric buses under various scenarios based on operating condition characteristic parameters; The model training module is used to train various preset models based on the energy consumption dataset to obtain various energy consumption prediction models; The model interpretation module is used to interpret various energy consumption prediction models based on interpretive machine learning methods, and obtain the contribution information of characteristic parameters of each operating condition to energy consumption. The system building module is used to build energy consumption prediction and energy consumption optimization systems based on contribution information.

[0078] This embodiment uses interpretable machine learning methods to explain a black-box energy consumption prediction model. The analysis focuses on three aspects: feature importance, the influence of features on energy consumption, and the model's energy consumption prediction process, thus improving the model's interpretability, reliability, and application scope. The explanation method used in this invention is model-independent, meaning it can be explained after the model is fully built, regardless of the preceding model construction method. Therefore, any electric bus energy consumption prediction model already built based on existing data can be explained using the explanation method provided by this invention, thereby improving the model's interpretability, reliability, and application scope. Based on the interpretation results of the data-driven model, this invention constructs an energy consumption prediction and optimization system for specific operating conditions, providing a reliable, trustworthy, and easy-to-operate tool for electric bus energy consumption prediction and optimization. This invention uses easily obtainable and observable variables and variable levels obtained from real-world operating conditions to conduct simulation experiments to obtain electric bus energy consumption, significantly reducing data collection costs for bus companies and expanding the scope of observable operating conditions.

[0079] It is readily understood that those skilled in the art can combine, split, or reorganize the embodiments provided in this application to obtain other embodiments, all of which do not exceed the protection scope of this application.

[0080] The present invention and its embodiments have been described above illustratively. This description is not restrictive, and the embodiments shown are only part of the embodiments of the present invention. The actual structure is not limited thereto. Therefore, if those skilled in the art are inspired by this description and design similar structures and embodiments without departing from the spirit of the present invention, they should all fall within the protection scope of the present invention.

Claims

1. An energy consumption prediction and optimization method based on interpretive machine learning, comprising: S1, based on historical data of electric buses, preset multiple operating condition characteristic parameters; S2, based on operating condition characteristic parameters, constructs energy consumption datasets for electric buses under various scenarios; S3, based on the energy consumption dataset, trains multiple preset models to obtain multiple energy consumption prediction models; S4, based on interpretive machine learning methods, interprets various energy consumption prediction models to obtain information on the contribution of characteristic parameters of each operating condition to energy consumption; S5, based on contribution information, constructs an energy consumption prediction system and an energy consumption optimization system.

2. The energy consumption prediction and optimization method based on interpretive machine learning according to claim 1, wherein, S1 specifically includes: Based on historical data of electric buses, multiple operating condition characteristic parameters are preset. The historical data of electric buses includes vehicle parameters, operating parameters, road parameters, and external parameters. Based on full factorial experimental design, multiple working condition characteristic parameters are combined horizontally to generate multiple working condition scenarios.

3. The energy consumption prediction and optimization method based on interpretive machine learning according to claim 2, wherein, S2 specifically includes: Based on multiple operating scenarios, the operation of electric buses in different operating scenarios is simulated through a simulation platform; Calculate the energy consumption of electric buses under multiple operating conditions and construct an energy consumption dataset.

4. The energy consumption prediction and optimization method based on interpretive machine learning according to claim 1, wherein, S3 specifically includes: Based on the energy consumption dataset, various preset models were trained; Based on grid search and cross-validation, the optimal combination of hyperparameters for each preset model is determined; Based on preset performance indicators, the model with the best performance is determined from a variety of preset models after training as the energy consumption prediction model.

5. The energy consumption prediction and optimization method based on interpretive machine learning according to claim 4, wherein, The process of determining the optimal hyperparameter combination for each preset model based on grid search and cross-validation includes: For discrete hyperparameters, the optimal hyperparameter values ​​for cross-validation are determined based on a pre-set set of discrete candidates. For continuous hyperparameters, a candidate set is formed based on a preset initial range and step size. The hyperparameter value with the best performance in cross-validation is determined, and the range and step size are iteratively adjusted based on this value until the optimal hyperparameter value is determined.

6. The energy consumption prediction and optimization method based on interpretive machine learning according to claim 1, wherein, S4 specifically includes: Based on the Shapley value method, the contribution of each operating condition characteristic parameter to energy consumption is determined, and the importance ranking of the features and the interaction between the features are obtained. Based on the local dependency graph method, the influence relationship between characteristic parameters of each operating condition and energy consumption is determined.

7. The energy consumption prediction and optimization method based on interpretive machine learning according to claim 6, wherein, The Shapley value-based method determines the contribution of each operating condition characteristic parameter to energy consumption, and obtains the ranking of feature importance and the interaction between features, including: The Shapley value of each working condition characteristic parameter is determined based on the marginal contribution calculation and weighted average of the feature subsets. Based on the Shapley value, the characteristic parameters of each working condition are ranked by importance; Based on the interaction value calculation of feature pairs, the contribution of the interaction between any two operating condition feature parameters to energy consumption is determined.

8. The energy consumption prediction and optimization method based on interpretive machine learning according to claim 6, wherein, The method based on local dependency graphs determines the influence relationship between characteristic parameters of each operating condition and energy consumption, including: Select any operating condition feature as the observation operating condition feature, and confirm the value range of the corresponding observation operating condition feature parameter; Keeping other operating condition characteristic parameters unchanged, calculate the predicted energy consumption values ​​of the observed characteristic parameters under different values ​​based on the energy consumption prediction model; Based on the different values ​​of the characteristic parameters of the observed operating conditions and their corresponding predicted energy consumption values, the influence relationship between the characteristic parameters of the observed operating conditions and energy consumption is determined. Each operating condition characteristic is used as an observation characteristic in turn to determine the influence relationship between each operating condition characteristic parameter and energy consumption.

9. The energy consumption prediction and optimization method based on interpretive machine learning according to claim 1, wherein, S5 specifically includes: An energy consumption prediction system is constructed based on contribution information. The energy consumption prediction system is used to determine and return the corresponding energy consumption prediction value and the contribution value of each operating condition feature parameter to the energy consumption prediction value based on the specific operating condition feature parameters input by the user. Based on contribution information, an energy consumption optimization system is constructed. The energy consumption optimization system is used to determine and return the combination of operating condition characteristic parameters with the lowest energy consumption value within a range of partial operating condition characteristic parameters set by the user.

10. An energy consumption prediction and optimization system based on interpretive machine learning, for implementing the method of any one of claims 1-9, comprising: The parameter preset module is used to preset multiple operating condition characteristic parameters based on historical data of electric buses. The dataset construction module is used to build energy consumption datasets for electric buses under various scenarios based on operating condition characteristic parameters; The model training module is used to train various preset models based on the energy consumption dataset to obtain various energy consumption prediction models; The model interpretation module is used to interpret various energy consumption prediction models based on interpretive machine learning methods, and obtain the contribution information of characteristic parameters of each operating condition to energy consumption. The system building module is used to build energy consumption prediction and energy consumption optimization systems based on contribution information.

Citation Information

Patent Citations

  • Electric bus travel energy consumption rapid prediction method based on characteristic data

    CN115759347A

  • Energy consumption estimation method for electric buses based on actual operating conditions

    CN115952899B

  • Electric bus energy consumption prediction method

    CN116956568A

  • Electric bus energy consumption prediction method based on machine learning

    CN117493842A

  • Method for predicting energy consumption of data-driven electric bus

    CN117493843A