The problems existed in production of spiral welded pipes are analyzed. According to its production principle and process，a steel pipes automatic optimization cutting system which combines software and hardware is designed. Two sets of PLC respectively collect encoder pulses in different production stations，and exchange production data through wireless Ethernet in real-time. The flying shear optimization cutting algorithm is proposed，which combines with various formulas and cutting rules used in the production process，and the corresponding control programs are written. After the on;site commissioning，it realizes spiral welded pipes automatic optimization cutting successfully，and now it has been applied in the production field. The applications show that the system solves the existing problems，improves the automation level of production line，and avoids waste of production raw materials.