This article proposes to improve the charge carrier transport efficiency in perovskite solar cells (PSCs) by adjusting the pore size of each mesoporous layer, so as to improve the performance of the device. The two-dimensional modeling of PSCs is carried out to clarify the relationship between the pore size of the mesoporous layer and the performance of PSCs. The simulation results show that the control of the pore size of the mesoporous layer can help to form a large potential difference and a deep potential well in the PSC and then improve the carrier transport in the PSC and the carrier collection in the PSC. When the pore size is 20 nm, the effect is the best, and the PSC performance is the best. This study provides theoretical and technical support for the research of mesoporous PSCs and promotes the basic research and commercialization of PSCs, which has important scientific significance and economic value.