A cascaded pseudo-potential lattice Boltzmann model and refilling algorithms for moving boundary treatment were used to simulate the large density ratio cavitating flow in a two-dimensional nozzle with the periodic motion of the needle valve. The relationships between density variation at the cavitation zone, the evolution of force acting on the lower boundary of the sack wall region, and the surface of the needle valve with time under different needle valve motion frequencies were obtained. The results indicate that the inception and evolution of cavitation mainly exist in the vicinity of the lower boundary of the sack wall region. The density at cavitation decreases by approximately three orders of magnitude, while the force on the lower boundary of the sack wall region decreases by about one order of magnitude. Since cavitation does not exist in the vicinity of the needle valve, the forces are mainly influenced by the periodic motion of the needle valve and do not change significantly. Changes in the frequency of needle valve motion affect the time taken for cavitation evolution to reach a relatively steady state but do not significantly affect the forces acting on the different components.