Natural disasters,accident disasters,public health events and social security events are the main types of emergency,which are frequent in China in recent years,so it is urgent to build an all-dimensional and stereoscopic emergency communication support system.To overcome the communication interruption caused by the damage of the ground infrastructure after the disaster,the relay UAVs can be used to realize the interrupted transmission.Aiming at the problem that D2D communication cannot obtain accurate two-side information in the complex environment after the disaster,this paper studies the UAV-assisted relay selection problem of D2D users based on the uncertain preference ordinal from the perspective of matching theory.First,by considering the real-time characteristics of the network,the optimization problem is abstracted as the maximization of the average transmission success rate of D2D users,and the optimization problem is solved by using the stable matching in dynamic scenarios.Second,according to the transmission rate within the predicted flight ranges,the uncertain preference ordinals of both the D2D pairs and the UAVs are obtained.Further the uncertain preference ordinal is comprehensively evaluated to generate corresponding preference lists,and a many-to-one two-side matching model is established on this basis.Third,to avoid the influence of peer effects among the D2D user clusters that reuse the same UAV relay,a two-side exchange-stable matching relay selection algorithm is proposed to ensure the stability of the matching.Finally,simulation results demonstrate that,considering the uncertainty of the post-disaster emergency scenario,the proposed algorithm can effectively improve the transmission success rate of D2D users compared with existing algorithms.