In recent years, with the repeated occurrence of extreme weather and the continuous increase of air pollution, the incidence of weather-related diseases is increasing year by year. Air pollution and extreme temperature bring serious threats to the lives of sensitive groups, among which air pollution is most closely related to respiratory diseases. Owing to the skewed attention, timely intervention is necessary to better predict and warn the occurrence of death from respiratory diseases.In this paper, according to the existing research, based on a number of environmental monitoring data, the regression model is established by integrating the machine learning methods XGBoost, SVM and GAM model. The distributed lag nonlinear model (DLNM) is used to set the warning threshold to transform the data and establish the warning model. According to the DLNM model, the cumulative lag effect of meteorological factors is explored. There is a cumulative lag effect between air temperature and PM2.5, which reaches the maximum when the lag is 3 days and 5 days respectively. If the low temperature and high environmental pollutants (PM2.5) continue to influence for a long time, the death risk of respiratory diseases will continue to rise, and the early warning model based on DLNM has better performance.