As a thin-walled complex structure, the manufacturing of Al-based diesel engine diaphragms involves casting and heat treatment. Residual stress is introduced during the uneven temperature field in casting and heat treatment, as well as the plastic deformation and cutting heat during mechanical processing. This research investigates the evolution and accumulation models of residual stress in casting and heat treatment for Al-based diesel engine diaphragms using ProCAST and ABAQUS software, combining with the experimental tests. To mitigate residual stress, the optimal parameter combination for casting temperature, knockout temperature, and mold preheating temperature in casting process is explored. The results indicate that the knockout temperature has the most significant influence on casting residual stress, and mold preheating is beneficial for reducing residual stress. Despite improvements, some internal stress concentration areas persist on the knockout casting surface. Furthermore, T6 heat treatment proves to be effective in eliminating more than 50% of the residual stress.