In response to the challenges associated with the inefficiency and poor quality of 3D path planning for Unmanned Aerial Systems (UAS) operating in vast airspace, a novel two-layer path planning method is proposed based on a divide-and-conquer methodology. This method segregates the solution process into two distinct stages: heading planning and path planning, thereby ensuring the planning of both efficiency and path quality. Firstly, the path planning phase is formulated as a multi-objective optimization problem, taking into account the environmental constraints of the UAV mission and path safety. Subsequently, the multi-dimensional environmental data is transformed into a two-dimensional probabilistic map. An improved ant colony algorithm is proposed to efficiently generate high-quality sets of headings, facilitating the preliminary heading planning for UAVs. Then, the three-dimensional environment of the heading regions is extracted, and an improved Dung Beetle algorithm with multiple strategies is proposed to optimize the three-dimensional path in the secondary layer accurately. The efficacy and quality of the proposed path planning methodology are substantiated through comprehensive simulation analysis.