Intelligent decision-making method based on rule engine and finite-state machine

Through intelligent decision-making methods based on rules engines and finite state machines, combined with QT high-performance development framework and memory database, the automatic operation of business state machines is realized, solving the problems of difficult code modification and poor compatibility in traditional methods, and improving the software maintainability and data security.

CN119292660AActive Publication Date: 2025-01-10JIANGSU JARI GROUP CO LTD

Patent Information

Application Number
CN202411271262.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2025-01-10
Estimated Expiration
2044-09-11

AI Technical Summary

Technical Problem

The traditional business state process implementation method requires code modification when business rules and logic changes, and the maintenance workload is large, and it is difficult to meet the needs of multi-layer state machines. It has poor compatibility with domestic operating systems, so it is impossible to effectively separate business personnel and codecs. personnel.

Method used

Using intelligent decision-making methods based on rules engines and finite state machines, the automatic operation of business state machines is achieved through metadata management, state nodes and rule settings management, internal and external transfer settings of state space, and the QT high-performance cross-platform development framework is used. and memory database access rules and data, support business personnel to define rules, and code personnel to call them directly.

Benefits of technology

It realizes the automation and intelligence of business decisions in complex systems, improves the maintainability, testability, portability and data security of software, reduces the need for code modification, and adapts to business scenarios with complex and variable processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292660A_ABST
    Figure CN119292660A_ABST
Patent Text Reader

Abstract

An intelligent decision-making method based on a rule engine and a finite-state machine adopts a QT high-performance cross-platform development framework and a safe and reliable mode of accessing rule data by a memory database. The method mainly comprises metadata management, state node and rule setting management, state space internal transfer setting, state space external transfer setting, rule data acquisition, service execution or circulation scheme acquisition, rule input data real-time acquisition, rule matching, state machine internal state transfer processing, execution action and state space external transfer processing. And calling functions such as an internal state transfer method of the state machine. According to the method, automation and intelligentization of business decision making of a complex system can be achieved, when business rules change, automatic operation of the business state machine in an application system can be achieved without modifying business logic codes, and the transportability of software, the running reliability of the software and the data safety can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent decision making, and in particular to an intelligent decision making method based on a rule engine and a finite state machine. Background Art

[0002] At present, complex business decision systems will inevitably have business rules and logic changes during operation. The traditional implementation of business state processes is to write business rules and business logic into the code. When a rule or state transition relationship changes, the corresponding code needs to be modified and recompiled. The maintenance workload and testing difficulty are very large, and the business personnel and coders cannot be effectively separated. Although the traditional business state process implementation method has been replaced by some automated workflow engines, the current more mature open source workflow engines have limited functions. For example, it is difficult to meet the business process requirements of multi-layer state machines, and the problem of poor fit with the domestic market requires more additional development work. On the other hand, in order to meet the needs of software that can be more closely used in domestic operating systems such as Galaxy Kylin and Red Flag Linux, the QT high-performance cross-platform development framework is adopted. The technology based on the combination of finite state machines and rule engines has become a new solution to the problem. Summary of the invention

[0003] The technical problem to be solved by the present invention is to address the deficiencies in the prior art and to provide an intelligent decision-making method based on a rule engine and a finite state machine that can realize automation and intelligence of business decisions for complex systems. When business rules change, the automatic operation of the business state machine in the application system can be realized without modifying the business logic code, and the portability of the software as well as the software operation reliability and data security can be improved.

