Electric vehicle charging station baseline load estimation method based on bert-tcn

CN123012994APending Publication Date: 2026-10-30NORTH CHINA ELECTRIC POWER UNIV +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611290424.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-25
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0006]本发明的目的在于提供一种基于BERT-TCN的电动汽车充电站基线负荷估计方法,以解决上述背景技术中提到的现有基线负荷估计方法难以同时有效捕捉负荷长期周期性特征与短期波动性特征、未能充分挖掘充电站之间空间相关性特征、缺乏时空特征自适应深度融合机制的问题

Benefits of technology

[0014]采用本发明产生的有益效果:本发明突破了现有的电动汽车充电站基线负荷估计方法对其负荷周期性特征和波动性特征提取兼顾性一般,导致基线负荷估计结果的精确度和稳定性难以保证。该方案首先分别通过BERT架构和TCN架构分别提取电动汽车充电站负荷的周期性特征和波动性特征;其次构建动态权重矩阵,通过特征的权重动态变化实现基线负荷估计结果精度提升。本方法通过引入BERT模型的多头自注意力机制,捕获跨日、跨周的周期规律,实现周期性特征提取;同时,借助时序卷积网络的扩张因果卷积结构,以层级化方式提取局部负荷波动特征,增强模型对实时负荷突变的敏感性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123012994A_ABST
    Figure CN123012994A_ABST
Patent Text Reader

Abstract

The application discloses a BERT-TCN-based baseline load estimation method for an electric vehicle charging station, belongs to the technical field of electric vehicle charging stations, and comprises the following steps: data preprocessing and input matrix construction, BERT periodic feature extraction, TCN fluctuation feature extraction, comparative learning space feature enhancement, spatiotemporal feature adaptive fusion and baseline load estimation output. The application breaks through the general compatibility of the existing baseline load estimation method for the electric vehicle charging station to the periodic features and the fluctuation features of the load, so that the accuracy and stability of the baseline load estimation result can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of electric vehicle charging station technology, specifically relating to a baseline load estimation method for electric vehicle charging stations based on BERT-TCN. Background Technology

[0002] With the continuous increase in the number of electric vehicles, their large-scale charging behavior has exacerbated the peak-valley difference in power system load, posing new challenges to the safe and stable operation of the power grid. Demand response, as an important means to improve the operational flexibility of the power system, guides users to change their electricity consumption behavior through electricity price signals or financial subsidies, thereby achieving the purpose of peak shaving and valley filling and smoothing the load curve.

[0003] Baseline load refers to the electricity load that a user would consume without participating in demand response, and it is the core basis for calculating economic compensation for users participating in demand response. The accuracy of baseline load estimation directly affects the fairness of compensation and the enthusiasm of demand response participants. As an important medium for interaction between electric vehicles and the power grid, the accurate estimation of the baseline load of electric vehicle charging stations is of great significance for promoting vehicle-grid interaction and improving the effectiveness of demand response implementation.

[0004] Currently, commonly used baseline load estimation methods both domestically and internationally are mainly divided into historical averaging, control group methods, and regression methods. However, these commonly used baseline load estimation methods share the following common technical shortcomings: First, they fail to fully utilize the multi-level periodicity in the time dimension; existing methods often only focus on a single time scale and lack the ability to collaboratively model multi-scale time-series features. Second, they fail to effectively mine the inter-station correlation features in the spatial dimension; existing methods mostly adopt a single-station independent modeling approach, ignoring the spatial clustering features between charging stations. Third, they lack a deep fusion mechanism of spatiotemporal features, resulting in insufficient estimation accuracy and robustness when load patterns change abruptly or the external environment changes.

[0005] Therefore, there is an urgent need to propose a baseline load estimation method that can comprehensively utilize the temporal and spatial correlation characteristics of electric vehicle charging station loads and possess high accuracy and robustness. Summary of the Invention

