A diesel vehicle fuel consumption prediction and analysis method, system, device and storage medium based on machine learning

CN122132703APending Publication Date: 2026-06-02GUILIN UNIV OF ELECTRONIC TECH +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUILIN UNIV OF ELECTRONIC TECH
Filing Date
2026-04-15
Publication Date
2026-06-02

Smart Images

  • Figure CN122132703A_ABST
    Figure CN122132703A_ABST
Patent Text Reader

Abstract

This invention discloses a method, system, device, and storage medium for predicting and analyzing diesel vehicle fuel consumption based on machine learning. It relates to the field of diesel vehicle fuel consumption prediction and analysis technology, and includes constructing a fuel consumption prediction model; using intelligent interpolation to impute missing values ​​in data from different sources; using Gaussian filtering to suppress noise in data from different sources; extracting fuel consumption features from the imputed data and generating simplified features using PCA; constructing a multi-algorithm fusion prediction framework; evaluating the performance of the trained fuel consumption prediction model; and using a weighted integration strategy and Stacking method to construct real-time fuel consumption prediction accuracy for the simplified features. The method of this invention achieves high-precision prediction of diesel vehicle fuel consumption, feature optimization and dimensionality reduction, automated data processing, and real-time visualization analysis, improving prediction accuracy, ease of operation, and system stability, and adapting to complex driving conditions and multi-scenario applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of diesel vehicle fuel consumption prediction and analysis technology, specifically to a method, system, device, and storage medium for diesel vehicle fuel consumption prediction and analysis based on machine learning. Background Technology

[0002] With the escalation of the global energy crisis and environmental pollution, diesel vehicle fuel consumption control has become an important means of reducing carbon emissions and energy consumption. Diesel vehicles are widely used in the transportation industry, and fuel consumption prediction is of great significance for energy conservation and emission reduction, optimizing driving strategies and reducing operating costs. However, existing diesel vehicle fuel consumption prediction methods generally have limitations.

[0003] Traditional fuel consumption prediction methods are mostly based on physical models or statistical methods. Physical models predict fuel consumption by building dynamic models of vehicles and engines. Although they have a certain degree of accuracy in theory, they are complex to model, require a large number of vehicle parameters, and lack adaptability to factors such as driving behavior, road conditions, and weather. The computational complexity of physical models is high, making it difficult to meet the needs of real-time prediction. In contrast, algorithms based on statistics and machine learning are faster to compute, but these methods often assume a linear relationship between fuel consumption and influencing factors, making it difficult to capture the nonlinear characteristics between fuel consumption and complex factors. They are also sensitive to data quality, feature selection relies on human experience, and their generalization ability is weak.

[0004] In recent years, although some studies have introduced more complex machine learning algorithms, such as XGBoost and random forest, to improve prediction accuracy, existing methods still suffer from limitations of single algorithms, poor integration effects, and insufficient intelligence. These methods lack automated data processing and environmental adaptation functions, resulting in a poor user experience, and the prediction patterns cannot meet the needs of multi-scenario applications.

[0005] Therefore, existing technologies still face many challenges in terms of accuracy, real-time performance, intelligence, and user experience in fuel consumption prediction. There is an urgent need for a comprehensive, accurate, and intelligent technical solution to overcome the shortcomings of existing technologies and meet the complex and diverse practical application needs. Summary of the Invention

[0006] In view of the above-mentioned problems, the present invention is proposed.

[0007] Therefore, the technical problem solved by this invention is that existing technologies for predicting diesel vehicle fuel consumption suffer from low accuracy, low level of intelligence, and poor real-time performance, and the problem of how to improve prediction accuracy and achieve automated and intelligent configuration.

[0008] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a method for predicting and analyzing diesel vehicle fuel consumption based on machine learning, including constructing a fuel consumption prediction model, using intelligent interpolation to impute missing values ​​in data from different sources, and using Gaussian filtering to suppress noise in data from different sources; Fuel consumption features are extracted from the suppressed data and simplified features are generated using PCA. A multi-algorithm fusion prediction framework is constructed to evaluate the performance of the fuel consumption prediction model after training. A weighted ensemble strategy and Stacking method are used to construct the real-time fuel consumption prediction accuracy for the simplified features.

