Charging Demand Prediction Method for Charging Stations and Operation Optimization Method for Electric Buses

By adopting a random forest model to screen features in electric bus charging stations and combining a charging demand prediction model with a long and short-term memory neural network and a light gradient decision tree network, the problem of low accuracy in the peak and valley period charging demand prediction of electric bus charging stations is solved, and more efficient charging plans and lower grid instability and charging costs are achieved.

CN118644276BActive Publication Date: 2025-06-10HEFEI UNIV OF TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411102708.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2025-06-10
Estimated Expiration
2044-08-13

AI Technical Summary

Technical Problem

In the prior art, the accuracy of charging demand forecasts for electric bus charging stations during peak and valley periods is relatively low, resulting in centralized charging of electric buses during peak periods, resulting in unstable power grids and excessive charging costs.

Method used

A charging demand prediction method is adopted to obtain historical charging record data of electric bus charging stations, and the target characteristics related to charging demand are screened out using a random forest model, and the charging demand prediction model combined with a long-term memory neural network and a light gradient decision tree network are predicted. This model uses an attention mechanism to allocate weights to the output of long and short-term memory neural networks to improve prediction accuracy.

Benefits of technology

Improve the accuracy of charging demand forecasts, especially during peak and valley periods, help build more effective electric bus charging plans and reduce problems such as instability in the power grid and excessive charging costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118644276B_ABST
    Figure CN118644276B_ABST
Patent Text Reader

Abstract

The present application relates to a method for predicting the charging demand of a charging station and a method for optimizing the operation of an electric bus. The method for predicting the charging demand of the charging station includes: obtaining the historical charging record data of the electric bus charging station, and screening out the target features related to the charging demand from the historical charging record data based on the random forest model; predicting the charging demand of the electric bus charging station through the trained charging demand prediction model based on the feature data of the target features; wherein, the charging demand prediction model includes a long short-term memory neural network and a light gradient decision tree network, the long short-term memory neural network includes a plurality of network units and uses an attention mechanism to assign weights to the outputs of each network unit, and the output of the charging demand prediction model is the result of weighted summation of the output of the long short-term memory neural network and the output of the light gradient decision tree network. It solves the problem that the prediction accuracy of the charging demand during the peak and valley periods of the electric bus charging station is relatively low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data prediction, and particularly to a method for predicting the charging demand of a charging station and a method for optimizing the operation of an electric bus. Background Art

[0002] The rapid growth of electric vehicles poses a major challenge to the management of charging infrastructure. In particular, the centralized charging of electric vehicles during peak hours can cause grid instability, while the utilization rate of charging facilities is low during off-peak hours, resulting in waste of resources. Therefore, accurately predicting the charging demand of charging stations during peak and off-peak periods is crucial for effectively managing grid operation and optimizing charging plans. However, in existing research, the accuracy of predicting the charging demand of charging stations during peak and off-peak periods is relatively low, so an efficient charging plan for electric vehicles, especially electric buses, cannot be constructed, leading to problems such as centralized charging of electric buses during peak hours, causing grid instability and high charging costs.

[0003] Regarding the problem of relatively low accuracy in predicting the charging demand of electric bus charging stations during peak and off-peak periods in the existing technology, no effective solution has been proposed yet. Summary of the Invention

[0004] In the present invention, a method for predicting the charging demand of a charging station and a method for optimizing the operation of an electric bus are provided to solve the problem of relatively low accuracy in predicting the charging demand of electric bus charging stations during peak and off-peak periods in the existing technology.

[0005] In a first aspect, the present invention provides a method for predicting the charging demand of a charging station, including:

[0006] Obtaining historical charging record data of an electric bus charging station, and screening out target features related to the charging demand from the historical charging record data based on a random forest model;

[0007] Predicting the charging demand of the electric bus charging station based on the feature data of the target features through a trained charging demand prediction model;

[0008] Wherein, the charging demand prediction model includes a long short-term memory neural network and a light gradient decision tree network. The long short-term memory neural network includes multiple network units and uses an attention mechanism to assign weights to the outputs of each network unit. The output of the charging demand prediction model is the result of weighted summation of the output of the long short-term memory neural network and the output of the light gradient decision tree network.

[0009] In a second aspect, the present invention provides a method for optimizing the operation of an electric bus, including:

[0010] Obtain the charging demand of the electric bus charging station through the charging demand prediction method of the charging station described in the first aspect;

[0011] Optimize the operation route of the electric bus according to the charging demand of the electric bus charging station and the state of charge of the battery of the electric bus.

[0012] In a third aspect, the present invention provides a charging demand prediction device for a charging station, including:

[0013] A data acquisition module, configured to acquire historical charging record data of an electric bus charging station, and screen out target features related to charging demand from the historical charging record data based on a random forest model;

[0014] A demand prediction module, configured to predict the charging demand of the electric bus charging station based on the feature data of the target features through a trained charging demand prediction model;

[0015] Wherein, the charging demand prediction model includes a long short-term memory neural network and a light gradient decision tree network. The long short-term memory neural network includes multiple network units and uses an attention mechanism to assign weights to the outputs of each network unit. The output of the charging demand prediction model is the result of weighted summation of the output of the long short-term memory neural network and the output of the light gradient decision tree network.

[0016] In a fourth aspect, the present invention provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the charging demand prediction method of the charging station described in the first aspect.

[0017] In a fifth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the charging demand prediction method of the charging station described in the first aspect are implemented.

[0018] Compared with the related art, the charging demand prediction method of the charging station provided by the present invention, compared with the existing prediction algorithms, uses relatively better features selected by the random forest algorithm to train the LAL model, dynamically focuses on the input sequence segments and processes variable-length sequences (mainly based on the combined use of the long short-term memory neural network and the light gradient decision tree network, and the long short-term memory neural network uses an attention mechanism to assign weights to the outputs of each network unit), and has better prediction accuracy, especially the prediction accuracy during peak and valley periods. Therefore, the problem of relatively low prediction accuracy of the charging demand during peak and valley periods of the electric bus charging station in the prior art is solved.

[0019] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more concise and understandable. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a flowchart of a method for predicting charging demand of a charging station provided in an embodiment of the present invention;

[0021] Figure 2 is a schematic diagram of a random forest model in some embodiments of the present invention;

[0022] Figure 3 is a schematic diagram of a long short-term memory neural network unit in some embodiments of the present invention;

[0023] Figure 4 is a schematic diagram of an attention mechanism in some embodiments of the present invention;

[0024] Figure 5 is a spatial distribution of charging demand during peak hours in some embodiments of the present invention;

[0025] Figure 6 is a spatial distribution of charging demand during off-peak hours in some embodiments of the present invention;

[0026] Figure 7 is a spatial distribution of charging demand during valley hours in some embodiments of the present invention;

[0027] Figure 8 is a distribution map of electric bus charging stations A, B, C, D, and E in some embodiments of the present invention;

[0028] Figure 9 is a schematic diagram of the operating routes of electric buses in some embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0029] To more clearly understand the purpose, technical solution, and advantages of the present application, the present application will be described and illustrated below with reference to the drawings and embodiments.

[0030] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meanings understood by those with ordinary skills in the technical field to which this application belongs. In this application, words such as "a", "an", "one kind", "the", "these", etc. do not indicate a limitation in quantity, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent in these processes, methods, products or devices. The words such as "connect", "be connected", "couple" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "plurality" involved in this application means two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, and B exists alone. Usually, the character " / " indicates that the objects associated before and after are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application only distinguish similar objects and do not represent a specific order for the objects.

[0031] In the present invention, a method for predicting the charging demand of a charging station is provided. Figure 1 It is a flowchart of the method for predicting the charging demand of a charging station provided in the embodiments of the present invention, as Figure 1 shown, and this process includes step S110 and step S120.

[0032] Step S110, obtain the historical charging record data of an electric bus charging station, and screen out the target features related to the charging demand from the historical charging record data based on the random forest model.

[0033] Not all the feature data in the historical charging record data has a high correlation with the charging demand. Therefore, it is necessary to screen out the target feature data highly related to the charging demand, so as to improve the accuracy of charging demand prediction. The random forest model is a machine learning model including multiple decision trees (classifiers).

[0034] Among them, screening out the target features related to the charging demand from the historical charging record data based on the random forest model includes step S111 and step S112.

[0035] Step S111, randomly divide the historical charging record data into two groups to obtain an in-bag data set and an out-of-bag data set.

[0036] Step S112: Construct a random forest model based on the in-bag dataset, evaluate each decision tree in the random forest model using the out-of-bag dataset, and screen out target features from the out-of-bag dataset based on the evaluation results.

