A Method for Predicting Charging Power of New Energy Vehicles Based on Tree Model

Through the combination of deep neural network and improved XGBoost residual correction model, multi-scale features are extracted using one-dimensional causal convolution and bidirectional GRU, and through dynamic parameter adjustment methods, the complexity problem of charging capacity prediction of new energy vehicles is solved, high-precision and robust prediction are achieved, and charging station resource configuration and power grid management are optimized.

CN120031258BActive Publication Date: 2025-08-05CHANGCHUN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510502613.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-22
Publication Date
2025-08-05
Estimated Expiration
2045-04-22

AI Technical Summary

Technical Problem

The existing charging power forecast method for new energy vehicles is difficult to take into account the impact of short-term fluctuations, long-term trends and new energy fluctuations, resulting in unstable prediction accuracy and difficult to meet the needs of power grid scheduling and charging station resource allocation.

Method used

The deep neural network is combined with the improved XGBoost residual correction model, and one-dimensional causal convolution and bidirectional GRU extract multi-scale local timing features, combined with dynamic splitting mechanism, residual adaptive regularization mechanism and dynamic mixed loss function method, adaptively adjust the model parameters to achieve accurate fitting of nonlinear and variable errors.

Benefits of technology

It significantly improves the accuracy and robustness of charging capacity prediction for new energy vehicles, optimizes the resource allocation of charging stations, reduces the operating costs of the power grid, and promotes the coordinated development of the smart grid and the new energy vehicle industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120031258B_ABST
    Figure CN120031258B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of prediction and optimization of charging power of new energy vehicles, and discloses a method for predicting charging power of new energy vehicles based on a tree model, which aims to solve the problems of low prediction accuracy and poor robustness of traditional methods when processing complex nonlinear, non-time series and long-tail distribution data. The method first pre-processes the original data, then constructs a deep neural network model to obtain preliminary prediction values and calculate the residual sequence; then uses the dynamic setting #imgabs0# method, the dynamic adjustment gamma method and the dynamic mixed loss function method to improve the XGBoost residual correction model, and corrects the residual to achieve adaptive parameter optimization of interactive information based on the statistical characteristics of the residual sequence and candidate features; finally, the preliminary prediction value is fused with the residual correction value to obtain the final charging power prediction value. This method significantly improves the robustness and accuracy of the new energy vehicle charging power prediction, and is widely applicable to the intelligent prediction and optimization of complex charging scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of prediction and optimization of charging power of new energy vehicles, and specifically to a method for predicting charging power of new energy vehicles based on a tree model. Background Art

[0002] With the popularization of new energy vehicles, the charging demand of electric vehicles (EVs) has brought new challenges to grid load management, optimal layout of charging stations and new energy consumption.

[0003] Reasonable prediction of new energy vehicle charging power can not only improve the accuracy of grid scheduling and reduce the impact of charging loads on the grid, but also optimize the resource allocation of charging stations, improve charging efficiency, and alleviate the imbalance between power supply and demand during peak charging periods. However, because new energy vehicle charging behavior is influenced by multiple factors such as user habits, charging station location, electricity pricing strategies, weather factors, and fluctuations in new energy output, the charging power of new energy vehicles exhibits strong nonlinearity, time-dependent, and high volatility, increasing the complexity of prediction.

[0004] Existing new energy vehicle charging power prediction methods mainly include three types of methods based on statistical analysis, time series modeling, and machine learning:

[0005] Statistical analysis methods are mainly used to process linear and stationary data, which makes it difficult to capture the complex nonlinear changes in the charging power of new energy vehicles and has low prediction accuracy.

[0006] The time series modeling method can establish the time dependence of charging power and is suitable for long-term trend prediction. However, its prediction effect is highly sensitive to the selection of time windows and is easily affected by outliers, emergencies and fluctuations in new energy sources, resulting in large prediction deviations.

[0007] Machine learning methods have been applied in charging power prediction. These models can effectively handle complex nonlinear features and have good interpretability. However, due to their limited ability to capture time series information, they are still insufficient in dealing with the long-term dependence and trend changes of new energy vehicle charging power.

[0008] Existing methods for predicting charging power based on a single model struggle to simultaneously account for short-term fluctuations, long-term trends, and the impact of fluctuations in renewable energy sources. This leads to unstable prediction accuracy and makes it difficult to meet the needs of renewable energy consumption and smart grid scheduling. Therefore, building a prediction model that combines time series feature extraction and nonlinear modeling capabilities to improve the accuracy and robustness of new energy vehicle charging power prediction is an urgent problem in this field.