[0009] As a preferred embodiment of the machine learning-based diesel vehicle fuel consumption prediction and analysis method described in this invention, the intelligent interpolation includes: filling missing data using an intelligent interpolation method based on the KNN algorithm; employing linear interpolation for time periods with a missing rate higher than the missing threshold; calculating the distance between missing value samples and other complete samples; selecting the K nearest neighbors; and obtaining a weighted average to fill the missing data; identifying and processing outlier data points using IQR and DBSCAN clustering algorithms; and employing a truncation strategy for extreme outliers; the intelligent interpolation method based on the KNN algorithm is expressed as follows: Sample distance, expressed as: , The weighted average is expressed as: , , in, Indicates missing value samples and complete sample The distance between them This indicates the feature index where the sample with missing values ​​is located. When a sample has multiple features, It is the location of one of the features. Representing feature dimension, This represents the feature dimension index when calculating the Euclidean distance between samples. Indicates missing value samples In the Values ​​on each feature Indicates missing value samples In the Values ​​on each feature Indicates missing value samples In the Values ​​on each feature Indicates missing value samples In the Values ​​on each feature This indicates the number of nearest neighbors selected. Indicates the first The neighbor weights of each missing value sample are calculated based on the distance between the current neighbor and the target missing value sample. Represents a local minimum; linear interpolation is represented as: , in, Indicates the interpolation at the missing time point. , This represents consecutively missing data segments in a time series. and The timestamp representing a valid data point. Indicates the timestamp Valid observations at that time Indicates the timestamp Valid observations at that time.

[0010] As a preferred embodiment of the machine learning-based diesel vehicle fuel consumption prediction and analysis method described in this invention, the Gaussian filtering includes: smoothing the collected engine sensor data to remove sensor noise, maintaining and optimizing data features by selecting an appropriate filter window size and standard deviation, and inputting the data features into the fuel consumption prediction model; the mathematical expression of Gaussian filtering is: , Calculation of the filtered signal: , in, Represents sensor data points Gaussian distribution value, This represents the standard deviation of a Gaussian distribution. Indicates the location of the sensor data points. Indicates to Filtered data values ​​from neighboring data points This represents the half-width of the Gaussian filter window, and the window size is... , Indicates the corresponding neighboring data points Gaussian function value, Indicates the location of the original data point. The value at that location.

[0011] As a preferred embodiment of the machine learning-based diesel vehicle fuel consumption prediction and analysis method of the present invention, the fuel consumption features include power system features, driving behavior features, driving environment features, and fuel efficiency features; each feature is derived based on a data processing algorithm and an automatic normalization selection mechanism; the data processing algorithm includes calculating the fuel consumption features of time-series data based on fixed windows and sliding windows, capturing the rate of change of data using first-order difference, capturing the acceleration of data change using second-order difference, and performing data denoising and smoothing using the Holt-Winters exponential smoothing method; the automatic normalization selection mechanism includes automatically identifying the data distribution type based on KS test and skewness-kurtosis analysis.

[0012] As a preferred embodiment of the machine learning-based diesel vehicle fuel consumption prediction and analysis method described in this invention, the PCA method includes: obtaining the current covariance matrix and performing eigenvalue decomposition; selecting the eigenvectors corresponding to the top k largest eigenvalues ​​to form a projection matrix; reducing the dimensionality by projecting the original data onto a new feature space, retaining the main features in the data, automatically selecting the number of principal components based on the cumulative variance contribution rate, and supporting manual adjustment according to business needs.

[0013] As a preferred embodiment of the machine learning-based diesel vehicle fuel consumption prediction and analysis method described in this invention, the multi-algorithm fusion prediction framework includes the XGBoost algorithm and the Random Forest algorithm; the XGBoost algorithm, wherein the objective function is expressed as: , in, Describe the objective function. Indicates the first The loss function of the wheel, Indicates the first The regularization term for each tree.

[0014] As a preferred embodiment of the machine learning-based diesel vehicle fuel consumption prediction and analysis method described in this invention, the random forest algorithm includes out-of-bag error, expressed as: , in, This represents the out-of-bag error, which is the evaluation of the performance of each decision tree based on unsampled samples. This represents the number of samples used to calculate the error. Indicates the use of not containing the first The prediction results of the tree for each sample Indicates the first The true label of each sample.

[0015] Another objective of this invention is to provide a diesel vehicle fuel consumption prediction and analysis system based on machine learning. This system can solve the problems of single algorithm limitations, low accuracy, and poor real-time performance in current fuel consumption prediction technologies by integrating a multi-algorithm fusion prediction framework and combining the advantages of XGBoost and random forest algorithms.

