Electric vehicle charging load prediction method based on user behavior analysis

Through the TCN-DA-STGNN-Attention fusion model combined with user behavior analysis, the whale algorithm is optimized, which solves the problems of insufficient identification of influencing factors and insufficient fusion of models in electric vehicle charging load prediction, and achieves higher accuracy and faster iteration prediction, supporting the stable operation of the power system and user demand-side management.

CN120280901APending Publication Date: 2025-07-08HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202510394521.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-31
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

The existing electric vehicle charging load prediction technology is not comprehensive enough in the identification of influencing factors and unreasonable weight allocation, resulting in large prediction errors and insufficient model fusion, making it difficult to accurately predict the randomness of user charging behavior and difficult to adjust parameters, slow iteration speed and low prediction accuracy.

Method used

The TCN-DA-STGNN-Attention fusion model is adopted to combine user behavior analysis, and through the spatial feature extraction of TCN, the dynamic learning of DA-STGNN and the Attention mechanism, the whale algorithm is optimized to improve prediction accuracy and robustness, establish the minimum objective function and constraints, and optimize the model parameters to adapt to different application scenarios.

Benefits of technology

It improves the accuracy and iterative speed of electric vehicle charging load prediction, is suitable for real-time applications, enhances the operation and scheduling support of the power system, reduces the load pressure of the power grid, and improves user satisfaction and charging efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120280901A_ABST
    Figure CN120280901A_ABST
Patent Text Reader

Abstract

An electric vehicle charging load prediction method based on user behavior analysis comprises the steps of 1, data collection and preprocessing: initializing the number of electric vehicles in a power distribution network area, collecting various data of electric vehicle users, preprocessing the data, and establishing a data set; 2, constructing a load prediction model, determining an objective function and constraint conditions, and fusing the load prediction model; 4, training the load prediction model by using the data set; step 5, optimizing the whale WOA algorithm, and fusing the optimized whale algorithm into the load prediction model to optimize the model; step 6, predicting the charging load of the electric vehicle by using the optimized load prediction model; and 7, obtaining a prediction result and outputting the prediction result. According to the method, the charging load of the electric vehicle is predicted in combination with user behavior analysis, spatio-temporal data analysis and machine algorithm learning, the accuracy of prediction of the charging load of the electric vehicle can be improved, and charging resources are optimally configured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electric load forecasting, and particularly relates to an electric vehicle charging load forecasting method based on user behavior analysis. Background Art

[0002] With the popularization of electric vehicles, charging load forecasting has become an important basis for the planning, operation and energy management of charging stations. However, the existing technologies are not comprehensive enough in identifying influencing factors. The charging behavior of electric vehicles is affected by various factors. The current forecasts mostly use conventional factors such as historical load, meteorological conditions, holidays, traffic conditions, etc. to build models, and do not consider special factors such as extreme weather and transitional weather enough, resulting in large forecasting errors.

[0003] The factor weight distribution is unreasonable. Different factors have different degrees of influence on the spatio-temporal distribution of charging load, but it is currently difficult to accurately determine the weights of each factor. If the weight distribution is unreasonable, the model will not pay enough attention to some key factors, affecting the accuracy of the forecasting results.

[0004] The existing technologies still have the technical defect of insufficient model fusion in the model aspect. When the existing fusion models are used for electric vehicle load forecasting, there are technical defects such as being unable to fully mine feature data, being unable to fully predict and judge the randomness of user charging behavior, difficult to adjust parameter values, slow iteration speed, and low forecasting accuracy. Summary of the Invention

[0005] In view of the above technical problems, the present technical solution provides an electric vehicle charging load forecasting method based on user behavior analysis, which uses a TCN-DA-STGNN-Attention fusion model for multi-scale spatio-temporal and user behavior forecasting, can improve the forecasting accuracy, has a faster iteration speed, and is suitable for real-time applications. The TCN-DA-STGNN-Attention neural network fusion model combines the spatial feature extraction ability of TCN, DA-STGNN can dynamically learn and adjust the features in the spatial dimension, and capture the periodic and trend changes of the charging load; the attention enhancement ability of the Attention mechanism effectively improves the accuracy and robustness of the electric vehicle charging load forecasting. This model shows significant advantages in dealing with complex time series data, can better adapt to different actual application scenarios, provides strong support for the operation and dispatching of the power system; effectively solves the above problems.

[0006] The present invention is realized through the following technical solutions:

[0007] An electric vehicle charging load forecasting method based on user behavior analysis, comprising the steps:

[0008] Step 1: Data collection and preprocessing: Initialize the number of electric vehicles in the distribution network area, collect various data of electric vehicle users, preprocess the data, and establish a data set;

[0009] Step 2: Construct the TCN-DA-STGNN-Attention prediction model: Establish the minimum objective function and constraints, and integrate the minimum objective function and constraints into the TCN-DA-STGNN-Attention prediction model;

[0010] Step 3: Use the data set to train the TCN-DA-STGNN-Attention prediction model;

[0011] Step 4: Optimize the whale algorithm; including the steps:

[0012] Step 4.1: Add a periodic mutation strategy function to the original algorithm, and modify and improve the code at the same time;

[0013] Step 4.2: Use Tent chaotic mapping to generate the initial population in the initialization stage of the algorithm;

[0014] Step 4.3: Increase the change rate of the inertia weight during local development in the later stage of the algorithm;

[0015] Step 5: Integrate the optimized whale algorithm into the TCN-DA-STGNN-Attention prediction model to optimize the model; including the steps:

[0016] Step 5.1: Divide and process the data set obtained in Step 1 into samples, and add corresponding label attributes at the same time;

[0017] Step 5.2: Initialize the parameters of the DA-STGNN network;

[0018] Step 5.3: Use the Adam optimizer to perform iterative loop training on the weights of the DA-STGNN network;

[0019] Step 5.4: Feed the adjustment parameters calculated by the optimized whale algorithm back to the DA-STGNN network;

[0020] Step 5.5: Use the output of DA-STGNN in Step 5.4 as the input of the attention layer, and calculate the differences between parameter values such as MSE, RMSE, R2, MAE, MAPE and the true value through function calculation. Through comparative analysis, the charging load of electric vehicles can be predicted more accurately;

[0021] Step 6: Construct an optimized machine learning prediction model, and train and evaluate the model;

[0022] Step 7: Use the optimized machine learning prediction model to predict the charging load of electric vehicles; obtain the prediction results and output them.

[0023] Furthermore, the various data collected from electric vehicle users in Step 1 include collecting data on the basic information, driving mileage, historical charging records, charging power, traffic flow and congestion data, and weather forecast data of electric vehicle users; cleaning, denoising, handling missing values, and normalizing the collected data. With this data as support, it can provide a basis for accurate charging load prediction, improve the pertinence and satisfaction of charging services; by analyzing the driving mileage data, it is possible to predict when and where the vehicle needs to be charged, as well as the possible charging amount; based on the analysis of historical charging records, a user charging behavior model can be constructed to predict future charging needs; the analysis of charging power helps to optimize the configuration and scheduling of charging facilities and improve charging efficiency; the analysis of traffic flow and congestion data can better capture the dynamic changes of charging load and improve the accuracy and reliability of the prediction model; weather conditions have a significant impact on the driving and charging behavior of electric vehicles. Uncertain bad weather may cause users to reduce going out, thereby reducing charging demand. The impact of weather changes on charging load can be predicted in advance, and the operation strategy of charging facilities can be adjusted in advance.

[0024] Furthermore, the specific operation method for establishing the minimum objective function and constraint conditions in Step 2 includes:

[0025] Establishing the minimum objective function aims to achieve the comprehensive minimization of charging cost, time, and distance. To better capture the sensitivity changes of users to cost, time, and distance, quadratic terms are introduced, and the formula is as follows:

[0026]