[0006] The purpose of this invention is to provide a baseline load estimation method for electric vehicle charging stations based on BERT-TCN, in order to solve the problems mentioned in the background art, such as the inability of existing baseline load estimation methods to simultaneously and effectively capture the long-term periodic characteristics and short-term fluctuation characteristics of the load, the failure to fully explore the spatial correlation characteristics between charging stations, and the lack of a spatiotemporal feature adaptive deep fusion mechanism.

[0007] The technical solution adopted in this invention is: a baseline load estimation method for electric vehicle charging stations based on BERT-TCN, the method comprising: Step S1: Data preprocessing and input matrix construction. Collect historical load data, temperature data, humidity data and electricity price data of electric vehicle charging stations, and construct a multidimensional input matrix after preprocessing. Step S2: BERT periodic feature extraction. Input the input matrix into the BERT model and extract the daily and weekly periodic features of the load in the time dimension based on the multi-head self-attention mechanism to obtain the periodic feature vector. Step S3: TCN volatility feature extraction. The input matrix is ​​input into the TCN model in parallel. Based on dilated causal convolution and residual connection, the intraday short-term local random volatility features of the load are extracted to obtain the volatility feature vector. Step S4: Comparative learning spatial feature enhancement. Based on the periodic feature vector obtained in step S2, positive and negative sample pairs are constructed and self-supervised training is performed using the InfoNCE loss function to optimize the BERT model parameters, so that the periodic feature vector has both temporal periodicity and spatial correlation characteristics, thus obtaining the spatiotemporal enhanced feature vector. Step S5: Spatiotemporal feature adaptive fusion. The spatiotemporal enhanced feature vector obtained in step S4 and the volatility feature vector obtained in step S3 are fused with attention, the dynamic weight coefficients are calculated and adaptive weighted fusion is performed to generate multidimensional fused features. Step S6: Baseline load estimation output, flatten the multidimensional fusion features, and obtain the baseline load estimate for the target time period through fully connected regression.

[0008] Furthermore, the input matrix expression for the electric vehicle charging station baseline load estimation model in step S1 is: , In the formula, n represents the total length of the input sequence, represents the number of historical view steps of the sliding window; load is the historical load data vector of electric vehicle charging stations, tem is the temperature data vector, hum is the humidity data vector, and mon is the electricity price data vector.

[0009] Furthermore, the BERT periodic feature extraction in step S2 specifically includes the following sub-steps: Step S21: Vector construction, mapping the input matrix to the query vector Q, key vector K, and value vector V through three different linear transformation matrices: , , , In the formula, X target X is the feature matrix of the target time period to be estimated; history X is the feature matrix within the historical view of the sliding window; loadW is a vector of historical load values. Q W K W V It is a learnable linear transformation weight matrix; After constructing the query vector Q, key vector K, and value vector V, the data contained in each vector is as follows: , , , In the formula, Q t K represents the feature vector for the baseline load estimation period t; m represents the length of the baseline load estimation period; t This represents the characteristic information of the load during historical periods within the sliding window's field of view, including historical load, temperature (tem), humidity (hum), and electricity price (mon); V t This represents the load value for a historical period; n represents the total length of the input sequence, and represents the number of historical view steps in the sliding window; Step S22: Scale the dot product attention calculation, based on the query vector Q, key vector K, and value vector V, for the i-th attention head: , In the formula, Let d be the projection matrix of the query, key, and value in the i-th attention head. k The dimension is the key vector, and softmax is the activation function; Step S23: Multi-head attention aggregation, concatenating the outputs of h attention heads and mapping them back to the original dimension via linear transformation: , In the formula, h represents the number of attention heads; W 0 To output the projection matrix; Step S24: Residual Connectivity and Layer Normalization: , In the formula, X (l-1) This is the output of the (l-1)th layer encoder; The output of the l-th layer encoder after residual connection and layer normalization; Step S25: Nonlinear transformation of the feedforward neural network: , , In the formula, W1 and W2 are the weight matrices of the feedforward network; b1 and b2 are the bias vectors; and ReLU is the activation function. Step S26: After being processed layer by layer by the L-layer encoder, the periodic feature vector F is output. BERT: .

