Cu/HfO<sub>x</sub>/Pt and Cu/HfO<sub>x</sub>-ZnO/Pt RRAM devices were prepared by magnetron sputtering. The results showed that the Cu/HfO<sub>x</sub>/Pt device had stable bipolar resistive switching characteristics, good retention up to 10<sup>4</sup>s and a switching ratio greater than 10<sup>3</sup>. The current conduction mechanism of HfO<sub>x</sub> device was ohmic conduction at low resistance, while SCLC mechanism dominates at high resistance, and the conductive filament was composed of oxygen vacancies. Due to the low content and random distribution of oxygen defects in HfO<sub>x</sub> film, the endurance and uniformity of the device were poor. For HfO<sub>x</sub>-ZnO device, compared with HfO<sub>x</sub> device, HfO<sub>x</sub>-ZnO device exhibited lower operating voltage and better uniformity and stability. The main reason was that ZnO materials have smaller oxygen vacancies formation energy, which can produce more oxygen defects under electric field to participate in the resistive switching behavior of the device, thereby reducing the operating voltage and improving the uniformity of the device. In addition, due to the existence of the interface between HfO<sub>x</sub> and ZnO film, the random distribution of oxygen defects was inhibited, that is, the random fracture and formation of conductive filaments were inhibited, which was beneficial to improve the uniformity of the device. In addition, the resistive switching behavior of Cu/HfO<sub>x</sub>/Pt and Cu/HfO<sub>x</sub>-ZnO/Pt RRAM devices under different intensities of 255 nm ultraviolet illumination was studied. For Cu/HfO<sub>x</sub>/Pt device, the light of 255 nm wavelength showed little effect on its resistive switching characteristics. For the Cu/HfO<sub>x</sub>-ZnO/Pt RRAM device, the operating voltage and stability of the device can be improved with the increase of light intensity. Although the switching ratio of the device decreased with the increase of light intensity, the device can exhibit multiple resistance states by adjusting different light intensities to achieve multi-level storage. Finally, through the analysis of the I-V curves of the devices, it was found that the two types of devices showed similar resistive switching mechanisms under the illumination of light or no light, which can be explained by the resistive switching mechanism of oxygen vacancy conductive filaments. Therefore, a physical model based on the oxygen vacancy conductive filament was established to explain the resistive switching behavior of the device in this paper.