
==== Front
Heliyon
Heliyon
Heliyon
2405-8440
Elsevier

S2405-8440(24)11871-3
10.1016/j.heliyon.2024.e35840
e35840
Research Article
Prediction and analysis of relative error in electric vehicle charging stations based on an improved ConvFormer model
Chen Liwen a
Liu Zhibin a
Yu Qingquan 1357211702@qq.com
a⁎
Jiang Xing b
Zhang Huanghui c
Lin Xin d
a Fujian University of Technology Institute of Ubiquitous Perception and Multi-sensor Integration Research, Fuzhou, Fujian Province, 350118, China
b Fuzhou Chengtou New Infrastructure Group Co., Ltd, Fuzhou, Fujian Province, 350011, China
c Fujian Institute of Metrology, Fuzhou, Fujian Province, 350003, China
d Straits Construction Engineering Group Co., Ltd, Fuzhou, Fujian Province, 350000, China
⁎ Corresponding author. 1357211702@qq.com
16 8 2024
30 8 2024
16 8 2024
10 16 e3584012 10 2023
15 7 2024
5 8 2024
© 2024 The Authors. Published by Elsevier Ltd.
2024

https://creativecommons.org/licenses/by-nc-nd/4.0/ This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).
In order to address the issue of metering inaccuracies in charging stations that directly affect the development of electric vehicles, a prediction method for the relative error of charging stations based on the ConvFormer model is proposed. The model combines Convolutional Neural Networks (CNN) with Transformer models in parallel, significantly improving the prediction accuracy. First, charging station data is preprocessed using forward interpolation and normalization methods, and the dataset is transformed into a dataset of input relative errors. Then, a neural network with an improved unidirectional convolutional and attention combination for time-series forecasting is constructed, and common regression performance evaluation metrics, MAE (Mean Absolute Error) and MSE (Mean Squared Error), are selected for evaluation. Finally, based on seven days of charging station data, the relative error of charging stations for the next 24 h is predicted, and compared to traditional Transformer and LSTM (Long Short-Term Memory) time-series models. The results show that the improved model yields the lowest values for both MAE and MSE, with a 47.30 % reduction in MAE compared to the Transformer model and a 38.06 % reduction compared to LSTM, and a 66.94 % reduction in MSE compared to the Transformer model and approximately 62.32 % reduction compared to LSTM.

Keywords

Artificial intelligence
Time series forecasting
Neural network
ConvFormer
Relative errorr of charging stations
==== Body
pmc1 Introduction

With the advancement of the “dual-carbon” strategic goals, the new energy vehicles are in rapid development stage, and the charging infrastructure is also experiencing rapid growth. By the end of 2022, the cumulative number of charging infrastructure nationwide reached 5.21 million units, with an annual increase of 2.593 million units, a year-on-year growth of 176.9 % [1]. In theory, charging infrastructure should increase with the increase of electric vehicles, which means a significant expansion of charging infrastructure. This not only brings convenience but also raises a series of potential challenges and risks. Although the popularity of charging stations has promoted the use of clean energy, at the same time, the safety and stability of charging infrastructure have become a focus of attention. With the increase in the number of charging stations, such as the selection of installation locations, benefit analysis, safety assessment, and management, these are facing more complex challenges and have become research hotspots. However, the neglect of metrological analysis of the charging stations themselves has led to a closer relationship between metrology and users. This not only involves the payment costs of users, but also indirectly reflects the performance issues of charging stations. Such as electricity calculation and billing, the meters in the charging stations need to obtain accurate information on electricity consumption and fees to ensure that users receive correct bills and sufficient charging services. Deviations in electricity consumption and fee calculation can harm users’ interests, increase their costs, and undermine their trust in using charging stations. Therefore, ensuring the accuracy and reliability of charging station usage data is crucial for safeguarding user rights.

