Aiming at the problem that most of the existing air and water pollution prediction is not accurate enough, a pollution prediction model based on deep learning in the Internet of things environmental monitoring system is proposed. Firstly, the pollutant prediction in the environmental monitoring system of the Internet of things is defined as the problem of time series data prediction, and by using the read first method to filter the redundant data, the long and short term memory network (LSTM) is improved to obtain the RLSTM which is more suitable for the long-term series prediction. Then, the pollution prediction model is constructed based on the encoding decoding architecture of self coding neural network. The encoder is used to extract the distribution characteristics of time series pollutant concentration data, and the decoder uses the extracted characteristics to predict the pollutant concentration data in unknown time. Both the encoder and decoder adopt RLSTM structure. Finally, the temporal attention mechanism is introduced into the prediction model and a variety of external factors are fused to improve the accuracy of prediction. Based on two real environmental data sets in Beijing and Shanghai, the experimental results show that the predicted value is the closest to the real value, and the root mean square error, correlation coefficient and running time are 7.625 (wg/ril), 0,996 and 0.068s, respectively. The overall prediction effect is better than other comparison models.