Nothing Special   »   [go: up one dir, main page]

CN113064674A - Method and device for expanding state machine logic, storage medium and electronic device - Google Patents

Method and device for expanding state machine logic, storage medium and electronic device Download PDF

Info

Publication number
CN113064674A
CN113064674A CN202010001955.4A CN202010001955A CN113064674A CN 113064674 A CN113064674 A CN 113064674A CN 202010001955 A CN202010001955 A CN 202010001955A CN 113064674 A CN113064674 A CN 113064674A
Authority
CN
China
Prior art keywords
state machine
state
logic
machine logic
configuration file
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.)
Granted
Application number
CN202010001955.4A
Other languages
Chinese (zh)
Other versions
CN113064674B (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.)
Zhuhai Youte Enterprise Management Co.,Ltd.
Original Assignee
Guangdong Youteyun Technology 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 Guangdong Youteyun Technology Co ltd filed Critical Guangdong Youteyun Technology Co ltd
Priority to CN202010001955.4A priority Critical patent/CN113064674B/en
Publication of CN113064674A publication Critical patent/CN113064674A/en
Application granted granted Critical
Publication of CN113064674B publication Critical patent/CN113064674B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4498Finite state machines

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to a method, a device, a storage medium and an electronic device for expanding state machine logic. The method comprises the following steps: acquiring a state machine logic adjustment description file based on a state machine logic task to be expanded; acquiring a state machine configuration file of a state machine; generating a current set of execution logic for the state machine based on the state machine logic adjustment profile and a state machine configuration file for the state machine. The method and the device for expanding the state machine logic provided by the embodiment of the invention can be used for performing operations such as addition, deletion, modification and the like on the state machine logic of the state machine of the equipment only by updating the current execution logic set of the state machine without upgrading firmware, can be performed in the running process of the state machine, and can flexibly change the state machine logic.

Description

