A method for predicting electric vehicle charging load based on a pre-trained language model

By constructing dual-channel cue input in the pre-trained language model and introducing learnable time-position embeddings, the problems of cross-scenario generalization and multi-source knowledge fusion in electric vehicle charging load prediction are solved, achieving higher prediction accuracy and stability.

CN121834756BActive Publication Date: 2026-06-26CHANGCHUN UNIV OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHANGCHUN UNIV OF TECH
Filing Date
2026-03-06
Publication Date
2026-06-26

Smart Images

  • Figure CN121834756B_ABST
    Figure CN121834756B_ABST
Patent Text Reader

Abstract

The application provides a kind of electric vehicle charging load prediction method based on pre-training language model.The method constructs supervised learning sample according to sliding window to hour-level granularity load data, and uses reversible instance normalization to alleviate sequence non-stationarity.Further, a double-channel prompt input is constructed: the numerical sequence channel determines the workday / weekend label and introduces time backtracking token to form a structured sequence with normalized load values;the calendar-semantic channel injects station description and calendar features such as hour and week. Time decay and same-type day enhancement weight are applied to the time backtracking token, and the time-location identifier is generated. A learnable time embedding is added to the embedding layer to achieve time series adaptation. A shared pre-trained backbone "Bert" encodes the double-channel vectors and outputs the future multi-step load through gated fusion regression. The application can improve the prediction accuracy and enhance the cross-day type generalization ability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power load forecasting, and more particularly to a method for forecasting electric vehicle charging load based on a pre-trained language model. Background Technology

[0002] Electric vehicle (EV) charging load is significantly affected by the randomness of user behavior, calendar periodicity, holiday effects, and local events, exhibiting characteristics of suddenness, spikes, and non-stationarity. Traditional statistical models (such as the Autoregressive Integrated Moving Average model, ARIMA) and some deep learning models (Long Short-Term Memory network, LSTM) have limitations in cross-scenario generalization, semantic information fusion, and small-sample transfer.

[0003] In recent years, pre-trained language models have been attempted to be applied to the field of time series prediction due to their powerful representation capabilities. However, directly inputting numerical sequences into pre-trained language models still faces three problems: First, the native positional encoding of pre-trained language models is difficult to characterize the temporal dependency between "backtracking step size and prediction anchor point", resulting in insufficient time-position semantics. Second, key prior knowledge in EV charging scenarios (such as weekday / weekend pattern differences) lacks an explicit and structured injection mechanism. Third, a single input channel is difficult to effectively integrate numerical dynamics with high-level semantic information such as calendar and time at the same time, which limits the collaborative modeling capability of multi-source knowledge.

[0004] Therefore, we propose an electric vehicle charging load prediction method based on a pre-trained language model, which can embed prior knowledge of EV charging scenarios into the model input in a structured manner and enhance the positional learnability of temporal tokens, while taking into account both training stability and model interpretability. Summary of the Invention

[0005] A method for predicting electric vehicle charging load based on a pre-trained language model, the method comprising the following operations:

[0006] First, a charging session dataset from a certain site is used to convert it into charging load data with hourly granularity.

[0007] Secondly, the supervised learning samples are subjected to reversible instance normalization to eliminate the impact of dimensional differences on model training.

[0008] Subsequently, a dual-channel prompt input was customized for this EV charging scenario, introducing weekday / weekend marker tokens and time backtracking tokens, and encoding day type information and historical sequence backtracking step size information into the model input in a structured form.

[0009] Furthermore, the embedding layer is relabeled with temporal semantics. Time decay weights that decrease with the backtracking step size are introduced for the time backtracking tokens. Tokens that are consistent with the predicted anchor day type are enhanced, while those that are inconsistent are appropriately suppressed. This is to explicitly incorporate the scenario priors of "the most recent date is the most important" and "days of the same type are more similar". The stability of the training process is improved through mechanisms such as weight pruning.

[0010] Then, a temporal adapter is constructed to introduce learnable time-position embeddings for time tokens, thereby enhancing the model's ability to learn and represent backtracking step semantics.

[0011] Finally, the prediction results are output after dual-channel gating fusion. The model is then validated using charging load data from the Caltech laboratory, and the effectiveness of the model is judged by evaluation indicators. The specific process is as follows.