[0004] The technical problem to be solved by the present invention is achieved through the following technical solution. The present invention is an intelligent decision-making method based on a rule engine and a finite state machine, and the steps of the method are as follows: Step 1: Metadata management, that is, defining and maintaining state machine classification and the parameters and behaviors used by the rule conditions under the state machine: Step 1: Parameter management, which is to define and maintain the parameters or attributes used by the state rule conditions; Step 2: Classification management of state machines, that is, defining and maintaining the state machines included in the system; Step 3: Behavior management, which is to define and maintain the actions performed to meet the rule conditions; Step 2: State nodes and rule setting management, that is, defining and maintaining the state nodes under the state machine, the required rule conditions to reach the state nodes, and the behaviors to be executed: The first step is to select a state machine and enter the state name; The second step is to define the rule condition expression, select the condition parameters from the metadata table, define the corresponding thresholds, and select the "and" and "or" relationships between the compound conditions; The third step is to define the processing behavior of the rule, select the behavior to be executed to meet the rule from the atomic behavior table, and set the priority order of the execution behavior; Step 4: Repeat steps 1 to 4 until all states in the state machine are defined. Step 3: Set the internal transfer of the state space, that is, set the transfer relationship between the states within a single state machine: The first step is to select a state machine; The second step is to select the state involved in the state machine; Step 3: Set the start state; Step 4: Set the sub-states of each state in sequence starting from the start state until the last state is the end state or contains a state transition behavior; Step 4: External transfer setting of state space, that is, when the system contains multiple state machines, maintain the transfer relationship between multiple state machines: The first step is to select a state machine; The second step is to select the state machine that the state machine may transfer to from the state machine table. The third step is to define the rule condition expression, select the condition parameters from the metadata table, define the corresponding thresholds, select the "and" and "or" relationships between the compound conditions, and save the combined condition expression into the database; Step 4: Repeat steps 2 to 3 until all possible state machines to be transferred to are defined; Step 5: If the entry conditions of multiple entry state machines are the same, set the entry priority; Step 6: Repeat steps 1 to 5 until all external transfers of the state machines are set. Step 5: Obtain rules and state machine related data and store them in the system cache: The first step is parameter initialization, which obtains all parameters and their corresponding default values ​​from the metadata table of the database and stores them in the system cache; The second step is to create a memory database, and copy the state node table, state space internal transfer table, and state space external transfer table in the physical database as the master to the memory database; Step 3: Create a matching condition table in the in-memory database and add a piece of data; Step 6: Obtain the business execution or flow plan, parse the plan and store the parsing results in the system cache; Step 7: Real-time acquisition of rule input data, that is, real-time acquisition of sensor, external input data or internally processed data and assignment to corresponding rule condition parameters; Step 8: Rule matching, bring the parameter value into the rule condition expression for matching; Step 9: Process the internal state transfer of the state machine to determine whether the current state is the start state. If it is the start state, first search the start state node of the state machine from the internal transfer table of the state space, obtain the current state node number, the next state node sequence number and the state number, then set the start state flag to no, and then perform rule matching according to the state number. If it is not the start state, parse the state number that may be transferred to, cyclically search the state node and rule number from the internal transfer table of the state space, and then call the state transfer rule matching method according to the state number to perform rule matching; Step 10: Execute the corresponding actions, parse the corresponding action method names, and execute the corresponding action methods in sequence; Step 11: In step 10, if the execution action method contains a state external transfer method, the state space external transfer method is called; Step 12: External transfer processing of state space: The first step is to obtain the state machines that the current state machine may transfer to from the state space external transfer table according to the current state machine, and sort them by priority; The second step is to retrieve the information of the state machine with the highest current priority, including its conditional expression and the state machine name. The third step is to call the state transition rule matching method to transition the current state machine to the start state of another state machine; Step 13: Create and set a timer to periodically trigger the internal state transfer method of the state machine.

[0005] The technical problem to be solved by the present invention can also be further achieved through the following technical solutions. For the above-mentioned intelligent decision-making method based on rule engine and finite state machine, in step 2 and step 4, the defined rule condition expression is mainly spliced ​​into atomic condition expression through user word meaning mapping and escape; if it is a compound condition expression, it is further combined on this basis according to the set logical relationship; the above-mentioned spliced ​​condition expression is respectively escaped into the rule condition expression understood by the user and the rule condition expression that conforms to the conditional syntax in where in SQL language, so as to meet the needs of business personnel to define and maintain rules, and coders to directly call the defined rules, so as to effectively separate business personnel and coders.