[0037] In this step, first, a random forest model is trained based on the in-bag dataset. Then, through this random forest model, the importance of each feature in the out-of-bag dataset can be obtained, and the part of the features with the highest importance is selected as the target features. For step S112, it specifically includes multiple rounds of screening steps and result comparison steps.

[0038] Each round of screening steps includes:

[0039] Evaluate each decision tree in the random forest model using the out-of-bag dataset and calculate the initial out-of-bag error.

[0040] Randomly change each feature in the out-of-bag dataset and calculate the posterior out-of-bag error. For each feature in the out-of-bag dataset, calculate the importance of the feature according to the initial out-of-bag error and the corresponding posterior out-of-bag error:

[0041]

[0042] Among them, i X represents the importance of feature X , n and N respectively represent the serial number and total number of decision trees, u n1 and u n2 respectively represent the initial out-of-bag error and the posterior out-of-bag error corresponding to the nth decision tree.

[0043] Select the part of the features with the highest importance in the out-of-bag dataset to form a candidate feature set and update the random forest model based on the candidate feature set.

[0044] Among them, each decision tree corresponds to a pair of initial out-of-bag errors and posterior out-of-bag errors. For any feature in the out-of-bag dataset, it is necessary to calculate the error change of each decision tree when it changes (the difference between the initial out-of-bag error and the posterior out-of-bag error), and the average value of the error changes of each decision tree is the importance of the feature. After calculating the importance of each feature, they can be sorted from high to low, and then the top part of the features (such as the first 90%) can be selected as the candidate feature set. Then, use the feature data in the candidate feature set to retrain the random forest model, thereby updating the model parameters of the random forest model. In the next round of screening steps, a new set of candidate feature sets can be obtained using the updated random forest model, and the random forest model can be updated again according to the new candidate feature set. Therefore, multiple sets of candidate feature sets can be obtained iteratively.

[0045] The result comparison step includes:

[0046] Compare the total feature importance of the candidate feature sets in each round of screening steps, and obtain the target features based on the candidate feature set with the lowest total feature importance.

[0047] For each feature in the candidate feature set, its importance has been calculated. By adding them up, the total feature importance of the corresponding candidate feature set can be obtained. Finally, select the candidate feature set with the lowest total feature importance as the target feature set. The target features in the target feature set are features that are highly correlated with the charging requirements of the electric bus charging station.

[0048] Exemplarily, the target features are shown in Table 1.

[0049] Table 1 Features Highly Correlated with the Charging Requirements of Electric Bus Charging Stations

[0050]

[0051] Step S120, based on the feature data of the target features, predict the charging requirements of the electric bus charging station through the trained charging requirement prediction model; among them, the charging requirement prediction model (LAL model, LSTM-Attention-LightGBM) includes a long short-term memory neural network (LSTM) and a light gradient decision tree network (LightGBM). The long short-term memory neural network includes multiple network units and uses an attention mechanism (Attention) to assign weights to the outputs of each network unit. The output of the charging requirement prediction model is the result of weighted summation of the output of the long short-term memory neural network and the output of the light gradient decision tree network. The weights of the two outputs can be set according to the actual situation, or the output weights of the two can be optimized by means of joint training.

[0052] Based on the feature data of the target features in the historical charging record data, the charging demand of the electric bus charging station can be predicted. Usually, a real-time data window can be set, and the target feature data within the real-time data window is used as the input of the charging demand prediction model to predict the charging demand in the future (such as the next 24 hours). Exemplarily, if the real-time data window is set to 5 days, and it is necessary to predict the charging demand of electric buses tomorrow, the target feature data of the most recent 5 days can be used as the input of the charging demand prediction model. Among them, the target feature data can be divided according to a certain time period to obtain the target feature data of each time period, and the target feature data of each time period constitutes a sample data, and then these sample data are sorted by time. Correspondingly, the model training is also completed using the target feature data. For example, if the target feature data of a certain time period in the historical charging record data is used as the label, then the target feature data of multiple time periods before this time period can be used as the corresponding sample data.

[0053] To improve the accuracy of the charging demand prediction model, on the one hand, the long short-term memory neural network and the light gradient decision tree network are combined, and on the other hand, the attention mechanism is used to assign weights to the outputs of each network unit in the long short-term memory neural network.