[0010] Furthermore, the TCN volatility feature extraction in step S3 specifically includes the following sub-steps: Step S31: Dilated causal convolution operation, for the l-th layer of dilated causal convolution: , In the formula, f (l) (·) represents the kernel function of the l-th layer; The output of layer l-1 at time td l The value of i, when l-1, is x (0) =X, which is the input feature matrix, and also the input to the l-th layer dilated causal convolution; d l =2 l-1 The dilation rate of the l-th layer is denoted by k; k is the kernel size. Step S32: Weight Normalization and Activation: , In the formula, For weight normalization operations; For activation functions; Step S33: Random deactivation regularization: , In the formula, p is the random inactivation probability; Step S34: Residual connection: , In the formula, x (l-1) This is the input to the (l-1)th level residual block; x (l) This is the output of the l-th residual block; Step S35: After processing the residual blocks through M layers, output the volatility feature vector: .

[0011] Furthermore, the contrastive learning space feature enhancement in step S4 includes: Step S41: Positive sample construction, based on the periodic feature vector F obtained in step S26. BERT Data augmentation is performed by generating positive samples through amplitude jitter and time jitter. : , In the formula, This refers to amplitude disturbance noise; For time-shifted perturbations; Step S42: Negative sample selection. For a training batch containing N charging stations, select the periodic feature vectors of the other N-1 charging stations in the same batch. As a negative sample; Step S43: Similarity calculation, using cosine similarity to measure the degree of similarity between feature vectors: , Step S44: Constructing the InfoNCE loss function: , In the formula, For temperature hyperparameters, For positive sample pairs, For negative sample pairs, Loss is the loss function; Step S45: Minimize the loss using the backpropagation algorithm, iteratively update the BERT model parameters, so that positive sample pairs are closer to each other and negative sample pairs are farther apart in the feature space, to obtain a spatiotemporally enhanced feature vector that integrates spatial correlation characteristics. .

[0012] Furthermore, the spatiotemporal feature adaptive fusion in step S5 includes: Step S51: Perform linear transformations on the two features from steps S3 and S4 respectively: , , In the formula, W b W t Let b be the eigenvalue transformation weight matrix. b b t It is the bias vector; Step S52: Calculate the dynamic weighting coefficients: , In the formula, It is the softmax activation function; These are the dynamic weight coefficients for the BERT branches; Step S53: Adaptive weighted fusion to generate multidimensional fusion features: .

[0013] Furthermore, the baseline load estimation output in step S6 is: , In the formula, W out b is the weight matrix of the output layer. out For bias vectors, For flattening operation, This is the vector of baseline load estimates for each sampling point during the target time period.

[0014] The beneficial effects of this invention are as follows: This invention overcomes the limitations of existing electric vehicle charging station baseline load estimation methods, which generally fail to adequately extract both periodic and volatile load characteristics, leading to difficulties in guaranteeing the accuracy and stability of the baseline load estimation results. This scheme first extracts the periodic and volatile characteristics of the electric vehicle charging station load using BERT and TCN architectures respectively; secondly, it constructs a dynamic weight matrix, improving the accuracy of the baseline load estimation results through dynamic changes in feature weights. This method introduces the multi-head self-attention mechanism of the BERT model to capture daily and weekly periodic patterns, achieving periodic feature extraction; simultaneously, it utilizes the dilated causal convolutional structure of a temporal convolutional network to extract local load volatile characteristics in a hierarchical manner, enhancing the model's sensitivity to real-time load mutations. Attached Figure Description

[0015] Figure 1 This is a flowchart of the present invention; Figure 2 Extract the flowchart for the TCN architecture. Detailed Implementation

[0016] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.

