The invention relates to the technical field of optical manufacturing and in particular to a continuous zoom lens with a linear motor and a self-locking function. The lens comprises a movable lens, agrid ruler, a reading head, a control circuit, a sliding block, a sliding rail, a linear motor and a self-locking structure, the linear motor comprises a stator and a rotor, the stator comprises a first magnet fixing plate and a second magnet fixing plate, a magnet array is fixedly arranged on the first magnet fixing plate and the second magnet fixing plate, a gap is formed between the first magnet fixing plate and the second magnet fixing plate, an opening is formed in one side of the stator, and one side of the rotor extends out of the opening; the self-locking structure comprises a lockingmotor, a rotating shaft, a magnet and a locking block, magnetic conductive sheets are arranged on the two sides of the locking block in parallel, and the rotating shaft is provided with the magnet. The grating ruler and the reading head are adopted, the position information of the moving lens is obtained by reading the position information of the grating ruler, the control circuit controls the operation state of the linear motor according to the position information, and therefore closed-loop control over vertical movement of the moving lens is achieved.