In shale gas mining areas, indigenous microorganisms degrade organic pollutants such as petroleum hydrocarbons into carbon dioxide (CO2) and water (H2O) through aerobic metabolism. A large quantity of CO2 emissions will exacerbate the “Greenhouse effect”. Based on the clean sieved soil and oil-based drilling fluid in the shale gas mining area, this experiment set three concentration gradients (3523 ± 159 mg/kg, 8715 ± 820 mg/kg and 22,031 ± 1533 mg/kg) to treat the soil, and each group was disposed for the same amount of time (63 days). By analyzing the dynamic changes of microbial diversity and the abundance of key functional genes for carbon fixation, the impact of petroleum hydrocarbons on carbon fixation potential was discovered, and the natural attenuation law of petroleum hydrocarbons in contaminated soil was explored. It provided the scientific research basis of ecology for the carbon cycle, carbon allocation, and carbon fixation in microbial remediation of petroleum hydrocarbon contaminated soil. The results obtained indicated the following: i) The removal rate of petroleum hydrocarbons under high-concentration pollution (45.33 ± 3.90%) was significantly lower than low and medium-concentration pollution. The TPH concentration removal rate of each group was the largest in the early stage of culture (1-5d), and there was no significant correlation between the TPH content and the community composition (R2 = 0.0736, P > 0.05). ii) Composition and function of Carbon Fixation associated microbiota were assessed by 16S rRNA sequencing and PICRUSt (phylogenetic investigation of communities by reconstruction of unobserved states) analysis. The main carbon fixation pathway in this study is the reductive citric acid cycle, because there was no shortage of enzymes that can affect subsequent reactions.