Insufficient reservoir pressure and gas source problems seriously limit effective applications of CO2 flooding in hydrocarbon reservoirs. An attractive strategy is to co-inject the produced associated hydrocarbon gas with CO2 to achieve miscible/near-miscible flooding to enhance oil recovery. However, the composition of the injected mixture and the in-situ spatio-temporal composition evolution of the displacing/displaced fluids significantly affect the CO2-oil miscibility and the overall hydrocarbon recovery performance. In this work, based on slim tube simulation results, a prediction model of minimum miscible pressure (MMP)/minimum near-miscible pressure (MNMP) is established. This model takes into account the effects of CO2 concentration distribution, oil composition and temperature changes to achieve accurate spatiotemporal characterization of miscibility in the reservoir. In addition, the distribution law of the phase and components front for the impure CO2 injection process was also investigated. The miscible volume factor and recovery efficiency were used as the basis for judging the minimum injection concentration limit of CO2. The simulation results of slim tube experiment indicate that the MMP and MNMP obtained are 16.74 MPa and 12.35 MPa, respectively. Furthermore, the error caused by the traditional slim tube experiment can be reduced by using the CO2 produced fraction. It is found that CO2 injection concentration and reservoir temperature are the main factors affecting miscibility, but injection rate has less effect. Moreover, the fast migration of CH4 front leads to the shrinkage of miscible/near-miscible zone, which is not conducive to CO2 flooding. Finally, the CO2 injection concentration of non-breakthrough stage, breakthrough stage and large-scale breakthrough stage was determined to be 78.3%, 61.5% and 29.2%, respectively. This work provides strong evidence for the treatment of associated gas reinjection, which is beneficial for optimization of carbon capture, EOR-utilization and storage (CCUS-EOR) projects.