[0027] Among them: F represents the comprehensive optimization objective function; N represents the total number of users; C i represents the charging cost of user i; T i represents the charging waiting time of user i; D i represents the driving distance of user i to the charging station; δ C , δ T , δ D are the weight coefficients of the quadratic terms, used to further optimize the non-linear relationship between charging cost, time, and distance; α, β, γ are weight coefficients, used to balance the relative importance of cost, time, and distance in the objective function; if the user cares very much about cost, the value of α can be set higher; if the user's time is very precious, the value of β can be set higher; if the user wants to charge nearby, the value of γ can be set higher;

[0028] The key to establishing the minimum objective function lies in the weight coefficients; in the objective function, α, β, and γ are weight coefficients used to balance the charging cost C i , the charging waiting time T i , and the driving distance D i in the relative importance in the objective function; these weight coefficients can be adjusted according to the specific needs of users to achieve different optimization goals; associating the weight coefficients α, β, and γ with the specific needs of users, the specific operation methods include:

[0029] Step 2.1: User needs survey: Through user surveys or historical data, obtain the user's preference levels for charging cost, charging waiting time, and driving distance;

[0030] Step 2.2: Calculation of weight coefficients: Calculate the weight coefficients α, β, and γ according to the user preference levels; the calculation formula is:

[0031]

[0032] where: the user's preference level for charging cost is p C , the preference level for charging waiting time is p T , and the preference level for driving distance is p D ; θ C , θ T , θ D are quadratic coefficients used to adjust the weight coefficients;

[0033] The minimum objective function is set with constraint conditions, and the constraint conditions include:

[0034] 1) For battery capacity limitation:

[0035] 0 ≤ E charge,i ≤ E max,i (5)

[0036] where, E charge,i represents the charging amount of user i, and E max,i represents the maximum capacity of its battery;

[0037] Charging station capacity:

[0038] 2) For each charging station j, it is necessary to satisfy:

[0039]

[0040] where, Users j represents the set of users charging at charging station j, S capacity,j represents the total charging capacity of charging station j, ∈ j is the capacity redundancy coefficient of charging station j;

[0041] 3) Charging waiting time:

[0042] T wait,i ≤T max,i -ζ i T max,i (7)

[0043] Among them, T wait,i represents the waiting time of user i, and T max,i represents the maximum acceptable waiting time of user i, and ζ i is the time sensitivity coefficient of user i.

[0044] Furthermore, the TCN-DA-STGNN-Attention prediction model described in step 2 adopts a convolutional neural network TCN-DA-STGNN-Attention prediction model, including:

[0045] (I) Temporal Convolutional Network TCN:

[0046] The TCN part adopts a stack of convolutional neural networks Conv1D to extract key features from time series data; the operation expression of its unit is as follows:

[0047] c t,i =ω i ×x t +b i (8)

[0048] In the formula: c t,i is the feature vector obtained by the action of the i-th convolutional kernel ω i on the input data x t at time t; b i is the bias term;

[0049] (II) Dynamic Adaptive Spatio-Temporal Graph Neural Network DA-STGNN:

[0050] The DA-STGNN model can dynamically learn and adjust the graph structure, capture the correlation of electric vehicle charging loads between different geographical locations, and the influence of traffic road network information on the driving rules and charging demands of electric vehicles, so as to achieve accurate spatio-temporal distribution prediction; its operation expression is as follows:

[0051] A. Dynamic graph structure learning:

[0052]

[0053] Among them, this formula is used to construct a dynamic adjacency matrix indicating the link weight between node i and node j at time t; and respectively represent the magnitudes of the feature vectors of node i and node j at time t; by calculating the cosine similarity between the feature vectors of node i and j at time t and to determine the connection and weight between nodes. If the cosine similarity is greater than the threshold θ, it is considered that there is a connection between node i and node j, and the weight of the connection is this cosine similarity; otherwise, the weight is 0, indicating no connection;

[0054] B. Time series modeling and feature fusion prediction:

[0055]

[0056] Among them, this formula realizes the prediction of the charging load at future time t + τ; first, the charging load of node i at time t + τ predicted by the model, the MLP multi-layer perceptron, is used to map the fused features to the final predicted value; α is the attention weight, which is used to dynamically adjust the contribution ratio of spatial features and time features; σ is the activation function, which is used to introduce non-linearity; The normalized graph adjacency matrix, where D is the node degree matrix and A is the adjacency matrix containing self-loops; W is the weight matrix in GCN, which is used to learn the linear transformation of node features; The time series data of node i at time t; The hidden state of GRU at time t - 1, representing the historical time features of node i; use GRU to encode the time series data of node i to obtain time features; then, use GCN to extract spatial features; fuse spatial features and time features through the attention weight α; finally, input the fused features into MLP to obtain the predicted value

[0057] (III) Attention mechanism:

[0058] When dealing with time series problems, the attention mechanism can perform weighted processing on sequence data at different times; by adjusting the proportion weights of the vehicle's previous state information and surrounding environment information, more important trajectory data information is screened out, enabling the model to extract more representative lane-changing features; introduce the attention mechanism into the DA-STGNN model;

[0059] The attention mechanism includes the following 3 steps:

[0060] a) Information input:

[0061] X = [x1, x2, …, x T is the input sequence information of length T;

[0062] b) Calculate the attention distribution probability vector α i :

[0063] The attention weight coefficient α = [α1, α2, …, α T , and the calculation formula is:

[0064] α i = softmax[s(X i , q)] (11)

[0065] In the formula, s(X i , q) is the attention scoring mechanism, that is

[0066] s(X i , q) = V T tanh(WX i + Uq) (12)

[0067] In the formula: W, U, and V are learnable network parameters; q is the query vector related to the input sequence; α i represents the degree of association between the i-th part of the input information and q;

[0068] c) Perform weighted summation on the input information:

[0069] Adopt an information selection mechanism to give the result obtained by the query, and summarize the input information in a weighted average manner to obtain the attention value:

[0070]

[0071] In the formula: α i represents the degree of association between the i-th part of the input information and q; X i is a multi-dimensional vector containing the state information of the vehicle at the i-th moment and the surrounding environment information.

[0072] Furthermore, the specific operation method of step 4.1 is:

[0073] Add a periodic factor to the position update formula of the whale algorithm. Let the periodic factor be P, which is a function that changes with time or the number of iterations, and express it as P(t); in the behavior of surrounding the prey, multiply the periodic factor P(t) by A or C to introduce periodic changes; the new position update formula is expressed as:

[0074]

[0075] In the formula, represents the position of the i-th prey at time t + 1; Denote the best position among all prey at time t; P(t) represents the period factor, which is a function varying with time and is used to introduce periodic changes; A represents a constant or function for adjusting the amplitude of prey position update; C represents a constant or function for adjusting the amplitude of prey position update. Denote the position of the i-th prey at time t.

[0076] The above formula introduces periodic changes, making the position update of prey or solutions periodic, which helps the algorithm explore and utilize more effectively in the search space; the introduction of the periodic mutation strategy enables the whale algorithm to jump out of the local optimal solution during the search process and continue to search within the entire solution space, contributing to finding the global optimal solution.

[0077] Furthermore, the specific operation method of step 4.2 is as follows:

[0078] Step 4.21: Initialize parameter settings: Set the number of whales N and the maximum number of iterations T.

[0079] Step 4.22: Generate the initial population: Use the Tent chaotic mapping to generate a chaotic sequence; map the chaotic sequence to the solution space of the optimization problem. The specific formula is expressed as:

[0080] Generate a chaotic sequence using the Tent chaotic mapping:

[0081] x n+1 ~U(0,1) (15)

[0082] In the formula, x n+1 is the generated chaotic mapping sequence; U(0,1) represents the uniform distribution on the interval [0,1).

[0083] Map the chaotic sequence to the solution space of the optimization problem: Let the solution space of the optimization problem be [a,b],

[0084]