Currently, most of the measurement and detection of charging stations are done manually, which is not only time-consuming and labor-intensive but also has a significant lag in diagnosing faults only after a metering deviation report is made. This inconvenience for users and is not conducive to the management of charging stations. Existing literature mainly focuses on aspects such as the quantity [1], construction, design, operation, and fault detection of charging stations [2,3], but there is little research on measurement. To overcome the problems of traditional on-site measurement and detection methods, reference [4] proposed the comparison method of metering modules and the big data screening method. The comparison method of metering modules requires hardware modification and funding investment for charging stations, which may increase production costs. The big data screening method uses mathematical models or algorithms established using big data to compare the data from DC energy meters, thus screening out abnormal charging stations. Deep learning algorithms can establish predictive models by utilizing large amounts of data and have successfully addressed many difficult problems, such as substation fault diagnosis [5,6], electrical demand forecasting [7,8], grid load forecasting [9,10], among others. Of course, there is also a lot of research in the field of charging piles. For example, deep learning can be used to monitor the health status of electric vehicle batteries. By analyzing data during charging and discharging processes, deep learning models can detect battery attenuation and faults, and take measures in advance to extend battery life [11]. Deep learning can be used to detect faults in charging piles. By analyzing real-time data such as voltage, current, and temperature, deep learning models can identify abnormal situations, detect charging station faults in advance, and reduce maintenance time [12]. Deep learning can be used to improve user experience, such as predicting the best charging station selection based on user charging history and behavior to reduce waiting time and improve user satisfaction [13]. Deep learning is a method for predicting the charging energy consumption of electric vehicle charging stations, which helps to more accurately measure charging costs and electricity consumption [14]. Deep learning can predict the load capacity of charging stations [15].

The application of deep learning in charging station measurement includes Dixit P and others using deep learning technology to evaluate the quality of electric vehicle charging data and detect anomalies. By analyzing data such as current and voltage, they used deep learning methods to detect measurement errors and anomalies [16]. Mazhar T et al. described a method using deep learning for energy measurement of electric vehicles in smart grids. They used neural networks to improve the measurement accuracy of electric vehicles [17]. Liu Wei described an advanced measurement system (AMI) data-driven evaluation method for the measurement and operation error status of electric vehicle charging facilities [18]. However, the deviation set in this experiment was ±5 %, which still cannot achieve an error of ±2 % for secondary charging piles. But all of them are real-time measurement error detection and cannot predict future trends. There is still lag, and efficiency and accuracy are not enough. Therefore, deep learning technology was introduced to establish a ConvFormer prediction model. The advantage of using convolutional neural networks to extract local features and the advantage of Transformer to extract global features can improve the accuracy of the model through parallel operations. Among them, the ConvFormer model has advantages in higher computing efficiency, better capturing of local information, better generalization ability, and better interpretability. However, the potential of ConvFormer model in terms of relative measurement errors of charging stations needs further exploration.

Based on the above research, this paper designs and implements a method for predicting relative measurement errors of electric vehicle charging stations based on the improved ConvFormer model, using the Aofeng Bus Station in Fuzhou City as the experimental site. The method is applied to the prediction of relative measurement errors in six charging stations at Aofeng Bus Station, and the model's accuracy is verified to be the highest.

Main content of each section:

Section Ⅰ is the introduction. Introduced the research background and current status of this project, and provided an overview of the main content of the entire article.

Section Ⅱ is about relevant theories. A detailed review of the testing regulations for measuring and verifying charging stations was conducted, and the theoretical knowledge of CNN and Transformer algorithms was introduced.

Section Ⅲ is about building the ConvFormer model. Introduced the specific ConvFormer charging station relative error model.

Section Ⅳ introduces the data sources and conducts data processing and analysis, detailing the preprocessing methods and setting evaluation indicators MAE and MSE.

Section Ⅴ presents the experimental results. Introduced the experimental platform, specific experimental parameters of various models, and experimental results of comparative models.

Section Ⅵ provides a summary of the entire article and provides prospects for future research.

2 Experimental theoretical support

2.1 Measurement error

The verification regulations for DC charging piles of electric vehicles are a series of standardized steps and requirements aimed at ensuring the accuracy and reliability of charging piles before delivery and during regular maintenance. According to the metrological verification regulations of JJG1149-2018 "Non Vehicle Charging Equipment for Electric Vehicles", this standard specifies the requirements and verification conditions for the metrological performance of non vehicle charging equipment, including key indicators such as payment amount error, clock indication error, working error, and indication error for non vehicle charging equipment. To ensure the accuracy and reliability of charging data, regulations require these indicators to be calibrated at least once a year [19].

Working error refers to the deviation of the measuring equipment from the standard measurement value during the actual working process of the charging station. This reflects the difference between the measured data and the actual value of the charging station in its actual working state.

Indicating error refers to the accuracy between any measurement data displayed by the charging station (such as electricity, time, etc.) and the actual measurement value, usually expressed as relative error.

The values for different accuracy levels are shown in Table 1. In summary, if the working error of the charging station meets the specified range shown in Table 1, the error is considered to be within an acceptable level.Table 1 Values of working error parameters.

Table 1Accuracy level	Name	Error value	unit	
1.0	Work error limit	±1.0	%	
2.0	Work error limit	±2.0	%	

