An intelligent knowledge decision and reasoning engine method and system for compilation and runtime optimization

By splitting and optimizing knowledge conditions, building weight attributes and indexes, it solves the real-time response and execution efficiency issues of decision-making and reasoning engines in existing technologies, and provides a concise knowledge definition language suitable for rapid decision-making in areas such as financial risk control and real-time anti-fraud.

CN116502712BActive Publication Date: 2025-10-10ZHEJIANG BANGSUN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211604293.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-13
Publication Date
2025-10-10
Estimated Expiration
2042-12-13

AI Technical Summary

Technical Problem

Existing deep learning methods lack explainability in the fields of financial risk control and real-time anti-fraud, resulting in the inability of decision-making and reasoning engines to respond in real time to decision-making needs in high-concurrency situations. At the same time, knowledge definitions are complex, unfriendly to non-technical personnel, and knowledge execution takes a long time.

Method used

By splitting knowledge into separate conditions, merging repeated conditions, optimizing the order of conditions based on the principles of locality and globality, building an optimized knowledge tree, and using weight attributes and machine learning models to predict execution time, optimizing the knowledge execution order, building an index to quickly locate affected knowledge, and discarding false conditions, a concise knowledge definition language is provided.

Benefits of technology

It achieves rapid response and efficient execution of decision-making and reasoning engines, simplifies the knowledge definition process, is suitable for real-time decision-making on massive data, and improves the speed and efficiency of decision-making and reasoning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116502712B_ABST
    Figure CN116502712B_ABST
Patent Text Reader

Abstract

The application discloses a kind of compiling and runtime optimization intelligent knowledge decision and reasoning engine method and system, by resolving knowledge into individual condition, then each condition is aggregated and sorted operation, to speed up the reasoning and decision process of all knowledge.In compilation, first, knowledge is preprocessed, then the same condition in different knowledge is merged, so that the same condition in different knowledge is executed only once;In actual execution, the engine adjusts the execution order of the condition and knowledge in real time by calculating the running cost of the condition, so that the decision and reasoning time is the shortest.The application can greatly speed up the decision speed for each event under complex knowledge, while also reducing a large amount of memory usage.The application is especially suitable for real-time marketing and real-time risk control fields containing massive data, with good real-time performance and high scalability.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of knowledge decision and reasoning, and in particular to a method and system for compiling and runtime optimization of intelligent knowledge decision and reasoning engine. BACKGROUND

[0002] In the field of financial risk control, real-time anti-fraud, etc., there are often decision and reasoning problems such as "whether the current operation of a certain user should be allowed" and "whether a certain user is likely to be involved in a black-related group". The existing deep learning method cannot use the reasoning result given by it as the basis for making decisions because it basically does not have explainability, and can only be used as a reference. The more general method is still to use a decision and reasoning engine based on various knowledge.

[0003] Decision and reasoning engine is one of the cores of computer technology, which can support the automation of a large number of businesses and break the efficiency and bottleneck of manual processing. It uses a series of knowledge obtained by induction to automatically determine whether there is an event that meets the pre-defined knowledge in the current generated event, or uses these knowledge to infer other results, and makes further processing according to the judgment and reasoning result. The decision and reasoning engine contains the following values: first, it allows business departments to quickly define, update and maintain current knowledge, improving operational efficiency; second, it allows non-technical personnel to quickly use the tool; third, enterprises can support a large number of business automation through the use of decision and reasoning engine, thereby speeding up the business update iteration speed.

[0004] An excellent decision and reasoning engine should have the following characteristics: flexibility, that is, not only can the knowledge be freely configured, but also the weights and other detailed properties of each knowledge can be configured to ensure the friendliness to the business; universality, that is, there should be a set of universal decision and reasoning system in the entire enterprise, which can be deployed by any department, and all tasks related to decision and reasoning can be assigned to it, avoiding the confusion caused by the enterprise managing multiple different types of decision and reasoning systems at the same time; fast deployment, that is, the configured knowledge can take effect in real time, and if it involves general knowledge modification, a gray deployment can be done; real-time response under high concurrency, that is, in the case of a large number of data concurrency, the decision and reasoning engine should also be able to respond in real time.