[0085] In the formula, x n is the n-th iteration value, r is the chaotic coefficient, and 0 < r < 1, but usually r = 0.5 to ensure chaotic behavior;

[0086]

[0087] In the formula, is the initial position of the i-th whale;

[0088] Step 4.23: Execute the whale optimization algorithm: Use the generated initial population Iterative optimization is performed according to the basic steps of the whale optimization algorithm, ultimately achieving the goal of improving the search efficiency and performance of the algorithm.

[0089] Furthermore, the change rate of the inertia weight increased in Step 4.3 is the inertia weight of the improved standard whale algorithm, and its expression is:

[0090]

[0091] In the formula, X (i,t) represents the position of whale individual i at time t; X (i,t+1) represents the position of whale individual i at time t + 1; w align is the alignment weight, used to adjust the degree of alignment of whale individual i with other whale individuals; Σ j≠i (X (j,t) -X (i,t) ) represents the summation of the position differences between whale individual i and all other whale individuals j = i; N is the total number of the whale population; What is calculated is the difference between the average position of all other whale individuals except whale individual i and the position of whale individual i.

[0092] An appropriate alignment weight can accelerate the convergence speed of the algorithm, enabling whale individuals to approach the optimal solution faster. At the same time, the alignment weight also helps to improve the accuracy of the algorithm, enabling whale individuals to conduct a more detailed search near the optimal solution. The introduction of the alignment weight increases the robustness of the algorithm, making it have better adaptability and stability when facing different problems and complex environments.

[0093] Furthermore, the specific operation method for constructing the optimized machine learning prediction model described in Step 6 is as follows:

[0094] Step 6.1: Use user behavior characteristics, spatio-temporal characteristics, and other influencing factors as input variables to train the model to predict the spatio-temporal distribution of the charging load in a future period of time;

[0095] Step 6.2: Construct the objective function and constraint conditions for the weight allocation problem;

[0096] Suppose there are n factors affecting the charging load, denoted as x1, x2, …, x n ; the corresponding weights are w1, w2, …, w n ; the objective function expression is:

[0097]

[0098] In the formula: y i is the actual charging load of the i-th factor; is the predicted charging load of the i-th factor; is the absolute error between the actual value and the predicted value of the i-th factor;

[0099] The described constraint conditions include:

[0100] Weight normalization: The sum of all weights is 1 to ensure reasonable weight distribution;

[0101]

[0102] In the formula: To ensure reasonable distribution, the sum of w from i = 1 to n i is equal to 1.

[0103] Non - negative weights: Each weight value must be non - negative to ensure the physical meaning of the weights;

[0104] w i ≥0, i = 1, 2, …, n (21)

[0105] In the formula: To ensure the physical meaning of each weight, for i from 1 to n, each w i is greater than or equal to 0.

[0106] Analysis of factor importance: According to practical experience or data, set a minimum weight for some key factors to ensure that key factors are given sufficient attention in the model;

[0107] w i ≥w min,i (22)

[0108] In the formula: Set the minimum weight value w for the key factor min,i , w min,i represents the minimum weight value that the i - th key factor must be allocated at least in the model; w i represents the weight of the i - th factor.

[0109] Obtain the objective function and constraint conditions for the dynamic electricity price of electric vehicle loads, and further analyze the charging load prediction of electric vehicles; including:

[0110] Minimize the grid load fluctuation: By adjusting the electricity price to guide electric vehicles to charge when the grid load is low, so as to reduce the peak - valley difference of the grid load and improve the stability of grid operation. The expression is:

[0111]

[0112] where, L t is the basic grid load at time t, is the charging power of the i - th electric vehicle at time t, is the average value of the grid load, T is the set of time, and I is the set of electric vehicles;

[0113] Maximize user satisfaction: Through reasonable electricity price settings, users can get preferential treatment in charging costs while meeting their charging needs;

[0114]

[0115] Among them, is the total charging cost of the i-th electric vehicle;

[0116] Construct constraint conditions according to the objective function:

[0117] Electric vehicle charging demand constraint: The charging amount of each electric vehicle must meet its charging demand;

[0118]

[0119] Among them, is the total charging demand of the i-th electric vehicle;

[0120] Grid load constraint: The total load of the grid cannot exceed its maximum capacity;

[0121]

[0122] Among them, L max is the maximum capacity of the grid;

[0123] Electricity price constraint: The electricity price must fluctuate within a reasonable range to avoid imposing too heavy an economic burden on users;

[0124]

[0125] Among them, p t is the electricity price at time t, p min and p max are the minimum and maximum values of the electricity price respectively;

[0126] Electric vehicle charging power constraint: The charging power of each electric vehicle must be within its rated power range;

[0127]

[0128] Among them, is the maximum charging power of the electric vehicle;

[0129] Charging time constraint: The charging time of the electric vehicle must be within its available charging time window;

[0130]

[0131] Among them, is the available charging time window of the i-th electric vehicle.

[0132] Further, the specific operation method for evaluating the model in step 6 is as follows:

[0133] Step 6.3: Select the mean absolute percentage error MAPE, root mean square error RMSE, and determination coefficient R 2 as the evaluation indicators for the model prediction results;

[0134] MAPE and RMSE are used to measure the prediction accuracy. The smaller the values of both, the higher the prediction accuracy of the model; R 2 is used to reflect the quality of the model, and its value range is [0,1]. The closer R 2 is to 1, the better the performance of the prediction model; The calculation formulas are as follows:

[0135]

[0136]

[0137] In the formula, y i represents the true value of the i-th sample point; represents the predicted value of the i-th sample point; represents the estimated value of the i-th sample point; n is the total number of samples.

[0138] Among them, when using the TCN-DA-STGNN-Attention prediction model to perform electric vehicle load prediction analysis, the mean square error MSE and mean absolute error MAE are important indicators for evaluating the prediction performance of the model. MSE measures the average of the squares of the differences between the predicted values and the actual values. Due to the presence of squares, MSE is more sensitive to larger errors. Therefore, it is usually used to evaluate the prediction accuracy of the model. The smaller the value of MSE, the better the prediction performance of the model, that is, the closer the predicted value is to the actual value. The advantage of MSE is that it is simple to calculate and easy to understand, but its amplification effect on errors may lead to excessive attention to outliers (i.e., extreme errors). MAE measures the average of the absolute values of the differences between the predicted values and the actual values. Compared with MSE, MAE is less sensitive to outliers because it uses absolute values instead of squares. The smaller the value of MAE, the better the prediction performance of the model. The advantage of MAE is that it is easy to understand and calculate, and is less sensitive to outliers. However, it may not be as capable as MSE in capturing large errors.

[0139]

[0140] In the formula, n is the number of samples or time periods; F i is the predicted value of the i-th time period; A i is the actual value of the i-th time period;

[0141]

[0142] In the formula, n, F i and A i have the same meanings as those in MSE; |F i -A i | represents the absolute value of the difference between the predicted value and the actual value.

[0143] Beneficial effects

[0144] A method for predicting the charging load of electric vehicles based on user behavior analysis proposed by the present invention, compared with the prior art, has the following beneficial effects:

[0145] (1) The present invention uses the TCN-DA-STGNN-Attention fusion model for multi-scale spatio-temporal and user behavior prediction, which can improve the prediction accuracy, has a faster iteration speed, and is suitable for real-time applications. The TCN-DA-STGNN-Attention neural network fusion model combines the spatial feature extraction ability of TCN, DA-STGNN can dynamically learn and adjust the features in the spatial dimension, and capture the periodic and trend changes of the charging load; the attention enhancement ability of the Attention mechanism effectively improves the accuracy and robustness of the electric vehicle charging load prediction. The model shows significant advantages in processing complex time series data, can better adapt to different actual application scenarios, and provides strong support for the operation and scheduling of the power system.