The main research object of this article is the working error and indication error in metrological verification, which are usually expressed in the form of relative error. Therefore, unless otherwise specified, the measurement error and relative error mentioned in this article refer to working error and indication error.

2.2 CNN

CNN, also known as Convolutional Neural Network, consists of convolutional layers, pooling layers, activation functions, etc., as shown in Fig. 1. These components work collaboratively and can utilize convolution kernels to perform sliding window-based processing on input data, thereby analyzing local features of different sizes and positions and combining them into higher-level feature representations. This enables CNN to automatically capture abstract features in signals and achieve more accurate and efficient classification, recognition, and other tasks. The calculations in CNN are typically achieved through convolution and pooling operations. The general formulas are shown in (1), (2):(1) yconvm+1=F(∑i=1N∑j=1Kwi,jm*xim+bi,jm)

(2) ypoolm+1=poolings(yconvm+1)

Among them, wi,jm is the convolutiona kernel parameter with a length of, bi,jm is the bias term, F represents the activation function, yconvm+1 is the output feature processed by the convolutional layer, and poolings represents the pooling operation.Fig. 1 CNN structure.

Fig. 1

2.3 Transformer

Transformer is a model based on self-attention mechanism, which establishes a mechanism for mutual correlation between elements at different positions in the entire input sequence, thereby better capturing the dependencies between elements in the sequence and forming more precise and efficient feature representations. The Transformer mainly consists of an encoder, a decoder, self-attention mechanism, multi-head attention mechanism, feed-forward neural network, etc. It performs end-to-end mapping through the encoder-decoder structure, as shown in Fig. 2. The encoder is responsible for converting the input sequence into abstract feature representations, while the decoder transforms these feature representations into the output sequence to complete the sequence-to-sequence transformation task. The specific structure of the encoder is shown in Fig. 3.Fig. 2 Overview of transformer structure.

Fig. 2

Fig. 3 Specific structure of transformer encoder.

Fig. 3

3 Building a relative error model for charging stations based on convformer

First, the ConvFormer model is built, and then the collected data is preprocessed to improve its quality and adapt it to the model's input. Finally, the model is trained, validated, and analyzed using the test set data, and compared with the traditional Transformer and LSTM methods. The overall flowchart of this article is shown in Fig. 4.Fig. 4 Overall idea diagram.

Fig. 4

3.1 Overview of ConvFormer model

The improved ConvFormer model, also known as the ConvFormer model, combines the neural network model with the combination of unidirectional convolution and attention. The ConvFormer model is a fusion of CNN and Transformer. Transformer is a neural network model based on the self-attention mechanism, emphasizing the global dependencies of information in the sequence. In contrast, CNN is a neural network model that emphasizes local features and translation invariance. The ConvFormer model effectively combines the advantages of Transformer and CNN [20]. by inserting convolution modules into the Transformer encoder, enabling it to capture both local features and global dependencies in the sequence. The structure of the ConvFormer model is shown in Fig. 5.Fig. 5 ConvFormer model structure diagram.

Fig. 5

Fig. 5 shows that the proposed ConvFormer model consists of an input layer, a feature extraction layer, and an output layer.

Firstly, the input is passed through both the CNN convolution module and the Transformer Encoder module. The convolution module is composed of multiple convolutional layers and linear layers, which are used to extract short-range relationships. It includes 6 CNN Block modules for extracting local features and reducing sequence length to improve non-linear representation ability, while avoiding the inefficiency of processing long data. The Transformer Encoder is a stacked layer consisting of multiple Transformer Encoder Layers, which helps improve the model's non-linear learning capabilities. In this model, 6 Transformer Encoder Layers are used, each mapping the input tensor to a 1024-dimensional space and performing self-attention mechanisms and fully connected networks. Thus, when generating a new representation based on these weighted information, better contextual information is obtained. In each Encoder layer of the Transformer, after using multiple self-attention mechanisms, the vectors are mapped through a fully connected layer to build dependency relationships between them while preserving the order information of the original sequence. In the final layer of the Encoder, the output is dimensionally reduced through another linear layer.

Then, the feature vectors processed by the CNN convolution module are concatenated with the features processed by the Transformer Encoder module, and further processed through a convolutional layer and a pooling layer, ultimately obtaining the output through fully connected layers. Using a convolutional neural network instead of the Transformer Decoder output allows for a better capture of local information and global structure through down-sampled feature vectors, resulting in improved classification and processing performance. By using fully connected layers, the extracted feature vectors can be linearly transformed into the target output space dimensions, thereby achieving target output prediction.