[0016] As a preferred embodiment of the machine learning-based diesel vehicle fuel consumption prediction and analysis system of the present invention, the system includes: a data processing module, a feature extraction and dimensionality reduction module, and a multi-algorithm fusion prediction module. The data processing module performs missing value imputation, noise suppression, and outlier processing on data from different sources. Specifically, it uses a KNN-based intelligent interpolation method to fill in missing data and employs Gaussian filtering to smooth the collected engine speed, vehicle speed, torque, and other data. The feature extraction and dimensionality reduction module extracts features from the preprocessed data, including powertrain features, driving behavior features, driving environment features, and fuel efficiency features, and performs dimensionality reduction on the extracted features using the PCA method. The multi-algorithm fusion prediction module combines two advanced machine learning algorithms, XGBoost and Random Forest, using a weighted ensemble strategy and a Stacking method to predict fuel consumption, evaluates the performance of the trained fuel consumption prediction model, and performs real-time fuel consumption accuracy prediction.

[0017] Another object of the present invention is to provide a machine learning-based diesel vehicle fuel consumption prediction and analysis device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement a machine learning-based diesel vehicle fuel consumption prediction and analysis method.

[0018] Another object of the present invention is to provide a storage medium for predicting and analyzing diesel vehicle fuel consumption based on machine learning, wherein a computer program is stored thereon, and when the computer program is executed by a processor, the steps of the method for predicting and analyzing diesel vehicle fuel consumption based on machine learning are implemented.

[0019] The beneficial effects of this invention are as follows: The diesel vehicle fuel consumption prediction and analysis method based on machine learning provided by this invention achieves complementary advantages and improves fuel consumption prediction accuracy by integrating XGBoost and random forest algorithms; it reduces the difficulty of user operation and shortens the environment configuration time by automatically configuring the Python running environment; it reduces manual intervention by automating data preprocessing, model training and prediction; and it achieves significant innovation and improvement in nonlinear relationship modeling, prediction accuracy, automated processing and user operation convenience. Attached Figure Description

[0020] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 The above is an overall flowchart of a machine learning-based method for predicting and analyzing diesel vehicle fuel consumption, as provided in Embodiment 1 of the present invention.

[0022] Figure 2 The flowchart of a multi-algorithm fusion prediction method for predicting and analyzing diesel vehicle fuel consumption based on machine learning is provided in Embodiment 1 of the present invention.

[0023] Figure 3 This is a comparison chart of the 5-fold cross-validation results of a machine learning-based diesel vehicle fuel consumption prediction and analysis method provided in Embodiment 1 of the present invention.

[0024] Figure 4 This is a comparison chart of model evaluation indicators for a machine learning-based diesel vehicle fuel consumption prediction and analysis method provided in Embodiment 1 of the present invention.

[0025] Figure 5 This is a comparison chart of the effects of different model fusion strategies for a machine learning-based diesel vehicle fuel consumption prediction and analysis method provided in Embodiment 1 of the present invention.

[0026] Figure 6 This is a comparison chart showing the improvement in technical performance of a machine learning-based method for predicting and analyzing diesel vehicle fuel consumption, as provided in Embodiment 1 of the present invention. Detailed Implementation

[0027] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.

[0028] Example 1, referring to Figure 1 As an embodiment of the present invention, a method for predicting and analyzing diesel vehicle fuel consumption based on machine learning is provided, comprising: S1: Construct a fuel consumption prediction model 100, use intelligent interpolation 101 to impute missing values ​​in data from different sources, and use Gaussian filtering 104 to suppress noise in data from different sources.

[0029] It should be noted that the fuel consumption prediction method first collects data from multiple data sources, including the OBD-II on-board diagnostic system, vehicle CAN bus, high-precision GPS positioning system, vehicle ECU data, and historical driving database. Data collection is achieved through standardized MODBUS and CAN bus interfaces, and it also supports real-time data streaming (such as MQTT protocol) and batch import of historical data (such as CSV and JSON formats).

[0030] The acquisition frequency can be adaptively adjusted for different types of data, with OBD data at 10Hz, GPS data at 1Hz, and CAN bus data at 50Hz. During the acquisition process, the data is verified based on CRC check and time series consistency to detect data missing, outliers, and time series inconsistencies in real time. The acquired data enters the data cleaning and preprocessing pipeline to build and train the fuel consumption prediction model 100.