[0017] See appendix Figure 1 This invention provides a baseline load estimation method for electric vehicle charging stations based on BERT-TCN, comprising the following steps: S1: Data Preprocessing and Input Matrix Construction The system acquires load sequence data of electric vehicle charging stations for the target power system over a historical period, along with temperature, humidity, and electricity price observation sequences relevant to the target area. To ensure temporal consistency, the load sequence is time-aligned with all external feature sequences. For data with timestamp discrepancies or inconsistent sampling frequencies, interpolation or resampling methods are used to unify them onto the same time grid, forming a strictly aligned multi-source time series.

[0018] Missing values ​​in the original data are filled using linear interpolation: for data segments with no more than 3 consecutive missing sampling points, linear interpolation of adjacent valid data is used; for data segments with more than 3 consecutive missing sampling points, the mean of the same type of data from the same period is used to fill the missing values.

[0019] Outliers were removed using the 3σ criterion: the mean μ and standard deviation σ of each feature sequence were calculated, and outliers exceeding this criterion were removed. Data points within the specified range are identified as outliers and replaced with the mean of the two valid data points before and after that point.

[0020] Perform Min-Max normalization on all feature data: , In the formula, x represents the original data; x min and x max These are the minimum and maximum values ​​of the feature sequence, respectively; x norm The data is normalized and its value range is [0,1].

[0021] The preprocessed dataset is divided into a training set and a validation set in chronological order, with the first 80% of the data used as the training set and the last 20% used as the validation set.

[0022] Training samples are constructed using a sliding time window method. Taking the current time t as the prediction starting point, data from time tn to t-1 is used as model input. The data sampling interval is 30 minutes, resulting in 48 sampling points per day. When the historical view spans 7 days: .

[0023] The selection of a 7-day historical horizon is based on the following reasons: Firstly, 7 days precisely covers a complete week cycle, encompassing both weekday and weekend load patterns, allowing the model to learn cyclical regularities. Secondly, while a longer historical horizon provides more historical information, it significantly increases the model's computational burden and parameter count, and the correlation between long-term historical data and current load decays over time, offering limited marginal improvement in estimation accuracy. Experiments have verified that when n=336, the model maintains estimation accuracy while exhibiting shorter training time and lower computational resource consumption.

[0024] Construct the input matrix: .

[0025] The input to each training sample is a 4×336-dimensional feature matrix, and the output is a 1×6-dimensional vector, which is the baseline load estimate of 6 sampling points in the period from 12:00 to 15:00.

[0026] Step S2: BERT Periodic Feature Extraction The input to the BERT model is the model constructed in step S1. The BERT model consists of a 12-layer Transformer encoder. Each encoder layer contains three core sub-modules: a multi-head self-attention mechanism, a residual connection and layer normalization module, and a feedforward neural network module. Input data flows sequentially through the 12 encoder layers, abstracting features layer by layer, and finally outputting a high-dimensional feature vector containing cross-day and cross-week periodic patterns.

[0027] In each encoder layer, the input features first undergo three different linear transformation matrices, which map them to the query vector Q, the key vector K, and the value vector V, respectively: , , , In the formula, X target X is the feature matrix of the target time period (12:00-15:00) to be estimated; history X is the feature matrix within the historical view of the sliding window; load W is a vector of historical load values. Q W K W V It is a learnable linear transformation weight matrix.

[0028] The physical meaning of the query vector Q is: to represent the expected load characteristics of the target time period to be estimated, and to retrieve similar patterns in the historical view; the physical meaning of the key vector K is: to represent the multi-dimensional feature information of each time in the historical view, and to serve as the index for retrieval; the physical meaning of the value vector V is: to represent the actual load value of each time in the historical view, and to serve as the target content for retrieval.

[0029] After constructing the query vector Q, key vector K, and value vector V, the data contained in each vector is as follows: , , , In the formula, Q t K represents the feature vector for the baseline load estimation period t; m represents the length of the baseline load estimation period; t This represents the characteristic information of the load during historical periods within the sliding window's field of view, including historical load, temperature (tem), humidity (hum), and electricity price (mon); V t represents the load value for the historical period; n represents the total length of the input sequence, and represents the number of historical view steps of the sliding window.