[0012] This invention is a method for predicting electric vehicle charging load based on a pre-trained language model. It uses a charging session dataset from a specific charging station, which consists of discrete charging session records. For the first... A charging session, including the charging session start time. End time Total energy consumption Therefore, it needs to be transformed into hourly granular load data suitable for time series modeling. This process specifically includes:

[0013] Step (1) Divide each session into hours. Assuming that the charging power is approximately uniform during the session, allocate the total energy consumption proportionally to the corresponding hour intervals based on the overlap ratio of the sessions within each hour:

[0014] ;

[0015] in, This means that the total energy consumption is proportionally and linearly distributed across the hourly timestamps. Indicates the first Duration of each session record:

[0016] ;

[0017] in, Representing a session and hourly interval Overlap duration:

[0018] ;

[0019] in, This indicates a time index, dividing the timeline into hours. Timestamp:

[0020] ;

[0021] in, Indicates the first Hourly intervals.

[0022] Step (2) aggregates the hourly energy consumption after processing all sessions to obtain the hourly load sequence:

[0023] ;

[0024] in, Represents the load sequence at the hourly granularity;

[0025] Step (3) Fill in the missing time intervals with zero energy consumption to ensure the continuity of time:

[0026] ;

[0027] in, Represents a complete and continuous set of hourly indexes:

[0028] ;

[0029] This represents the starting time of the time series. This represents the end point of the time series;

[0030] After the above steps, hourly granular electric vehicle charging load data is obtained. This data is then sorted in ascending order by timestamp, and a sliding window is used to construct supervised learning samples: with a length of... The historical load sequence is used as the model input, with a length of The load sequence is used as the prediction target; the data is divided into training set, validation set and test set according to the proportion.

[0031] Secondly, EV charging scenarios exhibit significant non-stationarity, specifically characterized by substantial amplitude differences across different day types and seasons. To address this, a reversible instance normalization mechanism is introduced at the sample level. Specifically, for the first... The historical window sequence of each sample is labeled as follows:

[0032] ;

[0033] in Indicates the number within the history window The load value at each moment is used to calculate the average load for that historical window. with standard deviation :

[0034] ;

[0035] ;

[0036] To prevent the denominator from being 0 during inverse normalization, we take... ;

[0037] Subsequently, in order to explicitly inject the periodicity, daily type differences, and backtracking step size information of EV charging scenarios into the model input, a dual-channel prompt input was constructed and structured annotation information was generated simultaneously. The specific steps are as follows:

[0038] Step (1): Construct a numerical sequence channel (channel A) hint, using the last moment of the historical window as the prediction anchor point, and determine the day type token: weekday token (WD) or weekend token (WE). Then, concatenate the historical sequence with backtracking tokens from most recent to oldest time. With the corresponding normalized load value token, where For backtracking step size encoding, a "closer, smaller" encoding method is adopted: the most recent historical moment corresponds to... The earliest historical moment corresponds to This forms a structured token sequence, enabling the model to establish a one-to-one correspondence between "backtracking step size and numerical value" at the token level.

[0039] Step (2) constructs a calendar-semantic channel (channel B) prompt. This channel uses natural language text to construct semantic prompts, which include a description of the site background and calendar element information, such as hour, whether it is a weekend, month and date, and can be expanded to include holiday identifiers or external event information. This channel is used to supplement "calendar priors and scene semantics" to improve the model's adaptability in different operating scenarios;

[0040] Step (3) Label the structured information and generate two types of labels that are aligned with the token position in the numerical sequence channel: one is a time-position identifier sequence, which is used to explicitly mark the time index token and leave 0 for all other non-time tokens; the other is an embedding scaling weight sequence, which is used for the temporal semantic relabeling of the subsequent embedding layer; perform word segmentation and indexing on channel A and channel B respectively to make them meet the input format of the pre-trained language model.

[0041] Furthermore, to explicitly incorporate the prior knowledge of "stronger recency" and "daily similarity of similar types," and to enhance the encoder's learnable expressive ability for backtracking step length, this invention introduces semantic weight scaling in the embedding layer. The specific steps are as follows:

[0042] Step (1), for the time backtracking token in channel A Introduce a weight function that decreases with the backtracking step size:

[0043] ;

[0044] in, Represents an exponential function. It is the attenuation coefficient. and The larger the value, the greater the weight the model assigns to more recent historical windows, thus tending to highlight the impact of recent data on the prediction results;