[0005] Current decision and reasoning engines typically contain multiple pieces of knowledge. When executing an incoming event, the decision and reasoning engine must execute all subscribed knowledge. In practical applications, the amount of knowledge in decision and reasoning engines is often very large. Furthermore, some knowledge requires not only the currently received data but also historical data when executing. To preserve historical data, it is typically stored persistently on disk and then loaded into memory when it is actually used, a process that is often very time-consuming. Ultimately, for scenarios with high real-time requirements, typical decision and reasoning systems cannot deliver the expected results in real time. Furthermore, typical decision and reasoning systems often require time-consuming learning of complex knowledge definition languages. The lack of a simple, easy-to-use knowledge definition language makes them unsuitable for non-technical business personnel. Summary of the Invention

[0006] The purpose of the present invention is to address the deficiencies of the existing technology and provide a compilation and runtime optimized intelligent knowledge decision and reasoning engine method and system, which can greatly accelerate the operation speed of the decision and reasoning engine.

[0007] The object of the present invention is achieved through the following technical solution: a compilation and runtime optimization intelligent knowledge decision and reasoning engine method, the method comprising the following steps:

[0008] (1) Obtain user-defined knowledge and perform corresponding preprocessing operations

[0009] The knowledge base in the decision and reasoning engine is initially empty. Users define a series of knowledge using the knowledge construction language included in the decision and reasoning engine. At this time, users package the knowledge definitions related to business logic into a knowledge package, and then send the knowledge package to the decision and reasoning engine's knowledge base for subsequent user subscription and use.

[0010] Users subscribe to existing knowledge packages in the decision and reasoning engine's knowledge base. After determining the knowledge package to subscribe to, the decision and reasoning engine loads the selected knowledge package from the knowledge base to the local computer and compiles all the knowledge in the package. During the compilation process, the decision and reasoning engine splits all the knowledge into separate conditions and removes duplicate conditions from each piece of knowledge.

[0011] (2) After the knowledge is stored in the knowledge base, it is compiled and optimized at runtime when judgment is needed.

[0012] After obtaining the preprocessed knowledge, the decision and reasoning engine first optimizes based on the principle of locality, merging the same conditions in different knowledge. Then, it optimizes based on the principle of globality, topologically sorting all conditions according to their relevant weights and optimizing the execution order based on the results of the topological sorting. The decision and reasoning engine then constructs an optimized knowledge tree and uses the current optimized knowledge tree to execute decisions.

[0013] Use the currently optimized knowledge tree to process incoming events. Each condition in the knowledge is an expression or a key. For each key, the corresponding result is retrieved from the cache of the decision and reasoning engine. Therefore, the execution time of the current knowledge is obtained by estimating the execution time of each condition. When the decision and reasoning engine is running, the estimated knowledge execution time is used as the cost of executing each piece of knowledge, and the execution order with the lowest cost is selected.

[0014] (3) Finally, based on the results of each knowledge after execution, the judgment given by the decision and reasoning engine is returned to the user; based on this result, the user can perform subsequent operations according to his or her own needs.

[0015] Furthermore, each condition in the knowledge contains a weight attribute, which is used to indicate the importance of the current condition in the entire result; the weight attribute is used as a reference when calculating the execution order of each condition.

[0016] Furthermore, during the compilation process, the decision and reasoning engine constructs an index based on the optimized knowledge to determine which knowledge results will be affected when the result of a condition changes; during the operation process, the decision and reasoning engine uses this index to quickly locate which knowledge results will be affected, and speeds up decision-making and reasoning by only executing the affected knowledge.

[0017] Furthermore, for each piece of knowledge, during operation, the decision and reasoning engine includes the following three optimization methods:

[0018] a) Optimize based on the probability of the result being false;

[0019] b) Estimate the running time of the entire knowledge based on the time complexity of the conditional execution;

[0020] c) Use machine learning models to predict the running time of current knowledge;

