Five-stroke input algorithm optimization based on Petri net