Background. Patients are allowed to be released from quarantine after virus turns negative for asymptomatic or mild covid-19. Factors affecting the negative conversion of nucleic acid are unknown. Methods. This study included asymptomatic or mild covid-19 patients quarantined in Shanghai shelter hospital from April to May 2022. They were tested daily for SARS-CoV-2 nucleic acid. The clinical characteristics were collected. Univariate and multivariate Cox regression were used to explore the relationship between clinical characteristics and the time of virus turning negative (TTN), finally a risk model was established. Results. A total of 7836 patients enrolled were divided into training or validation set randomly. In training set, age (≥40 Y), symptoms (yes) , diabetes (yes) and vaccination status(yes) were correlated with TTN. We used HR values of the above factors in multivariate Cox regression as risk coefficients to build a risk model for predicting TTN. TTN of patients with high risk score was longer than with low risk score. This risk model has been well validated in the validation set and the complete set. Conclusions. Our study found that age, symptoms, diabetes and vaccination status were correlated with the TTN,and we first build a risk model to predict TTN in asymptomatic or mild Covid-19.