Abstract:Among all kinds of civil spring locks in this country there is a problem of openning many locks with one and the same key simply because of the present level of production. As a result, it influences the competition of market and safety for use.The method offered in this paper can improve the function of hardware with the help of optimal design of software. An optimization program of dividing spring locks into groups and traps is presented. This optimization program has already been applied to production.