The efficiency of pattern matching algorithm used in detection engine decides the performance of intrusion detection system. This paper improves the data structure of SBOM Algorithm, which is well-known keyword matching algorithm, by adding or removing keywords dynamically. The results of experiments on 1999 DARPA intrusion Detection Evaluation Data Sets indicate that the implemented NIDS(Network Intrusion Detection System) is comparatively excellent for large keyword sets.