[0031] The intelligent interpolation 101 includes: an intelligent interpolation method 102 based on the KNN algorithm to fill missing data; linear interpolation 103 for time periods with missing rates higher than the missing threshold; calculating the distance between missing value samples and other complete samples; selecting the K nearest neighbors; obtaining a weighted average to fill missing data; and using IQR and DBSCAN clustering algorithms to identify and process outlier data points, and employing a truncation strategy for extreme outliers.

[0032] Based on linear interpolation 103, timestamp alignment and synchronization of multi-source data are achieved with millisecond-level time accuracy. Data of different formats are uniformly converted into standardized CSV format, which includes timestamp index and unified field naming convention.

[0033] The intelligent interpolation method 102 based on the KNN algorithm is expressed as follows: Sample distance, expressed as: , The weighted average is expressed as: , , in, Indicates missing value samples and complete sample The distance between them This indicates the feature index where the sample with missing values ​​is located. When a sample has multiple features, It is the location of one of the features. Representing feature dimension, This represents the feature dimension index when calculating the Euclidean distance between samples. Indicates missing value samples In the Values ​​on each feature Indicates missing value samples In the Values ​​on each feature Indicates missing value samples In the Values ​​on each feature Indicates missing value samples In the Values ​​on each feature This indicates the number of nearest neighbors selected. Indicates the first The neighbor weights of each missing value sample are calculated based on the distance between the current neighbor and the target missing value sample. This represents the minimum value.

[0034] Linear interpolation 103 is expressed as: , in, Indicates the interpolation at the missing time point. , This represents consecutively missing data segments in a time series. and The timestamp representing a valid data point. Indicates the timestamp Valid observations at that time Indicates the timestamp Valid observations at that time.

[0035] It should be noted that the sensor data of the acquired engine is smoothed based on Gaussian filter 104 to remove sensor noise. The data features are maintained and optimized by selecting an appropriate filter window size and standard deviation, and the data features are input into the fuel consumption prediction model 100.

[0036] Sensor data includes rotational speed, vehicle speed, torque, etc.

[0037] The mathematical expression for a Gaussian filter of 104 is: ,

[0038] Calculation of the filtered signal: ,

[0039] in, Represents sensor data points Gaussian distribution value, This represents the standard deviation of a Gaussian distribution. Indicates the location of the sensor data points. Indicates to Filtered data values ​​from neighboring data points This represents the half-width of the Gaussian filter window, and the window size is... , Indicates the corresponding neighboring data points Gaussian function value, Indicates the location of the original data point. The value at that location.

[0040] S2: Extract fuel consumption features 200 from the imputed data and generate simplified features using PCA method 201.

[0041] Fuel consumption characteristics 200 include powertrain characteristics, driving behavior characteristics, driving environment characteristics, and fuel efficiency characteristics; each characteristic is derived based on data processing algorithms and an automatic normalization selection mechanism.

[0042] Based on the automatic normalization selection mechanism, the Kolmogorov-Smirnov (KS) test is performed on the sample data of each feature to determine whether the data follows a normal distribution, and the skewness and kurtosis indices of the data are calculated.

[0043] (a) If the KS test results show that the data are approximately normally distributed and the skewness and kurtosis are within the preset threshold range, then Z-Score standardization will be automatically selected for normalization.

[0044] (ii) If the KS test results show that the data deviates from the normal distribution and there are extreme values ​​or heavy-tailed distributions, then Robust standardization (based on the median and quartile range) should be selected for normalization.

[0045] (iii) If the data is evenly distributed and does not contain extreme outliers, then choose Min-Max normalization to map the data to the [0,1] interval.

[0046] The above judgment logic is executed automatically, traversing each feature in turn. Without manual intervention, it can automatically assign the corresponding normalization method based on the KS test and skewness-kurtosis results, realizing intelligent data processing throughout the entire process.

[0047] The data processing algorithms include calculating the fuel consumption characteristics 200 of time-series data based on fixed and sliding windows, capturing the rate of change of data using first-order difference and the acceleration of data change using second-order difference, and using the Holt-Winters exponential smoothing method for data denoising and smoothing; the automatic normalization selection mechanism includes automatically identifying the data distribution type based on KS test and skewness-kurtosis analysis.

[0048] The automatic normalization selection mechanism is derived from the multi-strategy normalization method, which automatically selects Min-Max normalization, Z-Score normalization, and Robust normalization.