[0054] Specifically, the loss function of the long short-term memory neural network is:

[0055]

[0056] Among them, T represents the total number of sample data, y t and respectively represent the t-th predicted value and the label value, t represents a variable integer.

[0057] The t-th predicted value is obtained by weighted summation of the outputs of the first t network units:

[0058]

[0059] The output weights of the first t network units are determined based on the attention mechanism:

[0060]

[0061]

[0062] Among them, s and a both represent the sequence numbers of the first t network units, h s represents the output of the s-th network unit,u s Indicates the correlation between the predicted value and the true value of the s-th network unit. u a Indicates the correlation between the predicted value and the true value of the a-th network unit. Indicates the output weight of the s-th network unit. and is the weight matrix. b is the bias vector.

[0063] Among them, the mean squared error (MSE) is used as the loss function, and the adaptive moment estimation optimizer updates the network weight matrix and bias vector according to the loss function gradient in the backpropagation process; the attention mechanism assigns weights to the outputs of network units and dynamically prioritizes the key parts of long time series data according to different inputs.

[0064] It should be noted that since the target feature data is time series data, all sample data constitutes a set of time data sequences. The t-th sample data is the target feature data within the t-th time period, and T also represents the length of the time data sequence. The sample data is sorted by time and sent into the corresponding network units. The t-th predicted value is obtained based on the sample data before the t-th time period, and the t-th label value is the sample data of the t-th time period. Therefore, t can represent both the serial number of the network unit and the predicted value, as well as the serial number of the time period corresponding to the sample data.

[0065] For any network unit, each network unit includes a gating unit, a memory unit, and an output unit.

[0066] The calculation of the gating unit is:

[0067]

[0068] The calculation of the memory unit is:

[0069]

[0070] The calculation of the output unit is:

[0071]

[0072] Among them, x t is the t-th sample data (corresponding to the target feature data of the t-th time period), is the sigmoid activation function, h t-1 and c t-1 are both the outputs of the (t - 1)-th network unit. w fx ,w fh , w ix , w ih , w ox , w oh , w ch and w cx are all weight matrices, b f , b i , b o and b c are all bias vectors, is the update vector of the gating unit, is the hyperbolic tangent activation function, h t and c t are the outputs of the t-th network unit.

[0073] The structure of a single network unit and the specific calculation method of the unit output are described in detail above.

[0074] For the Light Gradient Boosting Machine (LightGBM), it constructs trees using the histogram algorithm and leaf-wise growth with constraints, aiming to improve efficiency and reduce overfitting.

[0075] In some of these embodiments, the present invention optimizes the traditional objective function of the Light Gradient Boosting Machine and adopts a new objective function:

[0076]

[0077] where, represents the objective function of the Light Gradient Boosting Machine, I represents the total number of sample data, i represents a variable integer, Ψ represents the leaf node sample set (at the parameter level, it represents the set of subscripts of the sample data in this sample set), g i and h i respectively represent the first-order partial derivative and the second-order partial derivative of the loss function, and represent the penalty coefficients of the regularization function, T is the total number of leaf nodes.

[0078] Specifically, after each iteration of the LightGBM model, the LightGBM algorithm combines the predicted values of the new tree model with the predicted values of the previous generation to generate predicted values that are relatively close to the actual values. The specific expression is:

[0079]

[0080] Among them, x i represents the set of the first i sample data, j represents the total number of iterations, r represents the iteration number, represents the tree function, and with a subscript, it represents the value of the tree function after the corresponding subscript-th iteration, represents j- the predicted value of the first generation, y i represents the i-th predicted value.

[0081] The objective function of the light gradient decision tree network includes a loss function and a regularization function. The specific expression is:

[0082]

[0083] Among them, I is the total number of sample data, is the loss function, y i is the i-th predicted value, is the i-th label value, is the regularization function, which is used to prevent overfitting. The specific expression is:

[0084]

[0085] Among them, T is the total number of leaf nodes, is the weight vector of the leaf nodes, and are the penalty coefficients of the regularization function. The former controls the number of leaf nodes, and the latter ensures the output of the leaf nodes.

[0086] In addition, can be transformed into , because minimizing the calculated value of the objective function is independent of constants. Perform a second-order Taylor expansion on the loss function, ignoring known values and constant terms, to obtain a new objective function. The specific expression is:

[0087]