[0021] Comprehensive optimization is performed based on the above three methods to obtain the optimal knowledge execution order.

[0022] Furthermore, in step (1), during the compilation process, if the knowledge contains conditions that are known to be false, the knowledge is directly discarded.

[0023] In another aspect, the present application also provides an intelligent knowledge decision and reasoning engine system for compilation and runtime optimization, which comprises a user knowledge definition module, a knowledge management module, a decision module and a result output module.

[0024] The knowledge definition module is used to acquire user-defined knowledge and perform corresponding preprocessing operations. A user defines a series of knowledge through a knowledge construction language contained in the decision and reasoning engine. At this time, the user packs the knowledge related to business logic as a knowledge package, and then sends the knowledge package to the knowledge management module for subsequent user subscription.

[0025] The knowledge management module is used to save all user-defined knowledge packages, and other users subscribe to the knowledge packages defined and packed in the knowledge definition module. After determining the knowledge package to be subscribed, the selected knowledge package is loaded and all knowledge in the package is compiled. During the compilation process, the decision and reasoning engine splits all knowledge into individual conditions and removes duplicate conditions for each piece of knowledge.

[0026] The decision module is used to determine whether a new event can meet some knowledge subscribed by a user. After obtaining the preprocessed knowledge, the decision and reasoning engine first optimizes based on the locality principle to merge the same conditions in different knowledge. Then, based on the global principle, all conditions are topologically sorted according to the related weights, and the execution order is optimized according to the topological sorting result. The decision and reasoning engine constructs an optimized knowledge tree according to the current optimized knowledge tree, and uses the current optimized knowledge tree to execute the decision. The current optimized knowledge tree is used to process the incoming event. Each condition in the knowledge is an expression or a Key. For a Key, the corresponding result is taken from the cache of the decision and reasoning engine, so the execution time of the current knowledge is obtained by estimating the execution time of each condition. During the runtime of the decision and reasoning engine, the estimated knowledge execution time is used as the cost of executing each knowledge, and the execution order with the minimum cost is selected.

[0027] The result output module is used to output the results of each knowledge after the execution of the current decision and reasoning engine, and returns the judgment given by the decision and reasoning engine to the user. According to this result, the user can perform subsequent operations according to his own needs.

[0028] Further, the system further comprises a runtime bypass optimization module, which is used to optimize each piece of knowledge during the running process through the following three means to obtain the optimal knowledge execution order:

[0029] a) optimization according to the probability of false result;

[0030] b) Estimate the running time of the entire knowledge based on the time complexity of the conditional execution;

[0031] c) Use relevant machine learning models to predict the running time of current knowledge.

[0032] Beneficial effects of the present invention:

[0033] (1) Provide a universal way to define and construct knowledge

[0034] It provides a unified approach to knowledge definition and construction, enabling not only simple knowledge consisting of multiple conditions but also easily extending it to knowledge represented by graphs or complex knowledge represented by various machine learning models. It uses an expression similar to the Java Lambda language, offering clear logic and ease of learning.

[0035] (2) Optimizing the execution method of knowledge

[0036] Knowledge compilation optimization: First, conditions that are guaranteed to be false are discarded. Then, each piece of knowledge is split into individual conditions. Repeated conditions are merged so that each condition is executed at most once. This significantly improves decision-making and reasoning speed when there are many repeated conditions.

[0037] Knowledge Runtime Optimization: The core of runtime optimization is to identify the false conditions as soon as possible for knowledge that ultimately results in false results, thereby terminating the execution of the current knowledge. During runtime, the decision and reasoning engine's built-in algorithms estimate the execution time of knowledge and optimize the execution order accordingly.

[0038] Knowledge query optimization: During the execution of knowledge, an efficient cache is used to optimize complex indicator queries in some conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 Flowchart of the intelligent knowledge decision-making and reasoning engine method for compilation and runtime optimization provided by the present invention.

[0040] Figure 2 This is a diagram of the system architecture of the intelligent knowledge decision and reasoning engine for compilation and runtime optimization provided by the present invention.

