Charging pile peak queuing time prediction method based on big data analysis

Through the combination of position encoding and Transformer encoder combined with self-supervised comparison learning, the lack of nonlinear and long-term dependency processing in charging pile queue time prediction is solved, high-precision and robust prediction are achieved, and the data usage of charging piles is improved Feature representation and computational efficiency.

CN118966408AInactive Publication Date: 2024-11-15ZHONGNENG GUANGHE (SUZHOU) NEW ENERGY TECH CO LTD
View PDF 0 Cites 7 Cited by

Patent Information

Application Number
CN202410920541.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2024-11-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing charging pile queue time prediction method is insufficient in handling complex nonlinear relationships and long-term dependencies, and the extraction and representation of data features are relatively single, so it cannot fully utilize the richness of charging pile usage data. information.

Method used

The position encoding mechanism is used to convert the timestamp into a high-dimensional vector, combined with the Transformer encoder and the self-supervised comparison learning method, and the correlation and features in the time series are captured through the self-attention mechanism and the multi-head attention mechanism, and a multi-objective loss function is constructed for Model training provides high accuracy, high robustness and real-time optimization prediction.

Benefits of technology

Improve the understanding of time dependencies in the usage data of charging piles and the capture ability of long-term dependencies, enhance the robustness and generalization ability of feature representation, achieve more efficient prediction accuracy and computing capabilities, and support real-time prediction and optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118966408A_ABST
    Figure CN118966408A_ABST
Patent Text Reader

Abstract

The invention discloses a big data analysis-based charging pile peak queuing time prediction method. The method comprises the following steps of S1, obtaining historical use data of a charging pile; s2, preprocessing the historical use data; s3, encoding the time sequence data by using a position encoding mechanism, and converting a timestamp into a high-dimensional vector representation; s4, inputting the data after position coding into a Transform encoder, calculating the correlation between each position in the sequence and other positions through a self-attention mechanism, and capturing the features of different subspaces by using a multi-head attention mechanism; s5, constructing a comparative learning module, and performing self-supervised learning on the encoded data by generating a positive sample and a negative sample; s6, defining a multi-objective loss function, and training and optimizing the model; and S7, applying the trained model to real-time data, and providing a visual user interface. According to the method, position coding, Transform and self-supervised comparative learning are combined, and the queuing time of the charging pile is accurately predicted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of big data analysis, and in particular to a method for predicting charging pile peak-period queue time based on big data analysis. Background Art

[0002] With the popularity of electric vehicles, charging piles have become an essential facility for electric vehicle users. However, the number of charging piles is limited. Especially during peak hours, the demand for charging piles increases dramatically, resulting in increased waiting time and affecting user experience. Accurately predicting the waiting time of charging piles during peak hours is of great significance for improving the utilization efficiency of charging piles and optimizing resource allocation. Traditional time series prediction methods, such as ARIMA (autoregressive integrated moving average model) and LSTM (long short-term memory network), have certain limitations in dealing with charging pile waiting time prediction.

[0003] Existing time series forecasting methods mainly rely on linear models and recurrent neural networks (RNNs), such as ARIMA and LSTM. The ARIMA model assumes that time series data is linear and has limited processing capabilities for nonlinear and complex time dependencies. In addition, the ARIMA model has high requirements for data stationarity and requires differential operations on the original data to achieve stationarity, which increases the complexity of data preprocessing in practical applications.

[0004] As a recurrent neural network, LSTM can capture long-term dependencies to a certain extent by introducing memory units and gating mechanisms. However, the LSTM model has the problems of gradient vanishing and gradient exploding when processing long-term series data, which makes model training difficult and computationally inefficient. In addition, LSTM still has insufficient performance when capturing long-distance dependencies in sequences.

[0005] The introduction of the Transformer model has brought new hope to time series prediction. Through the self-attention mechanism and the multi-head attention mechanism, the Transformer model can effectively capture the correlation between various positions in the sequence, especially when processing long time series data. The position encoding mechanism adds position information to each position in the sequence, allowing the model to better understand the order and periodic changes of the time series. However, the Transformer model is mainly used in the field of natural language processing, and its application in time series prediction tasks is still relatively small.

