The layout and configuration of urban infrastructure are essential for the orderly operation and healthy development of cities. With the promotion and popularization of new energy vehicles, the modeling and prediction of charging pile usage and allocation have garnered significant attention from governments and enterprises. Short-term demand forecasting for charging piles is crucial for their efficient operation. However, existing prediction models lack a discussion on the appropriate time window, resulting in limitations in station-level predictions. Recognizing the temporal nature of charging pile occupancy, this paper proposes a novel stacked-LSTM model called attention-SLSTM that integrates an attention mechanism to predict the charging demand of electric vehicles at the station level over the next few hours. To evaluate its performance, this paper compares it with several methods. The experimental results demonstrate that the attention-SLSTM model outperforms both LSTM and stacked-LSTM models. Deep learning methods generally outperform traditional time series forecasting methods. In the test set, MAE is 1.6860, RMSE is 2.5040, and MAPE is 9.7680%. Compared to the stacked-LSTM model, MAE and RMSE are reduced by 4.7%and 5%, respectively; while MAPE value decreases by 1.3%, making it superior to LSTM overall. Furthermore, subsequent experiments compare prediction performance among different charging stations, which confirms that the attention-SLSTM model exhibits excellent predictive capabilities within a six-step (2 h) window.