Real-time intrusion detection system based on the von Neumann architecture struggle to balance low power consumption and high computing speed. In this work, a strategy for network intrusion detection system based on the WO3–x/WO3–x-Ag/WO3–x structured optoelectronic memristor overcoming the aforementioned issues is proposed and demonstrated. Through the modulation of electrical signals, the memristor successfully simulates a series of important synaptic functionalities including short-term/long-term synaptic plasticity.