[0049] PCA method 201 includes: obtaining the current covariance matrix and performing eigenvalue decomposition; selecting the eigenvectors corresponding to the top k largest eigenvalues ​​to form a projection matrix; performing dimensionality reduction by projecting the original data onto a new feature space, retaining the main features in the data, automatically selecting the number of principal components based on the cumulative variance contribution rate, and supporting manual adjustment according to business needs.

[0050] It should be noted that the characteristics of the power system are expressed as follows: Engine load rate = net engine output torque (%) × engine speed (rpm) / maximum torque × maximum speed.

[0051] Driving behavior characteristics are represented as follows: Acceleration = (Current vehicle speed - Previous vehicle speed) / Sampling time; Deceleration = (Previous vehicle speed - Current vehicle speed) / Sampling time; Rapid acceleration frequency = (Number of times acceleration > 2m / s / Total number of samples) * 100%; Rapid deceleration frequency = Number of times the deceleration is greater than 2m / Total number of samples * 100%.

[0052] The characteristics of the driving environment are represented as follows: Road resistance = gradient (%) * vehicle weight (kg) * 9.8 N / kg * 0.01; Power correction value = power output * (standard atmospheric pressure / current atmospheric pressure) * (current temperature + 273) / (standard temperature + 273); Altitude correction factor = 1 - (altitude (m) / 44300) 0.19 .

[0053] Fuel efficiency characteristics are expressed as: , in, This indicates the fuel consumption rate (g / kWh). Indicates instantaneous fuel consumption (g / h). Indicates power output (kW).

[0054] Energy conversion efficiency: , in, Indicates energy conversion efficiency. This indicates the calorific value of diesel fuel (MJ / kg), and 3600 is the energy unit conversion factor. Specific energy consumption = fuel consumption rate × running time (h) / driving distance (km).

[0055] It should also be noted that the core steps of PCA method 201 are expressed as follows: Calculate the covariance matrix of the data: , in, Represents the covariance matrix of the data. This represents the original data matrix, where each row corresponds to a sample and each column corresponds to a feature. This represents the mean vector of the data matrix, calculating the mean for each column (feature).

[0056] Perform eigenvalue decomposition on the covariance matrix: , in, The first element of the covariance matrix represents the first element of the covariance matrix. 1 eigenvalue, Indicates the corresponding number The eigenvectors of each eigenvalue represent the directions of the principal components.

[0057] Before choosing The eigenvectors corresponding to the largest eigenvalues ​​form the projection matrix: , Project the original data onto a new feature space: , in, Represents the projection matrix. This indicates the number of principal components selected, which is usually determined based on the cumulative variance contribution rate (≥95%).

[0058] Principal component selection: The number of principal components is automatically selected based on the cumulative variance contribution rate (≥95%), and manual adjustment is supported according to business needs.

[0059] Formula for calculating variance contribution rate: , Cumulative variance contribution rate: , in, Indicates the first The variance contribution rate of each principal component represents the proportion of that principal component in the total variance. This represents the total number of eigenvalues ​​in the covariance matrix. Indicates the preceding The cumulative variance contribution rate of each principal component is used to determine the number of principal components to be selected.

[0060] It should also be noted that the improved K-means clustering algorithm automatically determines the K value: by combining the elbow rule (WCSS curve) and silhouette coefficient analysis, the optimal number of clusters (K=3-8) is automatically determined, and the application scenarios of clustering are defined. Driving style clustering: Based on characteristics such as acceleration / deceleration frequency, average vehicle speed, and fuel consumption, drivers are divided into aggressive, stable, and economical types.

[0061] Driving condition clustering: Identify congested urban roads, highways, mountain roads, etc., based on features such as vehicle speed distribution, start-stop frequency, and gradient changes.

[0062] Vehicle state clustering: Based on features such as power output, engine load rate, and fuel consumption, analyze the state patterns of vehicles under different load and gradient conditions.

[0063] Fuel consumption pattern clustering: Based on features such as fuel consumption rate, power output, and vehicle speed, normal fuel consumption, low fuel consumption, and high fuel consumption patterns are identified.

[0064] The improved K-means clustering algorithm is expressed as: , in This represents the objective function of K-means clustering, used to measure the total squared error between samples within a cluster and the cluster center. Indicates the first Clusters, Indicates the first The center of each cluster, This represents the Euclidean distance.