[0146] (2) The present invention establishes an objective function for the grid pressure, fully considers the load brought by the charging of electric vehicles to the grid, and makes a constraint analysis on a series of factors such as the charging demand of electric vehicles, the grid load, multi-scale electricity prices, charging power, and charging time. This not only helps to relieve the load pressure brought by the charging of electric vehicles to the grid, but also can enhance the interaction between the grid and the charging of electric vehicles, realize more reasonable demand-side management, improve the utilization of distributed energy, and promote the development of renewable energy. In the intelligent algorithm, the whale optimization algorithm is an optimization algorithm for solving complex non-linear problems. The algorithm simulates the hunting and searching and predation strategies of whales, and has the advantages of simple principle, convenient parameter setting, strong adaptability to expansion and optimization ability. Using the whale algorithm to optimize the model adjustment parameters of TCN-DA-STGNN-Attention can obtain the optimal combination solution of the adjustment parameters, and improve the accuracy of the recognition model. High-precision charging load prediction is an important means to ensure the stable operation of the power grid.

[0147] (3) The present invention applies the improved whale algorithm to optimize the parameters of the fusion model, enhancing the global search ability, which can help the optimized model jump out of the local optimal solution and find a better global solution; it speeds up the convergence rate, and the optimized fusion model converges faster during the parameter optimization process. Compared with traditional search methods, it can find a better solution in a shorter time, reducing the time cost of model training. Moreover, the optimized fusion model has better stability, with smaller fluctuations in its prediction results on different datasets, which can effectively avoid falling into the local optimum and improve the robustness of the model; using the improved whale algorithm can perform multi-objective optimization on the model adjustment parameters, reducing the difficulty of model tuning.

[0148] (4) The present invention adopts the TCN-DA-STGNN-Attention fusion model for multi-scale spatio-temporal and user behavior prediction, making the prediction more accurate and establishing a more comprehensive prediction model. Compared with other models, when using the TCN-DA-STGNN-Attention fusion model in electric vehicle charging load prediction, there are multi-scale spatio-temporal correlations among various load data. TCN can effectively and fully extract the features in the input data. Through convolutional operations, TCN can capture the local patterns and short-term dependencies in the data; moreover, in charging load prediction, the charging behavior of users has a certain degree of randomness, and both the future and the present are affected by a variety of factors comprehensively; while using DA-STGNN can dynamically learn and adjust the structure of the graph to adapt to the changes in the spatial dependencies in the data, and it can well capture the correlation of electric vehicle charging loads between different geographical locations, as well as the impact of traffic road network information on the driving rules and charging demands of electric vehicles. Using DA-STGNN can more accurately predict the changing trend of charging loads. The introduction of the Attention mechanism in the fusion model assigns different weights to the states output by DA-STGNN, strengthening the key features and reducing the loss of historical information. And the Attention mechanism can dynamically adjust the model's attention to key information, making the model more focused on important feature information and time nodes, thereby improving the accuracy and robustness of the prediction.

[0149] (5) The TCN-DA-STGNN-Attention prediction model proposed by the present invention has more advantages in prediction accuracy and stability compared with other models. At the same time, it has greater advantages in data processing and feature extraction. This model can fuse multi-source data, integrate traffic road network information, driving data of electric vehicles, user behavior data, and environmental data such as weather. Through data preprocessing and feature engineering, these data are transformed into effective inputs of the model, fully considering various factors affecting the charging load of electric vehicles. When extracting spatio-temporal features, this model uses TCN to extract features in the time dimension, capturing the periodic and trend changes of the charging load; through DA-STGNN, it learns features in the spatial dimension, reflecting the charging demand correlation between different regions; the Attention mechanism further enhances the importance of key features, enabling the model to more accurately grasp the spatio-temporal distribution law of the charging load of electric vehicles. Generally speaking, TCN is good at processing time series, DA-STGNN has advantages in spatial relationship modeling, and the Attention mechanism can focus on key information. The combination of the three can more comprehensively describe the spatio-temporal characteristics of the charging load of electric vehicles, thereby improving the prediction accuracy. In subsequent research, the influence of other external factors such as holidays on load prediction will be considered, and at the same time, the model will be optimized by combining intelligent algorithms to further improve the prediction accuracy and practicality of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0150] Figure 1 is the specific flowchart of the present invention.

[0151] Figure 2 is the comparison curve graph before and after the improvement of the whale algorithm of the present invention.

[0152] Figure 3 is the comparison graph of the predicted values and the true values before and after the optimization of the prediction model in the present invention.

[0153] Figure 4 is the analysis and comparison graph of the evaluation indexes MAE, MAPE, and RMSE before and after the optimization of the model in the present invention.

[0154] Figure 5 is the analysis and comparison graph of the evaluation indexes MAE, R 2 analysis and comparison graph.

[0155] Figure 6 is the radar chart of the analysis and comparison of each evaluation index before and after the optimization of the model in the present invention.

[0156] Figure 7 is the convergence broken line graph of the fitness curve after the model of the present invention applies the improved whale algorithm. DETAILED DESCRIPTION OF THE INVENTION

[0157] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. The described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Without departing from the design concept of the present invention, various variations and improvements made by those of ordinary skill in the art to the technical solutions of the present invention shall fall within the protection scope of the present invention.

[0158] Embodiment 1:

[0159] As Figure 1 shown, a method for predicting the charging load of electric vehicles based on user behavior analysis includes the following steps:

[0160] Step 1: Data collection and preprocessing: Initialize the number of electric vehicles in the distribution network area, collect various data of electric vehicle users, preprocess the data, and establish a data set.

[0161] Collect various data of electric vehicle users, including collecting basic information, driving mileage, historical charging records, charging power, traffic flow and congestion data, and weather forecast data of electric vehicle users; clean, denoise, handle missing values and standardize the collected data. With these data as support, it can provide a basis for accurate charging load prediction, improve the pertinence and satisfaction of charging services; by analyzing the driving mileage data, it can predict when and where the vehicle needs to be charged, and the possible charging amount; based on the analysis of historical charging records, a user charging behavior model can be constructed to predict future charging needs; the analysis of charging power helps to optimize the configuration and scheduling of charging facilities and improve charging efficiency; the analysis of traffic flow and congestion data can better capture the dynamic changes of charging load and improve the accuracy and reliability of the prediction model; weather conditions have a significant impact on the driving and charging behaviors of electric vehicles. Uncertain bad weather may cause users to reduce going out, thereby reducing charging demand. The impact of weather changes on charging load can be predicted in advance, and the operation strategy of charging facilities can be adjusted in advance.

[0162] Step 2: Construct a TCN-DA-STGNN-Attention prediction model: Establish the minimum objective function and constraint conditions, and integrate the minimum objective function and constraint conditions into the TCN-DA-STGNN-Attention prediction model.

[0163] Among them, establishing the minimum objective function and constraint conditions, the specific operation methods include:

[0164] Establishing the minimum objective function aims to achieve the comprehensive minimization of charging cost, time and distance. In order to better capture the sensitivity changes of users to cost, time and distance, a quadratic term is introduced, and the formula is as follows:

[0165]

[0166] Among them: F represents the comprehensive optimization objective function; N represents the total number of users; C i represents the charging cost of user i; T i represents the charging waiting time of user i; D i represents the driving distance of user i to the charging station; δ C , δ T , δ D are the weight coefficients of the quadratic terms, used to further optimize the non-linear relationship between charging cost, time and distance; α, β, γ are the weight coefficients, used to balance the relative importance of cost, time and distance in the objective function; if the user cares very much about the cost, the value of α can be set higher; if the user's time is very precious, the value of β can be set higher; if the user wants to charge nearby, the value of γ can be set higher.

[0167] The key to establishing the minimum objective function lies in the weight coefficients; in the objective function, α, β, γ are the weight coefficients, used to balance the charging cost C i , the charging waiting time T i and the driving distance D i in the relative importance in the objective function; these weight coefficients can be adjusted according to the specific needs of users to achieve different optimization objectives; associate the weight coefficients α, β, γ with the specific needs of users. The specific operation methods include:

[0168] Step 2.1: User demand survey: Through user surveys or historical data, obtain the user's preference levels for charging cost, charging waiting time and driving distance.

[0169] Step 2.2: Calculation of weight coefficients: Calculate the weight coefficients α, β, γ according to the user preference levels; the calculation formula is:

[0170]

[0171] Among them: the user's preference level for charging cost is p C , the preference level for charging waiting time is p T , the preference level for driving distance is p D ; θ C , θ T , θ D is the quadratic coefficient used to adjust the weight coefficients.

[0172] The minimum objective function is set with constraint conditions, and the constraint conditions include:

[0173] 1) For battery capacity limitation:

[0174] 0 ≤ Echarge,i ≤E max,i (5)

[0175] Among them, E charge,i represents the charging amount of user i, and E max,i represents the maximum capacity of its battery.

[0176] Charging station capacity:

[0177] 2) For each charging station j, it is necessary to satisfy:

[0178]

[0179] Among them, Users j represents the set of users charging at charging station j, S capacity,j represents the total charging capacity of charging station j, ∈ j is the capacity redundancy factor of charging station j.

[0180] 3) Charging waiting time:

[0181] T wait,i ≤T max,i -ζ i T max,i (7)

[0182] Among them, T wait,i represents the waiting time of user i, T max,i represents the maximum acceptable waiting time of user i, ζ i is the time sensitivity coefficient of user i.

[0183] The prediction model adopts the convolutional neural network TCN-DA-STGNN-Attention prediction model, including:

[0184] (I) Temporal Convolutional Network TCN:

[0185] The TCN part adopts a stack of convolutional neural networks Conv1D to extract key features from time series data. The operation expression of its unit is as follows:

[0186] c t,i =ω i ×x t +b i (8)

[0187] In the formula: c t,i is the feature vector obtained by the action of the i-th convolutional kernel ω i on the input data x t at time t; b i is the bias term.

[0188] (2) Dynamic Adaptive Spatiotemporal Graph Neural Network DA-STGNN:

[0189] The DA-STGNN model can dynamically learn and adjust the graph structure, capture the correlation of electric vehicle charging loads between different geographical locations, and the impact of traffic road network information on the driving patterns and charging demands of electric vehicles, so as to achieve accurate spatiotemporal distribution prediction. Its operation expression is as follows:

[0190] A. Dynamic Graph Structure Learning:

[0191]

[0192] Among them, this formula is used to construct the dynamic adjacency matrix represents the link weight between node i and node j at time t; and respectively represent the norms of the feature vectors of node i and node j at time t; By calculating the feature vectors of node i and j at time t and to determine the connection and weight between nodes. If the cosine similarity is greater than the threshold θ, it is considered that there is a connection between node i and node j, and the weight of the connection is this cosine similarity; Otherwise, the weight is 0, indicating no connection.

[0193] B. Time Series Modeling and Feature Fusion Prediction:

[0194]

[0195] Among them, this formula realizes the prediction of the charging load at future time t+τ; First, the charging load of node i predicted by the model at time t+τ, the MLP multi-layer perceptron, is used to map the fused features to the final predicted value; α attention weight, used to dynamically adjust the contribution ratio of spatial features and time features; σ activation function, used to introduce non-linearity; The normalized graph adjacency matrix, where D is the node degree matrix and A is the adjacency matrix including self-loops; W is the weight matrix in GCN, used to learn the linear transformation of node features; The time series data of node i at time t; The hidden state of GRU at time t-1, representing the historical time features of node i; Use GRU to encode the time series data of node i to obtain time features; Then, use GCN to extract spatial features; Fuse spatial features and time features through the attention weight α; Finally, input the fused features into MLP to obtain the predicted value

[0196] (3) Attention Mechanism:

[0197] When dealing with timing issues, the attention mechanism can perform weighted processing on sequence data at different times; by adjusting the proportional weights of the vehicle's previous state information and surrounding environment information, more important trajectory data information is screened out, enabling the model to extract more representative lane-changing features; the attention mechanism is introduced into the DA-STGNN model.

[0198] The attention mechanism includes the following three steps:

[0199] a) Information input:

[0200] X = [x1, x2, …, x T is the input sequence information of length T.

[0201] b) Calculate the attention distribution probability vector α i :

[0202] The attention weight coefficient α = [α1, α2, …, α T , and the calculation formula is:

[0203] α i = softmax[s(X i , q)] (11)

[0204] In the formula, s(X i , q) is the attention scoring mechanism, that is

[0205] s(X i , q) = V T tanh(WX i + U q ) (12)

[0206] In the formula: W, U, V are learnable network parameters; q is the query vector related to the input sequence; α i represents the degree of association between the i-th part of the input information and q.

[0207] c) Perform weighted summation on the input information:

[0208] An information selection mechanism is used to give the query result, and the input information is aggregated in a weighted average manner to obtain the attention value:

[0209]

[0210] In the formula: αi represents the degree of association between the i-th part of the input information and q; X i is a multi-dimensional vector containing the state information of the vehicle at the i-th moment and the surrounding environment information.

[0211] Step 3: Train the TCN-DA-STGNN-Attention prediction model using the dataset.

[0212] Step 4: Optimize the whale algorithm; including the steps:

[0213] Step 4.1: Add a periodic mutation strategy function on the basis of the original algorithm, and at the same time modify and improve the code.

[0214] Add a periodic factor to the position update formula of the whale algorithm. Let the periodic factor be P, which is a function that changes with time or the number of iterations, and express it as P(t); in the behavior of surrounding the prey, multiply the periodic factor P(t) by A or C to introduce periodic changes; the new position update formula is expressed as:

[0215]

[0216] In the formula, represents the position of the i-th prey at time t + 1; represents the best position among all prey at time t; P(t) represents the periodic factor, which is a function that changes with time and is used to introduce periodic changes; A represents a constant or function used to adjust the amplitude of the prey position update; C represents a constant or function used to adjust the amplitude of the prey position update; represents the position of the i-th prey at time t.

[0217] The above formula introduces periodic changes, making the position update of the prey or solution periodic, which helps the algorithm to explore and utilize more effectively in the search space; the introduction of the periodic mutation strategy enables the whale algorithm to jump out of the local optimal solution during the search process and continue to search within the entire solution space, which helps to find the global optimal solution.

[0218] Step 4.2: Use Tent chaotic mapping to generate the initial population at the initialization stage of the algorithm; the specific operation method is:

[0219] Step 4.21: Initialize parameter settings: Set the number of whales N and the maximum number of iterations T.

[0220] Step 4.22: Generate the initial population: Use Tent chaotic mapping to generate a chaotic sequence; map the chaotic sequence to the solution space of the optimization problem; the specific formula expression is:

[0221] Use Tent chaotic mapping to generate a chaotic sequence:

[0222] x n+1 ~U(0,1) (15)

[0223] In the formula, xn+1 is the generated chaotic mapping sequence; U(0,1) represents the uniform distribution on the interval [0,1).

[0224] Map the chaotic sequence to the solution space of the optimization problem: Let the solution space of the optimization problem be [a,b].

[0225]

[0226] where x n is the nth iteration value, r is the chaos coefficient, and 0 < r < 1, but usually r = 0.5 to ensure chaotic behavior.

[0227]

[0228] where is the initial position of the ith whale.

[0229] Step 4.23: Execute the whale optimization algorithm: Use the generated initial population Perform iterative optimization according to the basic steps of the whale optimization algorithm. Eventually, the purpose of improving the search efficiency and performance of the algorithm is achieved.

[0230] Step 4.3: During the local development in the later stage of the algorithm, increase the change rate of the inertia weight. The increased change rate of the inertia weight is the inertia weight of the improved standard whale algorithm, and its expression is:

