Diagenesis controls the formation, evolution, and distribution of deep-buried sandstone reservoirs in sedimentary basins. The essence of diagenesis is the transformation of substances between different phases (solid, gas and liquid phases) and the migration of materials transported by formation water. Fluids transport in deep-buried formations in sedimentary basins is generally slow, which lead the reaction system is in a near-equilibrium-to-equilibrium state. In this context, thermodynamics can be employed to calculate the solubility and characterize the occurrences of various minerals in different states, which can help reveal the genetic mechanism of secondary pores in the deep-buried rocks of sedimentary basins. In this study, we investigate the types and contents of particles in the aqueous solutions in the H2O-CO2-CaCO3-Albite-SiO2 system under different temperature and pressure conditions. Specifically, the Gibbs free energy of formation of minerals and gases are calculated based on the constant-pressure specific heat model; the apparent standard molal Gibbs free energy of different ions in fluids are computed using the HKF model; the equilibrium constants of different reactions are calculated according to the Gibbs function; the contents of different types of particles are computed based on the charge balance principle in the aqueous solution. The results show that the contents of various particles in the aqueous solution are mainly controlled by temperature and CO2 partial pressure, while they are rarely impacted by the total pressure. Different ions are demonstrated to have different responses to temperature changes. Specifically, types of Ca- and C-containing particles in the aqueous solution are closely related to temperature, while those of Al- and Si-rich particles are rarely changed as temperature varies. The CO2-rich fluid migration environment that results from hydrocarbon generation can be regarded as an open system for the dissolution of calcite, while it is a closed-to-semi-closed system for the dissolution of quartz and feldspar. The content of secondary pores is demonstrated to be determined by the solubility of various particles in the aqueous solution as well as the rate and duration of fluid migration, while the distribution patterns and ranges of secondary pores are controlled by responses of various particles in the solution to temperature and pressure changes.