[0088] Ψ represents the leaf node sample set, gi and h i respectively represent the first-order partial derivative and the second-order partial derivative of the loss function. The specific expression of the weight of the leaf node corresponding to the derivative being 0 is as follows:

[0089]

[0090] Then the objective function optimized by the LightGBM model is:

[0091]

[0092] Let and be respectively the left and right subtrees after splitting. Then the gain function after splitting is:

[0093]

[0094] Among them, and respectively represent Ψ the sample sets of the left and right leaf nodes after splitting.

[0095] The LightGBM algorithm selects the leaf node feature set with the largest gain loss by continuously calculating the node loss as the output.

[0096] In summary, compared with the existing prediction algorithms, the charging demand prediction method of the charging station provided by the present invention uses the relatively better features selected by the random forest algorithm to train the LAL model, dynamically focuses on the input sequence segments and processes variable-length sequences (mainly based on the combined use of the long short-term memory neural network and the light gradient decision tree network, and the long short-term memory neural network uses the attention mechanism to assign weights to the outputs of each network unit), and has better prediction accuracy, especially in the peak-valley period. Therefore, the problem of relatively low prediction accuracy of the charging demand of the electric bus charging station in the peak-valley period in the prior art is solved.

[0097] In the present invention, an operation optimization method for electric buses is also provided, which includes steps S210 and S220.

[0098] Step S210, obtaining the charging demand of the electric bus charging station through the charging demand prediction method of the charging station provided by the present invention.

[0099] Step S220, optimizing the operation route of the electric bus according to the charging demand of the electric bus charging station and the state of charge of the battery of the electric bus.

[0100] As follows, a specific embodiment is used to specifically illustrate the operation optimization method of the electric bus provided by the present invention and the charging demand prediction method of the charging station applied thereto.

[0101] An operation optimization method for an electric bus based on charging demand prediction includes:

[0102] S1: Use the random forest algorithm to screen out the features highly relevant to the charging demand of the electric bus charging station from the historical charging records of the electric bus charging station.

[0103] Specifically, it includes:

[0104] S11: Randomly divide the data set related to the charging demand of the electric bus charging station into two groups, one is the in-bag data set for training, and the other is the out-of-bag data set for testing.

[0105] S12: Use the in-bag data set to construct a random forest model, use the out-of-bag data set to evaluate each decision tree, and calculate the initial out-of-bag error.

[0106] S13: Randomly change a certain feature X in the out-of-bag data set and recalculate the posterior out-of-bag error.

[0107] S14: The change of feature X causes the error change of N decision trees in the out-of-bag data set, and the importance of model feature X is calculated as follows:

[0108]

[0109] Among them, i X represents the feature X importance, n and N respectively represent the serial number and total number of decision trees, u n1 and u n2 respectively represent the initial out-of-bag error and the posterior out-of-bag error corresponding to the nth decision tree.

[0110] S15: Use the formula in S14 to calculate the importance of feature X in the current random forest model, sort it in descending order, select the features in the top 90% of the importance ranking, form a new random forest model and recalculate the importance of feature X, and continuously iterate to obtain the feature set corresponding to the lowest out-of-bag error of the random forest model, and screen out the features highly relevant to the charging demand of the electric bus charging station, as shown in Table 1.

[0111] S2: Use the attention mechanism and the light gradient decision tree algorithm to optimize the long short-term memory neural network to construct the LAL model.

[0112] Specifically, it includes:

[0113] S21: The gating unit of the long short-term memory neural network consists of three gates: the forget gate ( f t ), the input gate ( i t ), and the output gate ( o t ), as shown in Figure 3 : Among them:

[0114] The forget gate ( f t ) determines what information to discard by reading the output of the previous LSTM unit ( h t-1 ) and the input of the current LSTM unit ( x t ).

[0115] The input gate ( i t ) determines what information to store through the sigmoid function.

[0116] The output gate ( o t ) determines what information to output.

[0117] The feedforward process of the LSTM unit includes the calculations of the gating unit, the memory unit, and the output unit.

[0118] The calculation of the gating unit is:

[0119]

[0120] The calculation of the memory unit is:

[0121]

[0122] The calculation of the output unit is:

[0123]