[0231]

[0232] where X (i,t) represents the position of the ith whale at time t; X (i,t+1) represents the position of the ith whale at time t + 1; w align is the alignment weight, which is used to adjust the degree of alignment of the ith whale with other whale individuals; ∑ j≠i (X (j,t) -X (i,t) ) represents the sum of the position differences between the ith whale and all other whale individuals j = i; N is the total number of the whale population; What is calculated is the difference between the average position of all other whale individuals except the ith whale and the position of the ith whale.

[0233] An appropriate alignment weight can accelerate the convergence speed of the algorithm, enabling the whale individuals to approach the optimal solution faster. At the same time, the alignment weight also helps to improve the accuracy of the algorithm, enabling the whale individuals to conduct a more detailed search near the optimal solution. The introduction of the alignment weight increases the robustness of the algorithm, making it have better adaptability and stability when facing different problems and complex environments.

[0234] Step 5: Incorporate the optimized whale algorithm into the TCN-DA-STGNN-Attention prediction model to optimize the model, including the following steps:

[0235] Step 5.1: Divide the dataset obtained in Step 1 into samples and add corresponding label attributes.

[0236] Step 5.2: Initialize the parameters of the DA-STGNN network.

[0237] Step 5.3: Use the Adam optimizer to perform iterative loop training on the weights of the DA-STGNN network.

[0238] Step 5.4: Feed the adjustment parameters calculated by the optimized whale algorithm back to the DA-STGNN network.

[0239] Step 5.5: Use the output of DA-STGNN in Step 5.4 as the input to the attention layer. Through function calculation, obtain the differences between parameter values such as MSE, RMSE, R2, MAE, MAPE and the true value. Through comparative analysis, the charging load of electric vehicles can be predicted more accurately.

[0240] Step 6: Construct an optimized machine learning prediction model and train and evaluate the model. The specific operation method for constructing the optimized machine learning prediction model is as follows:

[0241] Step 6.1: Use user behavior characteristics, spatio-temporal characteristics and other influencing factors as input variables to train the model to predict the spatio-temporal distribution of the charging load in the future for a period of time.

[0242] Step 6.2: Construct an objective function and constraints for the weight allocation problem.

[0243] Suppose there are n factors affecting the charging load, denoted as x1, x2, …, x n ; and the corresponding weights are w1, w2, …, w n ; The objective function expression is:

[0244]

[0245] In the formula: y i is the actual charging load of the i-th factor; is the predicted charging load of the i-th factor; is the absolute error between the actual value and the predicted value of the i-th factor.

[0246] The constraints include:

[0247] Weight normalization: The sum of all weights is 1 to ensure reasonable weight allocation;

[0248]

[0249] In the formula: To ensure reasonable allocation, the sum of w from i = 1 to n i is equal to 1.

[0250] The weights are non - negative: Each weight value must be non - negative to ensure the physical meaning of the weights;

[0251] w i ≥0, i = 1, 2, …, n (21)

[0252] In the formula: To ensure the physical meaning of each weight, for i from 1 to n, each w i is greater than or equal to 0.

[0253] Analysis of factor importance: According to practical experience or data, set a minimum weight for some key factors to ensure that key factors are given sufficient attention in the model;

[0254] w i ≥w min,i (22)

[0255] In the formula: Set the minimum weight value w for key factors min,i , w min,i represents the minimum weight value that the i - th key factor must be allocated at least in the model; w i represents the weight of the i - th factor.

[0256] Obtain the objective function and constraint conditions of the dynamic electricity price for electric vehicle loads, and further analyze the charging load prediction of electric vehicles; including:

[0257] Minimize the grid load fluctuation: By adjusting the electricity price, guide electric vehicles to charge when the grid load is low, so as to reduce the peak - valley difference of the grid load and improve the stability of the grid operation. The expression is:

[0258]

[0259] where, L t is the basic grid load at time t, is the charging power of the i - th electric vehicle at time t, is the average value of the grid load, T is the set of time, and I is the set of electric vehicles.

[0260] Maximize user satisfaction: Through reasonable electricity price setting, enable users to get preferential treatment in charging costs while meeting their charging needs.

[0261]

[0262] where, is the total charging cost of the i-th electric vehicle.

[0263] Construct constraint conditions according to the objective function:

[0264] Electric vehicle charging demand constraint: The charging amount of each electric vehicle must meet its charging demand.

[0265]

[0266] where is the total charging demand of the i-th electric vehicle.

[0267] Grid load constraint: The total load of the grid cannot exceed its maximum capacity.

[0268]

[0269] where L max is the maximum capacity of the grid.

[0270] Electricity price constraint: The electricity price must fluctuate within a reasonable range to avoid imposing too heavy an economic burden on users.

[0271]

[0272] where p t is the electricity price at time t, p min and p max are the minimum and maximum values of the electricity price respectively.

[0273] Electric vehicle charging power constraint: The charging power of each electric vehicle must be within its rated power range.

[0274]

[0275] where is the maximum charging power of the electric vehicle.

[0276] Charging time constraint: The charging time of the electric vehicle must be within its available charging time window.

[0277]

[0278] where is the available charging time window of the i-th electric vehicle.

[0279] The specific operation method for evaluating the model is as follows:

[0280] Step 6.3: Select the mean absolute percentage error MAPE, root mean square error RMSE, and determination coefficient R 2 as the evaluation indicators for the model prediction results.

[0281] MAPE and RMSE are used to measure the prediction accuracy. The smaller the values of both, the higher the prediction accuracy of the model; R 2 is used to reflect the quality of the model, and its value range is [0,1]. The closer R 2 is to 1, the better the performance of the prediction model; The calculation formulas are as follows:

[0282]

[0283] In the formula, y i represents the true value of the i-th sample point; represents the predicted value of the i-th sample point; represents the estimated value of the i-th sample point; n is the total number of samples.

[0284] Among them, when using the TCN-DA-STGNN-Attention prediction model to conduct electric vehicle load prediction analysis, the mean square error MSE and the mean absolute error MAE are important indicators for evaluating the prediction performance of the model. MSE measures the average of the squares of the differences between the predicted values and the actual values. Due to the existence of the square, MSE is more sensitive to larger errors. Therefore, it is usually used to evaluate the prediction accuracy of the model. The smaller the value of MSE, the better the prediction performance of the model, that is, the closer the predicted value is to the actual value. The advantage of MSE is that it is simple to calculate and easy to understand, but its amplification effect on errors may lead to excessive attention to outliers (i.e., extreme errors). MAE measures the average of the absolute values of the differences between the predicted values and the actual values. Compared with MSE, MAE is less sensitive to outliers because it uses absolute values instead of squares. The smaller the value of MAE, it also indicates that the prediction performance of the model is better. The advantages of MAE are easy to understand and calculate, and it is less sensitive to outliers. However, it may not be as capable as MSE in capturing large errors.

[0285]

[0286] In the formula, n is the number of samples or the number of time periods; F i is the predicted value of the i-th time period; A i is the actual value of the i-th time period.

[0287]

[0288] In the formula, the meanings of n, F i and A i are the same as those in MSE; |F i -A i | represents the absolute value of the difference between the predicted value and the actual value.

[0289] Step 7: Use the optimized machine learning prediction model to predict the charging load of electric vehicles; obtain the prediction results and output them.

[0290] Through comparative analysis, it can be concluded that the model optimized by applying the improved algorithm has a more accurate and rapid prediction effect in predicting the charging load of electric vehicles; applying the improved model also reduces the load pressure on the power grid and provides great help for improving user comfort.

