[go: up one dir, main page]

CN103513971B - The execution system of finite state machine and the method for execution - Google Patents

The execution system of finite state machine and the method for execution Download PDF

Info

Publication number
CN103513971B
CN103513971B CN201210204651.3A CN201210204651A CN103513971B CN 103513971 B CN103513971 B CN 103513971B CN 201210204651 A CN201210204651 A CN 201210204651A CN 103513971 B CN103513971 B CN 103513971B
Authority
CN
China
Prior art keywords
state machine
state
upper strata
incoming event
machine
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201210204651.3A
Other languages
Chinese (zh)
Other versions
CN103513971A (en
Inventor
章国全
王登勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanning Fulian Fugui Precision Industrial Co Ltd
Original Assignee
Hongfujin Precision Industry Shenzhen Co Ltd
Hon Hai Precision Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hongfujin Precision Industry Shenzhen Co Ltd, Hon Hai Precision Industry Co Ltd filed Critical Hongfujin Precision Industry Shenzhen Co Ltd
Priority to CN201210204651.3A priority Critical patent/CN103513971B/en
Publication of CN103513971A publication Critical patent/CN103513971A/en
Application granted granted Critical
Publication of CN103513971B publication Critical patent/CN103513971B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Multi Processors (AREA)

Abstract

The execution system of a kind of finite state machine includes engine unit, memory element and performance element.Engine unit is used for receiving incoming event.Memory element is for storing current state and the state-transition table of finite state machine.Performance element is for obtaining the current state of finite state machine from memory element, and in the incoming event that provides according to engine unit and memory element, the state-transition table of storage obtains the NextState machine of the confidential transfer of current state and uses the NextState machine obtained to update the current state of finite state machine.Described state-transition table includes that N shell state machine, upper strata state machine include some underlying state machines repelled each other, and underlying state machines is to obtain by inheriting upper strata state machine, and underlying state machines is provided with the interface module entering its upper strata state machine inherited.Each state machine only one of which example in N shell state machine, only processes the incoming event with this example direct correlation.Present invention also offers a kind of execution method of finite state machine.

Description

The execution system of finite state machine and the method for execution
Technical field
The present invention relates to finite state machine, particularly to execution system and the method for execution of finite state machine.
Background technology
Finite state machine has limited state, generally comprises the transfer relationship between state and state.In the system development of finite state machine, the transfer between state sets corresponding conditional statement according to current state and current incoming event and realizes.So, when system includes substantial amounts of state, each state intersects in transfer process, influences each other, and causes system design to become increasingly complex so that system is difficult to maintenance and expansion.
Summary of the invention
In view of this, the invention provides a kind of execution system being easily maintained with Extended FSM and execution method.
The execution system of a kind of finite state machine, the execution system of described finite state machine includes: engine unit, is used for receiving incoming event, as the trigger event of finite state machine;Memory element, for storing current state and the state-transition table of finite state machine;Performance element, for obtaining the current state of finite state machine from memory element, and according to engine unit provide incoming event and memory element in storage state-transition table obtain the confidential transfer of current state NextState machine and according to obtain NextState machine update finite state machine current state;nullDescribed state-transition table includes N shell state machine,Upper strata state machine includes some underlying state machines repelled each other,Several underlying state machines belonging to same upper strata state machine are to obtain by inheriting this upper strata state machine,Underlying state machines is provided with the interface module entering its upper strata state machine inherited,Make underlying state machines can post messages to its upper strata state machine inherited,Each state machine only one of which example in N shell state machine,Only process the incoming event with this example direct correlation,State machine layer in N shell receive there is no, with it, the incoming event directly contacted time,By interface module, this incoming event is sent to the state machine process on upper strata,State machine and this incoming event also not direct correlation such as upper strata,Then this incoming event is sent to the state machine of more top by the state machine on upper strata by its interface module,Until being sent to process the state machine of this incoming event.
A kind of execution method of finite state machine, including step: receive incoming event, as the trigger event of finite state machine;nullObtain the current state of finite state machine,And according to engine unit provide incoming event and a state-transition table,Obtain the NextState machine of the confidential transfer of current state,Described state-transition table includes N shell state machine,Upper strata state machine includes some underlying state machines repelled each other,Several underlying state machines belonging to same upper strata state machine are to obtain by inheriting this upper strata state machine,Underlying state machines is provided with the interface module entering its upper strata state machine inherited,Make underlying state machines can post messages to its upper strata state machine inherited,Each state machine only one of which example in N shell state machine,Only process the incoming event with this example direct correlation,State machine layer in N shell receive there is no, with it, the incoming event directly contacted time,By interface module, this incoming event is sent to the state machine process on upper strata,State machine and this incoming event also not direct correlation such as upper strata,Then this incoming event is sent to the state machine of more top by the state machine on upper strata by its interface module,Until being sent to process the state machine of this incoming event;The current state of finite state machine is updated according to the NextState machine obtained.
Execution system and the execution method of above-mentioned finite state machine only need to delete this state machine when deleting certain state machine, have no effect on the setting of other state machines, and when setting up new state machine, only need to set up the inheritance between this new state machine and this new state machine and corresponding upper strata state machine, it is easy to maintenance and expansion.
Accompanying drawing explanation
Fig. 1 is the module map of the execution system of finite state machine in an embodiment.
Fig. 2 is the schematic diagram of the state-transition table in Fig. 1.
Fig. 3 is the flow chart of the execution method of finite state machine in an embodiment.
Main element symbol description
The execution system of finite state machine 10
Engine unit 20
Memory element 30
Performance element 40
State-transition table 50
The execution method of finite state machine Step S610-S630
Following detailed description of the invention will further illustrate the present invention in conjunction with above-mentioned accompanying drawing.
Detailed description of the invention
Refer to Fig. 1 and Fig. 2, be the module map of the execution system 10 of finite state machine in an embodiment.The execution system 10 of finite state machine includes engine unit 20, memory element 30 and performance element 40.
Engine unit 20 is used for receiving incoming event, as the trigger event of finite state machine.
Memory element 30 is for storing current state and the state-transition table 50 of finite state machine.State-transition table 50 includes N shell state machine, N shell state machine includes 1 layer 1 state machine, this layer 1 state machine includes several layer 2 state machines repelled each other, several layer 3 state machines repelled each other are included under each layer 2 state machine, the like, until several layer N-1 state machines repelled each other, under each layer of N-1 state machine, include several layer N-state machines repelled each other.Wherein, several underlying state machines belonging to same upper strata state machine are to obtain by inheriting this upper strata state machine.Underlying state machines is provided with the interface module entering its upper strata state machine inherited so that underlying state machines can post messages to its upper strata state machine inherited.Each state machine in N shell state machine carries out reservation process for the incoming event received according to engine unit 20.Each layer of N-state machine only one of which example, only process the incoming event with this example direct correlation, layer N-state machine receive there is no, with it, the incoming event directly contacted time, by interface module, this incoming event is sent to the state machine process on upper strata, state machine and this incoming event also not direct correlation such as upper strata, then this incoming event is sent to the state machine of more top by the state machine on upper strata by its interface module, until being sent to process the state machine of this incoming event, i.e. with the state machine of this incoming event direct correlation.
Performance element 40 is for obtaining the current state of finite state machine from memory element 30, and in the incoming event that provides according to engine unit 20 and memory element 30, the state-transition table 50 of storage obtains the NextState machine of the confidential transfer of current state and updates the current state of finite state machine according to the NextState machine obtained.
Refer to Fig. 3, be the flow chart of the execution method of finite state machine in an embodiment, comprise the following steps:
Engine unit 20 receives incoming event, as the trigger event (S610) of finite state machine;
Performance element 40 obtains the current state of finite state machine, and the incoming event that provides according to engine unit 20 and a state-transition table, obtains the NextState machine (S620) of the confidential transfer of current state;
Above-mentioned state-transition table 50 includes N shell state machine, N shell state machine includes 1 layer 1 state machine, this layer 1 state machine includes several layer 2 state machines repelled each other, several layer 3 state machines repelled each other are included under each layer 2 state machine, the like, until several layer N-1 state machines repelled each other, under each layer of N-1 state machine, include several layer N-state machines repelled each other.Wherein, several underlying state machines belonging to same upper strata state machine are to obtain by inheriting this upper strata state machine.Underlying state machines is provided with the interface module entering its upper strata state machine inherited so that underlying state machines can post messages to its upper strata state machine inherited.Each state machine in N shell state machine carries out reservation process for the incoming event received according to engine unit 20.Each layer of N-state machine only one of which example, only process the incoming event with this example direct correlation, layer N-state machine receive there is no, with it, the incoming event directly contacted time, by interface module, this incoming event is sent to the state machine process on upper strata, state machine and this incoming event also not direct correlation such as upper strata, then this incoming event is sent to the state machine of more top by the state machine on upper strata by its interface module, until being sent to process the state machine of this incoming event, i.e. with the state machine of this incoming event direct correlation.
Performance element 40 updates the current state (S630) of finite state machine according to the NextState machine obtained.
It is inheritance between the underlying state machines in state-transition table and upper strata state machine in the execution system of above-mentioned finite state machine and execution method, each state machine only processes the event of direct correlation therewith, and underlying state machines sends the incoming event of the most non-immediate association received to upper strata state machine by interface module and processes.So, execution system and the execution method of above-mentioned finite state machine only need to delete this state machine when deleting certain state machine, have no effect on the setting of other state machines, and when setting up new state machine, only need to set up the inheritance between this new state machine and this new state machine and corresponding upper strata state machine, it is easy to maintenance and expansion.

Claims (2)

1. an execution system for finite state machine, the execution system of described finite state machine includes:
Engine unit, is used for receiving incoming event, and described incoming event is as the trigger event of finite state machine;
Memory element, for storing current state and the state-transition table of finite state machine;
Performance element, for obtaining the current state of finite state machine from memory element, and according to engine unit provide incoming event and memory element in storage state-transition table obtain the confidential transfer of current state NextState machine and according to obtain NextState machine update finite state machine current state;It is characterized in that:
nullDescribed state-transition table includes N shell state machine,Upper strata state machine includes some underlying state machines repelled each other,Several underlying state machines belonging to same upper strata state machine are to obtain by inheriting this upper strata state machine,Underlying state machines is provided with the interface module entering its upper strata state machine inherited,Make underlying state machines can post messages to its upper strata state machine inherited,Each state machine only one of which example in N shell state machine,Only process the incoming event with this example direct correlation,State machine layer in N shell receive there is no, with it, the incoming event directly contacted time,By interface module, this incoming event is sent to the state machine process on upper strata,State machine and this incoming event also not direct correlation such as upper strata,Then this incoming event is sent to the state machine of more top by the state machine on upper strata by its interface module,Until being sent to process the state machine of this incoming event.
2. an execution method for finite state machine, including step:
Receive incoming event, as the trigger event of finite state machine;
nullObtain the current state of finite state machine,And according to engine unit provide incoming event and a state-transition table,Obtain the NextState machine of the confidential transfer of current state,Described state-transition table includes N shell state machine,Upper strata state machine includes some underlying state machines repelled each other,Several underlying state machines belonging to same upper strata state machine are to obtain by inheriting this upper strata state machine,Underlying state machines is provided with the interface module entering its upper strata state machine inherited,Make underlying state machines can post messages to its upper strata state machine inherited,Each state machine only one of which example in N shell state machine,Only process the incoming event with this example direct correlation,State machine layer in N shell receive there is no, with it, the incoming event directly contacted time,By interface module, this incoming event is sent to the state machine process on upper strata,State machine and this incoming event also not direct correlation such as upper strata,Then this incoming event is sent to the state machine of more top by the state machine on upper strata by its interface module,Until being sent to process the state machine of this incoming event;
The current state of finite state machine is updated according to the NextState machine obtained.
CN201210204651.3A 2012-06-20 2012-06-20 The execution system of finite state machine and the method for execution Expired - Fee Related CN103513971B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210204651.3A CN103513971B (en) 2012-06-20 2012-06-20 The execution system of finite state machine and the method for execution

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210204651.3A CN103513971B (en) 2012-06-20 2012-06-20 The execution system of finite state machine and the method for execution

Publications (2)

Publication Number Publication Date
CN103513971A CN103513971A (en) 2014-01-15
CN103513971B true CN103513971B (en) 2016-08-03

Family

ID=49896762

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210204651.3A Expired - Fee Related CN103513971B (en) 2012-06-20 2012-06-20 The execution system of finite state machine and the method for execution

Country Status (1)

Country Link
CN (1) CN103513971B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109426239B (en) * 2017-08-31 2020-05-08 株洲中车时代电气股份有限公司 Locomotive sequence control system and method
CN114168094B (en) * 2021-11-24 2024-07-02 深圳康佳电子科技有限公司 Miracast message processing method, device and equipment based on inheritable state machine

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102103497A (en) * 2009-12-18 2011-06-22 阿尔卡特朗讯 Finite state machine actuating device and method, and method for establishing and using finite state machine

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW535390B (en) * 2001-08-03 2003-06-01 Wistron Corp Control method and apparatus of IP phone

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102103497A (en) * 2009-12-18 2011-06-22 阿尔卡特朗讯 Finite state machine actuating device and method, and method for establishing and using finite state machine

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《基于层次式有限状态机的织造控制任务设计》;刘刚等;《纺织学报》;20080831;第29卷(第8期);第105-106页 *
《基于有限状态机理论的导航软件设计与实现》;黄杨明;《中国优秀硕士学位论文全文数据库信息科技辑》;20071115;第9-27页 *

Also Published As

Publication number Publication date
CN103513971A (en) 2014-01-15

Similar Documents

Publication Publication Date Title
CN106454720B (en) Method for managing geo-fence and electronic device thereof
CN103176824B (en) A kind of method and device of system upgrade
CN103402194B (en) A kind of method recommending software when software upgrading and realize the system of the method
CN108242837B (en) Electronic device and method of controlling charging of electronic device
CN105930207B (en) Electronic device and application control method thereof
CN102929419B (en) A kind of automatic calibrating method, system and automatic calibration touch panel device of touch-screen
CN105159122A (en) Smart home control system and control method
CN105760199B (en) A kind of application resource loading method and its equipment
CN103324492A (en) Method for updating firmware of BIOS (basic input/output system) and electronic device
JP2011028752A5 (en)
CN103034498A (en) Method and system for organizing application programs
CN103927338A (en) Log information storage processing method and log information storage processing device
US20180285371A1 (en) Method and apparatus for automatically discovering gas station poi, storage medium and device
CN105045603A (en) Method and device for constructing finite-state machine model framework and electronic device
CN102223252A (en) Internet of Things (IoT) terminal failure processing method, IoT platform and IoT system
US20170005966A1 (en) Information sending method and information sending apparatus
RU2017104241A (en) METHOD OF CONNECTING TO THE CLUSTER OF ELECTRONIC DEVICES, CONNECTING THROUGH A WIRELESS NETWORK, RELATED TO THE SYSTEM AND ELECTRONIC DEVICE, Mentioned By
CN103744692A (en) Method and system for determining size of mobile terminal storage space occupied by application software
CN102831227A (en) Method and system for browsing information flow of social application
US20170005965A1 (en) Information sending method and information sending apparatus
CN103513971B (en) The execution system of finite state machine and the method for execution
CN106156097A (en) A kind of processing method and processing device of browser input record
CN104182532A (en) Terminal file cleaning method and device and terminal
CN104281462A (en) Firmware upgrade configuration saving system and method
CN106031296B (en) Message processing method and electronic device supporting same

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20180307

Address after: The Guangxi Zhuang Autonomous Region Nanning hi tech Zone headquarters Road No. 18, China ASEAN enterprise headquarters base three 5# workshop

Patentee after: NANNING FUGUI PRECISION INDUSTRIAL CO., LTD.

Address before: 518109 Guangdong city of Shenzhen province Baoan District Longhua Town Industrial Zone tabulaeformis tenth East Ring Road No. 2 two

Co-patentee before: Hon Hai Precision Industry Co., Ltd.

Patentee before: Hongfujin Precise Industry (Shenzhen) Co., Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160803

Termination date: 20180620