[0045] Step (2), introduce daily enhanced weights of the same type. Let the daily type of the prediction anchor point be... Multiply the token with the same date type as the anchor point by an enhancement factor. Multiply the inconsistent ones by a weakening factor ,in This mechanism is used to highlight the differences in load distribution between weekdays and weekends, making it easier for the model to learn the similarities between days of the same type.

[0046] Step (3): To avoid excessive scaling of weights leading to unstable training values, the final weights are... Crop to preset area:

[0047] ;

[0048] in, and These represent the upper and lower bounds of the weights, respectively. Pruning ensures that the weights are always kept within a reasonable range, thereby improving the numerical stability and convergence of the model training.

[0049] Next, a temporal adapter is constructed for the pre-trained language model. This is a learnable time-location embedding mechanism used to inject temporal information from time series into the pre-trained encoding backbone "Bert," thereby enhancing the model's sensitivity to historical observations. This mechanism achieves temporal adaptation by constructing a time embedding table and superimposing and scaling temporal information on the base embeddings. The construction and encoding process are described in detail below:

[0050] Step (1) constructs the time embedding table, with the embedding dimension of the pre-trained encoding backbone being... Reconstruct a learnable time embedding table:

[0051] ;

[0052] Represents the set of real numbers; The time-embedded table is a dimension-based table. The matrix, where each row vector is a learnable embedding vector, is optimized through gradient updates during training. It should be noted that index 0 corresponds to a non-time token, used to handle elements without a clear time-position relationship; index 1... (in ), corresponding backtracking step size That is, the relative position from the current prediction time. The smaller the value, the more recent the information. The larger the value, the further back in time it is. This design ensures that the temporal embedding can capture semantic differences at different historical depths.

[0053] Step (2) performs time-adapted embedding computation on the first... samples, sequence position is The token, after time-series adaptation, is embedded as follows:

[0054] ;

[0055] in, This represents the final temporal adaptation embedding vector, which integrates the original semantics and temporal context; It represents the basic embedding vector, which only captures the semantic content of the token and does not contain temporal information; Represents a time-location identifier used to inject specific patterns of relative time-location; Indicates the embedded scaling weight and This is an element-wise multiplicative vector used to control the overall magnitude of the embedding vector. This weight can be calculated using the following formula:

[0056] ;

[0057] in, Represents the clipping function, when the... Each token is hour, Cut to within; when Each token is hour, Cut to Inside; in other cases =1;

[0058] Step (3) embeds the temporal adaptation vectors of all sequence positions. The input is fed into the backbone encoding layer of the pre-trained language model "Bert" to obtain the hidden representation sequence of the sequence. ,in It is a contextual representation processed by attention mechanisms and feedforward networks; the advantage of the temporal adaptation structure is that, through learnable temporal embeddings and weight scaling, the model can adaptively capture the dynamic patterns of time series, improving the accuracy of EV charging load prediction.

[0059] Finally, after the dual-channel gating fusion mechanism, the model can adaptively organize the representation information of the two channels. After inverse normalization, inference output can be achieved. The specific steps are as follows:

[0060] Step (1), perform dual-channel gating fusion, for the first For each sample, a representation vector is obtained from channel A and channel B respectively. and These vectors are extracted through the aforementioned encoding process, capturing the static or dynamic features of the time series; subsequently, gating coefficients are generated through a gating network. The calculation formula is as follows:

[0061] ;

[0062] in, This represents the sigmoid function. It is a multilayer perceptron. This represents the concatenation of vectors from two channels, with the fused representation vector calculated based on the gating coefficients. The formula is:

[0063] ;

[0064] in, This represents the gating coefficient for channel A. This represents the gating coefficient for channel B. This represents element-wise multiplication;

[0065] Step (2) enters the training phase, using multi-step mean squared error as the main loss function to optimize model parameters and adjust the loss function. Defined as:

[0066] ;

[0067] in, It represents the mean squared error, which is used to quantify the overall bias of predictions and promote the model's learning of long-term dependencies. The model represents the first The first sample The normalized predicted value of the step, Represents the normalized true load value, corresponding to the first... The actual load value of the step;

[0068] Step (3) Enter the optimization process and use the AdamW optimizer (a variant of Adam with weight decay) to efficiently handle the high-dimensional parameter space. To improve the stability and convergence of training, four strategies are integrated, including: adaptive learning rate adjustment, early stopping strategy, gradient norm pruning and outlier skip protection. These will work together to ensure an efficient training process and avoid overfitting and numerical anomaly problems.