[0006] The technical problem to be solved by the present invention can also be further achieved by the following technical solutions. For the intelligent decision-making method based on rule engine and finite state machine described above, a memory database is created in step five. First, a SQLite memory database is created. Then, the state node table, the state space internal transfer table, and the state space external transfer table in the entity database are copied as the master to the memory database; then, the state node table, the state space internal transfer table, and the state space external transfer table model QSqlTableModel are created respectively, and the corresponding memory database is bound; Among them, QSqlTableModel is a read-write model control for operating database tables based on the QTSQL class. It can obtain the corresponding records of the data table according to the set conditions; finally, in the memory data, a matching condition table is created and a piece of data is added for the rule condition expression matching.

[0007] The technical problem to be solved by the present invention can also be further achieved by the following technical solutions. For the above-mentioned intelligent decision-making method based on rule engine and finite state machine, the internal state transfer rule condition matching in step nine includes the following steps: The first step is to find the corresponding rule expression and process the behavior expression by the state node number in the state node database table model; The second step is to obtain the condition parameter value from the system cache and bring it into the above rule expression; The third step is to use the parameter value as the condition of setFilter in the matching condition library table model; The fourth step is to execute the query operation of the matching condition database table model. If there is no query result record, it means that the current rule condition of the state is not met; if there is a query result record, it means that the current rule condition of the state is met. Get the next state node sequence number and assign it to the current state node variable, then get the action method name of the rule, and call the corresponding execution action method; in this way, the transfer between state nodes can be realized.

[0008] The technical problem to be solved by the present invention can also be further achieved by the following technical solutions. For the above-mentioned intelligent decision-making method based on rule engine and finite state machine, the state transition rule matching method in step 12 includes the following steps: Step 1: Get the regular expression; Step 2: Bring in the parameter value in the condition, set the where condition to the regular expression replaced with the condition parameter value, and perform a search for the matching condition table; Step 3: Determine whether there is a query record. If there is a query result record, it means that the rule condition is met. Modify the current state machine parameter value to the transferred state machine, set the start state flag to "yes", and then the previously running state machine can jump to the transferred state machine for operation; if there is no query result record, it means that the rule condition is not met, and the current state machine still stays in the previous state machine waiting for the conditions to be met to transfer out.

[0009] Compared with the prior art, the present invention utilizes a technology that combines a rule engine and a finite state machine. During the state transition process of the system's finite state machine, the rule engine matches predefined transfer conditions and executes corresponding actions or behaviors, thereby realizing the automation and intelligence of complex system business decision-making; secondly, the implementation of the present invention can improve the maintainability and testability of the system code. For business scenarios with complex and changeable processes, it is only necessary to adjust the transfer conditions and relationships between states and the corresponding actions without modifying the business logic code to realize the automatic operation of the business state machine in the system. At the same time, the present invention adopts the QT high-performance cross-platform development framework and the method of accessing rule data from the memory database, which can further improve the portability, operation reliability and data security of the software. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 is an application flow chart of the present invention; Figure 2 The present invention is a state transfer implementation flow chart. DETAILED DESCRIPTION

[0011] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0012] Reference Figure 1-2 , an intelligent decision-making method based on rule engine and finite state machine, based on the technology of combining rule engine and finite state machine, using QT high-performance cross-platform development framework and safe and reliable way of accessing rule data in memory database. In the state transition process of system finite state machine, the rule engine matches the predefined transfer conditions and executes the corresponding actions or behaviors, thus realizing the automation and intelligence of complex system business; Among them, the finite state machine is an object behavior modeling tool, which is applicable to systems with a limited number of states, a clear life flow, and limited choices in each state. The next state is determined based on the current state and input of the system. The rule engine is a software system used to execute rules. These rules are usually expressed as a set of conditions and actions. When the conditions are met, the rule engine will execute the corresponding actions. By utilizing the technology that combines finite state machines and rule engines, during the state transition process of the system's finite state machine, the rule engine matches predefined transfer conditions and executes corresponding actions or behaviors, thereby realizing the automation and intelligence of complex system business. The implementation of this technology can improve the maintainability and testability of system code. For business scenarios with complex and changeable processes, it is only necessary to adjust the transfer conditions and relationships between states and the corresponding actions, without modifying the business logic code, to realize the automatic operation of the business state machine in the system.