[0009] In response to the above problems, this paper proposes a new energy vehicle charging power prediction method based on a tree model. This method combines a deep neural network with an improved XGBoost residual correction model, extracting multi-scale local temporal features and global temporal dependencies in charging behavior through one-dimensional causal convolution and bidirectional Gated Recurrent Unit (GRU), thereby generating preliminary prediction results. The innovation lies in improving the XGBoost residual correction model and using dynamic settings. The dynamic adjustment gamma method and the dynamic mixed loss function method adaptively adjust the model parameters according to the statistical characteristics of the input residual sequence (such as quantile, standard deviation, skewness, kurtosis, etc.) to achieve accurate fitting of nonlinear and variable errors.

[0010] This improved model can not only effectively capture the short-term fluctuations and long-term trends of new energy vehicle charging behavior, but also better reflect its complex nonlinear relationship, thereby significantly improving prediction accuracy and providing more accurate data support for smart grid optimization scheduling, charging station resource allocation and new energy power consumption. Summary of the Invention

[0011] The purpose of the present invention is to provide a method for predicting the charging power of new energy vehicles based on a tree model to solve the problems raised in the above background technology.

[0012] To achieve the above object, the present invention provides the following technical solution: a method for predicting the charging power of new energy vehicles based on a tree model, the method comprising:

[0013] Step 1: Preprocess the raw data, including converting columns containing date information into numerical format; using wavelet decomposition to denoise the target variable; using methods based on interquartile range (IQR) and local outlier factor (LOF) to detect outliers and remove outlier samples; normalizing numerical features; and label encoding categorical features.

[0014] Step 2: Build a deep neural network model. The numerical feature input part uses one-dimensional causal convolution to extract multi-scale local temporal features, and combines it with a bidirectional GRU to capture global temporal dependencies. An independent embedding layer is set for the categorical features to map the discrete variables to a low-dimensional vector space and then fuse them with the numerical features. After processing through the fully connected layer and the Dropout layer, the preliminary prediction results are output.

[0015] Step 3: Calculate the difference between the target variable and the initial prediction result of the deep neural network to obtain the residual sequence.

[0016] Step 4: Use the improved XGBoost residual correction model to model and predict the residuals. The improved model adopts a dynamic splitting mechanism (dynamic setting method), residual adaptive regularization mechanism (dynamic adjustment gamma method) and dynamic mixed loss function method, which adaptively adjust model parameters according to the statistical characteristics of the input residual sequence such as quantile, standard deviation, skewness, and kurtosis, thereby achieving accurate fitting of the residuals.

[0017] Step 5: Add the preliminary prediction results of the deep neural network to the residuals predicted by the improved XGBoost residual correction model to obtain the final prediction value of the charging power of the new energy vehicle.

[0018] Preferably, the dynamic splitting mechanism (dynamic setting Methods) include:

[0019] The statistical indicators of the residual sequence are used to analyze the current residual sequence of the model, determine the degree of residual fluctuation, and adopt the following adjustment function:

[0020]

[0021] Where, Represents the standard deviation of the current residual series; is the preset reference standard deviation; when When , it indicates that the residual fluctuation is large (there is a long tail phenomenon), when , indicating that the residual distribution is more concentrated.

[0022] At the same time, the mutual information between all candidate feature pairs (i.e., feature pairs formed by combining all input features) and the residual is evaluated, and its mutual information index is It can be calculated as follows:

[0023]

[0024] Where, Representation characteristics and and residuals The joint probability distribution of and Respectively and 、 and The marginal probability distribution of .

[0025] In order to standardize the candidate feature mutual information index and reflect its impact on the split decision, the present invention provides a normalization adjustment function , which can be set as:

[0026]

[0027] Where, is the maximum mutual information value among the candidate feature pairs, is the preset reference interaction information value; and is a positive adjustment parameter used to amplify or reduce the influence of candidate features on the interaction effect; when When , it indicates that the candidate feature pair has a strong interaction effect; when , it indicates that the interaction effect of candidate features is weak.

[0028] Based on the above adjustment function, the present invention dynamically sets The calculation formula of the method is:

[0029]

[0030] Where, Indicates the final maximum depth of the decision tree in the XGBoost residual correction model; Indicates the preset base tree depth; It is the basic adjustment increment used to increase the tree depth when the residual fluctuation is large (long tail situation); is the basic adjustment reduction used to reduce the tree depth when the residual distribution is concentrated (short-tailed case); is the adjustment function based on the residual statistical index; Represents the normalized adjustment function, which is used to reflect the strength of the interaction effect of candidate features.

[0031] Through the dynamic adjustment mechanism, during the model training process, external callbacks or custom training loops can be used to update in real time and The value of , and dynamically adjust the subsequent tree construction accordingly This method can increase the tree depth when the residuals fluctuate greatly and the interaction effect of candidate features is significant, thereby enhancing the fitting ability of tail data and complex nonlinear relationships. It can also reduce the tree depth when the residual distribution is relatively concentrated, preventing overfitting and saving training resources, thereby improving the overall prediction accuracy and generalization ability of the model.