[0041] Figure 3 This is a diagram of the optimization process of multi-knowledge decision-making of the present invention.

[0042] Figure 4 This is a business process diagram of the intelligent knowledge decision-making and reasoning engine for compilation and runtime optimization provided by the present invention. DETAILED DESCRIPTION

[0043] The specific embodiments of the present invention are further described in detail below with reference to the accompanying drawings.

[0044] like Figure 1 As shown, the present invention provides an intelligent knowledge decision and reasoning engine method with compilation and runtime optimization. This method breaks down knowledge into individual conditions and then aggregates and sorts each condition to accelerate the reasoning and decision-making process of all knowledge at once.

[0045] The knowledge is composed of several conditions, which are connected by "and" and "or" relationships; all conditions of each knowledge can be split by preprocessing the knowledge, and all conditions in the knowledge can be reordered; during compilation, the knowledge is first preprocessed, and then the same conditions in different knowledge are merged, so that the same conditions in different knowledge are only executed once; during actual execution, the engine adjusts the execution order of conditions and knowledge in real time by calculating the running cost of the conditions, so that the decision-making and reasoning time is minimized.

[0046] Assume that n pieces of knowledge are defined, and the format of each piece of knowledge is Knowledge i =(fact i ,Relation i ), where fact represents a series of conditions in a rule, and relation represents the relationship between conditions, typically "AND" and "OR". Assume that a newly arrived event is called Event.

[0047] The method of the present invention comprises the following steps:

[0048] (1) Obtain user-defined knowledge and perform corresponding preprocessing operations

[0049] The knowledge base in the decision and reasoning engine is initially empty; users define a series of knowledge through the knowledge construction language contained in the decision and reasoning engine; at this time, users package the knowledge definitions related to business logic into a knowledge package, and then send the knowledge package to the knowledge base of the decision and reasoning engine for subsequent users to subscribe and use.

[0050] Users subscribe to existing knowledge packages in the decision and reasoning engine's knowledge base. After determining the knowledge package to subscribe to, the decision and reasoning engine loads the selected knowledge package from the knowledge base to its local machine and compiles all the knowledge in the package. During the compilation process, the decision and reasoning engine breaks all knowledge into separate conditions, removing duplicate conditions from each piece of knowledge. If the knowledge contains conditions that are known to be false, the knowledge is discarded.

[0051] (2) After the knowledge is saved in the knowledge base, compile and run-time optimization is performed when a decision needs to be made

[0052] After the pre-processed knowledge is obtained, the decision and reasoning engine first optimizes based on the locality principle, merging the same conditions in different knowledge; then optimizes based on the global principle, topologically sorting all the conditions according to the related weights, and optimizing the execution order according to the topological sorting result; each condition in the knowledge contains a weight attribute, which is used to represent the importance of the current condition in the entire result; when calculating the execution order of each condition, the weight attribute is used as a reference. The decision and reasoning engine builds an optimized knowledge tree according to the above, and uses the current optimized knowledge tree to execute the decision;

[0053] The current optimized knowledge tree is used to process incoming events; each condition in the knowledge is an expression or a Key, and for a Key, the corresponding result is taken from the cache of the decision and reasoning engine, so the execution time of the current knowledge is obtained by estimating the execution time of each condition; during the runtime of the decision and reasoning engine, the estimated knowledge execution time is used as the cost of executing each knowledge, and the execution order with the minimum cost is selected;

[0054] During the compilation process, the decision and reasoning engine constructs an index based on the optimized knowledge, which is used to determine which knowledge results will be affected when the result of a condition changes; during the running process, the decision and reasoning engine uses this index to quickly locate which knowledge results will be affected, and speeds up the decision and reasoning by only executing the affected knowledge.

[0055] For each piece of knowledge, the decision and reasoning engine contains the following three optimization methods during the running process:

[0056] a) Optimizing according to the probability of the result being false;

[0057] b) Estimating the running time of the entire knowledge according to the time complexity of the execution of the conditions;

[0058] c) Using machine learning models to predict the running time of the current knowledge;

