状态机简介:
状态机是有限状态自动机的缩写,是从现实事物的运行规则中抽象出来的数学模型[规则的抽象]
[En]
State machine is the abbreviation of finite state automata, which is a mathematical model abstracted from the running rules of real things [Abstraction of rules]
有限状态机一般都有以下特点:
(1)可以用状态来描述事物,并且任一时刻,事物总是处于一种状态;
(2)事物拥有的状态总数是有限的;
(3)通过触发事物的某些行为,可以导致事物从一种状态过渡到另一种状态;
(4)事物状态变化是有规则的,A状态可以变换到B,B可以变换到C,A却不一定能变换到C;
(5)同一种行为,可以将事物从多种状态变成同种状态,但是不能从同种状态变成多种状态。
状态机是一种通过将事物抽象为若干状态来描述客观世界的方法,然后所有事件和规则都会使事物在这些状态中游动。最后,它制造了一些东西\
[En]
State machine is a way to describe the objective world by abstracting things into several states, and then all events and rules cause things to swim in these states. Finally, it makes things
许多通信协议的开发必须使用状态机;健壮的状态机可以使您的程序不会突然进入程序的不可预测的分支,无论发生什么紧急情况。
[En]
The development of many communication protocols must use state machine; A robust state machine can make your program not suddenly enter an unpredictable branch of the program, no matter what kind of emergencies occur.