[0013] The main steps of this method are as follows: Step 1: Metadata management, define and maintain state machine classification and the parameters and behaviors used by the rule conditions under the state machine: Step 1: Parameter management, which is to define and maintain the parameters or attributes used by the state rule conditions; Step 2: Classification management of state machines, that is, defining and maintaining the state machines included in the system; Step 3: Behavior management, which is to define and maintain the actions performed to meet the rule conditions; Step 2: State nodes and rule setting management, that is, defining and maintaining the state nodes under the state machine, the required rule conditions to reach the state nodes, and the behaviors to be executed: The first step is to select a state machine and enter the state name; The second step is to define the rule condition expression, select the condition parameters from the metadata table, define the corresponding thresholds, and select the "and" and "or" relationships between the compound conditions; The third step is to define the processing behavior of the rule, select the behavior to be executed to meet the rule from the atomic behavior table, and set the priority order of the execution behavior; Step 4: Repeat steps 1 to 4 until all states in the state machine are defined. Step 3: Set the internal transfer of the state space, that is, set the transfer relationship between the states within a single state machine: The first step is to select a state machine; The second step is to select the state involved in the state machine; Step 3: Set the start state; Step 4: Set the sub-states of each state in sequence starting from the start state until the last state is the end state or contains a state transition behavior; Step 4: External transfer setting of state space, that is, when the system contains multiple state machines, maintain the transfer relationship between multiple state machines: The first step is to select a state machine; The second step is to select the state machine that the state machine may transfer to from the state machine table; The third step is to define the rule condition expression, select the condition parameters from the metadata table, define the corresponding thresholds, select the "and" and "or" relationships between the compound conditions, and save the combined condition expression into the database; Step 4: Repeat steps 2 to 3 until all possible state machines to be transferred to are defined; Step 5: If the entry conditions of multiple entry state machines are the same, set the entry priority; Step 6. Repeat steps 1 to 5 until the external transfers of all state machines are set.

[0014] Step 5: Obtain rules and state machine related data and store them in the system cache: The first step is parameter initialization, which obtains all parameters and their corresponding default values ​​from the metadata table of the database and stores them in the system cache; The second step is to create a memory database, and copy the state node table, state space internal transfer table, and state space external transfer table in the physical database as the master to the memory database; Step 3: Create a matching condition table in the in-memory database and add a piece of data; Step 6: Obtain the business execution or flow plan, parse the plan and store the parsing results in the system cache; Step 7: Real-time acquisition of rule input data, that is, real-time acquisition of sensor, external input data or internally processed data and assignment to corresponding rule condition parameters; Step 8: Rule matching, bring the parameter value into the rule condition expression for matching; Step 9: Process the internal state transfer of the state machine to determine whether the current state is the start state. If it is the start state, first search the start state node of the state machine from the internal transfer table of the state space, obtain the current state node number, the next state node number and the state number, then set the start state flag to no, and then match the rules according to the state number. If it is not the start state, parse the state number that may be transferred to, loop to search the state node and rule number from the internal transfer table of the state space, and then call the state transfer rule matching method according to the state number to match the rules; Step 10: Execute the corresponding actions, parse the corresponding action method names, and execute the corresponding action methods in sequence; Step 11: In step 10, if the execution action method contains a state external transfer method, the state space external transfer method is called; Step 12: External transfer processing of state space: The first step is to obtain the state machines that the current state machine may transfer to from the state space external transfer table according to the current state machine, and sort them by priority; The second step is to retrieve the information of the state machine with the highest current priority, including its conditional expression and the state machine name. The third step is to call the state transition rule matching method to transition the current state machine to the start state of another state machine; Step 14: Create and set a timer to periodically trigger the internal state transfer method of the state machine.

