Charging demand prediction method of charging station and operation optimization method of electric bus
Through the random forest model screening features and the combination of long and short-term memory neural network and optical gradient decision tree network, the attention mechanism is used to predict charging demand, which solves the problem of low accuracy of demand prediction in peak and valley periods of electric bus charging stations and improves the efficiency of charging stations. Predictive accuracy and optimizes the operation of electric buses.
Patent Information
- Application Number
- CN202411102708.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-08-13
AI Technical Summary
In the existing technology, the charging demand prediction accuracy of electric bus charging stations during peak and valley periods is low, leading to problems of unstable power grid and excessive charging costs.
The random forest model is used to screen target features in historical charging records, and the long short-term memory neural network and optical gradient decision tree network are combined to build a charging demand prediction model. The weighted summation output of the attention mechanism is used to improve the prediction accuracy.
It significantly improves the accuracy of charging demand prediction, especially during peak and valley periods, solves the problem of low accuracy of charging demand prediction at electric bus charging stations, optimizes the operating routes of electric buses, and reduces charging costs.
Smart Images

Figure CN118644276A
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data prediction, and in particular to a charging demand prediction method for a charging station and an operation optimization method for an electric bus. Background Art
[0002] The rapid growth of electric vehicles poses a major challenge to the management of charging infrastructure. In particular, concentrated charging of electric vehicles during peak hours can cause grid instability, while the utilization rate of charging facilities during off-peak hours is low, resulting in a 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, the accuracy of charging demand prediction during peak and off-peak periods in existing studies is relatively low, making it impossible to build an efficient charging plan for electric vehicles, especially electric buses, resulting in concentrated charging of electric buses during peak hours, causing grid instability, excessive charging costs, and other problems.
[0003] With regard to the problem of relatively low accuracy in predicting charging demand during peak and valley periods at electric bus charging stations in the prior art, no effective solution has been proposed so far. Summary of the invention
[0004] The present invention provides a charging demand prediction method for a charging station and an operation optimization method for an electric bus, so as to solve the problem of relatively low accuracy in charging demand prediction during peak and valley periods of an electric bus charging station in the prior art.
[0005] In a first aspect, the present invention provides a charging demand prediction method for a charging station, comprising: 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; Among them, 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 weighted sum of the output of the long short-term memory neural network and the output of the optical gradient decision tree network.
[0006] In a second aspect, the present invention provides an operation optimization method for an electric bus, comprising: The charging demand of the electric bus charging station is obtained by the charging demand prediction method of the charging station described in the first aspect; The operation route of the electric bus is optimized according to the charging demand of the electric bus charging station and the battery charge state of the electric bus.
[0007] In a third aspect, the present invention provides a charging demand prediction device for a charging station, comprising: A data acquisition module, used to acquire historical charging record data of electric bus charging stations, and screen target features related to charging demand from the historical charging record data based on a random forest model; A demand prediction module, used to predict the charging demand of the electric bus charging station based on the characteristic data of the target characteristic through a trained charging demand prediction model; Among them, 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 weighted sum of the output of the long short-term memory neural network and the output of the optical gradient decision tree network.
[0008] In a fourth aspect, the present invention provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the charging demand prediction method for a charging station described in the first aspect.
[0009] In a fifth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method for predicting charging demand of a charging station described in the first aspect are implemented.
[0010] Compared with the related art, the charging demand prediction method for charging stations provided by the present invention uses relatively superior features selected by the random forest algorithm to train the LAL model, dynamically pays attention to 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 optical 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 and valley periods. Therefore, the problem of relatively low prediction accuracy of charging demand prediction of electric bus charging stations in the peak and valley periods in the prior art is solved.
[0011] 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 readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1is a flow chart of a charging demand prediction method for a charging station provided in an embodiment of the present invention; Figure 2 is a schematic diagram of a random forest model in some embodiments of the present invention; Figure 3 is a schematic diagram of a long short-term memory neural network unit in some embodiments of the present invention; Figure 4 is a schematic diagram of the attention mechanism in some embodiments of the present invention; Figure 5 is the spatial distribution of charging demand during peak hours in some embodiments of the present invention; Figure 6 is the spatial distribution of charging demand during off-peak hours in some embodiments of the present invention; Figure 7 is the spatial distribution of charging demand during off-peak hours in some embodiments of the present invention; Figure 8 is a distribution diagram of electric bus charging stations A, B, C, D, and E in some embodiments of the present invention; Fig. 9 It is a schematic diagram of the operation route of an electric bus in some embodiments of the present invention. DETAILED DESCRIPTION
[0013] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0014] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising 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 to these processes, methods, products or devices. The words "connect", "connected", "coupled" 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 "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0015] The present invention provides a charging demand prediction method for a charging station. Figure 1 is a flow chart of a charging demand prediction method for a charging station provided in an embodiment of the present invention. Figure 1 As shown, the process includes step S110 and step S120.
[0016] Step S110, obtaining historical charging record data of the electric bus charging station, and filtering out target features related to charging demand from the historical charging record data based on the random forest model.
[0017] Not all feature data in the historical charging record data have a high correlation with the charging demand, so it is necessary to screen out the target feature data that is highly correlated with the charging demand, thereby improving the accuracy of the charging demand prediction. The random forest model is a machine learning model that includes multiple decision trees (classifiers).
[0018] Among them, screening out target features related to charging demand from historical charging record data based on the random forest model includes step S111 and step S112.
[0019] Step S111, randomly dividing the historical charging record data into two groups to obtain an in-bag data set and an out-bag data set.
[0020] Step S112, building a random forest model based on the in-bag data set, using the out-of-bag data set to evaluate each decision tree in the random forest model, and screening out target features in the out-of-bag data set based on the evaluation results.
[0021] In this step, a random forest model is first trained based on the in-bag data set, and then the importance of each feature in the out-of-bag data set can be obtained through the random forest model, and some features with the highest importance are selected as target features. For step S112, it specifically includes multiple rounds of screening steps and result comparison steps.
[0022] Each round of screening includes: Each decision tree in the random forest model is evaluated on the out-of-bag dataset and the initial out-of-bag error is calculated.
[0023] Each feature in the out-of-bag dataset is randomly changed and the posterior out-of-bag error is calculated. For each feature in the out-of-bag dataset, the importance of the feature is calculated based on the initial out-of-bag error and the corresponding posterior out-of-bag error:
[0024] 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.
[0025] Select some of the most important features in the out-of-bag dataset to form a candidate feature set and update the random forest model based on the candidate feature set.
[0026] Among them, each decision tree corresponds to a pair of initial out-of-bag error and posterior out-of-bag error. For any feature in the out-of-bag data set, 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 mean error change of each decision tree is the importance of the feature. After the importance of each feature is calculated, it can be sorted from high to low, and then the highest part of the features (such as the top 90%) are selected as candidate feature sets. Then, the feature data in the candidate feature set is used to train the random forest model again, thereby updating the model parameters of the random forest model. In the next round of screening steps, a set of candidate feature sets can be obtained using the updated random forest model, and the random forest model can be updated again based on the new candidate feature set. Therefore, multiple sets of candidate feature sets can be iteratively obtained.
[0027] The result comparison steps include: The sum of the feature importance of the candidate feature sets in each round of screening steps is compared, and the target feature is obtained based on the candidate feature set with the lowest sum of feature importance.
[0028] The importance of each feature in the candidate feature set has been calculated, and the sum of the feature importance of the corresponding candidate feature set can be obtained by superimposing them. Finally, the candidate feature set with the lowest sum of feature importance is selected as the target feature set. The target feature in the target feature set is the feature that is highly related to the charging demand of electric bus chargers.
[0029] Exemplarily, the target features are shown in Table 1.
[0030] Table 1 Characteristics highly correlated with charging demand at electric bus charging stations
[0031] Step S120, based on the characteristic data of the target characteristics, the charging demand of the electric bus charging station is predicted by the trained charging demand prediction model; wherein, the charging demand 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, 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, and the weights of the outputs of the two can be set according to actual conditions, or the output weights of the two can be optimized by joint training.
[0032] Based on the characteristic data of the target characteristics 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 characteristic data in the real-time data window can be 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, the real-time data window can be set to 5 days. If the charging demand of the electric bus tomorrow needs to be predicted, the target characteristic data of the last 5 days can be used as the input of the charging demand prediction model. Among them, the target characteristic data can be divided according to a certain time period to obtain the target characteristic data of each time period. The target characteristic data of each time period constitutes a sample data, and then these sample data are sorted by time. Correspondingly, model training is also completed using target characteristic data. For example, the target characteristic data of a certain time period in the historical charging record data is used as a label, and the target characteristic data of multiple time periods before the time period can be used as the corresponding sample data.
[0033] In order to improve the accuracy of the charging demand prediction model, on the one hand, the long short-term memory neural network and the optical gradient decision tree network are used in combination, and on the other hand, weights are assigned to the outputs of each network unit in the long short-term memory neural network through the attention mechanism.
[0034] Specifically, the loss function of the long short-term memory neural network is for:
[0035] in, T Represents the total number of sample data, y t and Represent the tth predicted value and label value respectively, t Represents a mutable integer.
[0036] The t-th prediction value is obtained by weighted summing the outputs of the first t network units:
[0037] The output weights of the first t network units are determined based on the attention mechanism:
[0038]
[0039] 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.
[0040] Among them, the mean square 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 gradient of the loss function during the back propagation process; the attention mechanism assigns weights to the output of the network unit, and dynamically prioritizes the key parts of long time series data according to different inputs.
[0041] It should be noted that since the target feature data is time series data, all sample data constitute a set of time data sequences. The t-th sample data is the target feature data in the t-th time period. T also represents the length of the time data sequence. The sample data is sorted by time and sent to the corresponding network unit. The t-th prediction value is obtained based on the sample data before the t-th time period, and the t-th label value is the sample data in the t-th time period. Therefore, t can simultaneously represent the serial number of the network unit and the prediction value and the serial number of the time period corresponding to the sample data.
[0042] For any network unit, each network unit includes a gating unit, a memory unit and an output unit; The calculation of the gate control unit is:
[0043] The calculation of the memory unit is:
[0044] The calculation of the output unit is:
[0045] in, 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 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 andc t is the output of the tth network unit.
[0046] The above text specifically describes the structure of a single network unit and the specific calculation method of the unit output.
[0047] For the Light Gradient Decision Tree Network (LightGBM), it uses a histogram algorithm and constrained leaf growing to build a tree, aiming to improve efficiency and alleviate overfitting.
[0048] In some embodiments, the present invention optimizes the traditional objective function of the optical gradient decision tree network and adopts a new objective function:
[0049] in, represents the objective function of the light gradient decision tree network, 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 subscript set of sample data in the sample set), g i and h i They represent the first-order and second-order partial derivatives of the loss function, respectively. and represents the penalty coefficient of the regularization function, T is the total number of leaf nodes.
[0050] Specifically, after each iteration of the LightGBM model, the LightGBM algorithm combines the predicted value of the new tree model with the predicted value of the previous generation, and the generated predicted value is closer to the actual value. The specific expression is:
[0051] in, x i represents the set of the first i sample data, j represents the total number of iterations, r Represents the iteration number, Represents a tree function, and the following table indicates the tree function value after the iteration indicated by the subscript. express j- The predicted value of generation 1, y i represents the i-th predicted value.
[0052] The objective function of the optical gradient decision tree network includes a loss function and a regularization function. The specific expression is:
[0053] in, 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 a regularization function used to prevent overfitting. The specific expression is:
[0054] in, T is the total number of leaf nodes, is the weight vector of the leaf node, and is the penalty coefficient of the regularization function. The former controls the number of leaf nodes, and the latter ensures the output of leaf nodes.
[0055] also, Can be converted into , because the calculated value of the minimized objective function is independent of the constant, the loss function is expanded by the second-order Taylor formula, ignoring the known values and constant terms, and a new objective function is obtained, whose specific expression is:
[0056] Ψ represents the leaf node sample set, g i and h i They represent the first-order partial derivative and the second-order partial derivative of the loss function respectively. When the derivative is 0, the specific expression of the weight of the corresponding leaf node is:
[0057] Then the objective function of the LightGBM model after optimization is:
[0058] set up and They are The left and right subtrees after segmentation, the gain function after segmentation is:
[0059] in, and Respectively Ψ The sample sets of left and right leaf nodes after segmentation.
[0060] The LightGBM algorithm selects the leaf node feature set with the largest gain loss as output by continuously calculating the node loss.
[0061] In summary, the charging demand prediction method for charging stations provided by the present invention, compared with the existing prediction algorithms, uses relatively superior features selected by the random forest algorithm to train the LAL model, dynamically pays attention to 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 optical 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 and valley periods. Therefore, the problem of relatively low prediction accuracy of charging demand prediction of electric bus charging stations during the peak and valley periods in the prior art is solved.
[0062] The present invention also provides an operation optimization method for an electric bus, which includes steps S210 and S220.
[0063] 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.
[0064] Step S220, optimizing the operation route of the electric bus according to the charging demand of the electric bus charging station and the battery charge state of the electric bus.
[0065] As follows, the operation optimization method of an electric bus provided by the present invention and the charging demand prediction method of a charging station applied thereto are specifically described through a specific embodiment.
[0066] An operation optimization method of an electric bus based on charging demand prediction includes: S1: Use the random forest algorithm to filter out features that are highly correlated with the charging demand of electric bus charging stations from the historical charging records of electric bus charging stations.
[0067] Specifically include: S11: The datasets related to the charging demand of electric bus charging stations are randomly divided into two groups, one is the in-bag dataset for training, and the other is the out-of-bag dataset for testing.
[0068] S12: Use the in-bag dataset to build a random forest model, use the out-of-bag dataset to evaluate each decision tree, and calculate the initial out-of-bag error.
[0069] S13: Randomly change a feature X in the out-of-bag dataset and recalculate the posterior out-of-bag error.
[0070] S14: The change of feature X leads to the change of error of N decision trees in the out-of-bag data set, and the importance of model feature X is calculated as follows:
[0071] in, i X Representation characteristicsX 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.
[0072] S15: Use the formula in S14 to calculate the importance of the feature X of the current random forest model, and sort it in descending order, select the top 90% of the features in importance, 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 that are highly correlated with the charging demand of electric bus charging stations, as shown in Table 1.
[0073] S2: Use the attention mechanism and light gradient decision tree algorithm to optimize the long short-term memory neural network to build the LAL model.
[0074] Specifically include: S21: The gating unit of the long short-term memory neural network consists of three gates: the forget gate ( f t )、Input Gate( i t ) and the output gate ( o t ),like Figure 3 As shown, where: Forget Gate f t ) by reading the output of the previous LSTM unit ( h t-1 ) and the input of the current LSTM unit ( x t ) decides which information to discard. Input gate ( i t ) determines what information is stored by the sigmoid function.
[0075] Output Gate ( o t ) determines what information is output.
[0076] The feedforward process of the LSTM unit includes the calculation of the gating unit, the memory unit, and the output unit.
[0077] The calculation of the gate control unit is:
[0078] The calculation of the memory unit is:
[0079] The calculation of the output unit is:
[0080] 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 is the output of the tth network unit.
[0081] Using mean square error (MSE) as the loss function, the adaptive moment estimation optimizer updates the network weight matrix and bias vector according to the gradient of the loss function during back propagation:
[0082] in, T represents the length of the time series, y t and Represent the tth predicted value and label value (true value) respectively.
[0083] S22: The attention mechanism assigns weights to the output of the LSTM unit, dynamically prioritizing the key parts of long time series data according to different inputs, such as Figure 4 As shown:
[0084] 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.
[0085] S23: LightGBM uses histogram algorithm and constrained leaf growth to build trees, aiming to improve efficiency and reduce overfitting; Specifically, after each iteration of the LightGBM model, the LightGBM algorithm combines the predicted value of the new tree model with the predicted value of the previous generation, and the generated predicted value is closer to the actual value. The specific expression is:
[0086] in, 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 a tree function, which has the following table representing the structure of the tree function after the corresponding number of iterations. express j- Predicted value for 1 generation.
[0087] The traditional objective function of the optical gradient decision tree network includes a loss function and a regularization function, and the specific expression is:
[0088] in, 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 a regularization function used to prevent overfitting. The specific expression is:
[0089] Among them, T is the total number of leaf nodes, is the weight vector of the leaf node, and is the penalty coefficient of the regularization function. The former controls the number of leaf nodes, and the latter ensures the output of leaf nodes.
[0090] also, Can be converted into , because the calculated value of the minimized objective function is independent of the constant, the loss function is expanded by the second-order Taylor formula, ignoring the known values and constant terms, and the objective function is obtained. The specific expression is:
[0091] Ψ represents the leaf node sample set, g i and h i They represent the first-order partial derivative and the second-order partial derivative of the loss function respectively. When the derivative is 0, the specific expression of the weight of the corresponding leaf node is:
[0092] Then the objective function of the LightGBM model after optimization is:
[0093] set up and They are The left and right subtrees after segmentation, the gain function after segmentation is:
[0094] The LightGBM algorithm selects the leaf node feature set with the largest gain loss as output by continuously calculating the node loss.
[0095] S3: Use the features obtained in S1 to train the LAL model obtained in S2 to train the charging demand of electric bus charging stations in the next 24 hours.
[0096] S31: Use the features obtained in S1, including the historical charging demand of electric bus charging stations, the average charging demand of electric bus charging stations, the charging demand of electric bus charging stations in the same period, charging voltage, charging current, SOC, charging time, day of the week, time of the day, and temperature to construct time series data The purpose is to predict the charging demand in the future p time periods based on the charging demand in the historical m time periods. The specific expression is:
[0097] S32: Use time series data to train the LAL model to obtain the spatial distribution of charging demand at different electric bus charging stations during different charging periods, and use the natural interval classification method to divide the charging demand into multiple modes and display them intuitively on the map, such as Figure 5-7 shown.
[0098] S4: Dynamically adjust the operation method of the electric bus according to the charging demand of different electric bus charging stations and the battery charge state of the electric bus.
[0099] The charging demand at different electric bus charging stations at different times is predicted by S3. The charging price of different electric bus charging stations is positively correlated with the charging demand, that is, the greater the charging demand, the higher the charging price; the battery charge state of electric buses can be accurately obtained, and electric buses are not fixed to a specific bus route.
[0100] S41: 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 ,like Figure 8 shown.
[0101] S42: 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 q c .
[0102] S43: To ensure the battery performance of electric buses, the state of charge of the rechargeable battery has a safe lower limit s min , at this time, the charging price is sorted in order of size , , and Sorting, in ensuring Under the premise of low battery state of charge, electric buses with low battery state of charge are assigned 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. Fig. 9 shown.
[0103] In an embodiment of the present invention, a charging demand prediction device for a charging station is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and will not be repeated hereafter. The terms "module", "unit", "subunit", etc. used below can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0104] A charging demand prediction device for a charging station comprises: The data acquisition module is used to obtain historical charging record data of electric bus charging stations, and screen out target features related to charging demand from the historical charging record data based on a random forest model.
[0105] The demand prediction module is used to predict the charging demand of the electric bus charging station based on the characteristic data of the target characteristics through a trained charging demand prediction model.
[0106] Among them, 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 weighted sum of the output of the long short-term memory neural network and the output of the optical gradient decision tree network.
[0107] Compared with the existing prediction algorithms, the charging demand prediction device for the charging station provided by the present invention uses relatively superior features selected by the random forest algorithm to train the LAL model, dynamically pays attention to 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 optical 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 and valley periods. Therefore, the problem of relatively low prediction accuracy of charging demand in peak and valley periods of electric bus charging stations in the prior art is solved.
[0108] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0109] The present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, 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.
[0110] 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.
[0111] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.
[0112] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.
Claims
1. A charging demand prediction method for a charging station, 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; Among them, 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 weighted sum of the output of the long short-term memory neural network and the output of the optical gradient decision tree network.
2. The charging demand prediction method for a charging station 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 charging demand prediction method for a charging station 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 charging demand prediction method for a charging station according to claim 1, characterized in that: The loss function of the long short-term memory neural network for: , in, T Represents the total number of sample data, t Represents a variable integer, y t 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 charging demand prediction method for a charging station 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.
6. The charging demand prediction method of a charging station according to claim 1, characterized in that: The objective function of the optical gradient decision tree network is: , in, represents the objective function of the light gradient decision tree network, I Represents the total number of sample data, i Represents a variable integer, Ψ represents the leaf node sample set, g i and h i They represent the first-order and second-order partial derivatives of the loss function, respectively. and represents the penalty coefficient of the regularization function, T is the total number of leaf nodes.
7. A method for optimizing the operation of an electric bus, characterized in that: include: Obtaining the charging demand of the electric bus charging station by the charging demand prediction method of any one of claims 1 to 6; The operation route of the electric bus is optimized according to the charging demand of the electric bus charging station and the battery charge state of the electric bus.
8. A charging demand prediction device for a charging station, characterized in that: include: A data acquisition module, used to acquire historical charging record data of electric bus charging stations, and screen target features related to charging demand from the historical charging record data based on a random forest model; A demand prediction module, used to predict the charging demand of the electric bus charging station based on the characteristic data of the target characteristic through a trained charging demand prediction model; Among them, 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 weighted sum of the output of the long short-term memory neural network and the output of the optical gradient decision tree network.
9. An electronic device, comprising a memory and a processor, characterized in that: 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 according to any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the charging demand prediction method for a charging station according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Power load prediction method based on LSTM and LGBM
CN110084424A
Three-dimensional model retrieval method adopting Siamese structure-based bidirectional long-short-term memory network
CN110990608A
Virtual power plant day-ahead scheduling method for aggregating multiple types of electric vehicles
CN112865082A
PM2.5 concentration prediction method and system for optimizing RELM based on random forest and ISCA
CN113344261A
Power load prediction method based on neural network and random forest method
CN116050605A
