optimizing the access and transmission of massive devices in the uplink wireless network is crucial for the sixth-generation mobile communication system (6G). In this paper, we present a novel optimization approach based on non-orthogonal multiple access (NOMA) which consist of a large number of Internet of Things (IoT) devices. To minimize the access latency of devices, we propose a joint optimization scheme including unmanned aerial vehicle (UAV) trajectory planning, device scheduling, and power control. For UAV trajectory planning, we discretize the space and propose the Minimum Set Cover (MSC) based algorithm to minimize the UAV hovering positions. For user scheduling, we recast it as a k-cut problem, build a directional interference graph to model interference between devices, and establish a viable scheduling scheme. Moreover, we optimize the power allocation by fixed-point equations. Finally, simulation results verify that the proposed scheme can accomplish massive device access and quick data collection.