[0006] Existing charging pile queue time prediction methods mostly use traditional time series models and statistical methods, such as linear regression, ARIMA, and LSTM. Although these methods can capture the time pattern of charging pile usage to a certain extent, they have limited processing capabilities for complex nonlinear relationships and long-term dependencies, resulting in low prediction accuracy and robustness. In addition, the existing methods are relatively simple in extracting and representing data features, and cannot fully utilize the rich information in charging pile usage data, such as geographic location, user behavior, and environmental factors.

[0007] Therefore, how to provide a method for predicting the peak-period queue time of charging piles based on big data analysis is an urgent problem that technicians in this field need to solve. Summary of the invention

[0008] One object of the present invention is to propose a method for predicting the queuing time of charging piles during peak hours based on big data analysis. The present invention combines position coding, Transformer encoder and self-supervised comparative learning method to accurately predict the queuing time of charging piles during peak hours, and has the advantages of high precision, high robustness, high efficiency and real-time optimization.

[0009] A method for predicting charging pile peak queue time based on big data analysis according to an embodiment of the present invention includes the following steps:

[0010] S1. Obtain historical usage data of charging piles;

[0011] S2. Preprocess the acquired historical usage data, including data cleaning, missing value filling and data normalization;

[0012] S3, use the position encoding mechanism to encode the preprocessed time series data and convert the timestamp into a high-dimensional vector representation;

[0013] S4, input the position-encoded data into the Transformer encoder, calculate the correlation between each position in the sequence and other positions through the self-attention mechanism, and use the multi-head attention mechanism to capture the features of different subspaces;

[0014] S5. Construct a contrastive learning module to perform self-supervised learning on the encoded data by generating positive and negative samples;

[0015] S6. Define a multi-objective loss function, and train and optimize the model;

[0016] S7. Apply the trained model to real-time data and provide a visual user interface.

[0017] Furthermore, the S3 specifically includes:

[0018] S31, arranging the pre-processed historical usage data in chronological order to form time series data, wherein the record corresponding to each timestamp includes the usage status, usage duration, queue time, charging amount, user ID, geographic location and weather conditions of the charging pile;

[0019] S32. Use the position coding mechanism to encode each timestamp in the time series data. The position coding is generated by the sine function and the cosine function to convert the timestamp into a high-dimensional vector representation. The position coding formula is:

[0020]

[0021] Among them, pos represents the position index of the timestamp, i represents the dimension index, and d model represents the dimension of the position encoding vector;

[0022] S33, concatenate the position encoding vector with the usage status, usage duration, queue time, charging amount, user ID, geographic location and weather condition feature vectors in the time series data to form a new high-dimensional feature vector:

[0023] Encoded_Data(t)=[Original_Data(t)||PE(t)];

[0024] Among them, || represents the vector concatenation operation, Original_Data(t) represents the feature vector of usage time, queue time, charging amount, user ID, geographic location and weather conditions in the time series data, PE(t) represents the position encoding vector corresponding to timestamp t, and Encoded_Data(t) represents the high-dimensional feature vector of timestamp t;

[0025] S34, normalize the concatenated high-dimensional feature vector:

[0026]

[0027] Among them, Normalized_Data(t) represents the data at timestamp t after normalization, μ(t) represents the moving average of the feature vector at timestamp t, and σ 2 (t) represents the moving variance of the feature vector at timestamp t, α, β, and γ represent trainable parameters used to adjust the flexibility and stability of the normalization process;

[0028] S35. The high-dimensional feature vector obtained after normalization is used as the final encoded data.

[0029] Furthermore, the S4 specifically includes:

[0030] S41, inputting the position-encoded and normalized high-dimensional feature vector into a Transformer encoder, wherein the Transformer encoder includes stacked encoding layers, each encoding layer includes a multi-head attention mechanism and a feedforward neural network;

[0031] S42. In each encoding layer, a multi-head self-attention mechanism is used to calculate the correlation between each position in the sequence and other positions:

[0032]

[0033] Among them, Q represents the query matrix, K represents the key matrix, V represents the value matrix, and d k represents the dimension of the key vector, λ represents the trainable weight coefficient, R ij Represents the position relationship matrix, which is used to strengthen the dependency between specific positions i and j;

[0034] S43. Concatenate the outputs of the multi-head attention mechanism and transform them linearly to form the output of the encoding layer:

[0035] MultiHead(Q,K,V)=Concat(head1,head2,…,head h )W o ;