[0124] Among them, x t is the t-th sample data, is the sigmoid activation function, h t-1 and c t-1 are both the outputs of the (t - 1)-th network unit, w fx , w fh , w ix , w ih, w ox , w oh , w ch and w cx are all weight matrices, b f , b i , b o and b c are all bias vectors, is the update vector of the gating unit, is the hyperbolic tangent activation function, h t is the output of the t-th network unit.

[0125] The mean squared error (MSE) is used as the loss function, and the adaptive moment estimation optimizer updates the network weight matrix and bias vector according to the loss function gradient in the backpropagation process:

[0126]

[0127] where, T represents the length of the time series, y t and represent the t-th predicted value and the label value (true value), respectively.

[0128] S22: The attention mechanism assigns weights to the outputs of the LSTM units, and dynamically prioritizes the key parts of the long time series data according to different inputs, such as Figure 4 shown as:

[0129]

[0130] where, s and a both represent the sequence numbers of the first t network units, h s represents the output of the s-th network unit, u s represents the correlation between the predicted value and the true value of the s-th network unit, u a represents the correlation between the predicted value and the true value of the a-th network unit, represents the output weight of the s-th network unit, and are weight matrices, b is the bias vector.

[0131] S23: LightGBM constructs trees using the histogram algorithm and restricted leaf growth, aiming to improve efficiency and mitigate overfitting;

[0132] Specifically, after each iteration of the LightGBM model, the LightGBM algorithm combines the predicted values of the new tree model with the predicted values of the previous generation to generate predicted values that are relatively close to the actual values. The specific expression is:

[0133]

[0134] Where, i represents the number of sample data, x i represents the first i sample data, j represents the total number of iterations, r represents the iteration number, represents the tree function, and with the subscript, it represents the tree function structure after the corresponding iteration, represents j- the predicted value of the first generation.

[0135] The traditional objective function of the light gradient decision tree network includes a loss function and a regularization function. The specific expression is:

[0136]

[0137] Where, I is the total number of sample data, is the loss function, y i is the predicted value of the i-th sample, is the label value of the i-th sample, is the regularization function, used to prevent overfitting. The specific expression is:

[0138]

[0139] Where, T is the total number of leaf nodes, is the weight vector of the leaf node, and are the penalty coefficients of the regularization function. The former controls the number of leaf nodes, and the latter ensures the output of the leaf nodes.

[0140] In addition, can be transformed into , because minimizing the calculated value of the objective function is independent of the constant. Perform a second-order Taylor expansion on the loss function, ignoring the known values and constant terms, to obtain the objective function. The specific expression is:

[0141]

[0142] Ψ Denote the leaf node sample set, g i and h i respectively represent the first-order partial derivative and the second-order partial derivative of the loss function. The specific expression of the weight of the leaf node corresponding to the derivative being 0 is:

[0143]

[0144] Then the objective function optimized by the LightGBM model is:

[0145]

[0146] Let and be respectively the left and right subtrees after splitting. Then the gain function after splitting is:

[0147]

[0148] The LightGBM algorithm selects the leaf node feature set with the largest gain loss by continuously calculating the node loss as the output.

[0149] S3: Use the features obtained in S1 to train the LAL model obtained in S2 to train the charging demand of the electric bus charging station for the next 24 hours.

[0150] S31: Use the features obtained in S1, including the historical charging demand of the electric bus charging station, the average charging demand of the electric bus charging station, the charging demand of the electric bus charging station at the same time period, the charging voltage, the charging current, the SOC, the charging time, the day of the week, the time period of the day, and the temperature to construct time series data , aiming to predict the charging demand for the next p time periods through the charging demand in the historical m time periods. The specific expression is:

[0151]

[0152] S32: Use the time series data to train the LAL model to obtain the spatial distribution of the charging demand for different charging time periods of different electric bus charging stations, and use the natural intermittent classification method to divide the charging demand into multiple modes and visually display it on the map, such as Figures 5 - 7 shown.

[0153] S4: Dynamically adjust the operation method of the electric bus according to the charging demand of different electric bus charging stations and the state of charge of the electric bus battery.

[0154] The charging demands of different electric bus charging stations at different times are predicted by S3. The charging prices of different electric bus charging stations are positively correlated with the charging demands, that is, the greater the charging demand, the higher the charging price. The state of charge of the electric bus battery can be accurately obtained, and the electric buses are not fixed to a specific bus route.

