A dung collecting box sliding mechanism of a dung cleaning vehicle in a cattle farm is composed of a rack, an elevator, a dung collecting box, a rear limiting block, a swing arm, a front limiting block, a lifting oil cylinder, a lower sliding block and an upper sliding block. The lifting oil cylinder is located in the middle of the front end of the excrement collecting box, the upper end of the lifting oil cylinder is hinged to the excrement collecting box, the lower end of the lifting oil cylinder is hinged to the machine frame, every two upper sliding blocks and every two lower sliding blocks form a group, the upper sliding blocks and the lower sliding blocks are welded to the front ends of the excrement collecting box and the machine frame in a staggered mode, and the two swing arms are symmetrically located on the rear portion of the excrement collecting box. The upper ends of the swing arms are hinged to the excrement collecting box, the lower ends of the swing arms are hinged to the two front limiting stoppers, the two front limiting stoppers are welded to the rack, and the two rear limiting stoppers are located at the rear ends of the swing arms, correspond to the swing arms respectively and are welded to the rack at a certain distance from the swing arms. During work, the lifting oil cylinder, the swing arm, the upper sliding block, the lower sliding block, the front limiting stopper and the rear limiting stopper work together, the excrement collecting box slides downwards and backwards, the front end of the excrement collecting box is lifted, and excrement is dumped.