In summary, this model combines the traditional Transformer model and CNN model to effectively integrate local and global features. The general formulas are shown in (3), (4), (5), (6), (7), (8), (9).1. Use convolutional neural networks to perform convolution operations on input tensors xi,and obtain convolution results Xic.

(3) Xic=CNN(Xi)

2. Use the Transformer Encoeder to process the input tensor xi and obtain the output result Xit of the Transformer.

(4) Xit=Encoeder(Xi)

3. Splice convolution result Xic and Transformer output Xit together to obtain result Xicat.

(5) Xicat=Concat(Xip,Xit)

Among them, represents Concat splicing operation.4. Use a convolutional neural network to perform convolution on the concatenated result Xicat, and obtain the convolutional result Xio.

(6) Xio=Conv1d(Xicat,Wconv1d,bconv1d)

(7) Xir=ReLU(Xio)

(8) Xio=MaxPool1d(Xir)

Among them, Conv1d represents one-dimensional convolution operation, Wconv1 and bconv1 represent convolution kernel and bias term respectively, Relu represents activation function, and MaxPool1d Represents a one-dimensional maximum pooling operation.5. Input the convolutional result Xio into the fully connected layer to obtain the final output result Xiout.

(9) Xiout=Linear(Xio,Wfc,bfc)

Among them, Linear represents linear variation, and Wfc and bfc represent weights and bias terms, respectively.

In summary, the ConvFormer model adopts a parallel structure of CNN and Transformer encoders. This model has the following advantages.(1) Local and global feature fusion: Parallel running CNN and Transformer models can simultaneously utilize the local advantages of CNN and the global advantages of Transformer.

(2) Flexible and easy to adjust: The model design can be changed according to different application requirements, and the ratio and structure of CNN and Transformer encoders can be flexibly adjusted to adapt to different time series prediction tasks.

(3) Efficiency: Parallel structures allow models to perform both local and global analysis while processing sequences, which improves the learning efficiency and predictive performance of the model.

Verified on actual datasets, the results show that the model performs more accurately in the task of predicting measurement errors.

4 Experimental data preprocessing

4.1 Data sources

The data in this experiment is collected from 6 DC charging piles at the Aofeng Bus Pilot Station in Fuzhou City. High-precision electrical data is collected every 3 s from October 18, 2022, to October 18, 2023. The data mainly includes phase current and voltage data (A, B, C), charging efficiency, total electrical energy, dual-gun power, dual-gun frequency, dual-gun temperature, and other 27 dimensions. The common data of the charging piles mentioned above is obtained through high-precision meters installed in the charging piles. The dataset contains a total of 1.9878762×107 samples. Some sample data examples are shown in Table 2, Table 3.Table 2 Example of DC charging station data section Ⅰ

Table 2Time	Electric pile efficiency/%	electric energy/kW·h	power/kW	frequency/Hz	temperature/°C	
2023/7/12 0:00:48	97.24	609671	176	50	34	
2023/7/12 0:00:52	94.52	609671	180	50	34	
2023/7/12 0:00:55	91.28	609671	182	50	34	
2023/7/12 0:00:58	91.09	609671	178	50	34	
2023/7/12 0:01:01	92.03	609671	174	50	34.02	
2023/7/12 0:01:04	94.02	609672	170	50	34.02	

Table 3 Example of DC charging station data section Ⅱ

Table 3Time	Gun 1 remote electrical energy
/kW·h	Gun 1 original meter energy
/kW·h	Gun 2 remote electrical energy
/kW·h	Gun 2 original meter energy
/kW·h	Demand current
/A	
2023/7/12 0:00:48	319898	706639	292202.5	616684	250	
2023/7/12 0:00:52	319898	706639	292202.5	616684	250	
2023/7/12 0:00:55	319898	706639	292203.5	616684	250	
2023/7/12 0:00:58	319898	706639	292203.4	616685	250	
2023/7/12 0:01:01	319898	706639	292203.5	616685	250	
2023/7/12 0:01:04	319899	706640	292203.5	616685	250	

4.2 Data preprocessing

The charging stations involved in this study include a total of 6 DC charging stations, and the data collected by them are in the same format. For the convenience of analysis and presentation, the following will take the data of the No.1 charging station as an example for detailed discussion. In the actual experimental process, the following steps were carried out for each of the 6 DC charging stations.