[0030] For the i-th attention head Perform scaling dot product attention calculation: , In the formula, the dimension d of the key vector k =32, number of attention heads h=8.

[0031] During training, eight attention heads automatically emerge with different functions: some focus on capturing load similarity across daily cycles; some focus on capturing load similarity across weekly cycles; some focus on capturing the correlation between load and meteorological factors such as temperature and humidity; and the remaining attention heads focus on capturing the economic response relationship between load and electricity prices. This division of labor is not pre-set but spontaneously formed during the gradient descent optimization process.

[0032] The outputs of the eight attention heads are concatenated and then linearly transformed back to the original dimension: , The output of the multi-head attention module is added to the original input as a residual, and then layer normalization is performed: , Residual connections bypass input information to the output through direct cross-layer connections, effectively mitigating the vanishing gradient problem in deep networks and enabling stable training of encoder structures with 12 layers or even deeper. Layer normalization adjusts the feature distribution to a standard normal distribution with a mean of 0 and a variance of 1, accelerating the model's convergence process.

[0033] Feedforward neural networks perform a non-linear transformation on the input feature vector by adding a ReLU activation function between two linear transformation layers. , , In the formula, the intermediate layer dimension is 4 times the input dimension, i.e., 1024 dimensions. The first linear transformation expands the feature vector from 256 dimensions to 1024 dimensions. In this high-dimensional space, the originally linearly inseparable feature relationships become linearly separable. The ReLU activation function further filters out the most expressive nonlinear features. The second linear transformation reduces the feature vector back to 256 dimensions, completing the nonlinear feature abstraction.

[0034] After being processed layer by layer by a 12-layer encoder, each layer performs a higher level of abstraction based on the features of the previous layer, ultimately outputting a periodic feature vector: .

[0035] Step S3: Extraction of TCN volatility features The TCN model shares the same input feature matrix X as the BERT model. The TCN model consists of 8 stacked layers of dilated causal convolutional residual blocks, each layer employing a one-dimensional dilated causal convolution with an dilation rate d. l =2 l-1 It increases exponentially with the number of floors.

[0036] For the l-th layer dilated causal convolution: , In the formula, the kernel size k=3. The design of the dilation rate increasing exponentially with the number of layers enables TCN to cover multi-scale temporal dependencies from short-term local to long-term global while maintaining causality.

[0037] The output of each layer of dilated causal convolution is sequentially processed by weight normalization, ReLU activation function, and random deactivation regularization, and then added to the input through residual connections: .

[0038] The residual connections in the TCN model have a dual function: on the one hand, they bypass input information to the output through direct cross-layer connections, so that even in deep networks, the original waveform details of the input sequence can be transmitted to the final output layer without loss; on the other hand, when the output of the convolutional layer experiences gradient vanishing, the residual connections provide a "highway" for the backpropagation of gradients, so that shallow parameters can still obtain effective gradient updates and prevent deep networks from excessively smoothing out local abrupt changes.

[0039] After processing through 8 layers of residual blocks, the output volatility feature vector is: .

[0040] Step S4: Contrastive learning spatial feature enhancement The contrastive learning module uses the periodic feature vectors output by the BERT model. Based on this, the spatial correlation properties of features are enhanced through a self-supervised contrastive learning mechanism.

[0041] Positive sample construction: Data augmentation is performed by generating positive samples through amplitude jitter and time jitter. : , In the formula, Gaussian amplitude perturbation noise is used to simulate amplitude fluctuations caused by sensor measurement errors. To simulate the phase shift of the load pattern, the feature sequence is randomly shifted by 1-3 sampling points in time as a time-shifted perturbation.

[0042] Negative sample selection: For a training batch containing N=64 charging stations, the periodic feature vectors of the other 63 charging stations in the same batch are used as negative samples. Positive samples represent the same load patterns of the same charging station, while negative samples represent load patterns from different sources and with different spatial characteristics.

[0043] Cosine similarity is used to measure the similarity between feature vectors: , Constructing the InfoNCE loss function: , In the formula, the temperature hyperparameter Used to adjust the sharpness of the similarity distribution. Smaller The value makes the model more sensitive to distinguishing between positive and negative samples.

