Taking a cylindrical worm drive mechanism as the research object,the minimizing the volume of worm gear as objective function,the limit of the worm gear tooth surface contact strength,worm stiffness,number of worm threads,worm gear module and worm diameter coefficient as constraint conditions,the mathematical model of optimization design is established. Then,the M file is compiled to optimally design the structure size based on the Matlab. Finally,the optimal structure size of worm and gear is solved,which make the worm gear volume be cut down to 75% of the conventional design and it is significant and meaningful to the design of mechanical structure.