Although high-precision data is collected, the overall data quality is not high. Based on the analysis of the currently collected charging station data, it can be found that there are multiple issues with the charging station dataset.(1) There is a problem of missing data in the dataset. Data missing includes missing timestamps and data gaps. Analyzing the reasons for the null values, the main reason for the missing data in the dataset is that there are a total of two DC charging stations, with only one in use and the other in an idle state. Overall, the main reason for data loss is data gaps caused by no one using it. When dealing with missing data in datasets, there are usually multiple methods, including simple elimination, using statistical representative values (such as mean, median, or mode) to fill in, performing linear or nonlinear interpolation, and constructing algorithmic models to predict and fill in gaps, each of which has its own applicable scenarios and advantages and disadvantages.

Based on the characteristics of missing data in the dataset of this study, it has been decided to use the forward filling method, which uses the data from the previous moment to fill in the missing values. This method is simple and suitable for continuous collection of electrical data, avoiding the additional computational burden caused by the use of complex models, and ensuring processing speed and efficiency. The comparison before and after processing is shown in Table 4.(2) There is a problem of duplicate data in the dataset collected by the charging station. There are two main reasons for data duplication analysis. Firstly, the data collection speed is too fast, with data collected every 3 s. Although the charging station is in use, it does not sense any changes in the data. Only after accumulating for a certain period of time can the charging station sense the changes. The second is that the data of the charging station itself will not change with the use of the charging station, such as frequency and demand current.

Table 4 Vacancies in the No.1 charging station dataset.

Table 4Name	Total quantity	Number of vacancies	Empty value proportion	Proportion after processing	
Electric pile efficiency
/%	1460574	0	0	0	
electric energy
/kW·h	1460574	0	0	0	
power/kW	1460574	0	0	0	
Gun 1 remote electrical energy
/kW·h	1460574	399452	27.348974	0	
Gun 1 original meter energy
/kW·h	1460574	399452	27.348974	0	
Gun 2 remote electrical energy
/kW·h	1460574	489878	33.540101	0	
Gun 2 original meter energy
/kW·h	1460574	489878	33.540101	0	

For this study, considering the characteristics of continuous data collection and its potential impact on analysis accuracy, aggregation averaging was adopted to address the problem of data duplication. From collecting one data every 3 s to taking the average every 15 min, this not only avoids the impact of duplicate data on model accuracy, but also significantly reduces the memory usage of the data, thereby improving the overall analysis speed and efficiency. The comparison before and after processing is shown in Table 5.(3) There is an issue with abnormal points in the dataset collected by the charging station. The processing method is to use relative error as the key feature, and based on this, set that when the absolute value of the relative error of the data value is greater than 1, it is considered an outlier. Because in ideal circumstances, the relative error of measurement should not exceed 100 %, and data points outside this range are likely to be caused by data collection errors, equipment failures, or other external factors. By identifying and removing these outliers, the overall quality of the dataset can be significantly improved, laying a solid foundation for building high-precision prediction models. This method not only enhances the prediction accuracy of the model, but also optimizes the data processing efficiency during the model training process.

Table 5 The proportion of duplicate values in the dataset of charging station 1.

Table 5Name	Total quantity	Repetitive quantity	Ratio of duplicate values	Proportion after processing	
Electric pile efficiency
/%	1460574	19434	1.330573	0	
electric energy
/kW·h	1460574	19434	1.330573	0	
power/kW	1460574	19434	1.330573	0	
Gun 1 remote electrical energy
/kW·h	1460574	15655	1.071839	0	
Gun 1 original meter energy
/kW·h	1460574	15655	1.071839	0	
Gun 2 remote electrical energy
/kW·h	1460574	4844	0.331650	0	
Gun 2 original meter energy
/kW·h	1460574	4844	0.331650	0	

To transform data with different dimensions to the same scale and eliminate the difficulty of comparing different variables due to different dimensions, maximum and minimum normalization is applied. This linearly maps the data to the range [0,1], reducing the scale differences between different variables and improving the accuracy of prediction [21]. The general formula is shown in (10):(10) xtrans=x−xminxmax−xmin

Where xtrans is the converted value, xmin is the minimum value of the data, and xmax is the maximum value of the data.

4.3 Model prediction evaluation indicators

To intuitively compare the predictive performance of different methods, this paper selects the evaluation metrics including Mean Absolute Error (MAE) and Mean Square Error (MSE). These regression prediction metrics are used to measure the performance of the Transformer, LSTM, and ConvFormer models. The general formulas are shown in (11), (12):(11) MAE=1m∑i=1m|yi−f(xi)|

(12) MSE=1m∑i=1m(yi−f(xi))2

Among them, yi and f(xi) represent the true and predicted values of the i-th sample, respectively, and M represents the number of samples.

