Ionospheric delay is one of the important error sources in global satellite navigation and positioning. Improving the prediction accuracy of ionospheric TEC is very important to improve the accuracy of satellite navigation and positioning. This paper combines the sliding window and long short-term memory neural network, uses the sliding window algorithm to continuously update the input sequence data set and test the accuracy of the model corresponding to different input sequence lengths. Finally, the input parameters are updated with 10% of the input data to construct a TEC prediction model. Verification results show that the proportion of absolute values of predicted residuals of the model less than 5TECu both in the calm period and magnetic storm period reached more than 85%, an increase of 49% and 71% compared with the corresponding values of the traditional LSTM model, and the root mean square error was 31% and 35% lower; the average absolute error of its forecast results was reduced by 25% and 32%.