Method and device for expanding state machine logic, storage medium and electronic device
Technical Field
The invention belongs to the technical field of computer control, and particularly relates to a method and a device for expanding state machine logic, a storage medium and an electronic device.
Background
The state machine is a control center which is composed of a state register and a combinational logic circuit, can carry out state transition according to a preset state according to a control signal, coordinates the action of the related signal and completes a specific operation. The state machine is widely applied to hardware control circuit design, is also a common processing method on software, namely an FMM (fast moving Messaging machine) -finite message machine, decomposes complex control logic into finite stable states, judges an event on each state, changes continuous processing into discrete digital processing, and accords with the working characteristics of a computer. Meanwhile, since the finite state machine has a finite number of states, it can be implemented in practical engineering.
In the prior art, the logic of the state machine is determined in advance, i.e. is clearly determined when the product is defined. During operation, the logic of the state machine is completely executed according to the preset logic, and the logic of the state machine cannot be randomly or flexibly changed in the period.
Therefore, when an external event, action and/or state needs to be added to the logic of the state machine, the state machine needs to be reset and the program needs to be rewritten, which causes inconvenience to the setting and use of the state machine.
Disclosure of Invention
In order to solve the technical problem that the state machine logic cannot be changed, the invention provides a method, a device, a storage medium and an electronic device for expanding the state machine logic.
According to a first aspect of the invention there is provided a method of extending state machine logic, the method comprising:
acquiring a state machine logic adjustment description file based on a state machine logic task to be expanded;
acquiring a state machine configuration file of a state machine;
generating a current set of execution logic for the state machine based on the state machine logic adjustment profile and a state machine configuration file for the state machine.
Further, the method further comprises: updating a state machine configuration file for the state machine based on the generated current set of execution logic for the state machine.
Further, the state machine logic task to be expanded includes at least one piece of state machine logic information to be expanded, and the at least one piece of state machine logic information to be expanded includes the state machine logic to be expanded.
Further, the step of generating the current execution logic set of the state machine based on the state machine logic adjustment description file and the state machine configuration file of the state machine is: adding and/or deleting state machine logic in the state machine logic adjustment description file in a state machine logic set of a corresponding state machine-based state machine configuration file.
Further, the at least one piece of state machine logic information to be expanded further includes an adjustment option and a state machine name to be expanded, and the step of generating the current execution logic set of the state machine based on the state machine logic adjustment description file and the state machine configuration file of the state machine is as follows:
according to the state machine logic adjustment description file, the name of a state machine to be expanded in the state machine logic information to be expanded is obtained, and a state machine configuration file of the state machine corresponding to the name of the state machine is obtained from a plurality of state machines;
obtaining a state machine logic set from the obtained corresponding state machine configuration file;
and adding and/or deleting corresponding state machine logic in the obtained state machine logic set according to the adjustment options in the state machine logic information to be expanded of the state machine logic adjustment description file and the state machine logic to be expanded.
Further, the state machine logic to be expanded is the state machine logic to be newly added, the state machine logic comprises at least one of a current state, a trigger condition and an output action and a secondary state,
and when at least one state in the state machine logic to be newly added is the existing state in the state machine logic set of the state machine configuration file, adding the state machine logic to be newly added in the state machine logic set of the state machine configuration file.
Further, when at least one state in the state machine logic to be newly added is an existing state in the state machine logic set of the state machine configuration file, the step of adding the state machine logic to be newly added to the state machine logic set of the state machine configuration file includes:
acquiring the current state of the logic of a state machine to be newly added;
judging whether the acquired current state is the existing state in the state machine logic set of the state machine configuration file; when the obtained current state is the existing state in the state machine logic set of the state machine configuration file, adding the state machine logic to be newly added based on the existing state; when the obtained current state is not the existing state in the state machine logic set of the state machine configuration file, obtaining a secondary state of the state machine logic to be newly added;
judging whether the acquired secondary state is an existing state in a state machine logic set of the state machine configuration file; and when the acquired secondary state is the existing state in the state machine logic set of the state machine configuration file, adding the state machine logic to be newly added based on the existing state.
Further, a current execution logic set of the state machine is analyzed and generated in a state transition two-dimensional table mode, in the state transition two-dimensional table, a first row is a state row comprising a plurality of states, a first column is a trigger condition column comprising a plurality of trigger conditions, the state row and the trigger condition column are intersected to form a plurality of cells, and a secondary state of an action and/or transition executed when the corresponding trigger conditions are met in the corresponding state can be marked in each cell.
Further, the state of the state machine logic also includes a state condition, when the trigger condition of the state machine logic is satisfied, the state condition of the current state is calculated, the same or different output actions are executed according to the truth or the false of the state condition calculation result, and/or the state machine state is migrated or not migrated after the action execution is completed.
According to a second aspect of the present invention there is provided an apparatus for extending state machine logic, the apparatus comprising a processor which executes a computer program which implements a method as described above.
According to a third aspect of the present invention there is provided a storage medium having stored therein a computer program for performing the method as described above, the computer program being arranged to perform the method of extending state machine logic as described above when run.
According to a fourth aspect of the invention, there is provided an electronic device comprising a memory having a computer program stored therein and a processor arranged to execute the computer program to perform the method of extending state machine logic as described above.
The invention has the beneficial effects that: the method and the device for expanding the state machine logic provided by the embodiment of the invention can be used for performing operations such as addition, deletion, modification and the like on the state machine logic of the state machine of the equipment only by updating the configuration file of the state machine, namely the current execution logic set, without upgrading firmware, can be performed in the running process of the state machine, and can be used for flexibly changing the logic of the state machine.
Drawings
FIG. 1 is a flow diagram of a method for extending state machine logic according to an embodiment of the present invention;
FIG. 2 is a flow chart of adjusting the state machine execution logic in a method for expanding state machine logic according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of the operation of adding state machine logic using a method of extending the state machine logic according to an embodiment of the present invention;
fig. 4 is a flow chart of adding state machine logic by applying the method of expanding state machine logic according to the embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to specific embodiments and the accompanying drawings. Those skilled in the art will appreciate that the present invention is not limited to the drawings and the following examples.
According to a first aspect of the present invention, an embodiment of the present invention provides a method for extending state machine logic, as shown in fig. 1, including:
at 100, acquiring a state machine logic adjustment description file based on a state machine logic task to be expanded;
in the embodiment of the present invention, when the execution logic of one or more state machines in the device needs to be adjusted, the corresponding acquisition is based on the state machine logic task to be extended, and the state machine logic task to be extended includes at least one piece of state machine logic information to be extended.
The state machine logic information to be expanded is to add a state machine logic to a state machine or delete an existing state machine logic in a state machine configuration file. Those skilled in the art will appreciate that in the case where an existing piece of state machine logic in a state machine configuration file is to be modified, it is only necessary to delete the existing state machine logic and add new state machine logic in the state machine logic collection based on the state machine configuration file.
Thus, the piece of state machine logic information to be extended may include the adjustment options (add/delete), the state machine name to be extended, and the state machine logic to be extended (itself). The state machine logic may include a current state, a trigger condition, an output action, and a next state. The current state is the current state of the control object; the trigger condition is also called an "event", and when a trigger condition is satisfied, an output action may be triggered, and/or a state transition may be performed once, to a secondary state, which is relative to the current state, and once the secondary state is transitioned to the secondary state, the secondary state becomes the new current state.
When a state machine logic is added to a state machine, the adjustment option in the corresponding state machine logic information to be expanded is "add", the name of the state machine to be expanded is, for example, "number 01", and the state machine logic to be expanded is the state machine logic itself to be added.
When deleting an existing state machine logic in a state machine configuration file, the adjustment option in the corresponding state machine logic information to be expanded is "delete", the name of the state machine to be expanded is, for example, "number 02", and the state machine logic to be expanded is the existing state machine logic itself in the state machine configuration file of the state machine with the number 02.
In the embodiment of the invention, a state machine logic adjustment description file is generated based on a state machine logic task to be expanded, which comprises at least one piece of state machine logic information to be expanded, wherein the state machine logic adjustment description file also comprises information such as an adjustment option (addition/deletion), a state machine name to be expanded, the state machine logic to be expanded and the like, and each piece of state machine logic information to be expanded in the state machine logic task to be expanded is described, which state machine logic needs to be added or deleted is described, so that the execution logic of a plurality of state machines in equipment can be adjusted according to a plurality of pieces of state machine logic information to be expanded in one expanded state machine logic task.
It will be understood by those skilled in the art that the piece of state machine logic information to be extended may include only the state machine logic itself to be extended if the state machine logic task to be extended is simply to add state machine logic to a particular state machine.
In 200, acquiring a state machine configuration file of a state machine;
the state machine configuration files of the state machine cannot be changed at will. The state machine configuration file of the state machine is configured with the inherent set of state machine logic to be executed of the state machine, which is initially set, for example, by the state machine configuration tool.
And acquiring the state machine configuration files of all the state machines in the equipment, and searching the state machine configuration files of the corresponding state machines through the state machine names.
It should be noted that, the obtaining of the state machine configuration file of the state machine can achieve the object of the present invention before or after obtaining the state machine logic adjustment description file based on the state machine logic task to be expanded.
At 300, a current set of execution logic for the state machine is generated based on the state machine logic adjustment description file and the state machine configuration file for the state machine.
And according to the state machine logic adjustment description file, deleting and/or adding state machine logic in the state machine logic set of the state machine configuration file to generate a current execution logic set of the state machine. Specifically, a state machine logic set executed by a state machine is obtained based on a state machine configuration file of the state machine, for example, a state transition diagram or a two-dimensional table may be generated; and adjusting the description file according to the state machine logic, determining the state machine logic which needs to be added and/or deleted, adding or deleting corresponding state machine logic in a state machine logic set of the state machine configuration file based on the state machine, obtaining a current execution logic set of the state machine, and executing by the state machine. Optionally, the state machine configuration file of the state machine may be updated based on the current execution logic set of the state machine, so that the logic of the state machine may be flexibly changed.
Fig. 2 is a flowchart illustrating adjusting the execution logic of a state machine according to a preferred embodiment of the present invention, where a device includes a plurality of state machines, and the execution logic of the plurality of state machines in the device is adjusted according to a plurality of pieces of state machine logic information to be extended in one extended state machine logic task, where the state machine logic information to be extended further includes an adjustment option and a state machine name to be extended.
In 301, according to the name of the state machine to be expanded in the logic information of the state machine to be expanded of the state machine logic adjustment description file, acquiring a state machine configuration file of the state machine corresponding to the name of the state machine from a plurality of state machines;
and adjusting the name of the state machine to be expanded in the description file according to the logic of the state machine, searching in the state machine configuration files of the state machines of the plurality of state machines of the obtained equipment, and finding the state machine configuration file corresponding to the state machine.
At 302, obtaining a state machine logic set from the obtained corresponding state machine configuration file;
all logic for the state machine to execute is obtained from the acquired state machine configuration file, and a state transition diagram or a two-dimensional table can be generated.
In 303, according to the adjustment option in the state machine logic information to be expanded and the state machine logic to be expanded of the state machine logic adjustment description file, adding and/or deleting corresponding state machine logic in the obtained state machine logic set to obtain a current execution logic set of the state machine.
For the operation of deleting the state machine logic, the state machine logic to be deleted recorded in the state machine logic adjustment description file needs to be deleted in the acquired state machine logic set. For the operation of adding the state machine logic, the state machine logic to be added recorded in the state machine logic adjustment description file needs to be correspondingly added in the acquired state machine logic set.
According to the method provided by the embodiment of the invention, the operations of adding, deleting, modifying and the like can be carried out on the state machine logic of the state machine of the equipment only by updating the current execution logic set of the state machine without upgrading the firmware, and the operations can be carried out in the running process of the state machine.
In an embodiment of the present invention, as shown in fig. 3, based on a to-be-extended state machine logic task including to-be-added state machine logic information, a state machine configuration tool is used to generate a state machine logic adjustment description file, where the state machine logic adjustment description file describes, for the to-be-added state machine logic information in the to-be-extended state machine logic task, a state machine to which a specific state machine logic needs to be added; and when the added state machine logic comprises function functions which are not included in the equipment, the state machine configuration tool calls related function functions through a newly added function interface and configures the function functions in the state machine logic adjustment description file. The state machine configuration file of the state machine is initially set by the state machine configuration tool. And the state machine executor adjusts the description file according to the state machine logic, adds the state machine logic to be newly added in the state machine logic set of the state machine configuration file, generates a current execution logic set of the state machine, and calls the related function and executes the logic based on the generated current execution logic set of the state machine.
In the step of adding the to-be-added state machine logic in the state machine logic set of the state machine configuration file, the state in the to-be-added state machine logic, including the current state and the next state (if any), is obtained, and when at least one obtained state is an existing state in the state machine logic set of the state machine configuration file, the to-be-added state machine logic is added, preferably in the following manner, as shown in fig. 4.
In 3031, the current state of the state machine logic to be newly added is obtained;
the state machine logic to be newly added comprises at least one of a current state, a trigger condition and an output action and a secondary state, namely, the state machine logic to be newly added comprises the current state, the trigger condition and the output action, or comprises the current state, the trigger condition and the secondary state, or comprises the current state, the trigger condition, the output action and the secondary state.
In 3032, it is determined whether the obtained current state is an existing state in the state machine logic set of the state machine configuration file;
in 3033, when the obtained current state is the existing state in the state machine logic set of the state machine configuration file, adding the state machine logic to be newly added based on the existing state;
in a preferred embodiment of the present invention, a current execution logic set of the state machine is analyzed and generated in a state transition two-dimensional table manner, in the state transition two-dimensional table, a first row is a state row including a plurality of states, a first column is a trigger condition column including a plurality of trigger conditions, the state row and the trigger condition column intersect to form a plurality of cells, and a secondary state of an action and/or a transition executed when a corresponding trigger condition is satisfied in a corresponding state can be marked in each cell.
In a state machine logic set represented by a state transition two-dimensional table obtained by a state machine configuration file based on a state machine, for example, existing states in the state machine logic set include a state S1, a state S2 and a state S3, and when a new trigger condition C occurs, the state machine logic to be added is transited from the state S1 to the state S2, and then a new row of items of the trigger condition is added to the existing state S1 of the state transition two-dimensional table, as shown in the following table.
Trigger condition State S1 State S2 State S3
Trigger Condition A S2
Trigger condition B S3
Newly added trigger condition C S2
If the state machine logic to be added is to be transited from the state S3 to the state S4 when the new trigger condition D occurs, and the sub-state S4 of the state machine logic to be added is not an existing state in the state machine logic set, the corresponding sub-state is added, that is, the column of "state S4" is added to the table, and a row of items of the new trigger condition is added to the state transition two-dimensional table, as shown in the following table.
Trigger condition State S1 State S2 State S3 State S4
Trigger Condition A S2
Trigger condition B S3
Newly-added trigger condition D S4
Of course, as a matter of choice, those skilled in the art will understand, in the case that the state S4 of the state machine logic to be added is not an existing state in the state machine logic set, the system reports an error, and the state machine logic is not added.
In 3034, when the obtained current state is not the existing state in the state machine logic set of the state machine configuration file, obtaining a secondary state of the state machine logic to be newly added;
in 3035, it is determined whether the obtained secondary state is an existing state in the state machine logic set of the state machine configuration file;
in 3036, when the obtained secondary state is an existing state in the state machine logic set of the state machine configuration file, adding the state machine logic to be newly added based on the existing state;
in a state machine logic set represented by a state transition two-dimensional table obtained based on a state machine configuration file of a state machine, for example, existing states in the state machine logic set include a state S1, a state S2 and a state S3, when a new trigger condition E occurs, the state machine logic to be added is shifted from the state S5 to the state S3, a column of a "state S5" is added before a column of a "state S3" in the table, and a row of items of a new trigger condition is added in the state transition two-dimensional table, as shown in the following table.
Figure BDA0002353815680000071
Figure BDA0002353815680000081
In 3037, when the obtained secondary state is not the existing state in the state machine logic set of the state machine configuration file, an error is reported;
the state transition two-dimensional table analysis tool is used, so that the logic of the state can be clearly described, and the operation is flexible and convenient; through reasonable guidance, the up-and-down correlation operation of the new adding state is simplified; sub-table segmentation can be performed on the state machine, and service modularization is guaranteed; it is advantageous to determine whether the state machine will be in a blocking state.
In a preferred embodiment of the present invention, compared with the prior art, the states S1, S2, and … … of the state machine logic of the embodiment of the present invention further include respective state conditions, and when the trigger condition of the state machine logic is satisfied, the state condition of the current state is calculated, the same or different output actions, such as a true action or a false action, are executed according to the true or false of the state condition calculation result, and/or the state machine state is migrated or the state machine state is not migrated after the action is completed, so that the state machine logic can be flexibly migrated to different sub-states according to the calculation result of the state condition, as shown in the following table.
Figure BDA0002353815680000082
In the example of the above table, in the case where the trigger condition F is satisfied, the state condition of the state S1 is calculated, when the calculation result of the state condition of the state S1 is true, a true action is performed, and transition is made to the state S2 after the execution of the true action is completed; when the calculation result of the state condition of the state S1 is false, a false action is performed, and the transition is made to the state S3 after the execution of the false action is completed. It should be noted that the action may be null, and when the true action or the false action is null, it is equivalent to that no action is executed, and the state transition can be performed directly according to the state calculation result.
Under the condition that the trigger condition G is met, calculating the state condition of the state S2, executing a true action when the calculation result of the state condition of the state S2 is true, and transitioning to the state S1 after the execution of the true action is finished; if the calculation result of the state condition of the state S2 is false, a false operation is executed, and it is determined that the next state after the execution of the false operation is still S2, and therefore, no state transition is performed.
Under the condition that the trigger condition H is met, calculating the state condition of the state S1, executing a true action when the calculation result of the state condition of the state S1 is true, and transitioning to the state S2 after the execution of the true action is finished; when the calculation result of the state condition of the state S1 is false, a false action is performed, and transition is made to the state S1 after the execution of a true action is completed.
According to a second aspect of the present invention, an apparatus for extending state machine logic is also presented in an embodiment of the present invention, the apparatus comprising a processor, the processor executing a computer program of the method as described above.
According to a third aspect of the present invention, an embodiment of the present invention further proposes a storage medium, in which a computer program for executing the method described above is stored, the computer program being configured to execute the method for extending state machine logic described above when running.
According to a fourth aspect of the present invention, an embodiment of the present invention further provides an electronic apparatus, including a memory and a processor, where the memory stores a computer program, and the processor is configured to execute the computer program to perform the method for extending state machine logic as described above.
Those of skill in the art will understand that the logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be viewed as implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The embodiments of the present invention have been described above. However, the present invention is not limited to the above embodiment. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A method of extending state machine logic, comprising:
acquiring a state machine logic adjustment description file based on a state machine logic task to be expanded;
acquiring a state machine configuration file of a state machine;
generating a current set of execution logic for the state machine based on the state machine logic adjustment profile and a state machine configuration file for the state machine.
2. The method of extending state machine logic of claim 1, further comprising: updating a state machine configuration file for the state machine based on the generated current set of execution logic for the state machine.
3. The method of extending state machine logic according to claim 1, wherein the state machine logic task to be extended comprises at least one piece of state machine logic information to be extended, the at least one piece of state machine logic information to be extended comprising state machine logic to be extended.
4. The method of extending state machine logic according to claim 3, wherein the step of generating a set of currently executing logic for the state machine based on the state machine logic adjustment profile and the state machine configuration file for the state machine is: adding and/or deleting state machine logic in the state machine logic adjustment description file in a state machine logic set of a corresponding state machine-based state machine configuration file.
5. The method of extending state machine logic according to claim 3, wherein the at least one piece of state machine logic information to be extended further comprises an adjustment option and a state machine name to be extended, and the step of generating the current execution logic set of the state machine based on the state machine logic adjustment description file and the state machine configuration file of the state machine is:
according to the state machine logic adjustment description file, the name of a state machine to be expanded in the state machine logic information to be expanded is obtained, and a state machine configuration file of the state machine corresponding to the name of the state machine is obtained from a plurality of state machines;
obtaining a state machine logic set from the obtained corresponding state machine configuration file;
and adding and/or deleting corresponding state machine logic in the obtained state machine logic set according to the adjustment options in the state machine logic information to be expanded of the state machine logic adjustment description file and the state machine logic to be expanded.
6. The method of extending state machine logic according to claim 4 or 5, wherein the state machine logic to be extended is state machine logic to be added, the state machine logic comprising at least one of a current state, a trigger condition, and an output action and a next state,
and when at least one state in the state machine logic to be newly added is the existing state in the state machine logic set of the state machine configuration file, adding the state machine logic to be newly added in the state machine logic set of the state machine configuration file.
7. The method of claim 6, wherein adding the state machine logic to be added to the state machine logic set of the state machine configuration file when at least one state in the state machine logic to be added is an existing state in the state machine logic set of the state machine configuration file comprises:
acquiring the current state of the logic of a state machine to be newly added;
judging whether the acquired current state is the existing state in the state machine logic set of the state machine configuration file; when the obtained current state is the existing state in the state machine logic set of the state machine configuration file, adding the state machine logic to be newly added based on the existing state; when the obtained current state is not the existing state in the state machine logic set of the state machine configuration file, obtaining a secondary state of the state machine logic to be newly added;
judging whether the acquired secondary state is an existing state in a state machine logic set of the state machine configuration file; and when the acquired secondary state is the existing state in the state machine logic set of the state machine configuration file, adding the state machine logic to be newly added based on the existing state.
8. The method of extending state machine logic according to claim 7, wherein a current executing logic set of the state machine is analyzed and generated in a state transition two-dimensional table manner, wherein a first row is a state row comprising a plurality of states, a first column is a trigger condition column comprising a plurality of trigger conditions, the state row and the trigger condition column intersect to form a plurality of cells, and a sub-state of an action and/or a transition performed when the corresponding trigger condition is satisfied in the corresponding state can be marked in each cell.
9. The method according to claim 6, wherein the state of the state machine logic further comprises a state condition, and when the trigger condition of the state machine logic is satisfied, the state condition of the current state is calculated, the same or different output actions are executed according to the true or false of the calculation result of the state condition, and/or the state machine state is migrated or not migrated after the execution of the action is completed.
10. An apparatus for extending state machine logic, the apparatus comprising a processor that executes a computer program that performs the method of any one of claims 1-9.
11. A storage medium having stored therein a computer program for performing the method of any one of claims 1 to 9, the computer program being arranged to perform the method of extending state machine logic of any one of claims 1 to 9 when executed.
12. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and the processor is arranged to execute the computer program to perform the method of extending state machine logic of any of claims 1 to 9.
CN202010001955.4A 2020-01-02 2020-01-02 Method and device for expanding state machine logic, storage medium and electronic device Active CN113064674B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010001955.4A CN113064674B (en) 2020-01-02 2020-01-02 Method and device for expanding state machine logic, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010001955.4A CN113064674B (en) 2020-01-02 2020-01-02 Method and device for expanding state machine logic, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN113064674A true CN113064674A (en) 2021-07-02
CN113064674B CN113064674B (en) 2024-04-16