[0155] S41: There are four routes from electric bus charging station A to B, C, D, and E. The charging demands of the electric bus charging station are predicted during time period t to obtain the corresponding charging demands when the electric bus charging station A reaches B, C, D, and E. 、 、 and , as well as the corresponding charging prices under the charging demands 、 、 and , as Figure 8 shown.

[0156] S42: At electric bus charging station A during time period t, there are electric buses corresponding to B, C, D, and E, and the state of charge of the batteries is known to be s 1 、 s 2 、 s 3 and s 4 . The electricity consumption required for the electric buses at electric bus charging station A to reach electric bus charging stations B, C, D, and E during time period t is 、 、 and , and the battery capacity of the electric bus is q c .

[0157] S43: To ensure the battery performance of the electric bus, the state of charge of the charging battery has a safety lower limit s min . At this time, the charging prices 、 、 and are sorted in ascending order. On the premise of ensuring , electric buses with a lower state of charge are assigned to routes with lower charging prices so that the electric buses can complete low-cost charging after reaching electric bus charging stations B, C, D, and E, as Figure 9 shown.

[0158] In an embodiment of the present invention, a charging demand prediction device for a charging station is further provided. This device is used to implement the above-mentioned embodiments and preferred implementation manners, and those that have been described will not be repeated here. The following terms such as "module", "unit", "sub-unit", etc. can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0159] A charging demand prediction device for a charging station includes:

[0160] A data acquisition module, configured to acquire historical charging record data of an electric bus charging station, and screen out target features related to charging demand from the historical charging record data based on a random forest model.

[0161] A demand prediction module, configured to predict the charging demand of the electric bus charging station based on the feature data of the target features through a trained charging demand prediction model.

[0162] Wherein, the charging demand prediction model includes a long short-term memory neural network and a light gradient decision tree network. The long short-term memory neural network includes multiple network units and uses an attention mechanism to assign weights to the outputs of each network unit. The output of the charging demand prediction model is the result of weighted summation of the output of the long short-term memory neural network and the output of the light gradient decision tree network.

[0163] Compared with the existing prediction algorithms, the charging demand prediction device for a charging station provided by the present invention uses relatively better features selected by the random forest algorithm to train the LAL model, dynamically focuses on input sequence segments and processes variable-length sequences (mainly based on the combined use of a long short-term memory neural network and a light gradient decision tree network, and the long short-term memory neural network uses an attention mechanism to assign weights to the outputs of each network unit), and has better prediction accuracy, especially in the peak-valley period. Therefore, the problem of relatively low prediction accuracy of the charging demand of electric bus charging stations in the peak-valley period in the prior art is solved.

[0164] It should be noted that the above-mentioned each module can be a functional module or a program module, and can be implemented either by software or by hardware. For the modules implemented by hardware, the above-mentioned each module can be located in the same processor; or the above-mentioned each module can also be located in different processors in any combined form.

[0165] The present invention also provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the charging demand prediction method for a charging station or the operation optimization method for an electric bus provided by the present invention.

[0166] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the charging demand prediction method for a charging station or the operation optimization method for an electric bus provided by the present invention are implemented.

[0167] It should be understood that the specific embodiments described herein are only used to explain this application, rather than to limit it. According to the embodiments provided by the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0168] Obviously, the accompanying drawings are only some examples or embodiments of the present application. For those of ordinary skill in the art, the present application can also be applied to other similar situations based on these drawings without creative efforts. Additionally, it can be understood that although the work done during the development process may be complex and time-consuming, for those of ordinary skill in the art, certain design, manufacturing, or production changes based on the technical content disclosed in the present application are only conventional technical means and should not be regarded as insufficient disclosure of the present application.

Claims

