Patent ID: 8260799

Claim:
A method, which is implemented by a hardware processer, for creating a pattern matching state machine, the method comprising: dividing a keyword in a predefined keyword set according to a preset rule, and obtaining a sub-keyword field as a result of the division; generating a state transition (goto) function according to the sub-keyword field, and generating a failure function of each state node according to the goto function; and generating a next-hop goto function a δ of each state node according to the goto function and the failure function; wherein generating the next-hop goto function δ of each state node according to the goto function and the failure function comprises: obtaining each state node in a state queue S consecutively according to the preset rule; after obtaining each state node, deleting the state node in the state queue S, and generating an output of the next-hop goto function δ corresponding to the state node according to the obtained state node and the sub-keyword field.