[0036] in, and W O represents the trainable weight matrix, and h represents the number of heads;

[0037] S44. Perform residual connection and normalization on the output of the multi-head self-attention mechanism:

[0038] Output=LayerNorm(Normalized_Data(t)+MultiHead(Q,K,V)+β·PE(t));

[0039] Among them, LayerNorm represents the layer normalization operation, and β represents the trainable parameter;

[0040] S45. Input the output after residual connection and layer normalization into the feedforward neural network, which includes two linear transformations and a ReLU activation function:

[0041] FFN(x)=σ((xW1+b1)W2+b2)+α·Dropout(x);

[0042] Among them, W1 and W2 represent weight matrices, b1 and b2 represent bias vectors, σ represents activation function, α represents trainable parameters, and Dropout(x) represents the dropout operation, which is used to prevent overfitting.

[0043] S46. Perform residual connection and layer normalization processing on the output of the feedforward neural network:

[0044] Output=LayerNorm(Normalized_Data(t)+

[0045] FFN(Normalized_Data(t))+γ·PE(t));

[0046] Among them, γ represents a trainable parameter;

[0047] S47. Repeat S42-S46 until all stacked encoding layers are passed, and finally a high-dimensional feature vector is output as the result of the Transformer encoder.

[0048] Furthermore, the S5 specifically includes:

[0049] S51, map the encoded high-dimensional feature vector to a new feature space through a projection head, and the mapping formula is:

[0050] z i =w2·ReLU(W1·h i +b1)+b2;

[0051] Among them, z i represents the feature vector mapped to the new feature space, h i represents the high-dimensional feature vector of the input, W1 and W2 represent the weight matrices of the fully connected layer, b1 and b2 represent the bias vectors of the fully connected layer, and ReLU represents the rectified linear unit activation function;

[0052] S52, calculate the cosine similarity between the positive sample pair and the negative sample pair:

[0053]

[0054] Among them, sim(z i ,z j ) represents the cosine similarity between the feature vectors of sample i and sample j, z i represents the feature vector of sample i, z j represents the feature vector of sample j, · represents the dot product operation of the vector, ||·|| represents the norm of the vector;

[0055] S53. Define the contrast loss function and use the contrast loss based on the temperature parameter:

[0056]

[0057] Among them, L contrastiverepresents the contrast loss value, Represents sample i and positive sample The cosine similarity between i ,z k ) represents the cosine similarity between sample i and sample k, τ represents the temperature parameter, and N represents the total number of samples;

[0058] S54. Minimize the contrast loss function and adjust the model parameters.

[0059] Furthermore, the multi-objective loss function is:

[0060] L total =λ1L MSE +λ2L contrastive +λ3L smooth ;

[0061] Among them, λ1, λ2 and λ3 represent weight coefficients;

[0062] L MSE Denotes the mean square error loss:

[0063]

[0064] Where N represents the total number of samples, y i represents the true value of the i-th sample, Represents the predicted value of the i-th sample;

[0065] L smooth Represents the time series smoothing loss:

[0066]

[0067] Where T represents the time step, represents the predicted value at time step t, represents the predicted value at time step t+1.

[0068] The beneficial effects of the present invention are:

[0069] (1) Enriching temporal feature representation: The position encoding mechanism generates high-dimensional vectors through sine and cosine functions, adding position information to each position in the time series, enabling the model to capture the order and periodic changes in the time series. Compared with the simple numerical representation in traditional methods, position encoding makes temporal features more expressive and improves the model's understanding of temporal dependencies.

[0070] (2) Improve the ability to capture long-term dependencies: The Transformer encoder is used to effectively capture the correlation between each position in the sequence through the self-attention mechanism and the multi-head attention mechanism. The Transformer model can perform parallel calculations and performs well when processing long-term series data. Compared with RNN and LSTM, it can better capture long-distance time dependencies and improve the ability to analyze periodic and sudden changes in charging pile usage data.

[0071] (3) Enhance the robustness and generalization ability of feature representation: The self-supervised contrastive learning module generates positive and negative samples and uses the contrast loss function to maximize the distance between positive and negative samples to improve the discrimination and robustness of the model's feature representation. Positive samples are samples similar to the input samples, and negative samples are samples dissimilar to the input samples. Through this self-supervised learning method, the model can more effectively learn the potential patterns in the charging pile usage data and improve the quality of feature representation.

