Owing to the integration of energy digitization and artificial intelligence technology, smart energy grids can realize the stable, efficient and clean operation of power systems. However, the emergence of cyber-physical attacks, such as dynamic load-altering attacks (DLAAs) has introduced great challenges to the security of smart energy grids. Thus, this study developed a novel cyber-physical collaborative security framework for DLAAs in smart energy grids. The proposed framework integrates attack prediction in the cyber layer with the detection and localization of attacks in the physical layer. First, a data-driven method was proposed to predict the DLAA sequence in the cyber layer. By designing a double radial basis function network, the influence of disturbances on attack prediction can be eliminated. Based on the prediction results, an unknown input observer-based detection and localization method was further developed for the physical layer. In addition, an adaptive threshold was designed to replace the traditional precomputed threshold and improve the detection performance of the DLAAs. Consequently, through the collaborative work of the cyber-physics layer, injected DLAAs were effectively detected and located. Compared with existing methodologies, the simulation results on IEEE 14-bus and 118- bus power systems verified the superiority of the proposed cyber-physical collaborative detection and localization against DLAAs.