Cloud-based satellite and terrestrial spectrum shared networks (CB-STSSN) combines the triple advantages of efficient and flexible network management of heterogeneous cloud access (H-CRAN), vast coverage of satellite networks, and good communication quality of terrestrial networks. Thanks to the complementary coverage characteristics, anytime and anywhere high-speed communications can be achieved to meet the various needs of users. The scarcity of spectrum resources is a common problem in both satellite and terrestrial networks. In order to improve resource utilization, the spectrum is shared not only within each component but also between satellite beams and terrestrial cells, which introduces inter-component interferences. To this end, this paper first proposes an analytical framework which considers the inter-component interferences induced by spectrum sharing (SS). An intelligent SS scheme based on radio map (RM) consisting of LSTM-based beam prediction (BP), transfer learning-based spectrum prediction (SP) and joint non-preemptive priority and preemptive priority (J-NPAP)-based proportional fair spectrum allocation is than proposed. The simulation result shows that the spectrum utilization rate of CB-STSSN is improved and user blocking rate and waiting probability are decreased by the proposed scheme.