1. A method for optimizing the operation of an electric bus, characterized in that: include: Obtain historical charging record data of an electric bus charging station, and filter out target features related to charging demand from the historical charging record data based on a random forest model; Based on the characteristic data of the target characteristic, predicting the charging demand of the electric bus charging station through the trained charging demand prediction model; The charging demand prediction model includes a long short-term memory neural network and an optical gradient decision tree network. The long short-term memory neural network includes multiple network units and uses an attention mechanism to assign weights to the outputs of each network unit. The output of the charging demand prediction model is the result of weighted summation of the output of the long short-term memory neural network and the output of the optical gradient decision tree network. There are four routes from the electric bus charging station A to B, C, D, and E. The charging demand of the electric bus charging station is predicted in time period t to obtain the corresponding charging demand when the electric bus charging station A reaches B, C, D, and E. and , and the corresponding charging price under charging demand and ; In time period t, there are electric buses corresponding to B, C, D, and E at the electric bus charging station A, and the battery charge state is known to be s 1. s 2. s 3 and s 4. In time period t, the amount of electricity consumed by the electric bus at electric bus charging station A to reach electric bus charging stations B, C, D, and E is and , the battery capacity of electric buses is ; In order to ensure the battery performance of electric buses, the state of charge of the rechargeable battery has a safe lower limit , at this time, the charging price is sorted in order of size and Sorting, in ensuring Under the premise of allocating electric buses with low battery state of charge to routes with low charging prices, so that electric buses can complete low-cost charging after arriving at electric bus charging stations B, C, D, and E; when > > > When the battery state of charge is s The electric bus 1 goes to charging station E, and the battery state of charge is s The electric bus 2 goes to charging station D, and the battery state of charge is s The electric bus at 3 goes to charging station C, and the battery state of charge is s 4 electric buses go to charging station B, where s 4> s 3> s 2> s 1.

2. The operation optimization method of an electric bus according to claim 1, characterized in that: The step of selecting target features related to charging demand from the historical charging record data based on the random forest model includes: The historical charging record data is randomly divided into two groups to obtain an in-bag data set and an out-bag data set; The random forest model is constructed based on the in-bag data set, each decision tree in the random forest model is evaluated using the out-of-bag data set, and the target feature is screened out in the out-of-bag data set based on the evaluation result.

3. The operation optimization method of an electric bus according to claim 2, characterized in that: Using the out-of-bag data set to evaluate each decision tree in the random forest model and screening out the target feature in the out-of-bag data set based on the evaluation result includes multiple rounds of screening steps and result comparison steps; Each round of screening includes: Using the out-of-bag data set to evaluate each decision tree in the random forest model and calculate an initial out-of-bag error; Each feature in the out-of-bag data set is randomly changed and the posterior out-of-bag error is calculated. For each feature in the out-of-bag data set, the importance of the feature is calculated according to the initial out-of-bag error and the corresponding posterior out-of-bag error: in, i X Representation characteristics X The importance of n and N Respectively represent the sequence number and total number of decision trees, u n1 and u n2 They represent the initial out-of-bag error and the posterior out-of-bag error corresponding to the nth decision tree respectively; Selecting some of the most important features in the out-of-bag data set to form a candidate feature set and updating the random forest model based on the candidate feature set; The result comparison steps include: The sum of the feature importances of the candidate feature sets in each round of the screening step is compared, and the target feature is obtained based on the candidate feature set with the lowest sum of feature importance.

4. The operation optimization method of an electric bus according to claim 1, characterized in that: The loss function of the long short-term memory neural network l for: in, T Represents the total number of sample data, t Represents a variable integer, and Represent the tth predicted value and label value respectively; The t-th prediction value is obtained by weighted summing the outputs of the first t network units: The output weights of the first t network units are determined based on the attention mechanism: in, s and a Both represent the sequence numbers of the first t network units. h s represents the output of the sth network unit, u s represents the correlation between the predicted value and the true value of the sth network unit, u a represents the correlation between the predicted value and the true value of the a-th network unit, represents the output weight of the sth network unit, and is the weight matrix, b is the bias vector.

5. The operation optimization method of an electric bus according to claim 4, characterized in that: Each of the network units includes a gating unit, a memory unit and an output unit; The calculation of the gating unit is: The calculation of the memory unit is: The output unit is calculated as: in, x t is the tth sample data, is the sigmoid activation function, h t-1 and c t-1 are the outputs of the t-1th network unit, w fx , w fh , w ix , w ih , w ox , w oh , w ch and w cx are weight matrices, b f , b i , b o and b c are bias vectors, is the update vector of the gating unit, is the hyperbolic tangent activation function, h t and c t is the output of the tth network unit.

Citation Information

Patent Citations

  • Three-dimensional model retrieval method adopting Siamese structure-based bidirectional long-short-term memory network

    CN110990608A

  • PM2.5 concentration prediction method and system for optimizing RELM based on random forest and ISCA

    CN113344261A

  • Shared bicycle demand quantity prediction method based on Attention-LSTM-LightGBM

    CN116797274A