For the problems of low energy utilization and poor economy caused by "light abandonment" phenomenon in the current photovoltaic power generation process, a short-term photovoltaic power generation forecasting method based on XGBoost algorithm mixing multiple features is proposed. Firstly, the basic principle of XGBoost algorithm is introduced, and described briefly the advantages compared with other methods. The objective function of photovoltaic prediction model is constructed by introducing regularization penalty function and error function, and the abnormal data is preprocessed. Then Pearson correlation coefficients between photovoltaic power generation and each feature are analyzed.After training the model parameters, the test data are put into the photovoltaic forecasting model, and the photovoltaic power generation in the next three days is forecasted. The other two forecasting methods, SVM and LSTM, are selected for comparison experiments. The absolute values of load forecasting accuracy and load forecasting deviation rate are used as the evaluation indexes of the model. The experimental results show that XGBoost algorithm has high accuracy and practicability in forecasting photovoltaic power generation.