[0059] According to the above three methods, comprehensive optimization is performed to obtain the optimal knowledge execution order.

[0060] (3) Finally, based on the results of each knowledge after execution, the judgment given by the decision and reasoning engine is returned to the user; based on this result, the user can perform subsequent operations according to his or her own needs. The present invention includes event modeling, real-time knowledge application, compile-time optimization technology, and runtime optimization technology in massive data. Knowledge is constructed and represented through a Java Lambda-like DSL language, which contains the most basic operations such as AND, OR, NOT, and WHEN, and can determine whether the incoming event meets the existing rules. It is mainly suitable for fields such as financial risk control, sales, transportation, and real-time anti-fraud that have high real-time requirements for knowledge application, and can quickly identify and make decisions on events contained in massive data based on predefined knowledge.

[0061] On the other hand, the present invention also provides an intelligent knowledge decision and reasoning engine system for compilation and runtime optimization, including a user knowledge definition module, a knowledge management module, a decision module, a runtime bypass optimization module and a result output module. The relationship between the modules in the system is as follows: Figure 2 shown.

[0062] The knowledge definition module is used to obtain user-defined knowledge and perform corresponding preprocessing operations. The user defines a series of knowledge using the knowledge construction language included in the decision and reasoning engine. At this time, the user packages the knowledge definitions related to the business logic into a knowledge package, and then sends the knowledge package to the knowledge management module for subsequent user subscription and use;

[0063] The knowledge management module is used to store all user-defined knowledge packages. Other users can subscribe to the knowledge packages defined in the knowledge definition module. Once the subscription is complete, when an event triggers the subscribed knowledge, the user will receive a corresponding notification. After determining the knowledge package to subscribe to, the selected knowledge package is loaded and all the knowledge in the package is compiled. During the compilation process, the decision and reasoning engine splits all knowledge into separate conditions and removes duplicate conditions from each piece of knowledge.

[0064] The decision module is used to determine whether the current new event can satisfy certain knowledge subscribed by the user; before the first judgment, all knowledge will be compiled, and the repeated conditions in each knowledge will be merged to obtain the duplicated conditions. These conditions will then be used to construct a decision tree. Specifically, after obtaining the pre-processed knowledge, the decision and reasoning engine will first be optimized based on the principle of locality, merging the same conditions in different knowledge; then it will be optimized based on the principle of globality, topologically sorting all conditions according to the relevant weights, and optimizing the execution order according to the results of the topological sorting; the decision and reasoning engine will construct an optimized knowledge tree and use the current optimized knowledge tree to execute decisions; the current optimized knowledge tree will be used to process incoming events, and the incoming events will be traversed from the root node of the decision tree to determine whether the current event can meet the conditions on the decision tree. If they cannot be met, the matching of the current knowledge will be stopped immediately. Each condition in the knowledge is an expression or a key. For each key, the corresponding result is retrieved from the cache of the decision and reasoning engine. Therefore, the execution time of the current knowledge is obtained by estimating the execution time of each condition. When the decision and reasoning engine is running, the estimated knowledge execution time is used as the cost of executing each piece of knowledge, and the execution order with the lowest cost is selected.

[0065] The runtime bypass optimization module is used to comprehensively optimize each piece of knowledge during operation through the following three methods to obtain the optimal knowledge execution order:

[0066] a) Optimize based on the probability of the result being false;

[0067] b) Estimate the running time of the entire knowledge based on the time complexity of the conditional execution;

[0068] c) Use machine learning models to predict the running time of current knowledge;

[0069] According to the above optimization means, during the operation of the decision and reasoning engine, the decision tree is dynamically adjusted according to the execution status of the current knowledge to minimize the time of traversing the decision tree.

[0070] The result output module is used to output the results of each knowledge point after the current decision and inference engine is executed, returning the judgment given by the decision and inference engine to the user. When a newly arrived event meets certain knowledge points, the result output module will immediately return the matching knowledge points to users who have subscribed to the rules. Based on this result, users can perform subsequent operations as needed.

[0071] The overall business process of the decision and reasoning engine provided by the present invention is as follows Figure 3 shown.