[0072] (4) Comprehensive optimization of prediction accuracy and feature discrimination ability: Design a multi-objective loss function, combining mean square error (MSE), contrast loss and time smoothing loss, and comprehensively consider prediction error, feature representation discrimination ability and time series smoothness. The multi-objective loss function balances multiple optimization objectives to ensure that the model maintains the feature representation discrimination ability and the continuity and smoothness of the time series while improving prediction accuracy, achieving more comprehensive performance optimization.

[0073] (5) Improved computing power: The Transformer encoder has powerful parallel computing capabilities and can efficiently process large-scale time series data. Compared with traditional recurrent neural networks (RNNs) and long short-term memory networks (LSTMs), the Transformer has significant advantages in computing efficiency and model training speed, which enables this method to be quickly applied and deployed in the charging pile big data environment.

[0074] (6) Real-time prediction and optimization: By applying the trained model to real-time data, accurate queue time prediction is provided, and combined with a visual user interface, user experience and operational efficiency are improved. Real-time prediction and optimization not only help users arrange charging time reasonably and reduce waiting time, but also provide operators with effective charging pile scheduling and management decision support. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0076] Figure 1This is a flow chart of a method for predicting the peak-period queue time of charging piles based on big data analysis proposed by the present invention;

[0077] Figure 2 A schematic diagram of a Transformer encoder for a charging pile peak queue time prediction method based on big data analysis proposed in the present invention. DETAILED DESCRIPTION

[0078] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.

[0079] refer to Figure 1 and Figure 2 , a method for predicting the queuing time of charging piles during peak hours based on big data analysis, comprising the following steps:

[0080] S1. Obtain historical usage data of charging piles;

[0081] S2. Preprocess the acquired historical usage data, including data cleaning, missing value filling and data normalization;

[0082] S3, use the position encoding mechanism to encode the preprocessed time series data and convert the timestamp into a high-dimensional vector representation;

[0083] S4, input the position-encoded data into the Transformer encoder, calculate the correlation between each position in the sequence and other positions through the self-attention mechanism, and use the multi-head attention mechanism to capture the features of different subspaces;

[0084] S5. Construct a contrastive learning module to perform self-supervised learning on the encoded data by generating positive and negative samples;

[0085] S6. Define a multi-objective loss function, and train and optimize the model;

[0086] S7. Apply the trained model to real-time data and provide a visual user interface.

[0087] In this implementation, S3 specifically includes:

[0088] S31, arranging the pre-processed historical usage data in chronological order to form time series data, wherein the record corresponding to each timestamp includes the usage status, usage duration, queue time, charging amount, user ID, geographic location and weather conditions of the charging pile;

[0089] S32. Use the position coding mechanism to encode each timestamp in the time series data. The position coding is generated by the sine function and the cosine function to convert the timestamp into a high-dimensional vector representation. The position coding formula is:

[0090]

[0091] Among them, pos represents the position index of the timestamp, i represents the dimension index, and d model represents the dimension of the position encoding vector;

[0092] S33, concatenate the position encoding vector with the usage status, usage duration, queue time, charging amount, user ID, geographic location and weather condition feature vectors in the time series data to form a new high-dimensional feature vector:

[0093] Encoded_Data(t)=[Original_Data(t)||PE(t)];

[0094] Among them, || represents the vector concatenation operation, Original_Data(t) represents the feature vector of usage time, queue time, charging amount, user ID, geographic location and weather conditions in the time series data, PE(t) represents the position encoding vector corresponding to timestamp t, and Encoded_Data(t) represents the high-dimensional feature vector of timestamp t;

[0095] S34, normalize the concatenated high-dimensional feature vector:

[0096]

[0097] Among them, Normalized_Data(t) represents the data at timestamp t after normalization, μ(t) represents the moving average of the feature vector at timestamp t, and σ 2 (t) represents the moving variance of the feature vector at timestamp t, α, β, and γ represent trainable parameters used to adjust the flexibility and stability of the normalization process;

[0098] S35. The high-dimensional feature vector obtained after normalization is used as the final encoded data.

[0099] In this implementation, S4 specifically includes:

[0100] S41, inputting the position-encoded and normalized high-dimensional feature vector into a Transformer encoder, wherein the Transformer encoder includes stacked encoding layers, each encoding layer includes a multi-head attention mechanism and a feedforward neural network;

[0101] S42. In each encoding layer, a multi-head self-attention mechanism is used to calculate the correlation between each position in the sequence and other positions:

[0102]

[0103] Among them, Q represents the query matrix, K represents the key matrix, V represents the value matrix, and d k represents the dimension of the key vector, λ represents the trainable weight coefficient, R ij Represents the position relationship matrix, which is used to strengthen the dependency between specific positions i and j;

[0104] S43. Concatenate the outputs of the multi-head attention mechanism and transform them linearly to form the output of the encoding layer:

[0105] MultiHead(Q,K,V)=Concat(head1,head2,…,head n )W O ;

[0106] in, and W O represents the trainable weight matrix, and h represents the number of heads;

[0107] S44. Perform residual connection and normalization on the output of the multi-head self-attention mechanism:

[0108] Output=LayerNorm(Normalized_Data(t)+MultiHead(Q,K,V)+β·PE(t));

[0109] Among them, LayerNorm represents the layer normalization operation, and β represents the trainable parameter;

[0110] S45. Input the output after residual connection and layer normalization into the feedforward neural network, which includes two linear transformations and a ReLU activation function:

[0111] FFN(x)=σ((xW1+b1)W2+b2)+α·Dropout(x);

[0112] Among them, W1 and W2 represent weight matrices, b1 and b2 represent bias vectors, σ represents activation function, α represents trainable parameters, and Dropout(x) represents the dropout operation, which is used to prevent overfitting.

[0113] S46. Perform residual connection and layer normalization processing on the output of the feedforward neural network:

[0114] Output=LayerNorm(Normalized_Data(t)+

[0115] FFN(Normalized_Data(t))+γ·PE(t));

[0116] Among them, γ represents a trainable parameter;

[0117] S47. Repeat S42-S46 until all stacked encoding layers are passed, and finally a high-dimensional feature vector is output as the result of the Transformer encoder.

[0118] In this implementation manner, S5 specifically includes:

[0119] S51, map the encoded high-dimensional feature vector to a new feature space through a projection head, and the mapping formula is:

[0120] z i =W2·ReLU(W1·h i +b1)+b2;

[0121] Among them, z i represents the feature vector mapped to the new feature space, h i represents the high-dimensional feature vector of the input, W1 and W2 represent the weight matrices of the fully connected layer, b1 and b2 represent the bias vectors of the fully connected layer, and ReLU represents the rectified linear unit activation function;

[0122] S52, calculate the cosine similarity between the positive sample pair and the negative sample pair:

[0123]

[0124] Among them, sim(z i ,z j ) represents the cosine similarity between the feature vectors of sample i and sample j, z i represents the feature vector of sample i, z j represents the feature vector of sample j, · represents the dot product operation of the vector, ||·|| represents the norm of the vector;

[0125] S53. Define the contrast loss function and use the contrast loss based on the temperature parameter:

[0126]

[0127] Among them, L contrastive represents the contrast loss value, Represents sample i and positive sample The cosine similarity between i ,z k) represents the cosine similarity between sample i and sample k, τ represents the temperature parameter, and N represents the total number of samples;

[0128] S54. Minimize the contrast loss function and adjust the model parameters.

[0129] In this implementation, the multi-objective loss function is:

[0130] L total =λ1L MSE +λ2L contrastive +λ3L smooth ;

[0131] Among them, λ1, λ2 and λ3 represent weight coefficients;

[0132] L MSE Denotes the mean square error loss:

[0133]

[0134] Where N represents the total number of samples, y i represents the true value of the i-th sample, Represents the predicted value of the i-th sample;

[0135] L smooth Represents the time series smoothing loss:

[0136]

[0137] Where T represents the time step, represents the predicted value at time step t, represents the predicted value at time step t+1.

[0138] Embodiment 1:

[0139] In order to verify the feasibility of the present invention in implementation, the present invention is applied to an electric vehicle management center in a certain city.

[0140] First, the system obtains the historical usage data of all charging piles in the city, including timestamp, usage time, queue time, charging amount, user ID, geographic location and weather conditions, etc. These data cover all records in the past year, and the amount of data is very large.