[0291] The optimization algorithm optimizes the model adjustment parameters of TCN-DA-STGNN-Attention to obtain the optimal combination solution of adjustment parameters to improve the accuracy of the recognition model. The present invention applies the improved whale algorithm to optimize the fusion model parameters, enhances the global search ability, and can help the optimized model jump out of the local optimal solution and find a better global solution; speeds up the convergence speed. The optimized fusion model has a faster convergence speed in the parameter optimization process. Compared with traditional search methods, it can find a better solution in a shorter time, reducing the time cost of model training. Moreover, the optimized fusion model has better stability, and its prediction results have less fluctuation on different data sets, can effectively avoid falling into the local optimum, and improve the robustness of the model; using the improved whale algorithm can perform multi-objective optimization on the model adjustment parameters, reducing the difficulty of model tuning.

[0292] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes, substitutions, and improvements within the technical scope disclosed by the present invention are within the protection scope of the present invention.

Claims

1. A method for predicting the charging load of electric vehicles based on user behavior analysis, characterized in that: Including the steps: Step 1: Data collection and preprocessing: Initialize the number of electric vehicles in the distribution network area, collect various data of electric vehicle users, preprocess the data, and establish a data set; Step 2: Construct the TCN-DA-STGNN-Attention prediction model: Establish the minimum objective function and constraint conditions, and integrate the minimum objective function and constraint conditions into the TCN-DA-STGNN-Attention prediction model; Step 3: Use the data set to train the TCN-DA-STGNN-Attention prediction model; Step 4: Optimize the whale algorithm; including the steps: Step 4.1: Add a periodic mutation strategy function on the basis of the original algorithm, and modify and improve the code at the same time; Step 4.2: Use Tent chaotic mapping to generate the initial population in the initialization stage of the algorithm; Step 4.3: Increase the change rate of the inertia weight during the local development in the later stage of the algorithm; Step 5: Integrate the optimized whale algorithm into the TCN-DA-STGNN-Attention prediction model to optimize the model; Including Steps: Step 5.1: Divide and process the data set obtained in Step 1 into samples, and add corresponding label attributes at the same time; Step 5.2: Initialize the parameters of the DA-STGNN network; Step 5.3: Use the Adam optimizer to perform iterative loop training on the weights of the DA-STGNN network; Step 5.4: Feed back the adjustment parameters calculated by the optimized whale algorithm to the DA-STGNN network; Step 5.5: Take the output of the DA-STGNN in Step 5.4 as the input of the attention layer, and calculate the differences between parameter values such as MSE, RMSE, R2, MAE, MAPE and the true value through function calculation. Through comparative analysis, the charging load of electric vehicles can be predicted more accurately; Step 6: Construct an optimized machine learning prediction model, and train and evaluate the model; Step 7: Use the optimized machine learning prediction model to predict the charging load of electric vehicles; obtain the prediction results and output.

2. A method for predicting the charging probability and load of electric vehicle users in a residential area according to claim 1, characterized in that: The various data collected from electric vehicle users described in Step 1 include collecting data on the basic information, driving mileage, historical charging records, charging power, traffic flow and congestion situation data, and weather forecast data of electric vehicle users; cleaning, denoising, missing value processing and standardization processing of the collected data.

3. A method for predicting the charging probability and load of electric vehicle users in a residential area according to claim 1, characterized in that: The specific operation methods for establishing the minimum objective function and constraint conditions described in Step 2 include: Establishing the minimum objective function aims to achieve the comprehensive minimization of charging cost, time and distance. In order to better capture the sensitivity changes of users to cost, time and distance, quadratic terms are introduced. The formula is as follows: Among them: F represents the comprehensive optimization objective function; N represents the total number of users; C i represents the charging cost of user i; T i represents the charging waiting time of user i; D i represents the driving distance of user i to the charging station; δ C , δ T , β D are the weight coefficients of the quadratic terms, which are used to further optimize the non-linear relationship between charging cost, time and distance; α, β, γ are weight coefficients, which are used to balance the relative importance of cost, time and distance in the objective function; if the user cares much about the cost, the value of α can be set higher; if the user's time is very precious, the value of β can be set higher; if the user wants to charge nearby, the value of γ can be set higher; The key to establishing the minimum objective function lies in the weight coefficients; in the objective function, α, β, and γ are weight coefficients used to balance the charging cost C i , the charging waiting time T i and the driving distance D i in the relative importance in the objective function; these weight coefficients can be adjusted according to the specific needs of users to achieve different optimization goals; associating the weight coefficients α, β, and γ with the specific needs of users, the specific operation methods include: Step 2.1: User demand survey: Obtain the preference degrees of users for charging cost, charging waiting time and driving distance through user surveys or historical data; Step 2.2: Calculation of weight coefficients: Calculate the weight coefficients α, β, γ according to the user preference degrees; the calculation formula is: wherein: the preference degree of the user for the charging cost is p C , the preference degree of the user for the charging waiting time is p T , the preference degree of the user for the driving distance is p D ; θ C , θ T , θ D are quadratic coefficients for adjusting the weight coefficients; The minimum objective function is set with constraint conditions, and the constraint conditions include: 1) For battery capacity limitation: 0 ≤ E charge,i ≤ E max,i (5) Among them, E charge,i represents the charging amount of user i, and E max,i represents the maximum capacity of its battery; Charging station capacity: 2) For each charging station j, the following must be satisfied: Among them, Users j represents the set of users charging at charging station j, S capacity,j represents the total charging capacity of charging station j, ε j is the capacity redundancy factor of charging station j; 3) Charging waiting time: T wait,i ≤T max,i -ζ i T max,i (7) Among them, T wait,i represents the waiting time of user i, and T max,i represents the maximum acceptable waiting time of user i, and ζ i is the time sensitivity coefficient of user i.

4. A method for predicting the charging probability and load of electric vehicle users in a residential area according to claim 3, characterized in that: The TCN-DA-STGNN-Attention prediction model described in step 2 uses a convolutional neural network TCN-DA-STGNN-Attention prediction model, including: (I) Temporal Convolutional Network TCN: The TCN part uses a stack of convolutional neural networks Conv1D to extract key features from time series data; the operation expression of its unit is as follows: c t,i = ω i × x t + b i (8) where: c t,i is the i-th convolutional kernel ω i acting on the input data x at time t t to obtain the feature vector; b i is the bias term; (II) Dynamic Adaptive Spatio-Temporal Graph Neural Network DA-STGNN: The DA-STGNN model can dynamically learn and adjust the structure of the graph, capture the correlation of electric vehicle charging loads between different geographical locations, and the impact of traffic road network information on the driving rules and charging demands of electric vehicles, so as to achieve accurate spatio-temporal distribution prediction; its operation expression is as follows: A. Dynamic graph structure learning: Among them, this formula is used to construct a dynamic adjacency matrix represents the link weight between node i and node j at time t; and respectively represent the norms of the feature vectors of node i and node j at time t; by calculating the feature vectors of node i and j at time t and to determine the connection and weight between nodes by calculating the cosine similarity. If the cosine similarity is greater than the threshold θ, it is considered that there is a connection between node i and node j, and the weight of the connection is this cosine similarity; otherwise, the weight is 0, indicating no connection; B. Time series modeling and feature fusion prediction: Among them, this formula realizes the prediction of the charging load at future time t+τ. First, the charging load of node i at time t+τ predicted by the model, the MLP (Multi-Layer Perceptron), is used to map the fused features to the final predicted value; α is the attention weight, which is used to dynamically adjust the contribution ratio of spatial features and temporal features; σ is the activation function, which is used to introduce non-linearity. The normalized graph adjacency matrix, where D is the node degree matrix and A is the adjacency matrix including self-loops; W is the weight matrix in GCN, which is used to learn the linear transformation of node features. The time series data of node i at time t. The hidden state of GRU at time t-1, representing the historical time features of node i; the time series data of node i is encoded using GRU to obtain the time features. Then, the spatial features are extracted using GCN; the spatial features and time features are fused through the attention weight α; finally, the fused features are input into MLP to obtain the predicted value. (III) Attention mechanism: When dealing with time series problems, the attention mechanism can perform weighted processing on sequence data at different times; by adjusting the proportion weights of the vehicle's previous state information and surrounding environment information, more important trajectory data information is screened out, enabling the model to extract more representative lane-changing features; the attention mechanism is introduced into the DA-STGNN model; The attention mechanism includes the following 3 steps: a) Information input: X = [x1, x2, …, x T is the input sequence information of length T; b) Calculate the attention distribution probability vector α i : Attention weight coefficient α = [α1, α2, …, α T , and the calculation formula is: α i = softmax[s(X i ,q)] (11) where s(X i , q) is the attention scoring mechanism, that is s(X i ,q) = V T tanh(WX i +Uq) (12) where: W, U, V are learnable network parameters; q is a query vector related to the input sequence; α i represents the degree of association between the i-th partial content of the input information and q; c) Weighted summation of the input information: An information selection mechanism is used to give the query result, and the input information is aggregated in a weighted average manner to obtain the attention value: Where: att_ut is the final attention value, representing the input information after weighting; α i represents the degree of association between the i-th part of the input information and q; X i is a multi-dimensional vector containing the state information of the vehicle at the i-th moment and the surrounding environment information.

