In order to improve the performance of central processing unit (CPU) and graphics processing unit (GPU) in detecting network intrusion, this paper proposes a cpu/gpu hybrid pattern matching algorithm (LHPMA) with packet payload length constraints. Based on the analysis of cpu/gpu hybrid pattern matching algorithm (HPMA), a length constrained separation algorithm (LBSA) is designed to classify incoming packets in advance. The pre filter buffer in the CPU is used to quickly pre filter long packets, and the short packets are directly allocated to the GPU for full pattern matching in combination with the full match buffer. By reducing the diversity of payload length, the performance of cpu/gpu cooperative detection of network intrusion is improved. The experimental results show that lhpma enhances the processing performance of HPMA, gives full play to the advantage of GPU parallel processing shorter packets, and lhpma improves the throughput of network intrusion detection.