Public bicycle systems (PBSs) serve as the ‘last mile’ of public transportation for urban residents, yet the problem of the difficulty in borrowing and returning bicycles during peak hours remains a major bottleneck restricting the intelligent and efficient operation of public bicycles. Previous studies have proposed reasonable models and efficient algorithms for optimizing public bicycle scheduling, but there is still a lack of consideration for actual road network distances between stations and the temporal characteristics of demand at rental points in the model construction process. Therefore, this paper aims to construct a public bicycle dispatch framework based on the spatiotemporal characteristics of borrowing and returning demands. Firstly, the spatiotemporal distribution characteristics of borrowing and returning demands for public bicycles are explored, the origin–destination (OD) correlation coefficients are defined, and the intensity of connections between rental point areas is analyzed. Secondly, based on the temporal characteristics of rental point demands, a random forest prediction model is constructed with weather factors, time characteristics, and rental point locations as feature variables, and station bicycle-borrowing and -returning demands as the target variable. Finally, bicycle dispatch regions are delineated based on actual path distances between stations and OD correlation coefficients, and a public bicycle regional dispatch optimization method is established. Taking the PBS in Ningbo City as an example, the balancing optimization framework proposed in this paper is validated. The results show that the regional dispatch optimization method proposed in this paper can achieve optimized dispatch of public bicycles during peak hours. Additionally, compared with the Taboo search algorithm (TSA), the genetic algorithm (GA) exhibits a 11.1% reduction in rebalancing time and a 40.4% reduction in trip cost.