5. A method for predicting the charging probability and load of electric vehicle users in a residential area according to claim 1, characterized in that: The specific operation method of step 4.1 is as follows: A periodic factor is added to the position update formula of the whale algorithm. Let the periodic factor be P, which is a function that changes with time or the number of iterations, and it is expressed as P(t); in the behavior of surrounding the prey, the periodic factor P(t) is multiplied by A or C to introduce periodic changes; the new position update formula is expressed as: In the formula, represents the position of the i-th prey at time t + 1; represents the best position among all preys at time t; P(t) represents the period factor, which is a function that changes with time and is used to introduce periodic changes; A represents a constant or function used to adjust the amplitude of prey position update; C represents a constant or function used to adjust the amplitude of prey position update; represents the position of the i-th prey at time t.

6. A method for predicting the charging probability and load of electric vehicle users in a residential area according to claim 1, characterized in that: The specific operation method of step 4.2 is as follows: Step 4.21: Initial parameter setting: Set the number of whales N and the maximum number of iterations T; Step 4.22: Generate the initial population: Use the Tent chaotic map to generate a chaotic sequence; map the chaotic sequence to the solution space of the optimization problem; the specific formula expression is: Use the Tent chaotic map to generate a chaotic sequence: x n+1 ~U(0,1) (15) where x n+1 is the generated chaotic mapping sequence; U(0, 1) represents the uniform distribution on the interval [0, 1]; Map the chaotic sequence to the solution space of the optimization problem: Let the solution space of the optimization problem be [a, b], where x n is the nth iteration value, r is the chaos coefficient, and 0 < r < 1, but usually r = 0.5 to ensure chaotic behavior; Wherein, is the initial position of the i-th whale; Step 4.23: Execute the whale optimization algorithm: Use the generated initial population Perform iterative optimization according to the basic steps of the whale optimization algorithm.

7. A method for predicting the charging probability and load of electric vehicle users in a residential area according to claim 1, characterized in that: The change rate of increasing the inertia weight described in step 4.3 is the inertia weight of the improved standard whale algorithm, and its expression is: where X (i,t) represents the position of whale individual i at time t; X (i,t+1) represents the position of whale individual i at time t + 1; w align is the alignment weight, used to adjust the degree of alignment of whale individual i with other whale individuals; Σ j≠i (X (j,t) - X (i,t) ) represents the sum of the position differences between whale individual i and all other whale individuals j = i; N is the total number of the whale population; calculates the difference between the average position of all other whale individuals except whale individual i and the position of whale individual i.

8. A method for predicting the charging probability and load of electric vehicle users in a residential area according to claim 1, characterized in that: The specific operation method of constructing the optimized machine learning prediction model described in step 6 is as follows: Step 6.1: Use user behavior characteristics, spatio-temporal characteristics and other influencing factors as input variables to train the model to predict the spatio-temporal distribution of the charging load in the future for a period of time; Step 6.2: Construct an objective function and constraints for the weight allocation problem; Suppose there are n factors affecting the charging load, denoted as x1, x2, …, x n ; and the corresponding weights are w1, w2, …, w n ; The objective function is expressed as: Where: y i is the actual charging load of the i-th factor; is the predicted charging load of the i-th factor; is the absolute error between the actual value and the predicted value of the i-th factor; The constraints described include: Weight normalization: The sum of all weights is 1 to ensure reasonable weight allocation; Where: To ensure reasonable allocation, the sum w of i from 1 to n i equals 1; Weight non-negativity: Each weight value must be non-negative to ensure the physical meaning of the weights; w i ≥ 0, i = 1, 2, …, n (21) where: To ensure the physical meaning of each weight, i ranges from 1 to n, and each w i is greater than or equal to 0; Factor importance analysis: Based on practical experience or data, set minimum weights for certain key factors to ensure that key factors are given sufficient attention in the model; w i ≥ w min,i (22) Where: Set the minimum weight value w for the key factors min,i , w min,i represents the minimum weight value that the i-th key factor must be assigned at least in the model; w i represents the weight of the i-th factor; Obtain the objective function and constraint conditions for the dynamic electricity price of electric vehicle loads, and further analyze the charging load prediction of electric vehicles; including: Minimize grid load fluctuations: Guide electric vehicles to charge when the grid load is low by adjusting the electricity price. The expression is: Among them, L t is the basic grid load at time t, is the charging power of the i-th electric vehicle at time t, is the average value of the grid load, T is the set of time, and I is the set of electric vehicles; Maximize user satisfaction: Through reasonable electricity price settings, users can get preferential treatment in charging costs while meeting their charging needs; Among them, is the total charging cost of the i-th electric vehicle; Construct constraint conditions according to the objective function: Electric vehicle charging demand constraint: The charging amount of each electric vehicle must meet its charging demand; Among them, is the total charging demand of the i-th electric vehicle; Grid load constraint: The total load of the grid cannot exceed its maximum capacity; Among them, L max is the maximum capacity of the power grid; Electricity price constraint: The electricity price must fluctuate within a reasonable range to avoid imposing too heavy an economic burden on users; where, p t is the electricity price at time t, p min and p max are the minimum and maximum values of the electricity price, respectively; Electric vehicle charging power constraint: The charging power of each electric vehicle must be within its rated power range; Among them, is the maximum charging power of the electric vehicle; Charging time constraint: The charging time of electric vehicles must be within their available charging time windows; Among them, is the available charging time window of the i-th electric vehicle.

9. A method for predicting the charging probability and load of electric vehicle users in a residential area according to claim 8, characterized in that: The specific operation method for evaluating the model described in step 6 is: Step 6.3: Select the mean absolute percentage error MAPE, root mean square error RMSE, and coefficient of determination R 2 as the evaluation indicators for the model prediction results; MAPE and RMSE are used to measure the prediction accuracy. The smaller their values are, the higher the prediction accuracy of the model is; R 2 is used to reflect the quality of the model, and its value range is [0, 1]. R 2 The closer it is to 1, the better the performance of the prediction model; the calculation formulas are as follows: where y i represents the true value of the i-th sample point; represents the predicted value of the i-th sample point; represents the estimated value of the i-th sample point; n is the total number of samples.

Citation Information

Cited By

  • Power grid load prediction and dynamic scheduling optimization method based on big data

    CN120855327A

  • A power grid load prediction and dynamic scheduling optimization method based on big data

    CN120855327B

  • Charging demand prediction method for highway new energy vehicle charging station

    CN120952421A

  • Physical model driving and deep learning collaborative electric vehicle charging load prediction method

    CN121055282A

  • Attention-based electricity sale quantity time sequence prediction method, system and equipment and storage medium

    CN121167640A