In view of the requirement of a wide speed range of motor spindle motor, the built-in permanent magnet motor is selected to optimize the design, and the problems of high loss and low efficiency of the built-in permanent magnet synchronous motor are discussed and optimized. The motor optimization design was carried out for the four types of permanent magnet structures: non-segmented permanent magnet, two-segment permanent magnet, three-segment permanent magnet, and foursegment permanent magnet. The motor's finite element electromagnetic field simulation model was established, and the theoretical loss calculation was carried out for the motor structures with different segments of the permanent magnet. Through the coupling simulation analysis of electromagnetic and temperature field, the temperature rise and distribution of each component of the motor with four different segments of permanent magnets are obtained. Through theoretical analysis and prototype experiment verification, compared with the traditional built-in one-line motor, the built-in segmented fractional slot permanent magnet synchronous motor designed in this paper can reduce the machine loss to 43% of the original, and the overall performance of the prototype meets the requirements, the prototype design and test can provide a certain basis for the design of spindle motor.