[0015] Among them, in step 2 and step 4, the defined rule condition expression is mainly spliced ​​into an atomic condition expression through user word meaning mapping and escaping; if it is a compound condition expression, it is further combined according to the set logical relationship on this basis; the above spliced ​​condition expressions are respectively escaped into rule condition expressions understood by users and rule condition expressions that conform to the conditional syntax in the where in the SQL language, so as to meet the needs of business personnel to define and maintain rules, and coders to directly call the defined rules, so as to realize the effective separation of business personnel and coders; In step 5, create a memory database. First, create a SQLite memory database. Then, copy the state node table, state space internal transfer table, and state space external transfer table in the physical database as the master to the memory database; then, create the state node table, state space internal transfer table, and state space external transfer table model QSqlTableModel respectively, and bind the corresponding memory database. Among them, QSqlTableModel is a read-write model control for operating database tables based on the QTSQL class. It can obtain the corresponding records of the data table according to the set conditions; finally, create a matching condition table in the memory data, and add a piece of data for matching the rule condition expression. In this way, during the operation of the system, it can be completely separated from the physical database, which not only ensures the reliability and security of obtaining rule data, but also effectively improves the speed of data acquisition and improves the overall performance of the system when the amount of data is large.

[0016] The internal state transition rule condition matching in step nine includes the following steps: The first step is to find the corresponding rule expression and process the behavior expression by the state node number in the state node database table model; The second step is to obtain the condition parameter value from the system cache and bring it into the above rule expression; The third step is to use the parameter value as the condition of setFilter in the matching condition library table model; The fourth step is to perform a query operation on the matching condition database table model. If there is no query result record, it means that the current rule condition of the state is not met; if there is a query result record, it means that the current rule condition of the state is met, obtain the next state node number and assign it to the current state node variable, then obtain the action method name of the rule, and call the corresponding execution action method. In this way, the transfer between state nodes can be realized.

[0017] The state transition rule matching method in step 12 includes the following steps: Step 1: Get the regular expression; Step 2: Bring in the parameter value in the condition, set the where condition to the regular expression replaced with the condition parameter value, and perform a search for the matching condition table; Step 3: Determine whether there is a query record. If there is a query result record, it means that the rule condition is met. Modify the current state machine parameter value to the transferred state machine, set the start state flag to "yes", and then the previously running state machine can jump to the transferred state machine for operation; if there is no query result record, it means that the rule condition is not met, and the current state machine still stays in the previous state machine waiting for the conditions to be met to transfer out.

[0018] Specific: like Figure 1 As shown, the present invention preferably adopts an intelligent decision-making method based on a rule engine and a finite state machine. When the application system is started, the parameters are first initialized, a memory database is established to obtain rule data and store it in the memory database, and at the same time, the preset solution to be executed by the system is obtained for analysis and stored in the system cache, and the internal state transfer processing timer is started, and then the data acquisition thread is started, real-time data is received and processed accordingly, and finally the corresponding parameters of the rule expression are brought in to perform rule matching to drive state transfer, so that the state machine of the application system is in an automatic operation state.

[0019] like Figure 2 As shown, it is the state transfer method process. The driving service state transfer method is the key technical expenditure of the present invention, and the specific implementation is as follows: Determine whether the status category has changed, and if so, update the status category; Determine whether the current state is the start state. If it is the start state, first find the start state node of the state machine from the internal transfer table of the state space, obtain the current state node number, the next state node number and the state number, then set the start state flag to no, and then match the rules according to the state number; If it is not the start state, the state number that may be transferred to is analyzed, and the state node and rule number are searched from the internal transfer table of the state space in a loop, and then the state transfer rule matching method is called according to the state number to perform rule matching; Bring the parameter value into the rule condition expression for matching. If the condition expression is true, it means that the condition is met, the state is updated, and the state transfer process is completed.