Family

ID=76558180

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010001955.4A Active CN113064674B (en) 2020-01-02 2020-01-02 Method and device for expanding state machine logic, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN113064674B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114489132A (en) * 2022-01-26 2022-05-13 北京星际荣耀科技有限责任公司 Aircraft control method and device, electronic equipment and storage medium
US11381713B2 (en) * 2020-11-10 2022-07-05 Warner Bros. Entertainment Inc. Perfless and cadenceless scanning and digitization of motion picture film

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101047896A (en) * 2007-04-11 2007-10-03 华为技术有限公司 Value-added service allocation method and value-added service system based on package
US20110161926A1 (en) * 2009-12-30 2011-06-30 Robert B Cruise Finite state machine architecture for software development
CN102467414A (en) * 2010-11-19 2012-05-23 阿里巴巴集团控股有限公司 State machine control method, device and state machine system
US20130138593A1 (en) * 2011-11-30 2013-05-30 Metaswitch Networks Ltd. Method and Apparatus for Operating a Finite State Machine
CN105138332A (en) * 2015-08-26 2015-12-09 上海联影医疗科技有限公司 Realizing method and device for state machine
US9463386B1 (en) * 2011-11-08 2016-10-11 Zynga Inc. State machine scripting in computer-implemented games
CN106250100A (en) * 2016-08-15 2016-12-21 腾讯科技(深圳)有限公司 Analyzing logic control method and device
CN109375965A (en) * 2018-11-06 2019-02-22 东软集团股份有限公司 State machine processing method and device, readable storage medium storing program for executing
CN110083406A (en) * 2018-01-26 2019-08-02 广东亿迅科技有限公司 State machine based on text two-dimensional table defines method and its system
US20190266665A1 (en) * 2018-02-28 2019-08-29 Hewlett Packard Enterprise Development Lp Managing subscription life-cycles

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101047896A (en) * 2007-04-11 2007-10-03 华为技术有限公司 Value-added service allocation method and value-added service system based on package
US20110161926A1 (en) * 2009-12-30 2011-06-30 Robert B Cruise Finite state machine architecture for software development
CN102467414A (en) * 2010-11-19 2012-05-23 阿里巴巴集团控股有限公司 State machine control method, device and state machine system
US9463386B1 (en) * 2011-11-08 2016-10-11 Zynga Inc. State machine scripting in computer-implemented games
US20130138593A1 (en) * 2011-11-30 2013-05-30 Metaswitch Networks Ltd. Method and Apparatus for Operating a Finite State Machine
CN105138332A (en) * 2015-08-26 2015-12-09 上海联影医疗科技有限公司 Realizing method and device for state machine
CN106250100A (en) * 2016-08-15 2016-12-21 腾讯科技(深圳)有限公司 Analyzing logic control method and device
CN110083406A (en) * 2018-01-26 2019-08-02 广东亿迅科技有限公司 State machine based on text two-dimensional table defines method and its system
US20190266665A1 (en) * 2018-02-28 2019-08-29 Hewlett Packard Enterprise Development Lp Managing subscription life-cycles
CN109375965A (en) * 2018-11-06 2019-02-22 东软集团股份有限公司 State machine processing method and device, readable storage medium storing program for executing

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
PATRICK COOKE等: "Finite-State-Machine Overlay Architectures for Fast FPGA Compilation and Application Portability", 《ACM TRANSACTIONS ON EMBEDDED COMPUTING SYSTEMS》, pages 1 - 25 *
WEIXIN_33763244: "状态模式", pages 1 - 11, Retrieved from the Internet <URL:https://blog.csdn.net/weixin_33763244/article/details/91439659> *
聂旭中: "状态机设计研究", 《洛阳师范学院学报》, no. 02, pages 96 - 98 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11381713B2 (en) * 2020-11-10 2022-07-05 Warner Bros. Entertainment Inc. Perfless and cadenceless scanning and digitization of motion picture film
US11902688B2 (en) 2020-11-10 2024-02-13 Warner Bros. Entertainment Inc. Perfless and cadenceless scanning and digitization of motion picture film
CN114489132A (en) * 2022-01-26 2022-05-13 北京星际荣耀科技有限责任公司 Aircraft control method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113064674B (en) 2024-04-16