[0069] Step (4): Entering the inference stage, after optimization in the previous step, the optimal parameter combination of the model can be obtained. After inverse normalization, the model outputs... Predicted value of EV charging load It can be used for practical decision-making such as power grid dispatching;

[0070] Step (5) involves evaluating the predictive metrics. To quantify model performance, the mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R²) are selected in this invention. 2 As evaluation indicators, the formulas for the three are as follows:

[0071] ;

[0072] ;

[0073] ;

[0074] in, The total number of samples in the test set. Indicates the first The sample at the th The load forecast value after inverse normalization processing Indicates the first The sample at the th The actual load value of the step. This represents the average load across all samples.

[0075] Compared with the prior art, the beneficial effects of the present invention are:

[0076] (1) This invention explicitly injects temporal priors into the embedding layer to improve the model’s sensitivity to recent historical data; (2) This invention introduces weekday / weekend labels and enhancement coefficients for the same type of day to enable the model to more accurately capture the distribution differences between weekdays and weekends; (3) This invention uses Temporal Adapter to replace traditional static positional encoding with learnable temporal embeddings to better adapt to the semantic requirements of different backtracking steps; (4) The dual-channel gating mechanism adopted in this invention adaptively selects more reliable channels in the samples, which significantly enhances the model’s generalization ability and noise resistance. Attached Figure Description

[0077] Figure 1 This is an overall flowchart of the electric vehicle charging load prediction method based on a pre-trained language model according to the present invention.

[0078] Figure 2 This is a schematic diagram of the time-position and numerical prompt embedding structure in the numerical sequence channel of the present invention;

[0079] Figure 3 This is a schematic diagram of the timing adapter encoder embedding layer structure of the present invention;

[0080] Figure 4 This is a schematic diagram of the dual-channel gating fusion mechanism of the present invention. Detailed Implementation

[0081] The present invention will be further described below with reference to the accompanying drawings. The examples are provided to more clearly illustrate the technical solution of the present invention. The scope of application of the present invention is not limited thereto and can be applied to multiple fields.

[0082] like Figure 1 As shown, this invention provides a method for predicting electric vehicle charging load based on a pre-trained language model, which specifically includes the following steps:

[0083] First, the Caltech Labs Charging Session Dataset (ACN data) from Caltech is used. This dataset consists of discrete charging session records. A charging session, including the charging session start time. End time Total energy consumption Therefore, it needs to be transformed into hourly granular load data suitable for time series modeling. This process specifically includes:

[0084] Step (1) Divide each session into hours. Assuming that the charging power is approximately uniform during the session, allocate the total energy consumption proportionally to the corresponding hour intervals based on the overlap ratio of the sessions within each hour:

[0085] ;

[0086] in, This means that the total energy consumption is proportionally and linearly distributed across the hourly timestamps. Indicates the first Duration of each session record:

[0087] ;

[0088] in, Representing a session and hourly interval Overlap duration:

[0089] ;

[0090] in, This indicates a time index, dividing the timeline into hours. Timestamp:

[0091] ;

[0092] in, Indicates the first Hourly intervals.

[0093] Step (2) aggregates the hourly energy consumption after processing all sessions to obtain the hourly load sequence:

[0094] ;

[0095] in, Represents the load sequence at the hourly granularity;

[0096] Step (3) Fill in the missing time intervals with zero energy consumption to ensure the continuity of time:

[0097] ;

[0098] in, Represents a complete and continuous set of hourly indexes:

[0099] ;

[0100] In this example, It was 00:00 on January 1, 2019. The data is for 23:00 on December 31, 2019. After the above processing steps, hourly granular electric vehicle charging load data is obtained. This data is then sorted in ascending order by timestamp, and a sliding window is used to construct supervised learning samples: samples with a length of... The historical load sequence is used as the model input, with a length of The load sequence is used as the prediction target; in this example, we take... , As example parameters, all can be configured according to application requirements; the data is divided into training set, validation set and test set according to time sequence, using a ratio of 70%:15%:15% to avoid data leakage.

[0101] Secondly, the EV charging scenario in this example exhibits significant non-stationarity, specifically including substantial differences in amplitude across different day types and seasons. Therefore, a reversible instance normalization mechanism is introduced at the sample level. Specifically, for the first... The historical window sequence of each sample is labeled as follows:

[0102] ;

[0103] in Indicates the number within the history window The load value at each moment is used to calculate the average load for that historical window. with standard deviation :

[0104] ;

[0105] ;

[0106] To prevent the denominator from being 0 during inverse normalization, we take... ;

[0107] Subsequently, as Figure 2 As shown, in order to explicitly inject the periodicity, daily type differences, and backtracking step size information of EV charging scenarios into the model input, this example constructs a dual-channel prompt input and simultaneously generates structured annotation information. The specific steps are as follows:

[0108] Step (1): Construct a numerical sequence channel (channel A) hint, using the last moment of the historical window as the prediction anchor point, and determine the day type token: weekday token (WD) or weekend token (WE). Then, concatenate the historical sequence with backtracking tokens from most recent to oldest time. With the corresponding normalized load value token, where For backtracking step size encoding, a "closer, smaller" encoding method is adopted: the most recent historical moment corresponds to... The earliest historical moment corresponds to This forms a structured token sequence, enabling the model to establish a one-to-one correspondence between "backtracking step size and numerical value" at the token level.

[0109] Step (2) constructs a calendar-semantic channel (channel B) prompt. This channel uses natural language text to construct semantic prompts, which include a description of the site background and calendar element information, such as hour, whether it is a weekend, month and date, and can be expanded to include holiday identifiers or external event information. This channel is used to supplement "calendar priors and scene semantics" to improve the model's adaptability in different operating scenarios;

[0110] Step (3) Label the structured information and generate two types of labels aligned with the token positions in the numerical sequence channel: one is a time-position identifier sequence, which is used to explicitly mark the time index token and leave 0 for all other non-time tokens; the other is an embedding scaling weight sequence, which is used for the temporal semantic relabeling of the subsequent embedding layer; perform word segmentation and indexing on channel A and channel B respectively to make them meet the input format of the pre-trained language model.

[0111] Furthermore, to explicitly incorporate the prior knowledge of "stronger recency" and "daily similarity among similar types," and to enhance the encoder's learnable expressiveness of the backtracking step size, this example introduces semantic weight scaling in the embedding layer. The specific steps are as follows:

[0112] Step (1), for the time backtracking token in channel A Introduce a weight function that decreases with the backtracking step size:

[0113] ;

[0114] in, It is the attenuation coefficient. and The larger the value, the greater the weight the model assigns to more recent historical windows, thus tending to highlight the impact of recent data on the prediction results;

[0115] Step (2), introduce daily enhanced weights of the same type. Let the daily type of the prediction anchor point be... Multiply the token with the same date type as the anchor point by an enhancement factor. Multiply the inconsistent ones by a weakening factor ,in This mechanism is used to highlight the differences in load distribution between weekdays and weekends, making it easier for the model to learn the similarities between days of the same type.

[0116] Step (3): To avoid excessive scaling of weights leading to unstable training values, the final weights are... Crop to preset area:

[0117] ;

[0118] in, and These represent the upper and lower bounds of the weights, respectively. Pruning ensures that the weights are always kept within a reasonable range, thereby improving the numerical stability and convergence of the model training.

[0119] Then, a temporal adapter is constructed for the pre-trained language model. This is a learnable time-location embedding mechanism used to inject temporal information from the time series into the pre-trained encoding backbone "Bert," thereby enhancing the model's sensitivity to historical observations. This mechanism achieves temporal adaptation by constructing a time embedding table and superimposing and scaling temporal information on the base embeddings. Figure 3 As shown, the following details its construction and encoding process:

[0120] Step (1) constructs the time embedding table, with the embedding dimension of the pre-trained encoding backbone being... Reconstruct a learnable time embedding table:

[0121] ;

[0122] Represents the set of real numbers; The time-embedded table is a dimension-based table. The matrix, where each row vector is a learnable embedding vector, is optimized through gradient updates during training. It should be noted that index 0 corresponds to a non-time token, used to handle elements without a clear time-position relationship; index 1... (in ), corresponding backtracking step size That is, the relative historical position from the current prediction time. The smaller the value, the more recent the information. The larger the value, the further back in time it is. This design ensures that the temporal embedding can capture semantic differences at different historical depths.

[0123] Step (2) performs time-adapted embedding computation on the first... samples, sequence position is The token, after time-series adaptation, is embedded as follows:

[0124] ;