[0020] Compared with the existing decision-making methods, the beneficial effect of the present invention is that the business decision logic is separated from the business code. When the business rules change during the application of the business decision system, the business logic can be changed on demand by simply modifying the relationship between the business rules and the business status, without the need for developers to modify the code and then perform a series of work such as compilation, testing, and deployment, thereby greatly improving the maintainability, scalability and testability of the software system. At the same time, the software adopts the QT high-performance cross-platform development framework and the method of accessing rule data in the memory database, which can further improve the portability, operation reliability and data security of the software.

Claims

1. An intelligent decision-making method based on a rule engine and a finite state machine, characterized in that: The steps of this method are as follows: Step 1: Metadata management, that is, defining and maintaining state machine classification and the parameters and behaviors used by the rule conditions under the state machine: Step 1: Parameter management, which is to define and maintain the parameters or attributes used by the state rule conditions; Step 2: Classification management of state machines, that is, defining and maintaining the state machines included in the system; Step 3: Behavior management, which is to define and maintain the actions performed to meet the rule conditions; Step 2: State nodes and rule setting management, that is, defining and maintaining the state nodes under the state machine, the required rule conditions to reach the state nodes, and the behaviors to be executed: The first step is to select a state machine and enter the state name; The second step is to define the rule condition expression, select the condition parameters from the metadata table, define the corresponding thresholds, and select the "and" and "or" relationships between the compound conditions; The third step is to define the processing behavior of the rule, select the behavior to be executed to meet the rule from the atomic behavior table, and set the priority order of the execution behavior; Step 4: Repeat steps 1 to 4 until all states in the state machine are defined. Step 3: Set the internal transfer of the state space, that is, set the transfer relationship between the states within a single state machine: The first step is to select a state machine; The second step is to select the state involved in the state machine; Step 3: Set the start state; Step 4: Set the sub-states of each state in sequence starting from the start state until the last state is the end state or contains a state transition behavior; Step 4: External transfer setting of state space, that is, when the system contains multiple state machines, maintain the transfer relationship between multiple state machines: The first step is to select a state machine; The second step is to select the state machine that the state machine may transfer to from the state machine table. The third step is to define the rule condition expression, select the condition parameters from the metadata table, define the corresponding thresholds, select the "and" and "or" relationships between the compound conditions, and save the combined condition expression to the database; Step 4: Repeat steps 2 to 3 until all possible state machines to be transferred to are defined; Step 5: If the entry conditions of multiple entry state machines are the same, set the entry priority; Step 6: Repeat steps 1 to 5 until all external transfers of the state machines are set. Step 5: Obtain rules and state machine related data and store them in the system cache: The first step is parameter initialization, which obtains all parameters and their corresponding default values ​​from the metadata table of the database and stores them in the system cache; The second step is to create a memory database, and copy the state node table, state space internal transfer table, and state space external transfer table in the physical database as the master to the memory database; Step 3: Create a matching condition table in the in-memory database and add a piece of data; Step 6: Obtain the business execution or flow plan, parse the plan and store the parsing results in the system cache; Step 7: Real-time acquisition of rule input data, that is, real-time acquisition of sensor, external input data or internally processed data and assignment to corresponding rule condition parameters; Step 8: Rule matching, bring the parameter value into the rule condition expression for matching; Step 9: Process the internal state transfer of the state machine to determine whether the current state is the start state. If it is the start state, first search the start state node of the state machine from the internal transfer table of the state space, obtain the current state node number, the next state node sequence number and the state number, then set the start state flag to no, and then perform rule matching according to the state number. If it is not the start state, parse the state number that may be transferred to, cyclically search the state node and rule number from the internal transfer table of the state space, and then call the state transfer rule matching method according to the state number to perform rule matching; Step 10: Execute the corresponding actions, parse the corresponding action method names, and execute the corresponding action methods in sequence; Step 11: In step 10, if the execution action method contains a state external transfer method, the state space external transfer method is called; Step 12: External transfer processing of state space: The first step is to obtain the state machines that the current state machine may transfer to from the state space external transfer table according to the current state machine, and sort them by priority; The second step is to retrieve the information of the state machine with the highest current priority, including its conditional expression and the state machine name; The third step is to call the state transition rule matching method to transition the current state machine to the start state of another state machine; Step 13: Create and set a timer to periodically trigger the internal state transfer method of the state machine.