[0044] Minimize using the backpropagation algorithm The BERT model parameters are iteratively updated. During the optimization process, positive sample pairs... Negative sample pairs are close to each other in the feature space. They are kept apart from each other. After sufficient training, the feature vectors of charging stations of the same type form clusters in the embedding space, while the feature vectors of charging stations of different types are separated from each other.

[0045] The final spatiotemporally enhanced feature vector, which integrates the spatial similarity of multiple stations, is obtained: .

[0046] Step S5: Spatiotemporal Feature Adaptive Fusion Periodic features enhanced by contrastive learning Volatility characteristics extracted with TCN Perform attention fusion.

[0047] First, perform linear transformations on the two feature paths respectively to unify them to the same dimension: , , Then, calculate the dynamic weighting coefficients: , Dynamic weighting coefficients The physical meaning is: for each feature dimension and each time step, automatically assess the relative importance of the BERT periodicity feature and the TCN volatility feature. When the load exhibits a strong periodicity, Approaching 1 enhances the contribution of BERT features; when the load experiences random fluctuations or anomalous changes, Approaching 0 enhances the contribution of TCN features.

[0048] Adaptive weighted fusion generates multidimensional fusion features: .

[0049] Step S6: Baseline Load Estimation Output Flatten the multidimensional fusion features and perform fully connected regression: In the formula, Wout b is the weight matrix of the output layer. out It is the bias vector; For the flattening operation; output the baseline load estimate for the target time period (12:00 to 15:00, a total of 6 sampling points): .

[0050] Comparative Experiment and Results Analysis To verify the effectiveness of the baseline load estimation model proposed in this invention, the following comparative model is set up: Comparison Model 1 (Mid3of5 method): Select the 5 similar days before the demand response event, remove the highest and lowest load days, and take the average of the remaining 3 days as the baseline load estimate.

[0051] Comparison Model 2 (LSTM Model): Using an LSTM network, the baseline load is predicted directly from the input matrix.

[0052] Contrast Model 3 (BERT Model): Only the BERT model is used for feature extraction and load estimation, without the TCN branch and contrastive learning module.

[0053] Contrast Model 4 (Transformer Model): Adopts the standard Transformer encoder structure, without TCN branch and contrast learning module.

[0054] The model of this invention (BERT-TCN model): the complete model proposed in this invention.

[0055] Experimental setup: All deep learning models used the same training / validation set split (80% / 20%), the same input features, and the same output target.

[0056] When the number of training iterations is approximately 100, the loss function values ​​of the BERT-TCN model, BERT model, Transformer model, and LSTM model are all less than 0.01, which meets the accuracy requirements. Therefore, the number of training iterations is uniformly set to 100, and the batch size N=64.

[0057] The evaluation index system includes: Accuracy metrics: Mean absolute error (MAE) measures the average absolute deviation between the estimated value and the actual value; root mean square error (RMSE) measures the average square deviation between the estimated value and the actual value, and is more sensitive to large errors.

[0058] Volatility metrics: Estimation bias variance (Var) measures the dispersion of the estimation result bias; volatility coefficient (CV) measures the relative volatility of the estimation result bias.

[0059] , , , , , In the formula, N is the total number of load samples; The baseline load estimate at time t; The actual load value at time t; Estimate the absolute error at time t; for The average value.

[0060] The experiments were conducted in a medium-sized city in North China and a mega-city in East China, and the results are as follows: Table 1. Comparison of accuracy indicators of baseline load estimation models for electric vehicle charging stations in a medium-sized city in North China. Table 2 Comparison of Baseline Load Estimation Fluctuation Indicators for Electric Vehicle Charging Stations in a Medium-Sized City in North China Table 3 Comparison of accuracy indicators of baseline load estimation models for electric vehicle charging stations in a mega-city in East China. Table 4 Comparison of Baseline Load Estimation Fluctuation Indicators for Electric Vehicle Charging Stations in a Mega-City in East China In terms of accuracy, the BERT-TCN model proposed in this invention (the model of this invention) outperforms all comparative methods in all test scenarios. In the scenario of a mega-city in East China, the MAE reaches 95.56%, an improvement of 5.43 percentage points compared to the Mid3of5 method, 2.41 percentage points compared to LSTM, 1.90 percentage points compared to BERT, and 1.55 percentage points compared to Transformer. The RMSE metric also shows a consistent trend of superiority.

