Through the mathematical analysis of the elliptic contour cavity on the cylindrical surface, the correlation between the coordinate parameters was obtained. The manual macro program was programmed with variables, and the VERICUT software was used to simulate the production conditions to verify the simulation processing of the macro program, and the machining effect was good. In the processing of similar curve contour and its cavity structure, the relevant parameters of the curve contour can be analyzed and constructed, and the processing method of four-axis macro program can be adopted to give full play to the programming advantage of macro program effectively and improve the production effect.