[0032] Preferably, the residual adaptive regularization mechanism (dynamic gamma adjustment method) includes:

[0033] Perform statistical analysis on the residual sequence generated by the preliminary forecast model and calculate the skewness of the residual sequence and kurtosis ; Set the preset base regularization weight , coefficient used to normalize skewness And the kurtosis reference value , and define the residual adaptive regularization adjustment function , whose expression is:

[0034]

[0035] Where, A positive adjustment coefficient is used to control the impact of skewness and kurtosis on the adjustment amplitude; is the skewness of the residual sequence; represents the coefficient used to normalize skewness; is the kurtosis of the residual sequence; is the preset kurtosis reference value.

[0036] According to the adjustment function Calculating dynamic regularization weights , the formula is:

[0037]

[0038] Where, is the preset basic regularization weight; Represents the residual adaptive regularization adjustment function, whose value reflects the abnormality of the residual distribution.

[0039] Through the residual adaptive regularization mechanism, the model can be used in the face of outliers or tailing in the residual distribution (i.e. or Larger), increase value, so that Reduce to improve model flexibility; when the residual distribution is stable, The value is close to 1, It approaches , thereby enhancing the regularization effect and helping to improve the stability and generalization ability of the overall prediction.

[0040] Preferably, the dynamic hybrid loss function method includes:

[0041] A dynamic hybrid loss function is used, which dynamically weights the mean square error loss and the quantile error loss according to the statistical characteristics of the residual distribution to achieve a balanced fitting of outliers and regular data; specifically, for each sample, its predicted residual Defined as the difference between the actual value and the model predicted value, dynamic hybrid loss function The expression is:

[0042]

[0043] Where, represents the mean square error loss; represents the quantile error loss, is the preset quantile, is the indicator function, when hour, ,when hour, ; is a dynamic weight, based on the skewness of the residual sequence and kurtosis Automatically determined, the calculation formula is:

[0044]

[0045] Where, Indicates the skewness of the residual sequence; represents the kurtosis of the residual sequence; is the preset skewness reference value; is the preset kurtosis reference value; is a positive adjustment coefficient to control the impact of skewness and kurtosis on the adjustment amplitude; when the residual distribution is abnormal (i.e. or Larger), The value of is reduced, thereby increasing the proportion of quantile error loss in the hybrid loss function to enhance the robustness to large residuals; when the residual distribution is stable, A value close to 1 makes the mean square error loss dominant and ensures the overall prediction accuracy.

[0046] In the actual training process, each data point is trained separately using Calculate the gradient and Hessian matrix, whose expressions are:

[0047]

[0048] Where, is the loss function right The first derivative of ; is the loss function right The second derivative of When it is small, the dynamic hybrid loss function The gradient and Hessian matrix of are close to the mean square error loss, ensuring the smooth convergence of the model within the backbone data interval; when When the predetermined threshold is exceeded, the quantile error loss plays a dominant role, its gradient tends to a constant and the Hessian matrix value tends to zero, thereby effectively reducing the interference of abnormal samples on model training (especially split point selection) and improving overall robustness.

[0049] Preferably, the deep neural network model includes:

[0050] Multi-level residual connections and self-attention mechanisms are used to adaptively fuse the multi-scale local temporal features extracted by the one-dimensional causal convolutional layer with the global temporal features extracted by the bidirectional GRU. Features of different scales are dynamically weighted and combined through the gated residual module, and the self-attention module is used to automatically capture the long-distance dependencies between features, thereby significantly improving the sensitivity to the temporal changes in the charging demand of new energy vehicles and the prediction accuracy.

[0051] Compared with the prior art, the present invention has the following beneficial effects:

[0052] The present invention achieves accurate capture of short-term fluctuations and long-term trends in the charging power of new energy vehicles by integrating deep neural networks with improved XGBoost residual correction models. Specifically, the present invention uses one-dimensional causal convolution and bidirectional GRU layers to extract multi-scale local and global time series features, while configuring independent embedding layers for categorical variables to effectively integrate multi-source data characteristics and generate high-quality preliminary prediction results; further, the improved XGBoost residual correction model is used to model the residual between the preliminary prediction and the actual value. Its core innovation lies in the introduction of a dynamic splitting mechanism (dynamic setting method), residual adaptive regularization mechanism (dynamic adjustment gamma method) and dynamic mixed loss function method can adaptively adjust model parameters according to the statistical characteristics of the residual sequence such as quantile, standard deviation, skewness, kurtosis, etc., so as to accurately correct complex nonlinear errors. This mechanism greatly surpasses the fixed parameter strategy of residual modeling in existing technologies.

[0053] In addition, the present invention adopts wavelet denoising, interquartile range (IQR) and local outlier factor (LOF) methods in the data preprocessing stage, which can effectively eliminate outliers and eliminate short-term high-frequency noise, ensuring the stability and accuracy of the input data; and uses a small-scale hyperparameter search to fine-tune the deep network and the improved XGBoost residual correction model, so that the entire prediction system can maintain high accuracy and good robustness under different charging demand and grid load environments.