[0072] Assume that the knowledge defined by the user in the knowledge definition module is as shown in Table 1:

[0073] Table 1 Example of knowledge construction

[0074]

[0075] The initial decision tree and the optimized decision tree constructed using the above rules are as follows Figure 4 shown.

[0076] Example:

[0077] This embodiment further illustrates the above-mentioned intelligent knowledge decision-making and reasoning engine system with compilation and runtime optimization.

[0078] The user wants to build an anti-fraud knowledge package, and the defined knowledge is shown in Table 2:

[0079] Table 2

[0080]

[0081]

[0082]

[0083] After the system obtains the knowledge defined by the user knowledge definition module, it will send it to the knowledge management module. The knowledge management module will store the knowledge for other users to subscribe to and use.

[0084] Assume a user has subscribed to the aforementioned knowledge. When an event arrives, the decision module enters. Since this is the first time a decision is made, the current knowledge needs to be compiled and optimized. The rules contain some nodes that use keys as conditions. When the system encounters these nodes, it uses an efficient cache to quickly retrieve the conditional results.

[0085] When the decision is made, the system will return the decision results of each knowledge to the users who have subscribed to this knowledge through the result output module, and then the users will perform relevant operations based on these results.

[0086] Knowledge matching was performed using a currently common open source decision engine and the decision and reasoning engine proposed in this invention. After constructing different numbers of rules and sending 100 million test data to the two decision engines, the performance comparison of the two systems is shown in Table 3. The average time unit is milliseconds, and the other time units are seconds. In the table below, the open source decision engine Red Hat Drools 6.5 is abbreviated as "Drools", and a compilation and runtime optimized intelligent knowledge decision and reasoning engine is abbreviated as "this engine".

[0087] Table 3

[0088]

[0089]

[0090] The above embodiments are used to illustrate the present invention rather than to limit the present invention. Any modifications and changes made to the present invention within the spirit of the present invention and the protection scope of the claims shall fall within the protection scope of the present invention.

Claims

1. A compilation and runtime optimization intelligent knowledge decision and reasoning engine method, characterized in that: The method includes the following steps: (1) Obtain user-defined knowledge and perform corresponding preprocessing operations The knowledge base in the decision and reasoning engine is initially empty. Users define a series of knowledge using the knowledge construction language included in the decision and reasoning engine. At this time, users package the knowledge definitions related to business logic into a knowledge package, and then send the knowledge package to the decision and reasoning engine's knowledge base for subsequent user subscription and use. Users subscribe to existing knowledge packages in the knowledge base of the decision and reasoning engine; After determining the knowledge package to be subscribed, the decision and reasoning engine loads the selected knowledge package from the knowledge base to the local computer and compiles all the knowledge in the package; During the compilation process, the decision and reasoning engine splits all knowledge into separate conditions and removes duplicate conditions from each piece of knowledge; (2) After the knowledge is stored in the knowledge base, it is compiled and optimized at runtime when judgment is needed. After obtaining the preprocessed knowledge, the decision and reasoning engine first optimizes based on the principle of locality, merging the same conditions in different knowledge. Then, it optimizes based on the principle of globality, topologically sorting all conditions according to their relevant weights and optimizing the execution order based on the results of the topological sorting. The decision and reasoning engine then constructs an optimized knowledge tree and uses the current optimized knowledge tree to execute decisions. Use the currently optimized knowledge tree to process incoming events; Each condition in the knowledge is an expression or a key. For each key, the corresponding result is retrieved from the cache of the decision and reasoning engine. Therefore, the execution time of the current knowledge is obtained by estimating the execution time of each condition. When the decision and reasoning engine is running, the estimated knowledge execution time is used as the cost of executing each piece of knowledge, and the execution order with the lowest cost is selected; (3) Finally, based on the results of each knowledge after execution, the judgment given by the decision and reasoning engine is returned to the user; based on this result, the user can perform subsequent operations according to his or her own needs.

