Due to low-carbon transformation of heating sources in northern China, the combination of the solar heating system (SHS) and the air source heat pump (ASHP) has attracted widespread attention due to their significant low-carbon and energy-saving characteristics. Nevertheless, different outdoor meteorological parameters simultaneously affect both the SHS and the ASHP. The heat supply of the SHS is primarily influenced by solar radiation intensity, and the efficiency of the ASHP is mainly constrained by outdoor temperature. The dual uncertainty and volatility of the output capacities of these two heat sources pose significant challenges to their coordinated control. Previous research has primarily focused on traditional rule-based control (RBC) and feedback control, prioritizing the utilization of solar energy while employing ASHP to compensate for heating deficiencies. However, these methods ignore the variations in ASHP efficiency due to fluctuations in outdoor temperature, leading to low whole-system operating efficiency and limiting the flexibility and responsiveness of the control. In this paper, a model predictive control strategy of global optimal dispatch for a combined solar and ASHP (SASHP) heating system is proposed, which focuses on the flexibility and adaptability of dual heat source dispatch under different external conditions. A Temporal Convolutional Network (TCN) was used to establish a solar radiation intensity and load prediction model. A solar heat production prediction was realized by combining the mechanism model based on solar radiation intensity prediction; a two-step room temperature prediction model was established by introducing new input parameters in the load prediction. This strategy achieves globally optimal dynamic planning of the heat supply and duration of the SHS and ASHP systems by considering solar radiation, outdoor temperature, room temperature, and energy consumption, ensuring the efficient and stable operation of the system. Compared to RBC, experimental results indicated that under conditions of sufficient solar energy, the heating proportion of the SHS increased by 31.1 %, the average COP of the ASHP improved by 8.7 %, the energy-saving rate was 14.6 %, and the room temperature control was also more effective; whole-season simulation results showed an average energy-saving rate of 8.35 %.