[0061] From the perspective of volatility indicators, the estimation bias variance Var and volatility coefficient CV of the method of this invention are optimal in all test scenarios. In particular, in the scenario of megacities in East China, Var=1.29, which is the only method less than 1.5, indicating that the estimation results of the method of this invention are significantly more stable than the comparative methods.

[0062] Based on the experimental results from both cities, the method of this invention demonstrates consistent advantages in both accuracy and volatility metrics, validating the model's generalization ability and robustness. This is mainly attributed to: the BERT module effectively capturing cross-day and cross-week periodic patterns; the TCN module accurately characterizing intraday short-term fluctuations; the contrastive learning module enhancing the discriminative ability of spatial correlation features; and the attention fusion mechanism achieving adaptive deep integration of spatiotemporal features.

[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A baseline load estimation method for electric vehicle charging stations based on BERT-TCN, characterized in that, The method includes the following steps: S1. Data preprocessing and input matrix construction: Collect historical load data, temperature data, humidity data and electricity price data of electric vehicle charging stations, and construct a multidimensional input matrix after preprocessing; S2. BERT Periodic Feature Extraction: Input the input matrix into the BERT model, and extract the daily and weekly periodic features of the load in the time dimension based on the multi-head self-attention mechanism to obtain the periodic feature vector; S3. TCN volatility feature extraction: The input matrix is ​​input into the TCN model in parallel, and the intraday short-term local random volatility features of the load are extracted based on dilated causal convolution and residual connection to obtain the volatility feature vector; S4. Comparative learning spatial feature enhancement: Based on the periodic feature vector obtained in step S2, positive and negative sample pairs are constructed and self-supervised training is performed using the InfoNCE loss function to optimize the BERT model parameters, so that the periodic feature vector has both temporal periodicity and spatial correlation characteristics, thus obtaining the spatiotemporal enhanced feature vector. S5. Spatiotemporal feature adaptive fusion: Attention fusion is performed on the spatiotemporal enhanced feature vector obtained in step S4 and the volatility feature vector obtained in step S3 to obtain dynamic weight coefficients and perform adaptive weighted fusion to generate multidimensional fused features. S6. The baseline load estimation output flattens the multidimensional fusion features and obtains the baseline load estimate for the target time period through fully connected regression.

2. The baseline load estimation method for electric vehicle charging stations according to claim 1, characterized in that, The input matrix expression for the electric vehicle charging station baseline load estimation model in step S1 is: , In the formula, n represents the total length of the input sequence, represents the number of historical view steps of the sliding window; load is the historical load data vector of electric vehicle charging stations, tem is the temperature data vector, hum is the humidity data vector, and mon is the electricity price data vector.

3. The baseline load estimation method for electric vehicle charging stations according to claim 1, characterized in that, The BERT periodic feature extraction in step S2 specifically includes the following sub-steps: Step S21: Vector construction, mapping the input matrix to the query vector Q, key vector K, and value vector V through three different linear transformation matrices: , , , In the formula, X target X is the feature matrix of the target time period to be estimated; history X is the feature matrix within the historical view of the sliding window; load W is a vector of historical load values. Q W K W V It is a learnable linear transformation weight matrix; After constructing the query vector Q, key vector K, and value vector V, the data contained in each vector is as follows: , , , In the formula, Q t This represents the feature vector for the baseline load estimation period t; m represents the length of the baseline load estimation period; K t This represents the characteristic information of the load during historical periods within the sliding window's field of view, including historical load, temperature (tem), humidity (hum), and electricity price (mon); V t This represents the load value for a historical period; n represents the total length of the input sequence, and represents the number of historical view steps in the sliding window; Step S22: Scale the dot product attention calculation, based on the query vector Q, key vector K, and value vector V, for the i-th attention head: , In the formula, Let d be the projection matrix of the query, key, and value in the i-th attention head. k The dimension is the key vector, and softmax is the activation function; Step S23: Multi-head attention aggregation, concatenating the outputs of h attention heads and mapping them back to the original dimension via linear transformation: , In the formula, h represents the number of attention heads; W 0 To output the projection matrix; Step S24: Residual Connectivity and Layer Normalization: , In the formula, X (l-1) This is the output of the (l-1)th layer encoder; The output of the l-th layer encoder after residual connection and layer normalization; Step S25: Nonlinear transformation of the feedforward neural network: , , In the formula, W1 and W2 are the weight matrices of the feedforward network; b1 and b2 are the bias vectors; and ReLU is the activation function. Step S26: After being processed layer by layer by the L-layer encoder, the periodic feature vector F is output. BERT : 。 4. The baseline load estimation method for electric vehicle charging stations according to claim 1, characterized in that, The TCN volatility feature extraction in step S3 specifically includes the following sub-steps: Step S31: Dilated causal convolution operation, for the l-th layer of dilated causal convolution: , In the formula, f (l) (·) represents the kernel function of the l-th layer; The output of layer l-1 at time td l The value of i, when l-1, is x (0) =X, which is the input feature matrix, and also the input to the l-th layer dilated causal convolution; d l =2 l-1 The dilation rate of the l-th layer is denoted by k; k is the kernel size. Step S32: Weight Normalization and Activation: , In the formula, For weight normalization operations; For activation functions; Step S33: Random deactivation regularization: , In the formula, p is the random inactivation probability; Step S34: Residual connection: , In the formula, x (l-1) This is the input to the (l-1)th level residual block; x (l) This is the output of the l-th residual block; Step S35: After processing the residual blocks through M layers, output the volatility feature vector: 。 5. The baseline load estimation method for electric vehicle charging stations according to claim 1, characterized in that, The contrastive learning space feature enhancement in step S4 includes: Step S41: Positive sample construction, based on the periodic feature vector F obtained in step S26. BERT Data augmentation is performed by generating positive samples through amplitude jitter and time jitter. : , In the formula, This refers to amplitude disturbance noise; For time-shifted perturbations; Step S42: Negative sample selection. For a training batch containing N charging stations, select the periodic feature vectors of the other N-1 charging stations in the same batch. As a negative sample; Step S43: Similarity calculation, using cosine similarity to measure the degree of similarity between feature vectors: , Step S44: Constructing the InfoNCE loss function: , In the formula, For temperature hyperparameters, For positive sample pairs, For negative sample pairs, Loss is the loss function; Step S45: Minimize the loss using the backpropagation algorithm, iteratively update the BERT model parameters, so that positive sample pairs are closer to each other and negative sample pairs are farther apart in the feature space, to obtain a spatiotemporally enhanced feature vector that integrates spatial correlation characteristics. .

6. The baseline load estimation method for electric vehicle charging stations according to claim 1, characterized in that, The spatiotemporal feature adaptive fusion in step S5 includes: Step S51: Perform linear transformations on the two features from steps S3 and S4 respectively: , , In the formula, W b W t Let b be the eigenvalue transformation weight matrix. b b t It is the bias vector; Step S52: Calculate the dynamic weighting coefficients: , In the formula, It is the softmax activation function; These are the dynamic weight coefficients for the BERT branches; Step S53: Adaptive weighted fusion to generate multidimensional fusion features: 。 7. The baseline load estimation method for electric vehicle charging stations according to claim 1, characterized in that, The baseline load estimation output in step S6 is: , In the formula, W out b is the weight matrix of the output layer. out For bias vectors, For flattening operation, This is the vector of baseline load estimates for each sampling point during the target time period.