To further enhance the performance of the drive unit motor, a novel three-segment non-uniform Halbach array magnetic pole structure is proposed, which is applied to an external rotor permanent magnet motor with magnetic pole optimization. First, the overall motor design is carried out according to the requirements, determining the fundamental parameters of the motor. Then, four common magnetic pole structures—conventional arc-shaped, three-segment, Halbach array, and three-segment non-uniform Halbach array—are analyzed. A finite element analysis model of the motor is established for electromagnetic analysis, comparing the air-gap flux density, torque, and torque ripple of the four magnetic pole structures. Finally, optimized parameters for the stator and rotor tooth shapes are determined, and an optimization model is established. The NSGA-II algorithm is employed to optimize the stator and rotor tooth shapes. After optimization, the motor maintains its torque output while reducing torque ripple by 50%, effectively improving its performance.