An Automata Based Intrusion Detection Method for Internet of Things