[0141] After the data acquisition is completed, the system preprocesses these historical data, including data cleaning, missing value filling and data normalization. The preprocessed data is arranged in chronological order to form time series data. In this time series, each timestamp corresponds to the usage status and related characteristics of the charging pile.

[0142] The system then uses a positional encoding mechanism to encode each timestamp in the time series data. Positional encoding is generated using sine and cosine functions to convert timestamps into high-dimensional vector representations. This process enriches the representation of temporal features by capturing temporal dependencies and periodic changes.

[0143] Next, the system inputs the position-encoded data into the Transformer encoder. Through the self-attention mechanism, the system calculates the correlation between each position in the sequence and other positions, and uses the multi-head attention mechanism to capture the characteristics of different subspaces. The Transformer model performs well in processing long time series data, and greatly improves computing efficiency through parallel computing.

[0144] In order to further improve the robustness and generalization ability of the model, the system introduces a self-supervised contrastive learning module. By generating positive and negative samples and using the contrast loss function to maximize the distance between positive and negative samples, the model's ability to distinguish features is enhanced. Positive samples are samples similar to the input samples, while negative samples are samples that are dissimilar to the input samples.

[0145] During the model training process, the system defines a multi-objective loss function that comprehensively considers prediction error, contrast loss, and time series smoothness. The multi-objective loss function includes mean square error (MSE), contrast loss, and time smoothness loss. By optimizing multiple objectives, it balances the prediction accuracy and the distinguishing ability of feature representation.

[0146] Table 1 Experimental data on prediction of charging pile queue time during peak hours

[0147]

[0148] It can be seen from Table 1 that the prediction error of the charging pile peak queue time by the method of the present invention is kept at a low level in different dates and time periods. Specifically, the prediction error is between 1 and 2 minutes, which is much lower than the prediction error of the traditional method. This shows that the method of the present invention has a significant advantage in improving the accuracy of charging pile queue time prediction.

[0149] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A method for predicting the peak-period queue time of charging piles based on big data analysis, characterized in that: The steps include: S1. Obtain historical usage data of charging piles; S2. Preprocess the acquired historical usage data, including data cleaning, missing value filling and data normalization; S3, use the position encoding mechanism to encode the preprocessed time series data and convert the timestamp into a high-dimensional vector representation; S4, input the position-encoded data into the Transformer encoder, calculate the correlation between each position in the sequence and other positions through the self-attention mechanism, and use the multi-head attention mechanism to capture the features of different subspaces; S5. Construct a contrastive learning module to perform self-supervised learning on the encoded data by generating positive and negative samples; S6. Define a multi-objective loss function, and train and optimize the model; S7. Apply the trained model to real-time data and provide a visual user interface.

2. According to claim 1, a method for predicting the charging pile peak queue time based on big data analysis is characterized in that: The S3 specifically includes: S31, arranging the pre-processed historical usage data in chronological order to form time series data, wherein the record corresponding to each timestamp includes the usage status, usage duration, queue time, charging amount, user ID, geographic location and weather conditions of the charging pile; S32. Use the position coding mechanism to encode each timestamp in the time series data. The position coding is generated by the sine function and the cosine function to convert the timestamp into a high-dimensional vector representation. The position coding formula is: Among them, pos represents the position index of the timestamp, i represents the dimension index, and d model represents the dimension of the position encoding vector; S33, concatenate the position encoding vector with the usage status, usage duration, queue time, charging amount, user ID, geographic location and weather condition feature vectors in the time series data to form a new high-dimensional feature vector: Encoded_Data(t)=[Original_Data(t)||PE(t)]; Among them, || represents the vector concatenation operation, Original_Data(t) represents the feature vector of usage time, queue time, charging amount, user ID, geographic location and weather conditions in the time series data, PE(t) represents the position encoding vector corresponding to timestamp t, and Encoded_Data(t) represents the high-dimensional feature vector of timestamp t; S34, normalize the concatenated high-dimensional feature vector: Among them, Normalized_Data(t) represents the data at timestamp t after normalization, μ(t) represents the moving average of the feature vector at timestamp t, and σ 2 (t) represents the moving variance of the feature vector at timestamp t, α, β and γ represent trainable parameters; S35. The high-dimensional feature vector obtained after normalization is used as the final encoded data.

