The invention relates to a rack-and-segment type reciprocating pump limited by a cam, which is mainly composed of a frame, an input shaft, a fan, a rack assembly, a cam, a limit frame, a guide rail, a piston and a liquid cylinder. Among them, the input shaft is installed on the frame through the bearing, the gear fan is installed on the input shaft, the gear fan meshes with the rack assembly, one end of the rack assembly is connected with the piston rod, and the other end is connected with the limit frame, and the cam is placed in the limit position. in the box. The gear teeth of the gear sector are composed of cylindrical gears and elliptical gears with variable transmission ratios, and the corresponding circumferential angle of the part with gear teeth is less than 180°; near the far angle of repose of the cam, there is a contour line matched with the limit frame . When the mechanism is working, the piston is driven to reciprocate through the alternate meshing between the gear fan and the upper and lower racks, and the smooth and stable reversing of the mechanism is ensured through the cooperation of the cam and the limit frame. The invention has the advantages of simple structure, precise and stable commutation, high system efficiency, and small fluctuation of pump pressure and pump displacement.