[0054] Therefore, the present invention not only significantly reduces the prediction error of the charging power of new energy vehicles, improves the charging scheduling accuracy, and reduces the idle rate of charging facilities; it also optimizes the resource allocation of charging stations, reduces the operating costs of the power grid, effectively alleviates the contradiction between electricity supply and demand, and brings significant economic benefits; further, the dynamic residual correction mechanism of the present invention helps to improve the efficiency of new energy consumption, promote the coordinated development of smart grids and new energy vehicle industries, and promote green and low-carbon transformation. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 This is a flow chart of the overall model of the new energy vehicle charging power prediction method based on the tree model of the present invention;

[0056] Figure 2 Flowchart for preprocessing charging power data of new energy vehicles;

[0057] Figure 3 Flowchart of the deep neural network prediction model for new energy vehicle charging capacity;

[0058] Figure 4 Flowchart of the improved XGBoost residual correction model. DETAILED DESCRIPTION

[0059] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0060] See also Figure 1-4 The present invention provides a method for predicting the charging power of new energy vehicles, and its overall implementation scheme is as follows:

[0061] Step 1: Acquire and preprocess charging data: First, acquire new energy vehicle charging data by interacting with the data acquisition terminal of the charging station monitoring system. Simultaneously, extract charging records within a certain timeframe (e.g., one year) from the historical data repository and divide them into multiple time periods. The acquired data is then preprocessed, including: converting columns containing date information into numerical format (timestamps); using wavelet decomposition to denoise the target variable (charge level) and eliminate short-term high-frequency noise; detecting abnormal data using the interquartile range (IQR) and local outlier factor (LOF) methods and removing outliers; normalizing numerical features, label encoding categorical features, and configuring a separate embedding layer for each category to ensure data quality and consistency.

[0062] Step 2: Build a deep neural network model: Using the preprocessed data, a deep neural network model is constructed to generate preliminary prediction results. Specifically, the numerical features are first processed through a one-dimensional causal convolutional layer (using different dilation rates) to extract multi-scale local temporal features, and then through a bidirectional GRU layer to capture global temporal dependencies. The categorical features are converted to low-dimensional vectors through their respective embedding layers and fused with the extracted numerical features. The fused features are then processed through a fully connected layer and a dropout layer to output a preliminary prediction of the charging capacity of new energy vehicles.

[0063] Step 3: Calculate the prediction residuals: Compare the initial predictions from the deep neural network with the actual values of the target variable, and calculate the difference between the two to obtain a residual sequence. This residual sequence reflects the error patterns that the initial predictions from the deep neural network failed to capture, providing a basis for subsequent residual correction.

[0064] Step 4: Improved XGBoost residual correction model dynamic parameter optimization: For the residual sequence, the improved XGBoost residual correction model is used to model and predict the residual to achieve residual correction. Its core innovation lies in the introduction of a dynamic parameter adaptive adjustment mechanism, including the use of dynamic settings Method, based on the quantile or standard deviation of the residual sequence, adaptively determines the final maximum depth of the decision tree in the XGBoost residual correction model; uses the dynamic adjustment gamma method to adaptively adjust the regularization weight according to the skewness and kurtosis of the residual distribution ; A dynamic hybrid loss function method is adopted, through a dynamic weighted combination of mean square error loss and quantile error loss, and the weighting parameters are automatically adjusted according to the skewness and kurtosis of the residual, so as to achieve accurate correction of complex nonlinear errors.

[0065] Step 5: Generate the final prediction results and jointly optimize hyperparameters: The initial prediction results generated by the deep neural network are added to the residuals predicted by the modified XGBoost residual correction model to obtain the final predicted value of the new energy vehicle charging capacity. At the same time, a small-scale hyperparameter search is performed on the training and validation sets to jointly optimize the key parameters of the deep neural network and the modified XGBoost residual correction model to ensure that the system maintains high accuracy and good robustness under different charging demand and grid load conditions. The overall prediction effect is verified on the test set.

[0066] The implementation of the present invention is further described below in conjunction with the embodiments.

[0067] Example:

[0068] The purpose of this embodiment is to explain in detail how to accurately establish a new energy vehicle charging power prediction model. The implementation process and key technologies of each link are described in detail below.

[0069] First, by interacting with the data acquisition terminal of the charging station monitoring system, real-time new energy vehicle charging data is obtained from the Adaptive Charging Network (ACN) website and historical data repository. The data includes 28 relevant features such as station ID, dwell time, charging time, and charging power.

[0070] Table 1 Some feature samples of the ACN dataset

[0071]

[0072] The steps for preprocessing the acquired data include:

[0073] (1) Convert fields containing date information (such as "time") into a standard date format and convert them into a numeric timestamp.

[0074] (2) Calculation formula based on the interquartile range (IQR) and , calculate the first quartile and the third quartile ,in is a weight coefficient, which indicates the weighting degree of the quartile difference. , and remove those below or higher At the same time, the local outlier factor (LOF) algorithm is combined to further detect the features (stay time, charging time and charging capacity) and eliminate outlier samples.

[0075] (3) A two-level wavelet decomposition is performed on the “charging power” data. In addition, to further reflect the characteristics of charging behavior, this embodiment constructs a derived feature “charging ratio”. This derived feature helps to reveal the relationship between parking and charging, and provides a powerful input for subsequent models to capture charging behavior.

[0076] The derived feature "Charge Ratio" is calculated as:

[0077]

[0078] Where, This is a very small constant used to prevent a division by zero error when the charging time is 0.

[0079] (4) Normalize the numerical features and map the data to [0, 1]; label encode the categorical features and configure an independent embedding layer for each category to facilitate subsequent deep model fusion.

[0080] The data set is divided into a training set, a validation set, and a test set using a ratio of 6:2:2 for the 10,398 charging sessions in this embodiment.

[0081] Then, the preprocessed data is input into the deep neural network prediction model as a sample set.

[0082] The deep neural network model first processes the numerical feature input through a one-dimensional causal convolutional layer. This convolutional layer uses a causal filling mechanism to ensure that future information is not leaked in the time series, and extracts multi-scale local time series features by setting different expansion rates.

[0083] Subsequently, the output of the convolutional layer is further processed by the bidirectional GRU layer to capture the long-term dependencies between the forward and backward directions and model the global temporal characteristics of the charging behavior.

[0084] At the same time, the model uses an independent embedding layer for category features to map discrete data into a low-dimensional vector space, and effectively fuses it with the numerical feature extraction results after flattening.

[0085] The fused features are further processed by the fully connected layer and the Dropout layer, and finally the preliminary prediction results of the charging power of new energy vehicles are output.

[0086] This model structure fully integrates the advantages of the convolutional layer in local feature extraction, the GRU in long-range dependency modeling, and the embedding layer in category information processing, providing high-quality basic predictions for subsequent residual correction while helping to reduce the overall prediction error.

[0087] Next, the initial predictions from the deep neural network model are compared with the actual target variable, and the difference is calculated to form a residual sequence. This residual sequence reflects the shortcomings of the initial prediction model under complex nonlinear error patterns and is a key input to the improved XGBoost residual correction model.

[0088] The residual sequence is used as the input of the improved XGBoost residual correction model for residual correction. Its main innovation is to introduce a dynamic parameter adaptive adjustment mechanism. method, dynamically adjusted gamma method and dynamic mixed loss function method, realize the adaptive optimization of key parameters of the model, so that the model can automatically adjust according to the different characteristics of the residual sequence, improve the fitting ability of tail data and complex nonlinear relationships, and prevent overfitting when the residual is stable, ensuring a significant improvement in overall prediction accuracy and generalization performance.

[0089] Some key parameters in the traditional XGBoost model, such as maximum depth and regularization weight The loss function is usually a fixed value and is difficult to adapt to the needs of different residual distributions. This embodiment achieves the following dynamic adjustments through statistical analysis of residual data:

[0090] (1) Dynamic splitting mechanism (dynamic setting Method): This embodiment presets the base tree depth , and set the basic adjustment increment when the residual fluctuation is large (long tail situation) , and the basis adjustment reduction under the concentrated (short-tailed) residual distribution .

[0091] First, the residual sequence generated by the preliminary forecast model Calculate its standard deviation , and preset the reference standard deviation is the standard deviation of the initial residual sequence. The residual volatility adjustment function is defined as:

[0092]

[0093] Where, Represents the standard deviation of the current residual series; is the preset reference standard deviation; when When , it indicates that the residual fluctuation is large (there is a long tail phenomenon), when , indicating that the residual distribution is more concentrated.

[0094] At the same time, this embodiment evaluates the interaction information between all candidate feature pairs (i.e., all input feature pairs) and the residuals, and defines the candidate feature interaction index for:

[0095]

[0096] Where, Representation characteristics and and residuals The joint probability distribution of and Respectively and 、 and The marginal probability distribution of .

[0097] To normalize the interaction effect of candidate features, define the normalization adjustment function for:

[0098]

[0099] Where, is the maximum mutual information value among the candidate feature pairs, is the preset reference interaction information value; and is a positive adjustment parameter used to amplify or reduce the influence of candidate features on the interaction effect; when When , it indicates that the candidate feature pair has a strong interaction effect; when , it indicates that the interaction effect of candidate features is weak.

[0100] Finally, in order to enhance the fitting ability of tail data and complex nonlinear relationships, the formula is used to dynamically increase the tree depth:

[0101]

[0102] Where, Indicates the final maximum depth of the decision tree in the XGBoost residual correction model; Indicates the preset base tree depth. In this embodiment, ; In order to increase the basic adjustment increment for tree depth when the residual fluctuation is large (long tail situation), this embodiment takes ; In order to reduce the base adjustment amount for reducing the tree depth when the residual distribution is concentrated (short-tailed case), this embodiment takes ; is the adjustment function based on the residual statistical index; Represents the normalized adjustment function, which is used to reflect the strength of the interaction effect of candidate features. In this embodiment, to simplify the calculation, .

[0103] (2) Residual adaptive regularization mechanism (dynamic adjustment gamma method): regularization weight It is used to control the minimum loss reduction required for splitting leaf nodes. The larger the value, the more difficult it is for the model to perform node division, thereby enhancing the regularization strength to a certain extent and helping to prevent overfitting.

[0104] This embodiment presets the basic regularization weight . First calculate the skewness of the residual sequence and kurtosis , preset normalized skewness coefficient , kurtosis reference value , and define the residual adaptive regularization adjustment function as:

[0105]

[0106] Where, is a positive adjustment coefficient used to control the influence of skewness and kurtosis on the adjustment amplitude. ; is the skewness of the residual sequence; Represents the coefficient used to normalize the skewness. In this embodiment, ; is the kurtosis of the residual sequence; is the preset kurtosis reference value. In this embodiment, .

[0107] According to the adjustment function Calculating dynamic regularization weights , the formula is:

[0108]

[0109] Where, is the preset basic regularization weight. ; Represents the residual adaptive regularization adjustment function, whose value reflects the abnormality of the residual distribution.

[0110] Through the residual adaptive regularization mechanism, the model can be used in the face of outliers or tailing in the residual distribution (i.e. or Larger), increase value, so that Reduce to improve model flexibility; when the residual distribution is stable, The value is close to 1, It approaches , thereby enhancing the regularization effect and helping to improve the stability and generalization ability of the overall prediction.

[0111] (3) Dynamic hybrid loss function method: In order to improve the robustness of the XGBoost residual correction model in the regression task, this embodiment adopts a dynamic hybrid loss function method, which dynamically weights the mean square error loss and the quantile error loss according to the statistical characteristics of the residual sequence. For each sample, its predicted residual Defined as the difference between the actual value and the model's predicted value. Dynamic Hybrid Loss Function The expression is:

[0112]

[0113] Where, represents the mean square error loss; represents the quantile error loss, is the preset quantile, is the indicator function, when hour, ,when hour, ; is a dynamic weight, based on the skewness of the residual sequence and kurtosis Automatically determined, the calculation formula is:

[0114]

[0115] Where, Indicates the skewness of the residual sequence; represents the kurtosis of the residual sequence; is the preset skewness reference value. ; is the preset kurtosis reference value. In this embodiment, ; is a positive adjustment coefficient used to control the influence of skewness and kurtosis on the adjustment amplitude. ; When the residual distribution is abnormal (i.e. or Larger), The value of is reduced, thereby increasing the proportion of quantile error loss in the hybrid loss function to enhance the robustness to large residuals; when the residual distribution is stable, A value close to 1 makes the mean square error loss dominant and ensures the overall prediction accuracy.

[0116] In the actual training process, each data point is trained separately using Calculate the gradient and Hessian matrix to guide the split point selection and leaf node weight update of the decision tree in the XGBoost residual correction model. Their expressions are:

[0117]

[0118] Where, is the loss function right The first derivative of ; is the loss function right The second derivative of When it is small, the dynamic hybrid loss function The gradient and Hessian matrix of are close to the mean square error loss, ensuring the smooth convergence of the model within the backbone data interval; when When the threshold is exceeded, the quantile loss plays a dominant role, its gradient tends to a constant and the Hessian matrix value tends to zero, thereby effectively reducing the interference of abnormal samples on model training (especially split point selection) and improving overall robustness.

[0119] Based on the above dynamic parameter calculation, the parameters of the improved XGBoost residual correction model are set as follows in this embodiment:

[0120]

[0121] Where, Represents the model optimization objective, set to , that is, minimize the square error; is the learning rate, which is used to control the step size of each iteration to prevent overfitting; Indicates the sample sampling ratio used in each tree training, which helps improve the generalization ability of the model; Indicates the feature sampling ratio used in each tree training, which helps to reduce feature redundancy; The maximum final depth of the decision tree in the model plays a key role in regulating the model's expressiveness and overfitting risk. It is the minimum split loss gain threshold, which can adjust the complexity of the model structure and play a regularization role.

[0122] The model is trained on the residual sequence and outputs corrections to compensate for deficiencies in the initial predictions of the deep neural network.