[0065] Contour coefficient calculation formula: , in, Indicates sample The silhouette coefficient is used to evaluate the clustering effect. For the sample The average distance to other samples in the same cluster, For the sample The average distance to the nearest heterogeneous sample.

[0066] Initial cluster center optimization: The K-means++ algorithm is used to select the initial cluster centers, which improves the convergence speed by more than 30%.

[0067] Distance metric optimization: Combine Mahalanobis distance and Euclidean distance, and consider the correlation between features.

[0068] Formula for calculating Mahalanobis distance: , in, Indicates sample to sample Mahalanobis distance between them This represents the inverse of the covariance matrix.

[0069] Noise point processing: Noise points are identified and marked based on a distance threshold (3 times the standard deviation) to improve the stability of clustering results.

[0070] S3: Construct a multi-algorithm fusion prediction framework 300, evaluate the performance of the trained fuel consumption prediction model 100, and use a weighted integration strategy and stacking method to construct the real-time prediction accuracy of fuel consumption for simplified features.

[0071] The multi-algorithm fusion prediction framework 300 includes the XGBoost algorithm 301 and the Random Forest algorithm 302.

[0072] XGBoost algorithm 301, where the objective function is expressed as: , in, Describe the objective function. Indicates the first The loss function of the wheel, Indicates the first The regularization term for each tree.

[0073] , in, This represents the number of leaf nodes in the tree. Indicates the weight of the leaf node. and This represents the regularization parameter.

[0074] The optimal split point is selected using gain calculation: , in, This represents the split gain, used to evaluate the quality of the split point chosen when splitting nodes in a decision tree. The larger the gain, the better the splitting effect. and Let the gradients of the left and right subtrees be represented respectively. and Let represent the Hessian and of the left and right subtrees, respectively.

[0075] Random Forest algorithm 302 includes out-of-bag error, denoted as: , in, This represents the out-of-bag error, which is the evaluation of the performance of each decision tree based on unsampled samples. This represents the number of samples used to calculate the error. Indicates the use of not containing the first The prediction results of the tree for each sample Indicates the first The true label of each sample.

[0076] For reference Figure 2 As shown, the processed data is divided into training and testing sets. The training set is trained using the XGBoost algorithm (learning rate 0.1, tree depth 6, subsample ratio 0.8) and the Random Forest algorithm (200 trees, sqrt feature selection, Bootstrap=True). The final prediction result is output by fusing the model through weighted voting. Finally, the model is evaluated using the training and testing sets, including 5-fold cross-validation, calculating RMSE and R², and generating real-time fuel consumption prediction results.

[0077] Example 2 is an embodiment of the present invention, which provides a method for predicting and analyzing diesel vehicle fuel consumption based on machine learning. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.

[0078] XGBoost parameters: learning rate (η) = 0.1, tree depth (max_depth) = 6, subsample ratio (subsample) = 0.8, feature sampling ratio (colsample_bytree) = 0.8, regularization parameter (λ) = 1, γ = 0.1.

[0079] Random forest parameters: number of trees (n_estimators) = 200, tree depth (max_depth) = None, feature selection ratio (max_features) = sqrt, Bootstrap sampling = True.

[0080] Training efficiency: XGBoost: Training time is approximately 2.5 hours on an 8-core CPU, with a 5-fold cross-validation accuracy of 94.2%.

[0081] Random Forest: Training time is approximately 1.8 hours on an 8-core CPU, with an accuracy of 93.1% achieved through 5-fold cross-validation.

[0082] Predictive performance:

[0083] Table 1 Comparison of Predictive Performance

[0084] As shown in Table 1, under the same training and validation datasets, both the XGBoost and Random Forest algorithms perform well in terms of accuracy, precision, recall, F1-score, RMSE, and R². XGBoost is slightly better than Random Forest, indicating that XGBoost has higher accuracy and generalization ability in fuel consumption prediction tasks, while Random Forest can also provide stable prediction performance.

[0085] Model validation: For reference Figure 3 As shown, 5-fold cross-validation is used to ensure the model's generalization ability; The performance of the final model was evaluated using the hold-out validation set (20% of the data); For reference Figure 4 As shown, XGBoost achieves a prediction accuracy of 93.7% on the validation set, while Random Forest achieves 92.5%.

[0086] For reference Figure 5 As shown, weighted voting fusion: weights are assigned to the two models based on the cross-validation accuracy.

[0087] XGBoost weight: 0.55.

[0088] Random forest weight: 0.45.