Choosing MAE (Mean Absolute Error) and MSE (Mean Square Error) as evaluation metrics for the model is because they have obvious intuitiveness and can be flexibly applied to various prediction tasks. The smaller the values of MAE and MSE, the smaller the difference between the predicted and true values, indicating better prediction performance. Conversely, the larger the values of MAE and MSE, the worse the prediction performance. In the fields of machine learning and deep learning, these two indicators are commonly used to evaluate the performance of models and make choices based on specific problems.

5 Experimental results

5.1 Experimental environment configuration

The experiment was conducted on a rented server on the AutoDL platform. The hardware configuration of the server is shown in Table 6, and the software environment for the experiment is shown in Table 7.Table 6 Experimental server hardware Configuration Table.

Table 6Name	Parameters	
CPU	16 vCPU Intel(R) Xeon(R) Platinum 8350C CPU @ 2.60 GHz	
GPU	RTX 3090(24 GB) * 1	
Memory	80 GB	

Table 7 Experimental software environment Configuration Table.

Table 7Name	Version	
Operating system-environment	Ubnutu 20.04.4 LTS	
Python	3.8.10	
Conda	4.10.3	
Pytorch(GPU)	1.11.0	
Numpy	1.22.4	
Pandas	1.5.2	

5.2 Experimental parameter settings

The training set, validation set, and test set were divided in an 8:1:1 ratio. The data for 7 days was used to predict a time span of 24 h.

After preprocessing, model construction, and data partitioning, the data was imported into the models for training. In order to verify the effectiveness of the improved model, comparative experimental models Trasnformer and LSTM were added, and the same values were taken for the number of iterations, batch size, learning rate, activation function, and other parameters of each model. The specific parameters are shown in Table 8, Table 9.Table 8 Parameter settings for each model (comparison model).

Table 8Transformerm	Parameter	LSTM	Parameter	
Attention heads	8	Hidden size	512	
Number of epochs	200	Number of epochs	200	
Batch size	32	Batch size	32	
Learning rate	1e-5	Learning rate	1e-5	
Activation function	ReLU	Activation function	ReLU	
Input size	136	Input size	136	
Optimizer	Adam	Optimizer	Adam	

Table 9 ConvFormer parameter settings.

Table 9ConvFormer	Parameter	
CNN-Block	6	
Transformer Encoder Layer	6	
Transformer attention heads	8	
Number of epochs	200	
Batch size	32	
Learning rate	1e-5	
Activation function	ReLU	
Input size	136	
Optimizer	Adam	

5.3 Experimentation

To evaluate the superiority of the proposed ConvFormer model, a comparative experiment was conducted with the Transformer and LSTM models. The experimental results are shown in Table 10. Additionally, the average MAE and MSE of each model's predictions for the 6 charging stations are shown in Fig. 6.Table 10 Experimental result.

Table 10Evaluation Indicator	Model	No.1 charging
station	No.2 charging
station	No.3 charging
station	No.4 charging
station	No.5 charging
station	No.6 charging
station	
MAE	Transformer	0.01899
953	0.05956
700	0.01414
703	0.00910
851	0.01319
950	0.00704
439	
LSTM	0.02428
349	0.05394
899	0.01424
787	0.00407
142	0.00600
824	0.00471
881	
ConvFormer	0.01338
920	0.02437
195	0.01380
310	0.00390
218	0.00514
063	0.00364
765	
MSE	Transformer	0.00055
284	0.00867
815	0.00326
117	0.00012
475	0.00026
542	7.37399
812e-05	
LSTM	0.00110
810	0.00691
102	0.00320
402	2.79342
160e-05	5.90454
847e-05	3.21102
748e-05	
ConvFormer	0.00034
538	0.00070
419	0.00314
273	2.31042
048e-05	4.47730
706e-05	1.89276
108e-05	

Fig. 6 Average MAE and MSE

Fig. 6

From Tables 10 and it can be observed that the ConvFormer model has smaller MAE and MSE values for the predictions of the 6 charging stations compared to the Transformer and LSTM models. The smaller the values of MAE and MSE, the smaller the difference between the predicted and true values, indicating better prediction performance. Fig. 6 shows that the ConvFormer model has the smallest prediction errors, with an average reduction of approximately 47.30 % and 66.94 % in MAE and MSE, respectively, compared to the Transformer model, and a reduction of approximately 38.06 % and 62.32 % compared to the LSTM model.

The relative errors between the predicted and actual values for the 6 charging stations are shown in Fig. 7, Fig. 8, Fig. 9, Fig. 10, Fig. 11, Fig. 12. The gray semicircle represents the Transformer model, the yellow hollow pentagon represents the LSTM model, and the purple hollow square represents the ConvFormer model.Fig. 7 Comparison of model predictions for pile 1.

