High-risk (HR)-human papillomavirus (HPV) is the leading cause of precancerous cervical lesions in patients with chronic untreated infection. We investigated the relationships among several vaginal microbiological alterations, oncogene E6/E7 expression, and HR-HPV. A total of 1327 women who underwent HPV screening, vaginal microecology determination, and fluid-based thin-layer cytological test were enrolled and classified into the HPV-negative group, the low-risk (LR)-HPV-positive group, and the HR-HPV-positive group. The status of cervical HPV infection, vaginal microecology, and E6/E7 mRNA expression were examined sequentially. The effect of HR-HPV infection on cervical cancer (CC) was meticulously assessed, and associations between HR-HPV infection and vaginal microecology and E6/E7 mRNA were identified. In total 548/1327 patients were HPV positive, including LR-HPV infection (N = 132) and HR-HPV infection (N = 416). Patients in the HR-HPV positive group revealed higher detection rates of bacterial vaginosis (BV), trichomonal vaginitis (TV), and vulvovaginal candidiasis (VVC) relative to the HPV negative group. A higher E6/E7 mRNA expression was identified in HR-HPV patients compared to LR-HPV patients. BV and E6/E7 mRNA were classified as independent risk factors for HR-HPV infection. Patients with HR-HPV infection were more susceptible to CC development. Overall, BV and E6/E7 mRNA expression were identified as independent risk factors for HR-HPV infection. IMPACT STATEMENT What is already known on this subject? Through literature review, we found that vaginal ecological changes increase the risk of HPV infection, and HPV persistent infection is an important risk factor for cervical precancerous lesions and cervical cancer. In addition, HPV gene E6/E7 is expressed in HPV-positive cervical cancer cells, which is related to cell malignant transformation and even tumorigenesis. What do the results of this study add? This study further revealed that bacterial vaginosis (BV) and E6/E7 mRNA were independently correlated with HR-HPV infection, and HR-HPV infection increased the risk of cervical cancer. What are the implications of these findings for clinical practice and/or further research? E6/E7 mRNA detection may be used as a new auxiliary diagnostic index for HR-HPV infection. In addition, this study provides a reference for whether the restoration of vaginal microecological balance in patients with BV undergoing clinical treatment is conducive to HR-HPV regression, and provides theoretical support for the prevention and control of cervical cancer microecological approach and the occurrence and development of cervical cancer.