Similar Documents

Publication Publication Date Title
Fournier-Viger et al. TKS: efficient mining of top-k sequential patterns
CN106933733B (en) Method and device for determining memory leak position
CN111752571B (en) Program upgrading method, device, equipment and storage medium
CN113064674A (en) Method and device for expanding state machine logic, storage medium and electronic device
CN111984829A (en) Vue-based tree asynchronous loading method, device, equipment and medium
CN110597821B (en) Method and device for changing database table structure
CN113535225B (en) Environment configuration file processing method, device, equipment and medium of application software
CN103745319A (en) Data provenance traceability system and method based on multi-state scientific workflow
CN111158667B (en) Code injection method and device, electronic equipment and storage medium
US6275974B1 (en) Efficient tracing of shorts in very large nets in hierarchical designs using breadth-first search with optimal pruning
CN110286894B (en) Script generation method, script generation device, computer equipment and storage medium
CN110647664A (en) Method, system, medium and equipment for large-scale updating of tree graph in knowledge graph
CN112667463A (en) Application system baseline state monitoring method and device
CN112882705A (en) Expression calculation method, device, equipment and medium based on interface updating
CN110674179A (en) Query interface generation method, device and medium
CN111858387B (en) Data preparation method and device
CN110879722B (en) Method and device for generating logic schematic diagram and computer storage medium
US20240070979A1 (en) Method and apparatus for generating 3d spatial information
CN116991956B (en) Signal interaction method based on EDA, electronic equipment and storage medium
CN110347372B (en) Data traversal method and terminal
CN117891746A (en) Host migration testing method and device
CN112270142B (en) Flow field visualization pipeline dynamic construction method and device for human-computer interaction
CN109117359A (en) Serialize test method and device
CN118193032A (en) Method, apparatus, device, medium and program product for eliminating invalid dependency library
CN114610283A (en) Method and device for editing spline curve based on HTML (hypertext markup language)

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20240704

Address after: Office 3613, 31st Floor, No. 88 Xingye Road, Xiangzhou District, Zhuhai City, Guangdong Province, 519000

Patentee after: Zhuhai Youte Enterprise Management Co.,Ltd.

Country or region after: China

Address before: 519000 Youte technology building, 102 Yinhua Road, Xiangzhou District, Zhuhai City, Guangdong Province

Patentee before: Guangdong youteyun Technology Co.,Ltd.

Country or region before: China

TR01 Transfer of patent right