2. The intelligent knowledge decision and reasoning engine method for compilation and runtime optimization according to claim 1, characterized in that: Each condition in the knowledge contains a weight attribute, which is used to indicate the importance of the current condition in the entire result. The weight attribute is used as a reference when calculating the execution order of each condition.

3. The intelligent knowledge decision and reasoning engine method for compilation and runtime optimization according to claim 1, characterized in that: During the compilation process, the decision and reasoning engine constructs an index based on the optimized knowledge to determine which knowledge results will be affected when the result of a condition changes; During operation, the decision and reasoning engine uses this index to quickly locate which knowledge results will be affected, and speeds up decision-making and reasoning by executing only the affected knowledge.

4. The intelligent knowledge decision and reasoning engine method for compilation and runtime optimization according to claim 1, characterized in that: For each piece of knowledge, during operation, the decision and reasoning engine includes the following three optimization methods: a) Optimize based on the probability of the result being false; b) Estimate the running time of the entire knowledge based on the time complexity of the conditional execution; c) Use machine learning models to predict the running time of current knowledge; Comprehensive optimization is performed based on the above three methods to obtain the optimal knowledge execution order.

5. The intelligent knowledge decision and reasoning engine method for compilation and runtime optimization according to claim 1, characterized in that: In step (1), during the compilation process, if the knowledge contains conditions that are known to be false, the knowledge is directly discarded.

6. An intelligent knowledge decision and reasoning engine system for compiling and optimizing at runtime that implements the intelligent knowledge decision and reasoning engine method for compiling and optimizing at runtime as described in any one of claims 1 to 5, characterized in that: The system includes a user knowledge definition module, a knowledge management module, a decision module and a result output module; The knowledge definition module is used to obtain user-defined knowledge and perform corresponding preprocessing operations. The user defines a series of knowledge using the knowledge construction language included in the decision and reasoning engine. At this time, the user packages the knowledge definitions related to the business logic into a knowledge package, and then sends the knowledge package to the knowledge management module for subsequent user subscription and use; The knowledge management module is used to store all user-defined knowledge packages, and other users subscribe to the knowledge packages defined and packaged in the knowledge definition module; After determining the knowledge package you need to subscribe to, load the selected knowledge package and compile all the knowledge in the package; During the compilation process, the decision and reasoning engine splits all knowledge into separate conditions and removes duplicate conditions from each piece of knowledge; The decision module is used to determine whether the current new event can satisfy certain knowledge subscribed by the user. After obtaining the pre-processed knowledge, the decision and reasoning engine first optimizes based on the principle of locality, merging the same conditions in different knowledge. Then, it optimizes based on the principle of globality, topologically sorting all conditions according to their relevant weights, and optimizing the execution order based on the results of the topological sorting. The decision and reasoning engine constructs an optimized knowledge tree and uses the current optimized knowledge tree to execute decisions. Use the currently optimized knowledge tree to process incoming events; Each condition in the knowledge is an expression or a key. For each key, the corresponding result is retrieved from the cache of the decision and reasoning engine. Therefore, the execution time of the current knowledge is obtained by estimating the execution time of each condition. When the decision and reasoning engine is running, the estimated knowledge execution time is used as the cost of executing each piece of knowledge, and the execution order with the lowest cost is selected; The result output module is used to output the results of each knowledge after the current decision and reasoning engine is executed, and return the judgment given by the decision and reasoning engine to the user; based on this result, the user can perform subsequent operations according to his or her own needs.

7. The intelligent knowledge decision and reasoning engine system with compilation and runtime optimization according to claim 6, characterized in that: The system also includes a runtime bypass optimization module, which is used to comprehensively optimize each piece of knowledge during operation through the following three methods to obtain the optimal knowledge execution order: a) Optimize based on the probability of the result being false; b) Estimate the running time of the entire knowledge based on the time complexity of the conditional execution; c) Use relevant machine learning models to predict the running time of current knowledge.

Citation Information

Patent Citations

  • Software middleware oriented intelligent decision supporting frame and working method thereof

    CN101976375A

  • Decision support system architecture and method based on water conservancy knowledge-fact coupling network

    CN111368095A