In this paper, a support vector regression (SVR) adaptive optimization rolling composite model with a sooty tern optimization algorithm (STOA) has been proposed for temperature prediction. Firstly, aiming at the problem that the algorithm tends to fall into the local optimum, the model introduces an adaptive Gauss–Cauchy mutation operator to effectively increase the population diversity and search space and uses the improved algorithm to optimize the key parameters of the SVR model, so that the SVR model can mine the linear and nonlinear information in the data well. Secondly, the rolling prediction is integrated into the SVR prediction model, and the real-time update and self-regulation principles are used to continuously update the prediction, which greatly improves the prediction accuracy. Finally, the optimized STOA-SVR rolling forecast model is used to predict the final temperature. In this study, the global mean temperature data set from 1880 to 2022 is used for empirical analysis, and a comparative experiment is set up to verify the accuracy of the model. The results show that compared with the seasonal autoregressive integrated moving average (SARIMA), feedforward neural network (FNN) and unoptimized STOA-SVR-LSTM, the prediction performance of the proposed model is better, and the root mean square error is reduced by 6.33–29.62%. The mean relative error is reduced by 2.74–47.27%; the goodness of fit increases by 4.67–19.94%. Finally, the global mean temperature is predicted to increase by about 0.4976 °C in the next 20 years, with an increase rate of 3.43%. The model proposed in this paper not only has a good prediction accuracy, but also can provide an effective reference for the development and formulation of meteorological policies in the future.