[0123] Finally, the preliminary predictions from the deep neural network are added to the residuals predicted by the improved XGBoost residual correction model to obtain the final predicted value for the new energy vehicle's charging capacity. To further improve model performance, this example performs a small-scale hyperparameter search and joint optimization of key parameters of the deep neural network and the improved XGBoost residual correction model on the training and validation sets, ensuring that the entire system maintains high accuracy and good robustness under different charging demand and grid load conditions. The overall prediction results are finally verified on the test set.

[0124] In this embodiment, the results of the prediction of the new energy vehicle charging power data by the neural network prediction model and the improved XGBoost residual correction model are compared with the results predicted by the other three mainstream models.

[0125] Table 2 Model R 2 Results comparison table

[0126]

[0127] Aside from the main algorithm, maintaining all other conditions consistent, using the ARIMA, LSTM, and XGBoost models to predict charging power in the ACN dataset yielded unsatisfactory results. This is due to the complex nonlinear variations, outliers, and unexpected conditions in new energy vehicle charging power data. Consequently, the drawbacks of the three compared models are clearly evident.

[0128] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.

Claims

1. A method for predicting charging power of new energy vehicles based on a tree model, characterized in that: The method comprises: Step 1: Obtain new energy vehicle charging data by interacting with the data acquisition terminal of the charging station monitoring system. At the same time, extract charging records within a certain time range from the historical data repository and divide them into multiple time periods according to the time series. Preprocess the raw data, including converting columns containing date information into numerical format; using wavelet decomposition to denoise the target variable; using methods based on interquartile range and local anomaly factors to detect outliers and remove outlier samples; normalize numerical features; and label encode categorical features. The target variable is charging power. Step 2: Build a deep neural network model. For numerical feature input, a one-dimensional causal convolution is used to extract multi-scale local temporal features, combined with a bidirectional gated recurrent unit to capture global temporal dependencies. A separate embedding layer is used for categorical features, mapping discrete variables to a low-dimensional vector space before fusing them with the numerical features. After processing through a fully connected layer and a dropout layer, a preliminary prediction of the charging capacity of new energy vehicles is output. Step 3: Calculate the difference between the target variable and the initial prediction result of the deep neural network to obtain the residual sequence; Step 4: Use the improved XGBoost residual correction model to model and predict the residuals. The improved model adopts a dynamic splitting mechanism, a residual adaptive regularization mechanism, and a dynamic hybrid loss function method to adaptively adjust the model parameters according to the statistical characteristics of the input residual sequence, such as quantile, standard deviation, skewness, and kurtosis, so as to achieve accurate fitting of the residuals. The dynamic splitting mechanism includes: The statistical indicators of the residual sequence are used to analyze the current residual sequence of the model, determine the degree of residual fluctuation, and adopt the following adjustment function: f(σ_current)=σ_current / σ _ reference Where σ_current represents the standard deviation of the current residual sequence; σ_reference is the preset reference standard deviation; when f(σ_current)>1, it indicates that the residual fluctuation is large, and when f(σ_current)≤1, it indicates that the residual distribution is relatively concentrated; At the same time, the mutual information between all candidate feature pairs and residuals is evaluated, and its mutual information index I(f i , f j ; r) can be calculated as follows: I(f i ,f j ;r)=∑ x ∑ y P(x,y,r)log{P(x,y,r) / [P(x,r)·P(y,r)]} Where P(x, y, r) represents the feature f i With f j and the joint probability distribution of the residual r, P(x, r) and P(y, r) represent f i With r, f j and the marginal probability distribution of r; In order to standardize the candidate feature mutual information index and reflect its impact on the splitting decision, the present invention provides a normalization adjustment function h(I), which can be set as: Where, I max is the maximum mutual information value among the candidate feature pairs, I ref is the preset reference mutual information value; α and β are positive adjustment parameters used to amplify or reduce the influence of candidate features on the interaction effect; when h(I)>1, it means that the candidate feature pair has a strong interaction effect; when h(I)<1, it means that the candidate feature pair has a weak interaction effect; Based on the above adjustment function, the calculation formula of the method for dynamically setting max_depth in the present invention is: Where max_depth represents the final maximum depth of the decision tree in the XGBoost residual correction model; d0 represents the preset base tree depth; ω is the basic adjustment increment used to increase the tree depth when the residual fluctuation is large; ω′ is the basic adjustment decrement used to reduce the tree depth when the residual distribution is concentrated; f(σ_current) is the adjustment function based on the residual statistical indicator; h(I) represents the normalization adjustment function, which is used to reflect the strength of the interaction effect of candidate features. Through the dynamic adjustment mechanism, during the model training process, the values of f(σ_current) and h(I) can be updated in real time using external callbacks or custom training loops, and the max_depth parameter used in subsequent tree construction can be dynamically adjusted accordingly. This method can increase the tree depth when the residuals fluctuate greatly and the interaction effects of candidate features are significant, thereby enhancing the ability to fit tail data and complex nonlinear relationships. It can also reduce the tree depth when the residual distribution is relatively concentrated, preventing overfitting and saving training resources, thereby improving the overall prediction accuracy and generalization ability of the model. The residual adaptive regularization mechanism includes: Perform statistical analysis on the residual sequence generated by the preliminary prediction model, calculate the skewness S and kurtosis K of the residual sequence; set the preset basic regularization weight γ base , coefficient S used to normalize skewness scale And the kurtosis reference value K ref , and define the residual adaptive regularization adjustment function g(S, K), whose expression is: g(S,K)=1+a·(|S| / S scale +|K-K ref | / K ref ) Where a is a positive adjustment coefficient, which is used to control the influence of skewness and kurtosis on the adjustment amplitude; S is the skewness of the residual sequence; S scale represents the coefficient used to normalize the skewness; K is the kurtosis of the residual sequence; K ref is the preset kurtosis reference value; Calculate the dynamic regularization weight γ according to the adjustment function g(S, K) dy , the formula is: c dy =c base / g(S,K) Where, γ base is the preset basic regularization weight; g(S, K) represents the residual adaptive regularization adjustment function, and its value reflects the abnormality of the residual distribution; Through the residual adaptive regularization mechanism, the model can increase the g(S, K) value when there are outliers or tailing phenomena in the residual distribution, so that γ dy Reduce to improve model flexibility; when the residual distribution is stable, the g(S, K) value is close to 1, γ dy It approaches γ base , thereby enhancing the regularization effect and helping to improve the stability and generalization ability of the overall prediction; The dynamic hybrid loss function method includes: A dynamic hybrid loss function is adopted, which dynamically weights the mean square error loss and the quantile error loss according to the statistical characteristics of the residual distribution to achieve a balanced fitting of outliers and regular data. Specifically, for each sample, its prediction residual e is defined as the difference between the actual value and the model predicted value. The expression of the dynamic hybrid loss function L(e) is: L(e)=λ·L m (e)+(1−λ)·L q (and) Where, L m (e) = e 2 represents the mean square error loss; L q (e) = e [τ - J(e < 0)] represents the quantile error loss, τ is the preset quantile, J(e < 0) is the indicator function, when e < 0, J(e < 0) = 1, when e ≥ 0, J(e < 0) = 0; λ is a dynamic weight, which is automatically determined according to the skewness S and kurtosis K of the residual sequence. Its calculation formula is: λ=1-a·(|S-S ref | / S ref +|K-K ref | / K ref ) In the formula, S represents the skewness of the residual sequence; K represents the kurtosis of the residual sequence; S ref is the preset skewness reference value; K ref is the preset kurtosis reference value; a is a positive adjustment coefficient, which is used to control the influence of skewness and kurtosis on the adjustment amplitude; when the residual distribution is abnormal, that is, |SS ref |or|KK ref When | is large, the λ value decreases, thereby increasing the proportion of quantile error loss in the hybrid loss function to enhance the robustness to large residuals; when the residual distribution is stable, the λ value is close to 1, making the mean square error loss dominant and ensuring the overall prediction accuracy; In the actual training process, L(e) is used to calculate the gradient and Hessian matrix for each data point, and their expressions are: G(e)=dL(e) / de, H(e)=d 2 The / of 2 Where G(e) is the first-order derivative of the loss function L(e) with respect to e; H(e) is the second-order derivative of the loss function L(e) with respect to e. When |e| is small, the gradient and Hessian matrix of the dynamic hybrid loss function L(e) are close to the mean square error loss, ensuring smooth convergence of the model within the backbone data interval. When |e exceeds the predetermined threshold, the quantile error loss plays a dominant role, its gradient tends to a constant and the Hessian matrix value tends to zero, thereby effectively reducing the interference of abnormal samples on model training and improving overall robustness. Step 5: Add the preliminary prediction results of the deep neural network to the residuals predicted by the improved XGBoost residual correction model to obtain the final prediction value of the charging power of the new energy vehicle.

2. The method according to claim 1, characterized in that The deep neural network model includes: Multi-level residual connections and self-attention mechanisms are used to adaptively fuse the multi-scale local temporal features extracted by the one-dimensional causal convolution layer with the global temporal features extracted by the bidirectional Gated Recurrent Unit. Features of different scales are dynamically weighted and combined through the gated residual module, and the self-attention module is used to automatically capture the long-distance dependencies between features, thereby significantly improving the sensitivity to the temporal changes in the charging demand of new energy vehicles and the prediction accuracy.

Citation Information

Patent Citations

  • Solder paste printing quality prediction system and method based on XGBoost-LSTM mixed model

    CN118247262A

  • Electric vehicle charging load influence factor evaluation and prediction method based on combined weight

    CN118644097A