Psychrotrophic and thermoduric bacteria are the main reasons for the spoilage of dairy products. This study aims to address the composition and function of psychrotrophic and thermoduric bacteria in eight groups of raw milk samples obtained from Heilongjiang Province and Inner Mongolia (China). Microbial enumeration showed an average total bacterial count of 4.63 log c.f.u. ml-1 and psychrotrophic bacterial counts of 4.82 log c.f.u. ml-1. The mean counts of mesophilic and thermophilic thermoduric bacteria were 3.68 log and 1.81 log c.f.u. ml-1, respectively. Isolated psychrotrophic bacteria (26 genera and 50 species) and mesophilic thermoduric bacteria (20 genera and 32 species) showed high microbial diversity. Through metagenomic and proteomic analyses, significant disparities in the concentration and community structure of psychrotrophic and thermoduric bacteria were observed among different locations. A large number of peptidases were annotated by metagenomics, which may result in milk spoilage. They mainly come from some typical psychrotrophic and thermoduric bacteria, such as Chryseobacterium, Epilithonimonas, Pseudomonas, Psychrobacter, Acinetobacter, Lactococcus, Escherichia and Bacillus. However, the main proteins detected in fresh raw milk were associated with bacterial growth, reproduction and adaptation to cold environments. This investigation provides valuable insights into the microbial communities and protein profiles of raw milk, shedding light on the microbial factors contributing to milk deterioration.