3. The method for predicting the peak-period queue time of charging piles based on big data analysis according to claim 1 is characterized in that: The S4 specifically includes: S41, inputting the position-encoded and normalized high-dimensional feature vector into a Transformer encoder, wherein the Transformer encoder includes stacked encoding layers, each encoding layer includes a multi-head attention mechanism and a feedforward neural network; S42. In each encoding layer, a multi-head self-attention mechanism is used to calculate the correlation between each position in the sequence and other positions: Among them, Q represents the query matrix, K represents the key matrix, V represents the value matrix, and d k represents the dimension of the key vector, λ represents the trainable weight coefficient, R ij Represents the position relationship matrix, which is used to strengthen the dependency between specific positions i and j; S43. Concatenate the outputs of the multi-head attention mechanism and transform them linearly to form the output of the encoding layer: MultiHead(Q,K,V)=Concat(head1,head2,...,head h )W O ; in, and WO represent the trainable weight matrix, and h represents the number of heads; S44. Perform residual connection and normalization on the output of the multi-head self-attention mechanism: Output=LayerNorm(Normalized_Data(t)+MultiHead(Q, K, V)+β·PE(t)); Among them, LayerNorm represents the layer normalization operation, and β represents the trainable parameter; S45. Input the output after residual connection and layer normalization into the feedforward neural network, which includes two linear transformations and a ReLU activation function: FFN(x)=σ((xW1+b1)W2+b2)+α·Dropout(x); Among them, W1 and W2 represent weight matrices, b1 and b2 represent bias vectors, σ represents activation function, α represents trainable parameters, and Dropout(x) represents the dropout operation, which is used to prevent overfitting. S46. Perform residual connection and layer normalization processing on the output of the feedforward neural network: Output=LayerNorm(Normalized_Data(t)+ FFN(Normalized_Data(t))+γ·PE(t)); Among them, γ represents a trainable parameter; S47. Repeat S42-S46 until all stacked encoding layers are passed, and finally a high-dimensional feature vector is output as the result of the Transformer encoder.

4. The method for predicting the peak-period queue time of charging piles based on big data analysis according to claim 1 is characterized in that: The S5 specifically includes: S51, map the encoded high-dimensional feature vector to a new feature space through a projection head, and the mapping formula is: <h2 style=";text-align:left;direction:ltr">z<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> =W2·ReLU(W1·h<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> +b1)+b2; Among them, z i represents the feature vector mapped to the new feature space, h i represents the high-dimensional feature vector of the input, W1 and W2 represent the weight matrices of the fully connected layer, b1 and b2 represent the bias vectors of the fully connected layer, and ReLU represents the rectified linear unit activation function; S52, calculate the cosine similarity between the positive sample pair and the negative sample pair: Among them, sim(z i , z j ) represents the cosine similarity between the feature vectors of sample i and sample j, z i represents the feature vector of sample i, z j represents the feature vector of sample j, · represents the dot product operation of the vector, ||·|| represents the norm of the vector; S53. Define the contrast loss function and use the contrast loss based on the temperature parameter: Among them, L contrastare represents the contrast loss value, Represents sample i and positive sample The cosine similarity between i , z k ) represents the cosine similarity between sample i and sample k, τ represents the temperature parameter, and N represents the total number of samples; S54. Minimize the contrast loss function and adjust the model parameters.

5. The method for predicting the peak-period queue time of charging piles based on big data analysis according to claim 1 is characterized in that: The multi-objective loss function is: L total =λ1L MSE +λ2L contrastive +λ3L smooth ; Among them, λ1, λ2 and λ3 represent weight coefficients; L MsE Denotes the mean square error loss: Where N represents the total number of samples, y i represents the true value of the i-th sample, Represents the predicted value of the i-th sample; L smootj Represents the time series smoothing loss: Where T represents the time step, represents the predicted value at time step t, represents the predicted value at time step t+1.

Citation Information

Cited By

  • Fishery resource dynamic trend prediction system and method based on time sequence analysis

    CN119338078A

  • Water quality prediction method based on graph convolution and time-space interlaced attention mechanism

    CN119918982A

  • DMP data management method based on artificial intelligence

    CN120256519A

  • Heterogeneous flow analysis method, device and system driven by intelligent large model

    CN120358103A

  • An intelligent large model driven heterogeneous traffic analysis method, device and system

    CN120358103B