2. The intelligent decision-making method based on rule engine and finite state machine according to claim 1, characterized in that: In step 2 and step 4, the defined rule conditional expressions are mainly spliced ​​into atomic conditional expressions through user word meaning mapping and escaping; if it is a compound conditional expression, it is further combined on this basis according to the set logical relationship; the above-mentioned spliced ​​conditional expressions are respectively escaped into rule conditional expressions understood by users and rule conditional expressions that conform to the conditional syntax in where in the SQL language, so as to meet the needs of business personnel to define and maintain rules and coders to directly call the defined rules, thereby effectively separating business personnel and coders.

3. The intelligent decision-making method based on rule engine and finite state machine according to claim 1, characterized in that: In step 5, a memory database is created. First, a SQLite memory database is created. Then, the state node table, state space internal transfer table, and state space external transfer table in the physical database are copied to the memory database as the master copy. Then, create the state node table, state space internal transfer table, and state space external transfer table model QSqlTableModel respectively, and bind the corresponding memory database; Among them, QSqlTableModel is a read-write model control for operating database tables based on the QTSQL class. It can obtain the corresponding records of the data table according to the set conditions; finally, in the memory data, a matching condition table is created and a piece of data is added for the rule condition expression matching.

4. The intelligent decision-making method based on rule engine and finite state machine according to claim 1, characterized in that: The internal state transition rule condition matching in step nine includes the following steps: The first step is to find the corresponding rule expression and process the behavior expression by the state node number in the state node database table model; The second step is to obtain the condition parameter value from the system cache and bring it into the above rule expression; The third step is to use the parameter value as the condition of setFilter in the matching condition library table model; The fourth step is to execute the query operation of the matching condition database table model. If there is no query result record, it means that the current rule condition of the state is not met; if there is a query result record, it means that the current rule condition of the state is met. Get the next state node sequence number and assign it to the current state node variable, then get the action method name of the rule, and call the corresponding execution action method; in this way, the transfer between state nodes can be realized.

5. The intelligent decision-making method based on rule engine and finite state machine according to claim 1, characterized in that: The state transition rule matching method in step 12 includes the following steps: Step 1: Get the regular expression; Step 2: Bring in the parameter value in the condition, set the where condition to the regular expression replaced with the condition parameter value, and perform a search for the matching condition table; Step 3: Determine whether there is a query record. If there is a query result record, it means that the rule condition is met. Modify the current state machine parameter value to the transferred state machine, set the start state flag to "yes", and then the previously running state machine can jump to the transferred state machine for operation; if there is no query result record, it means that the rule condition is not met, and the current state machine remains in the previous state machine waiting for the conditions to be met to transfer out.

Citation Information

Patent Citations

  • Method for configuring and managing multimode machine supervising engine

    CN101201753A

  • Method for controlling business system by dynamic modeling of state machine

    CN103049264A

  • An automobile instrument HMI control program design system and method

    CN109947412A

  • Universal task instruction processing method supporting interoperation of unmanned system

    CN111045360A

  • Customizable automatic process method and system for cloud management platform

    CN111124642A

Cited By

  • Marine transportation scene data processing method, device, equipment and program product

    CN120416350A

  • Automatic protocol adaptation method for real-time access system of multi-source equipment

    CN120658802A