[0089] Accuracy of the fused model: 94.5%.

[0090] Stacking fusion: Using a linear model, the prediction results of the two models are used as new features for secondary training.

[0091] Accuracy of the fused model: 94.8%.

[0092] It has stronger generalization ability and is better adaptable to new data.

[0093] For reference Figure 6 As shown, abnormal fuel consumption detection: based on feature importance analysis of XGBoost, abnormal fuel consumption patterns are identified with an accuracy of 95.2%.

[0094] Driving style classification: The fusion model classifies driving styles into three categories: aggressive, stable, and economical, with a classification accuracy of 94.3%.

[0095] Driving condition recognition: Automatically recognizes driving conditions such as urban roads, highways, and mountain roads, with an accuracy rate of 93.8%.

[0096] Fuel consumption prediction: In the regression task, the fusion model has an RMSE of 0.125 and an R² of 0.958, and the prediction accuracy is more than 2.3% higher than that of the single model.

[0097] Example 3 is an embodiment of the present invention, which provides a diesel vehicle fuel consumption prediction and analysis system based on machine learning, including a data processing module, a feature extraction and dimensionality reduction module, and a multi-algorithm fusion prediction module.

[0098] The data processing module is used to perform missing value imputation, noise suppression, and outlier processing on data from different sources. Specifically, it uses a smart interpolation method 102 based on the KNN algorithm to fill in missing data and employs Gaussian filtering 104 to smooth the collected data such as engine speed, vehicle speed, and torque.

[0099] The feature extraction and dimensionality reduction module is used to extract features from the preprocessed data, including power system features, driving behavior features, driving environment features, and fuel efficiency features, and to reduce the dimensionality of the extracted features using the PCA method 201.

[0100] The multi-algorithm fusion prediction module is used to predict fuel consumption by combining two advanced machine learning algorithms, XGBoost and Random Forest, using a weighted ensemble strategy and Stacking method. It evaluates the performance of the trained fuel consumption prediction model 100 and performs real-time fuel consumption accuracy prediction.

[0101] This embodiment also provides a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements a machine learning-based method for predicting and analyzing diesel vehicle fuel consumption as proposed in the above embodiment.

[0102] This embodiment also provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements a machine learning-based method for predicting and analyzing diesel vehicle fuel consumption as proposed in the above embodiment.

[0103] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0104] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-including system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0105] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0106] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0107] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for predicting and analyzing diesel vehicle fuel consumption based on machine learning, characterized in that, include: A fuel consumption prediction model (100) is constructed, and intelligent interpolation (101) is used to impute missing values ​​in data from different sources. Gaussian filtering (104) is used to suppress noise in data from different sources. Oil consumption features were extracted from the imputed data (200), and simplified features were generated using the PCA method (201); A multi-algorithm fusion prediction framework (300) is constructed, the performance of the fuel consumption prediction model (100) after training is evaluated, and a weighted integration strategy and Stacking method are used to construct the real-time prediction accuracy of fuel consumption for the simplified features.

2. The method for predicting and analyzing diesel vehicle fuel consumption based on machine learning as described in claim 1, characterized in that: The intelligent interpolation (101) includes, The intelligent interpolation method based on the KNN algorithm (102) fills in the missing data. For time periods with missing rates higher than the missing threshold, linear interpolation (103) is used. By calculating the distance between the missing value sample and other complete samples, the nearest K neighbors are selected and the weighted average is obtained to fill in the missing data. Anomaly data points are identified and processed using the IQR method and the DBSCAN clustering algorithm, and a truncation strategy is adopted for extreme outliers. The intelligent interpolation method based on the KNN algorithm (102) is expressed as follows: Sample distance, expressed as: , The weighted average is expressed as: , , in, Indicates missing value samples and complete sample The distance between them This indicates the feature index where the sample with missing values ​​is located. When a sample has multiple features, It is the location of one of the features. Representing feature dimension, This represents the feature dimension index when calculating the Euclidean distance between samples. Indicates missing value samples In the Values ​​on each feature Indicates missing value samples In the Values ​​on each feature Indicates missing value samples In the Values ​​on each feature Indicates missing value samples In the Values ​​on each feature This indicates the number of nearest neighbors selected. Indicates the first The neighbor weights of each missing value sample are calculated based on the distance between the current neighbor and the target missing value sample. Indicates the minimum value; Linear interpolation (103) is expressed as: , in, Indicates the interpolation at the missing time point. , This represents consecutively missing data segments in a time series. and The timestamp representing a valid data point. Indicates the timestamp Valid observations at that time Indicates the timestamp Valid observations at that time.