[0125] in, This represents the final temporal adaptation embedding vector, which integrates the original semantics and temporal context; It represents the basic embedding vector, which only captures the semantic content of the token and does not contain temporal information; Represents a time-location identifier used to inject specific patterns of relative time-location; Indicates the embedded scaling weight and This is an element-wise multiplicative vector used to control the overall magnitude of the embedding vector. This weight can be calculated using the following formula:

[0126] ;

[0127] in, Represents the clipping function, when the... Each token is hour, Cut to within; when Each token is hour, Cut to Inside; in other cases =1;

[0128] Step (3) embeds the temporal adaptation vectors of all sequence positions. The input is fed into the backbone encoding layer of the pre-trained language model "Bert" to obtain the hidden representation sequence of the sequence. ,in It is a contextual representation processed by attention mechanisms and feedforward networks; the advantage of the temporal adaptation structure is that, through learnable temporal embeddings and weight scaling, the model can adaptively capture the dynamic patterns of time series, thereby improving the accuracy of EV charging load prediction.

[0129] Finally, after the dual-channel gating fusion mechanism, the model can adaptively organize the representation information of the two channels, and after inverse normalization, it can achieve inference output, such as... Figure 4 As shown, the specific steps are as follows:

[0130] Step (1), perform dual-channel gating fusion, for the first For each sample, a representation vector is obtained from channel A and channel B respectively. and These vectors are extracted through the aforementioned encoding process, capturing the static or dynamic features of the time series; subsequently, gating coefficients are generated through a gating network. The calculation formula is as follows:

[0131] ;

[0132] in, This represents the sigmoid function. It is a multilayer perceptron. This represents the concatenation of vectors from two channels, with the fused representation vector calculated based on the gating coefficients. The formula is:

[0133] ;

[0134] in, This represents the gating coefficient for channel A. This represents the gating coefficient for channel B. This represents element-wise multiplication;

[0135] Step (2) enters the training phase, using multi-step mean squared error as the main loss function to optimize model parameters and adjust the loss function. Defined as:

[0136] ;

[0137] in, It represents the mean squared error, which is used to quantify the overall bias of predictions and promote the model's learning of long-term dependencies. The model represents the first The first sample The normalized predicted value of the step, Represents the normalized true load value, corresponding to the first... The actual load value of the step;

[0138] Step (3) Enter the optimization process and use the AdamW optimizer (a variant of Adam with weight decay) to efficiently handle the high-dimensional parameter space. To improve the stability and convergence of training, four strategies are integrated, including: adaptive learning rate adjustment, early stopping strategy, gradient norm pruning and outlier skip protection. These will work together to ensure an efficient training process and avoid overfitting and numerical anomaly problems.

[0139] Step (4): Entering the inference stage, after optimization in the previous step, the optimal parameter combination of the model can be obtained. After inverse normalization, the model outputs... Predicted value of EV charging load It can be used for practical decision-making such as power grid dispatching;

[0140] Step (5) evaluates the predictive metrics. To quantify model performance, in this example, mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R²) are selected. 2 As evaluation indicators, the formulas for the three are as follows:

[0141] ;

[0142] ;

[0143] ;

[0144] in, The total number of samples in the test set. Indicates the first The sample at the th The load forecast value after inverse normalization processing Indicates the first The sample at the th The actual load value of the step. This represents the average load across all samples.

[0145] The prediction results are shown in Table 1. Under the same conditions, the model proposed in this invention is compared with the ARIMA and LSTM models to predict the EV charging load in the test set, and the effectiveness of the model is judged by the evaluation index.

[0146] Table 1: Model Evaluation Index Results

[0147] Model MAE RMSE <![CDATA[R 2 ]]> ARIMA 4.75 8.49 0.4726 LSTM 3.52 5.37 0.7887 Prediction model of this invention 3.18 5.18 0.8036

[0148] As can be seen from the results in Table 1, the prediction model of this invention achieves the best results, which proves the benefits of this invention.

Claims