Fig. 7

Fig. 8 Comparison of model predictions for pile 2.

Fig. 8

Fig. 9 Comparison of model predictions for pile 3.

Fig. 9

Fig. 10 Comparison of model predictions for pile 4.

Fig. 10

Fig. 11 Comparison of model predictions for pile 5.

Fig. 11

Fig. 12 Comparison of model predictions for pile 6.

Fig. 12

From the comparison of the experimental results for the 6 stations, it can be seen that the Transformer model has the largest fluctuations and the most significant errors, resulting in the worst overall performance. Comparing the LSTM model and the ConvFormer model, in the experiment shown in Fig. 7 for Station 1, the LSTM algorithm has large fluctuations and significant errors, while the ConvFormer model closely matches the actual values. In the experiment shown in Fig. 8 for Station 2, it is evident that the LSTM algorithm is less accurate, while the ConvFormer model not only provides more accurate data but also predicts the trend more accurately. In the results shown in Fig. 9 for Station 3, the blue curve representing the LSTM model has larger fluctuations and a discrepancy in the trend compared to the actual values, while the yellow curve representing the ConvFormer model has smaller fluctuations and closely follows the actual values, especially between 4 and 12 h where it is more accurate. Fig. 10 shows the results for Station 4, where the LSTM model performs poorly from the 4th to the 10th hour with almost no change, but the ConvFormer model predicts results that closely match the actual values with minimal error. Fig. 11 shows that the LSTM model has larger fluctuations compared to the ConvFormer model, especially in the 18th to 24th hour range. Fig. 12 shows that for Station 6, the LSTM model deviates from the actual values from the 4th to the 10th hour with larger fluctuations and greater errors.

In summary, the Transformer model has larger overall fluctuations and more significant errors, while the LSTM algorithm reduces the overall fluctuations compared to the Transformer model and has better alignment with the actual values with smaller errors, but the predicted values are not precise enough. The ConvFormer model better addresses this issue by providing more accurate predictions with smaller errors and can predict changes in extreme points, resulting in better performance and improved accuracy. The ConvFormer model proposed in this paper has the smallest prediction errors among all the models and the highest accuracy, making it more suitable for relative error prediction tasks for charging stations. At present, although the ConvFormer model has the highest prediction accuracy, execution time was not considered in this study, and further consideration will be given to the issue of execution time.

6 Conclusion

To address the issue of metering inaccuracies in charging stations, a measurement error prediction model based on convolutional neural network and Transformer was constructed. An improved ConvFormer model was proposed and implemented, which combines convolutional neural networks (CNN) and Transformer models in parallel, significantly improving model processing speed and prediction accuracy. This parallel structure fully utilizes the powerful ability of CNN in feature extraction and the efficiency of Transformer in processing sequence data, realizing their complementary advantages and bringing a qualitative leap to the field of charging station measurement error prediction. Through in-depth comparison and analysis with a variety of traditional algorithms, this study not only theoretically verified the progressiveness of the ConvFormer model, but also clearly demonstrated its superior performance in practical applications through experimental data, significantly superior to existing models.

In conclusion, the charging station prediction algorithm proposed in this paper has significant advantages in terms of accuracy and efficiency. It can be used to manage the metering inaccuracies of charging stations, predict the status of charging stations in advance, improve efficiency, and has promising applications.

This article conducts research on the relative error prediction of charging piles. Although certain achievements have been made, there are still some shortcomings. Future research can be conducted from the following aspects.(1) The current research focuses on predicting the measurement errors of charging stations within the next 24 h. Although this is of great significance for optimizing the operation and maintenance strategies of charging stations in the short term, expanding the prediction range to longer time periods, such as one week, one month, and even longer, will provide a more profound impact on charging station management and planning.

(2) At present, the model has been successfully applied to predict measurement errors, demonstrating its advantages in processing complex data and providing accurate predictions. However, the application potential of this model is not limited to this. Future research can consider expanding this model to related fields such as energy demand forecasting, renewable energy output forecasting, and power grid load analysis. By adjusting and optimizing the model appropriately to meet the specific needs and data characteristics of these fields, the applicability and influence of the model can be greatly improved.

(3) At present, the experiments of this model are all aimed at a bus stop type power station in Fuzhou City, but further exploration is needed for different regions, scales, and types of charging station networks.

Ethical approval

Written informed consent was obtained from all the participants prior to the enrollment (or for the publication) of this study.

Funding

1. “This paper was supported by the Special Fund for Promoting High Quality Development of Marine and Fisheries Industry in Fujian Province in 2023 (FJHYF-ZH-2023-07 ).”

