The proficiency of short-term load forecasting (STLF) is vital to the smart grid. Nevertheless, existing STLF methods are faced with two fundamental challenges. Firstly, there is a need to enhance the prediction accuracy. Secondly, the sensitivity of load data makes it challenging to maintain its privacy during the train process. To overcome these challenges, a new STLF model called Bagging-SA-HFL is proposed, incorporating bagging learning (Bagging), self-attention mechanism (SA), and horizontal federated learning (HFL). This model seeks to enhance accuracy through the use of Bagging and SA, and maintain privacy via HFL. A comparative analysis is performed between the proposed Bagging-SA-HFL model and other popular models including support vector regression (SVR), recurrent neural networks (RNN), long short-term memory (LSTM), gated recurrent unit (GRU) and Bagging using datasets from different regions in eastern China. The results demonstrate that the Bagging-SA-HFL method is highly accurate in its predictions while ensuring data privacy, which holds immense practical significance for STLF applications.