1. A method for predicting electric vehicle charging load based on a pre-trained language model, characterized in that, A temporal prediction network is constructed based on the pre-trained language model "Bert", and prediction is achieved through dual-channel prompts and a temporal adaptation structure. The method includes the following steps: Step 1: Perform data preprocessing, convert the raw electric vehicle (EV) charging session data into an hourly load sequence, and remove outliers and handle missing values ​​in the sequence. Step 2: A sliding time window is used to construct supervised learning samples. The input sequence consists of multiple consecutive historical load values, and the prediction target is the load values ​​at multiple consecutive subsequent time points. The mean and standard deviation of the load values ​​are calculated and then reversible instance normalization is performed to eliminate the influence of dimensional differences on model training. Step 3: A customized dual-channel prompt is constructed for the EV charging load prediction scenario. This dual-channel prompt includes a numerical sequence channel prompt and a calendar-semantic channel prompt. The numerical sequence channel prompt uses the last moment of the historical load input sequence as the prediction time anchor point, introducing an explicit time-location identifier for each historical moment. Based on the day type of the prediction anchor point, a weekday identifier (WD) or a weekend identifier (WE) is generated. Subsequently, the historical load input sequence is arranged in order from most recent to furthest time, and a time backtracking token and its corresponding normalized load value token are constructed for each historical moment. The time backtracking token uses a "closer, smaller" backtracking step. The long encoding method assigns the smallest backtracking step size number to the most recent historical moment and the largest backtracking step size number to the oldest historical moment, and embeds these numbers into the text prompts. The normalized historical load values, time-location identifiers, and day type identifiers are then combined to form the first prompt channel describing the numerical sequence information. The second channel is a calendar-semantic prompt channel, which uses natural language text to construct semantic prompts. These prompts mainly include semantic description text of the charging station and calendar feature text, containing at least hour, weekend / weekend, month, and date information to supplement the calendar priors and scene semantic information in EV charging load prediction. Finally, word segmentation and indexing are performed to ensure the input format meets the requirements of the pre-trained language model. Step four involves introducing semantic weight scaling in the embedding layer. For the numerical sequence channel prompts, a token weight matrix and a time-location identifier are generated. The token weight matrix assigns weights to the time index token and the day type marker token. The time-location identifier ensures that the time step number corresponding to the time index token is non-zero, while the non-time token is zero. The embedding scaling weight sequence is used to weight the time backtracking token and the day type marker token. Its generation method includes: introducing a time decay weight that decreases with the backtracking step size to the time backtracking token in the numerical sequence channel, so that the time backtracking token corresponding to the historical load closer to the prediction anchor point has a larger weight; and introducing a same-type day enhancement weight to the day type marker token according to the day type of the prediction anchor point. When the day type marker token is consistent with the day type of the prediction anchor point, it is multiplied by an enhancement coefficient; when the day type marker token is inconsistent with the day type of the prediction anchor point, it is multiplied by a weakening coefficient. At the same time, the final embedding scaling weight is clipped to a preset weight range to avoid overly strong scaling that could lead to training instability. Step 5: Construct a temporal adaptation structure with learnable time-location embedding functionality for the pre-trained language model. The temporal adaptation structure includes a learnable time embedding table, where the 0th index represents a non-time token, and the remaining indices represent time backtracking tokens with different backtracking step sizes. For the token in the numerical sequence channel prompt, a temporal adaptation embedding vector is generated based on the time-location identifier sequence and the embedding scaling weight sequence, and input into the pre-trained language model "Bert" encoder to obtain the numerical sequence channel representation vector. Simultaneously, the calendar-semantic channel prompt is input into the pre-trained language model "Bert" encoder with shared parameters to obtain the calendar-semantic channel representation vector. Step six: The numerical sequence channel representation vector and the calendar-semantic channel representation vector are concatenated and input into a gating network to generate gating coefficients. The numerical sequence channel representation vector and the calendar-semantic channel representation vector are then weighted and fused according to the gating coefficients to obtain a fused representation vector. Subsequently, a multi-step load prediction value at a normalized scale is output through a multi-step regression prediction head. The predicted value is then denormalized using the mean and standard deviation described in step two to obtain the multi-step prediction result of the EV charging load at the actual scale.

