The invention discloses a safe moving mechanism based on a paint spraying device. The mechanism includes a base, a rotating mechanism is fixedly mounted on the middle of the base, horizontal moving mechanisms are symmetrically arranged on two sides of the rotating mechanism, the rotating mechanism includes a first mounting frame, a rotating working table, a clamping assembly, a rotating main shaft, and a first motor, and the horizontal moving mechanism includes a second mounting frame, a fixing seat, a moving seat, a sliding rail, a guide wheel, a transmission belt, and a second motor. According to the safe moving mechanism, the first motor drives the rotating main shaft to rotate, the rotating main shaft drives the rotating working table to rotate, so that pipe-shaped work pieces in the clamping assembly rotate to the direction perpendicular to the horizontal moving mechanism to carry out spraying operation, the work pieces are taken out through the rotating working table after spraying is finished, the automatic feeding and discharging of the work pieces can be achieved during spraying, and the efficiency of work piece spraying is improved.