3. The method for predicting and analyzing diesel vehicle fuel consumption based on machine learning as described in claim 1 or 2, characterized in that: The Gaussian filter (104) includes, The sensor data collected from the engine are smoothed to remove sensor noise. The data features are maintained and optimized by selecting an appropriate filter window size and standard deviation, and the data features are input into the fuel consumption prediction model (100). The mathematical expression for Gaussian filtering (104) is: , Calculation of the filtered signal: , in, Represents sensor data points Gaussian distribution value, This represents the standard deviation of a Gaussian distribution. Indicates the location of the sensor data points. Indicates to Filtered data values ​​from neighboring data points This represents the half-width of the Gaussian filter window, and the window size is... , Indicates the corresponding neighboring data points Gaussian function value, Indicates the location of the original data point. The value at that location.

4. The method for predicting and analyzing diesel vehicle fuel consumption based on machine learning as described in claim 3, characterized in that: The fuel consumption characteristics (200) include, Powertrain characteristics, driving behavior characteristics, driving environment characteristics, and fuel efficiency characteristics; Each feature is derived based on data processing algorithms and an automatic normalization selection mechanism; The data processing algorithm includes calculating the fuel consumption characteristics (200) of time series data based on fixed window and sliding window, and using the Holt-Winters exponential smoothing method to perform data denoising and smoothing processing for the first-order difference to capture the rate of change of data and the second-order difference to capture the acceleration of data change. The automatic normalization selection mechanism includes automatically identifying the data distribution type based on KS test and skewness-kurtosis analysis.

5. The method for predicting and analyzing diesel vehicle fuel consumption based on machine learning as described in any one of claims 1, 2, and 4, characterized in that: The PCA method (201) includes, Obtain the current covariance matrix and perform eigenvalue decomposition. Select the eigenvectors corresponding to the k largest eigenvalues ​​to form the projection matrix. Dimensionality reduction is achieved by projecting the original data into a new feature space, preserving the main features of the data. The number of principal components is automatically selected based on the cumulative variance contribution rate, and manual adjustment can be supported according to business needs.

6. The method for predicting and analyzing diesel vehicle fuel consumption based on machine learning as described in claim 5, characterized in that: The multi-algorithm fusion prediction framework (300) includes, XGBoost algorithm (301) and Random Forest algorithm (302); The XGBoost algorithm (301) has an objective function expressed as: , in, Describe the objective function. Indicates the first The loss function of the wheel, Indicates the first The regularization term for each tree.

7. The method for predicting and analyzing diesel vehicle fuel consumption based on machine learning as described in any one of claims 1, 2, 4, and 6, characterized in that: The random forest algorithm (302) includes, Out-of-bag error, expressed as: , in, This represents the out-of-bag error, which is the evaluation of the performance of each decision tree based on unsampled samples. This represents the number of samples used to calculate the error. Indicates the use of not containing the first The prediction results of the tree for each sample Indicates the first The true label of each sample.

8. A diesel vehicle fuel consumption prediction and analysis system based on machine learning, employing the diesel vehicle fuel consumption prediction and analysis method based on machine learning as described in any one of claims 1 to 7, characterized in that: It includes a data processing module, a feature extraction and dimensionality reduction module, and a multi-algorithm fusion prediction module; The data processing module is used to perform missing value interpolation, noise suppression and outlier processing on data from different sources. The module uses a smart interpolation method (102) based on the KNN algorithm to fill in missing data and uses Gaussian filtering (104) to smooth the collected engine speed, vehicle speed, torque and other data. The feature extraction and dimensionality reduction module is used to extract features from the preprocessed data, including power system features, driving behavior features, driving environment features and fuel efficiency features, and to reduce the dimensionality of the extracted features using the PCA method (201). The multi-algorithm fusion prediction module is used to predict fuel consumption by combining two advanced machine learning algorithms, XGBoost and Random Forest, using a weighted ensemble strategy and Stacking method, to evaluate the performance of the trained fuel consumption prediction model (100) and to predict fuel consumption accuracy in real time.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the machine learning-based diesel vehicle fuel consumption prediction and analysis method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the machine learning-based diesel vehicle fuel consumption prediction and analysis method as described in any one of claims 1 to 7.