Magnesium alloys are lightweight structural materials with excellent machinability. However, further development is seriously limited by their low strength and poor formability. Therefore, further decreasing the surface residual stress of the frame by post-process treatment is a key issue, such as for reducing the subsequent deformation due to the residual stress, improving the machining accuracy and corrosion resistance of the magnesium alloy frame products, and extending the service life of the magnesium alloy frame products. Using AZ31B magnesium alloy as the experimental subject, and by exploring the effects of milling parameters on the surface quality of frame parts, this study shows that the surface residual compressive stress, hardness, and roughness of frame parts decreased with the increasing of the milling speed and increased as the depth of cut and the feed per tooth increased. Using cutting fluid in the milling process can decrease the surface residual stress and roughness of the frame parts but increase the surface hardness. In accordance with the experimental results and analysis, the main reason affecting the residual stress on the surface layer of frame components is the thermal elastoplastic problem caused by thermal mechanical coupling during the milling process, resulting in varying stress states on the workpiece’s surface. The primary contributors to hardness are the work-hardening effect induced by milling forces and the thermal-softening effect of milling temperatures, which either augment or diminish the workpiece’s surface hardness. Furthermore, the primary factor impacting surface roughness is the magnitude of cutting forces. Excessive cutting forces lead to the ploughing phenomenon or tool vibrations, thereby causing varying degrees of surface roughness on the workpiece. Meanwhile, the influence of stress-relief annealing or cryogenic treatment on surface residual stress and hardness after the milling of the frame parts was researched. It shows that within the selected milling parameters, both stress-relief annealing and cryogenic treatment can reduce the surface residual stress and homogenize the residual stress distribution of frame parts. Stress-relief annealing leads to a reduction in the hardness of the machined surface, and the hardness of the machined surface increases slightly under cryogenic treatment. The effects of the two post-processing methods on surface quality vary, and in practical production, a rational selection can be made according to the different processing requirements to achieve the optimal standards.