2. The electric vehicle charging load prediction method based on a pre-trained language model according to claim 1, characterized in that, The dual-channel prompt construction process includes: Step (1), construct channel A: numerical sequence channel hint, using the last moment of the historical window as the prediction anchor point, determine the day type token: weekday token WD or weekend token WE; then splice the historical sequence with time backtracking tokens from most recent to oldest. With the corresponding normalized load value token, where Represents a time index marker. For backtracking step size encoding, a "closer, smaller" encoding method is adopted: the most recent historical moment corresponds to... The earliest historical moment corresponds to This forms a structured token sequence, enabling the model to establish a one-to-one correspondence between "backtracking step size and numerical value" at the token level. Step (2), construct channel B: calendar-semantic channel prompt. This channel uses natural language text to construct semantic prompts, which include site background description and calendar element information, such as hour, whether it is a weekend, month and date, and can be extended with holiday identifiers or external event information; this channel is used to supplement "calendar prior and scene semantics" to improve the model's adaptability in different operating scenarios; Step (3) Label the structured information and further generate two types of labels aligned with the token position in the numerical sequence channel: one is a time-position identifier sequence, which is used to explicitly mark the time index token and leave 0 for all other non-time tokens; the other is an embedding scaling weight sequence, which is used for the time semantic recalibration of the subsequent embedding layer.

3. The electric vehicle charging load prediction method based on a pre-trained language model according to claim 1, characterized in that, The semantic weight scaling step described in step four includes: Step (1), for the time backtracking token in channel A Introduce a weight function that decreases with the backtracking step size: ; in, Represents an exponential function. It is the attenuation coefficient. and The larger the value, the greater the weight the model assigns to more recent historical windows, thus tending to highlight the impact of recent data on the prediction results; Step (2), introduce daily enhanced weights of the same type. Let the daily type of the prediction anchor point be... Multiply the token with the same date type as the anchor point by an enhancement factor. Multiply the inconsistent ones by a weakening factor ,in ; Step (3): To avoid excessive scaling of weights leading to unstable training values, the final weights are... Crop to preset area: ; in, and These represent the upper and lower bounds of the allowed weights, respectively. Trimming ensures that the weights are always kept within a reasonable range. The numerical sequence channel prompt is generated according to the structure of "daily type token, historical sequence structure fragment, multiple sets of time index tokens and corresponding normalized load value tokens"; and the token weight matrix weights the structure tokens, but does not force the numerical tokens to be weighted one by one, in order to reduce the risk of training instability.

4. The electric vehicle charging load prediction method based on a pre-trained language model according to claim 1, characterized in that, The construction steps of the timing adaptation structure include: Step (1) involves constructing the time embedding table. For the historical step size, the embedding dimension of the pre-trained encoding backbone is... Reconstruct a learnable time embedding table: ; Represents the set of real numbers; The time-embedded table is a dimension-based table. The matrix, where each row vector is a learnable embedding vector, is optimized through gradient updates during training. It should be noted that index 0 corresponds to a non-time token, used to handle elements without a clear time-position relationship; index 1... ,in Corresponding backtracking step size That is, the relative historical position from the current prediction time. The smaller the value, the more recent the information. The larger the value, the further into the future; Step (2) performs time-adapted embedding computation on the first... samples, sequence position is The token, after time-series adaptation, is embedded as follows: ; in, This represents the final temporal adaptation embedding vector, which integrates the original semantics and temporal context; It represents the basic embedding vector, which only captures the semantic content of the token and does not contain temporal information; Represents a time-location identifier used to inject specific patterns of relative time-location; Indicates the embedded scaling weight and This is an element-wise multiplicative vector used to control the overall magnitude of the embedding vector. This weight can be calculated using the following formula: ; in, Represents the clipping function, when the... Each token is hour, Cut to within; when Each token is hour, Cut to Inside; in other cases =1; Step (3) embeds the temporal adaptation vectors of all sequence positions. The input is fed into the backbone encoding layer of the pre-trained language model "Bert" to obtain the hidden representation sequence of the sequence. ,in It is a contextual representation processed by attention mechanisms and feedforward networks.

5. The electric vehicle charging load prediction method based on a pre-trained language model according to claim 1, characterized in that, In the dual-channel representation vector gating fusion process, for the first... For each sample, a representation vector is obtained from channel A and channel B respectively. and These vectors, extracted through the aforementioned encoding process, can capture the static or dynamic features of time series data. This represents the embedding dimension of the pre-trained encoding backbone; subsequently, gating coefficients are generated through a gating network. The calculation formula is as follows: ; in, This represents the sigmoid function. It is a multilayer perceptron. This represents the concatenation of vectors from two channels, with the fused representation vector calculated based on the gating coefficients. The formula is: ; in, This represents the gating coefficient for channel A. This represents the gating coefficient for channel B. This indicates element-wise multiplication.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform the method as described in any one of claims 1 to 5.