This study evaluates the impact of personnel on air quality in air-conditioned restaurant environments during winter, summer, and transitional seasons, characterized by the peculiarities of personnel movement, high concentration of personnel in a short period of time, poor ventilation and high personnel density, leading to the accumulation of pollutants that can severely damage personnel health. This study examines carbon dioxide (CO2) and particulate matter (PM) concentrations and proposes an online adaptive model for their prediction.Environmental influence factors are analyzed through correlations of measured data, and appropriate input parameters (time-lagged cumulative number of people) are selected. The Auto-Regressive with Exogenous Inputs (ARX) model is used to predict the change of air quality with the movement and number of people, compared with classical models (LR, DT, SVM, ENS, GPR, NN, VARX). Results show that the ARX model performs excellently in predicting restaurant environments; the effect of different environmental factors on the predictive effectiveness of the model was also explored. When combined with real-time sensor data and AIC-based adaptive optimization, the prediction accuracy is further improved by more than 25 %. The R2 of the ARX model is 0.9549, the MAE is 0.8352 μg/m3 and the MAPE is 3.17 %. The adaptively optimized model can be adapted to different environments, overcoming the problem of poor adaptability of such models. Our results enable effective environmental control strategies in public spaces, contributing to Sustainable Development Goal (SDG) 3: Good Health and Well-being by reducing health risks associated with indoor air pollution.