2. “This paper was supported by the Inner Mongolia Autonomous Region Science and Technology Project (No. 2023YFSW0020 ).”

3. “This paper was supported by the Horizontal R&D project (FQW-5TR-RCGGS-220316 ).”

Availability of data and materials

The datasets used and/or analyzed during the current study are available from the corresponding author on reasonable request.

CRediT authorship contribution statement

Liwen Chen: Writing – review & editing, Supervision, Project administration. Zhibin Liu: Writing – review & editing, Project administration, Data curation, Conceptualization. Qingquan Yu: Writing – original draft, Methodology. Xing Jiang: Investigation, Formal analysis, Conceptualization. Huanghui Zhang: Validation, Resources, Data curation. Xin Lin: Visualization, Resources, Formal analysis.

Declaration of competing interest

The authors declare the following financial interests/personal relationships which may be considered as potential competing interests:Liwen Chen reports financial support was provided by Special Fund for Promoting High Quality Development of Marine and Fisheries Industry. Liwen Chen reports financial support was provided by Inner Mongolia Autonomous Region Science and Technology Project. Liwen Chen reports financial support was provided by Horizontal R&D project. If there are other authors, they declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
==== Refs
References

1 Zheng Xueqin As of the end of 2022, the accumulated number of charging infrastructure reached 5.21 million units Auto World 2 2023 116 117
2 Yahao Rong Design and Implementation of Intelligent Status Monitoring System for Electric Vehicle Charging piles[D] 2020 Shandong University
3 He Simiao Research on Intelligent Charging Pile Status Classification and Fault Prediction Based on Big Data [D] 2022 Shenyang University of Technology
4 Ye Jiamin Chen Jieqiong Reflections on the new model of calibration for electric vehicle charging piles China Quality Supervision 4 2021 70 71
5 Liu Chang Ying Li Lu Xia Comprehensive performance evaluation of electric vehicle charging stations J. North China Electr. Power Univ. (Soc. Sci.) 44 1 2017 82 88
6 Ma Xin Transformer Fault Identification Method Based on Feature enhancement[D] 2021 North China Institute of Water Resources and Hydropower
7 Kong W. Dong Z.Y. Jia Y. Short-term residential load forecasting based on LSTM recurrent neural network IEEE Trans. Smart Grid 10 1 2017 841 851
8 Zhuang Ding Data-driven Prediction of Electric Vehicle Charging Demand [D] 2019 Chongqing University of Posts and Telecommunications
9 Sun Ye Lin Tang Su Bing Research on power transformer fault identification based on deep learning algorithm Microcomput. Appl. 37 12 2021 74 77
10 Du Zhiqiang Discussion on the application of big data in the field of new energy vehicles Intelligent Buildings and Smart Cities 6 2021 25 26
11 Park K. Moon I. Multi-agent deep reinforcement learning approach for EV charging scheduling in a smart grid Appl. Energy 328 2022 120111
12 Lu J. Xiong R. Tian J. Deep learning to estimate lithium-ion battery state of health without additional degradation experiments Nat. Commun. 14 1 2023 2760 37179411
13 Yu J. Shu L. Chen L. A deep learning approach for electric vehicle charging station fault detection IEEE Access 7 2019 181141 181150
14 Boulakhbar M. Farag M. Benabdelaziz K. A deep learning approach for prediction of electrical vehicle charging stations power demand in regulated electricity markets: the case of Morocco Cleaner Energy Systems 3 2022 100039
15 Wang Renjie Space Time Prediction of Charging Station Load Based on Deep Learning [D] 2023 Beijing Jiaotong University Beijing
16 Dixit P. Bhattacharya P. Tanwar S. Anomaly detection in autonomous electric vehicles using AI techniques: a comprehensive survey Expet Syst. 39 5 2022 e12754
17 Mazhar T. Asif R.N. Malik M.A. Electric vehicle charging system in the smart grid using different machine learning methods Sustainability 15 3 2023 2603
18 Liu Wei Wang Chaoliang Xiao Tao Etc an AMI data-driven method for evaluating the measurement and operation error status of electric vehicle charging facilities [J] Power Automation Equipment 42 10 2022 70 76
19 Shoujing the importance of metrological verification work China High tech Zone 11 2017 182 185
20 W H. CvT: introducing convolutions to vision transformers IEEE/CVF Int. Conf. Comput. Vis. 2021 22 31
21 Cheng Chen Research and Design of Intelligent Status Monitoring System for DC Charging Stations[D] 2023 Fujian University of Technology Fuzhou
