Implementation method of expert system based on multi-source knowledge

By constructing an expert system with multi-source knowledge, the versatility of the knowledge base and the reasoning ability are improved, the inefficiency of expert systems in cross-domain applications is solved, and the usability and scalability of the system are enhanced.

CN115526319BActive Publication Date: 2026-04-24SHANGHAI JIAOTONG UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI JIAOTONG UNIV
Filing Date
2022-10-28
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing expert systems typically have knowledge bases from a single source, which leads to inefficiency in cross-domain applications and a lack of explanatory capabilities and poor portability.

Method used

We construct an expert system based on multi-source knowledge, which uses a knowledge parser to convert knowledge from different sources into a unified format, and uses an inference engine to perform complex reasoning, combining knowledge graphs, rules and functions to solve problems.

Benefits of technology

It enhances the knowledge base versatility and reasoning ability of expert systems, supports multiple knowledge sources, breaks down domain limitations, and improves the ease of use and scalability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115526319B_ABST
    Figure CN115526319B_ABST
Patent Text Reader

Abstract

The application discloses an implementation method of an expert system based on multi-source knowledge, which comprises the following steps: constructing a knowledge base, respectively analyzing and converting different sources of knowledge into a format recognizable by the knowledge base, collecting question input, judging the domain of the input question, solving the question by using a domain method, observing the input question, querying matched rules or functions according to similar matching, further performing complete matching according to the rules and functions obtained through similar matching, generating a reasoning result, adding the reasoning result into the knowledge base, deleting redundant candidate reasoning results with a high probability of uselessness through reasoning contraction, and outputting the final result of the reasoning machine reasoning. The application greatly enhances the universality of the knowledge base, greatly widens the knowledge source, and greatly enhances the knowledge reasoning capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a technology in the field of expert systems, specifically a method for implementing an expert system based on multi-source knowledge. Background Technology

[0002] An expert system is an intelligent computer program system that contains a large amount of knowledge and experience at the level of an expert in a particular field. It can apply artificial intelligence and computer technology to reason and make judgments based on the knowledge and experience in the system, simulating the decision-making process of human experts in order to solve complex problems that require human experts to handle. In short, an expert system is a computer program system that simulates human experts in solving problems in a specific domain.

[0003] Expert systems typically consist of six parts: a human-computer interface, a knowledge base, an inference engine, an interpreter, a comprehensive database, and a knowledge acquisition module. A unique feature is the separation of the knowledge base and the inference engine. The architecture of an expert system varies depending on its type, function, and scale.

[0004] Since the first expert system, DENDRAL, was introduced at Stanford University in the United States in 1965, after 50 years of development, various expert systems have spread to various professional fields, involving industry, agriculture, military and various sectors of the national economy and even many aspects of social life.

[0005] Early expert systems, such as the DENDRAL system (1968, Feigenbaum et al., Stanford University), were used to infer the structure of chemical molecules, while the MYCSYMA system (1971, MIT) was used for mathematical operations. Their characteristics included high specialization and strong problem-solving capabilities, but they suffered from incomplete structure and functionality, poor portability, and a lack of interpretability.

[0006] Later, expert systems entered a mature stage, with systems such as MYCIN (Stanford University) for diagnosing blood-borne infectious diseases, PROSPECTOR (Stanford Research Institute) for mineral exploration, CASNET (Rutgers University) for glaucoma diagnosis and treatment, AM (1981, Stanford University) for simulating human generalization, abstraction, and inductive reasoning, and for discovering certain number theory concepts and theorems, and HEARSAY (Carnegie Mellon University) for speech recognition. These systems are characterized by: single-discipline professional expert systems; complete system structure, comprehensive functions, and good portability; reasoning and interpretation capabilities, and good transparency; the use of heuristic and imprecise reasoning; the use of production rules, frames, and semantic networks to express knowledge; and the use of definite English for human-computer interaction.

[0007] From the 1980s to the present, expert systems have entered a period of further development, with the emergence of XCON (DEC Corporation, Carnegie Mellon University) for developing hardware configuration schemes for VAX computer systems, as well as expert system development tools, such as skeleton systems (EMYCIN, KAS, EXPERT, etc.), general-purpose knowledge representation languages ​​(OPS5, etc.), and expert system development environments (AGE, etc.).

[0008] Currently, my country has also developed expert systems such as the Fertilization Expert System (Hefei Institute of Intelligent Machines, Chinese Academy of Sciences), the New Tectonic Water Exploration Expert System (Nanjing University), the Exploration Expert System and Oil and Gas Resource Evaluation Expert System (Jilin University), the Clothing Cutting Expert System and Floral Pattern Design Expert System (Zhejiang University), and the Guan Youbo Liver Disease Diagnosis Expert System (Beijing University of Traditional Chinese Medicine).

[0009] Although expert systems have been widely used in various fields and have achieved good results, their problem-solving scope is often limited, mainly because: ① insufficient knowledge; ② inappropriate problem-solving methods. Moreover, most expert systems are built for a specific domain, and once they step outside that domain, the system may no longer be able to operate effectively. Summary of the Invention

[0010] To address the aforementioned shortcomings of existing technologies, this invention proposes a method for implementing an expert system based on multi-source knowledge, which greatly enhances the versatility of the knowledge base, broadens the sources of knowledge, and significantly strengthens knowledge reasoning capabilities.

[0011] This invention is achieved through the following technical solution:

[0012] This invention relates to a method for implementing an expert system based on multi-source knowledge. The method involves constructing a knowledge base, parsing knowledge from different sources and converting it into a format recognizable by the knowledge base, collecting problem input, determining the domain of the input problem, and using domain-specific methods to solve the problem. The method then performs reasoning observation on the input problem, queries matching rules or functions based on similarity matching, performs further complete matching based on the rules and functions obtained from similarity matching, generates reasoning results, and adds the reasoning results to the knowledge base. Finally, the method shrinks and removes redundant and likely useless candidate reasoning results, and outputs the final result of the inference engine's reasoning.

[0013] This invention relates to a system for implementing the above method, comprising: a knowledge parser, a knowledge base, a reasoning engine, a user interface, and an output generator, wherein: the knowledge parser performs corresponding parsing processing according to different types of input knowledge, and converts the parsing results into the knowledge base; the knowledge base uses a knowledge model with general knowledge expression capabilities to store knowledge; the reasoning engine performs reasoning based on the user-input question and obtains a reasoning result (which may be a failed reasoning result); the user interface is responsible for interacting with the user, and the interaction method is command line; the output generator outputs the user-specified object in the user-specified format according to the user-input instructions.

[0014] Technical effect

[0015] This invention uses knowledge graphs, rules, and functions as basic elements to realize a general knowledge base. It utilizes various existing knowledge extraction and parsing techniques to analyze knowledge from multiple sources and integrates the parsing results into the general knowledge base. The reasoning of the inference engine is divided into simple reasoning and complex reasoning. Simple reasoning uses knowledge graph matching technology to find solutions to problems, while complex reasoning uses a cyclical process of reasoning observation, reasoning expansion, and reasoning contraction to try to find solutions to problems.

[0016] Compared with existing technologies, this invention supports multiple knowledge sources, solving the problem that previous expert systems could only parse a single knowledge source, and enhancing the ease of use and scalability of expert systems. The use of complex reasoning breaks to some extent the limitation of the inference engine of previous expert systems being restricted by the domain, so that some problems not covered by the algorithms pre-designed by expert systems can also be automatically solved by the inference engine. Attached Figure Description

[0017] Figure 1 A flowchart for multi-source knowledge parsing;

[0018] Figure 2 This is the core flowchart of the inference engine;

[0019] Figure 3 Expert system architecture diagram;

[0020] Figure 4 This is a diagram of the logical terms structure.

[0021] Figure 5 Flowcharts are used in expert systems. Detailed Implementation

[0022] like Figure 1 The diagram illustrates an implementation method for an expert system based on multi-source knowledge, comprising the following steps:

[0023] Step 1) Building a knowledge base

[0024] The knowledge base includes: a main knowledge graph, a rule base, and a function base. The main knowledge graph is a graph composed of nodes and relations, used to describe a large number of triple relations (A, Relation, B). The rule base consists of a large number of rules, each of which is a proposition, which may or may not have parameters. Parameterless rules are in the form IFATHEN B, and parameterized rules are in the form Foreach(x,y,z):IFATHEN B, where A and B are each a logical AND term (see...). Figure 4 Each logical AND term consists of at least one small knowledge graph and zero or more logical OR terms, and each logical OR term consists of at least one logical AND term; the function library consists of a large number of functions. Each function consists of input parameters, local variables, and a sequence of instructions. Each instruction can be a control instruction (such as return, conditional execution), a basic instruction (such as addition, subtraction, multiplication, and division), or a call to another function. The default execution mode of a function is to execute the function body in an infinite loop, exiting the function body execution by the return instruction. In addition, each function and each instruction can have start and end properties set, which are both logical AND terms used to describe the start and end states of the corresponding function or instruction.

[0025] Step 2) Parse the knowledge from knowledge graphs, graph databases, and relational databases and convert it into a format that the knowledge base can recognize, so that the expert system can analyze and process it. This specifically includes:

[0026] 2.1) For the data in the knowledge graph and graph database, perform data parsing directly to read all the triple relations (A, Relation, B), and then add these triple relations to the knowledge graph of the knowledge base.

[0027] 2.2) For data in a relational database, first perform data parsing to retrieve all relation records Ri(e1,e2,…,eN). For records of the form R(A), convert them into triple relations of the form (A,R,null). For records of the form R(A,B), convert them into triple relations of the form (A,R,B). For longer records R(e1,e2,…,eN), convert them into a set of triple relations of the form (e1,R,e2), (e1,R,e3), …, (e1,R,eN). Then add all the converted triple relations to the knowledge graph of the knowledge base.

[0028] Step 3) Parse the knowledge from XML and JSON and convert it into a format that the knowledge base can recognize, so that the expert system can analyze and process it. This specifically includes:

[0029] 3.1) For XML format, firstly, DOM (Document Object Model) technology is used to parse the XML file into a DOM tree, and then the nodes of the DOM tree are identified: the knowledge graph nodes in the DOM tree ( <kg>Parse the knowledge graph into triplet relations using the parsing method in step 2.1 and add them to the knowledge graph of the knowledge base. Then, add the rule nodes in the DOM tree ( <rule>) is parsed according to the tags of its child nodes into rules in the knowledge base, and the function nodes in the DOM tree are ( <func>The functions are parsed into functions in the knowledge base based on the tags of its child nodes.

[0030] 3.2) For JSON format, firstly, a finite state machine is used to perform lexical analysis on the JSON file. Then, a top-down syntax analysis is performed on the result of the lexical analysis to obtain the JSON object tree. Next, the nodes of the object tree are identified: the knowledge graph object ({kg:…}) in the object tree is parsed into triple relations according to the knowledge graph parsing method in step 2.1 and added to the knowledge graph of the knowledge base; the rule object ({rule:…}) in the object tree is parsed into rules in the knowledge base according to the key-value pairs of its child objects; and the function object ({func:…}) in the object tree is parsed into functions in the knowledge base according to the key-value pairs of its child objects.

[0031] Step 4) Parse the knowledge from Lisp and Prolog and convert it into a format that the knowledge base can recognize, so that the expert system can analyze and process it. This includes:

[0032] 4.1) For the Lisp format, a finite state machine is first used to perform lexical analysis on the Lisp file. Then, a top-down syntax analysis is performed on the result of the lexical analysis to obtain the Lisp abstract syntax tree. The Lisp abstract syntax tree is then parsed to convert the Lisp functions into functions in the function library of the knowledge base of this invention.

[0033] 4.2) For the Prolog format, a finite state machine is first used to perform lexical analysis on the Prolog file. Then, a top-down syntax analysis is performed on the result of the lexical analysis to obtain the Prolog abstract syntax tree. The Prolog abstract syntax tree is then parsed to convert the Prolog rules into rules in the rule base of the knowledge base of this invention.

[0034] Step 5) Collect problem input: A problem is to prove a proposition (its form is consistent with the rules in the rule base of the knowledge base of this invention), which is a proof problem; a problem is to find several entities in the knowledge base that match the parameters one by one, and satisfy the condition that the logical AND term can be inferred by the current knowledge base after parameter substitution, which is a query problem. For example, a proof problem is Foreach(x) IF x is an integer THEN x is a rational number. If the knowledge base has sufficient knowledge (knowledge graph, rules, functions), then the conclusion should be reached—the proposition is true. For example, a query problem is Select(a,b):(a,capital_is,b). If the knowledge base has appropriate knowledge, then several solutions should be found.

[0035] For example: (a,b) = (China,Beijing), which is (China,capital_is,Beijing). The specific steps to solve the input problem are as follows.

[0036] Step 6) Domain-Specific Determination for Input Question: Based on the user's input question, the rule base and function base in the knowledge base are traversed to determine whether the question can be solved using a domain-specific method. The determination method is based on the conditional clause (IF-clause, a logical AND term) of the rule or the initial property of the function (also a logical AND term). A complete match is performed on the input question (i.e., replacing the parameter entity in the logical AND term with an existing entity, and then calculating whether the parameter logical AND term is contained within an existing logical AND term). If a match is successful, it means that a rule or function in the knowledge base already provides a solution to the problem; the solution can be obtained by directly using the corresponding rule or running the corresponding function. This is called simple reasoning. If no match is found, the inference engine enters a loop reasoning process; this is called complex reasoning.

[0037] Step 7) Solve the problem using a domain-specific approach: Based on the result of step 6, the problem input by the user is handed over to the corresponding matching domain-specific approach for resolution, that is, the corresponding rules are used to deduce or the corresponding function is run.

[0038] For example, when a user requests to solve a quadratic equation QuadEq(3,4,5), the system iterates through the rule base and function base of the matching knowledge base. When it finds a function SolveQuadEq(a,b,c) that solves quadratic equations, it calls that function to solve the input quadratic equation, i.e., it calls SolveQuadEq(3,4,5).

[0039] Step 8) The inference engine performs reasoning and observation on the input question, and queries matching rules or functions based on similarity matching. Since Step 2 determined that there are no rules or methods in the knowledge base that can completely match the input question, the inference engine can continue to try reasoning in order to make progress.

[0040] For example, if there are no rules or functions for solving quadratic equations in the knowledge base, then you can still solve them by transposing terms or completing the square; if you observe that the coefficient of the quadratic term is 0, then you can eliminate the quadratic term and then find the solution to the linear equation.

[0041] Step 9) Based on the rules and functions obtained from similarity matching in Step 4, perform a complete match, generate inference results, and add the inference results to the knowledge base.

[0042] For example, when solving a quadratic equation can be done by completing the square, this step performs a complete match on the corresponding rule or function of the square, then performs the corresponding square transformation on the equation, and adds the new equation after the square to the knowledge base. Since each parameter is independent, the scale of a complete match may be very large (N1*N2*…Nm, where Ni is the number of candidate entities for the i-th parameter), and the matching time and the number of matching results grow at a combinatorial level, so a threshold needs to be set manually. The thresholds set in this invention are the maximum number of parameters for a single rule / function (6), the maximum number of candidate entities for a single parameter (100), and the maximum number of successful matching results in a single match (100).

[0043] Step 10) Redundant and likely useless inference results are deleted through inference shrinking to prevent the inference engine from quickly exhausting system resources and halting inference progress. This step performs similarity matching on the generated entities and relations. If several entities (the threshold set in this invention is 10) have similar relations and relation objects, these entities are likely redundant, and only one can be retained. For generated rules, their IF clauses and THEN clauses are fully matched pairwise. If one rule is a complete subset of another rule, the weaker rule is deleted. For generated functions, their initial and final properties are fully matched pairwise. If the properties of one function are completely covered by another function, the weaker function is deleted.

[0044] Step 11) Output the final result of the inference engine, i.e., the result calculated using rules or function calls in Step 3, the result observed in Step 4 indicating that the problem has been solved, or the error message output in Step 4 indicating that the system's time or space resources have been exhausted and cannot be freed up through inference. The final result can be output in any input format from any knowledge source, such as knowledge graphs, XML, Lisp, etc.

[0045] This embodiment relates to an expert system based on the above-described method, comprising: a knowledge parser, a knowledge base, a reasoning engine, a user interface, and an output generator. The knowledge parser performs corresponding parsing processing based on different types of input knowledge and converts the parsing results into the knowledge base. The knowledge base uses a knowledge model with general knowledge representation capabilities to store knowledge. The reasoning engine performs reasoning based on the user-input question and obtains the reasoning result. The user interface is responsible for interacting with the user via command line. The output generator outputs user-specified objects in a user-specified format according to user-input instructions.

[0046] Through practical experiments, running the aforementioned expert system on the Windows platform, it successfully reads, parses, and adds knowledge from various formats, including knowledge graphs, relational databases, graph databases, XML, JSON, Lisp, and Prolog, to the knowledge base. The output of the knowledge base shows that its content meets expectations. When users input questions in JSON format, simple queries produce expected results (success or failure), while some complex queries also run successfully. However, due to the relatively small threshold setting, the failure rate for complex queries becomes extremely high as the question size increases.

[0047] Compared with existing technologies, this method greatly enhances the universality of the knowledge base, broadens the sources of knowledge, and significantly improves the ability of knowledge reasoning.

[0048] The above-described specific implementations can be partially adjusted by those skilled in the art in different ways without departing from the principles and purpose of the present invention. The scope of protection of the present invention is defined by the claims and is not limited to the above-described specific implementations. All implementation schemes within the scope of the claims are bound by the present invention.< / func> < / rule> < / kg>

Claims

1. A method for implementing an expert system based on multi-source knowledge, characterized in that, Specifically, it includes: Step 1) Building a knowledge base: Step 2) Parse the knowledge from knowledge graphs, graph databases, and relational databases and convert it into a format that the knowledge base can recognize. This specifically includes: 2.1) For the data in the knowledge graph and graph database, perform data parsing directly to read all the triple relations (A, Relation, B), and then add these triple relations to the knowledge graph of the knowledge base; 2.2) For data in a relational database, first perform data parsing to read all relational records Ri(e1,e2,…,eN), specifically: a) For records in R(A), convert them into a triple relation of (A,R,null); b) For records in R(A,B), convert them into triple relations of (A,R,B); c) For a longer record R(e1,e2,…,eN), convert it into a set of triples (e1,R,e2), (e1,R,e3), …, (e1,R,eN); Then add all the triple relations converted above to the knowledge graph of the knowledge base; Step 3) Parse the knowledge from XML and JSON and convert it into a format that the knowledge base can recognize, specifically including: i) For XML format, first use DOM technology to parse the XML file into a DOM tree, then identify the nodes in the DOM tree: identify the knowledge graph nodes in the DOM tree ( <kg>Parse the knowledge graph into triplet relations using the parsing method in step 2.1 and add them to the knowledge graph of the knowledge base. Then, add the rule nodes in the DOM tree ( <rule>) is parsed according to the tags of its child nodes into rules in the knowledge base, and the function nodes in the DOM tree are ( <func> The functions are parsed into functions in the knowledge base based on the tags of their child nodes.< / func> < / rule> < / kg> ii) For JSON format, firstly, a finite state machine is used to perform lexical analysis on the JSON file, and then top-down syntax analysis is performed on the result of lexical analysis to obtain the JSON object tree; then, the nodes of the object tree are identified: the knowledge graph object ({kg:…}) in the object tree is parsed into triple relations according to the knowledge graph parsing method in step 2.1 and added to the knowledge graph of the knowledge base; the rule object ({rule:…}) in the object tree is parsed into rules in the knowledge base according to the key-value pairs of its child objects; and the function object ({func:…}) in the object tree is parsed into functions in the knowledge base according to the key-value pairs of its child objects. Step 4) Parse the knowledge from Lisp and Prolog and convert it into a format that the knowledge base can recognize, specifically including: α) For the Lisp format, firstly, a finite state machine is used to perform lexical analysis on the Lisp file, and then a top-down syntax analysis is performed on the result of the lexical analysis to obtain the Lisp abstract syntax tree; then the Lisp abstract syntax tree is parsed to convert the Lisp functions into functions in the function library of the knowledge base; β) For the Prolog format, firstly, a finite state machine is used to perform lexical analysis on the Prolog file, and then top-down syntax analysis is performed on the result of lexical analysis to obtain the Prolog abstract syntax tree; then the Prolog abstract syntax tree is parsed to convert the Prolog rules into rules in the rule base of the knowledge base. Step 5) Collect problem input; Step 6) Domain determination for the input question: Based on the user's input question, traverse the rule base and function base in the knowledge base to determine whether the question can be solved by a domain-specific method. The determination method is to perform a complete match on the input question based on the conditional clause of the rule or the initial property of the function, that is, replace the parameter entity in the logical AND term with the existing entity, and then calculate whether the parameter logical AND term is contained in the existing logical AND term. When the match is successful, it means that there is already a rule or function in the knowledge base that is the solution to the problem. That is, the solution to the problem can be obtained by directly using the corresponding rule or by directly running the corresponding function. When no match is found, the loop reasoning process of the inference engine is entered. Step 7) Solve the problem using a domain-specific approach: Based on the result of Step 2, the problem input by the user is handed over to the corresponding matching domain-specific approach for solution, that is, using the corresponding rules for derivation or running the corresponding function; Step 8) Analyze and reason about the input question, and query the matching rules or functions based on similarity matching; Step 9) Based on the rules and functions obtained from similarity matching in Step 4, further perform complete matching, generate inference results, and add the inference results to the knowledge base; Step 10) Remove redundant inference results through inference shrinking, including: 10.1) Perform similarity matching on the generated entities and relations. If several entities have similar relations and their relation objects, only one of them will be retained. 10.2) For the generated rules, perform a complete match on each pair of their IF clauses and THEN clauses. If a rule is a complete subset of another rule, delete the weaker rule. 10.3) For the generated functions, their initial and final properties are completely matched pairwise. If the property of one function is completely covered by another function, the weaker function is deleted. Step 11) Output the final result of the inference engine, that is, output the result calculated by using rules or calling functions in step 3, the result output by observing that the problem has been solved in step 4, or the error message output by observing that the system's time or space resources have been exhausted and cannot be freed up by inference shrinking.

2. The implementation method of the expert system based on multi-source knowledge according to claim 1, characterized in that, The knowledge base includes: a main knowledge graph, a rule base, and a function base. The main knowledge graph is a graph composed of nodes and relations, used to describe triple relations (A, Relation, B). The rule base consists of rules, each rule being a proposition. A and B are each a logical AND term, each logical AND term consisting of at least one sub-knowledge graph and zero or more logical OR terms, and each logical OR term consisting of at least one logical AND term. The function base consists of functions. Each function consists of input parameters, local variables, and a series of instructions. Each instruction is a control instruction, a basic instruction, or a call to another function. The default execution mode of a function is an infinite loop execution of the function body, exiting execution by a return instruction. Each function and each instruction can have initial and final properties set, each being a logical AND term used to describe the initial and final states of the corresponding function or instruction.

3. The method for implementing an expert system based on multi-source knowledge according to claim 1 or 2, characterized in that, The expert system includes: a knowledge parser, a knowledge base, a reasoning engine, a user interface, and an output generator. The knowledge parser performs corresponding parsing processing based on different types of input knowledge and converts the parsing results into the knowledge base. The knowledge base stores knowledge using a knowledge model with general knowledge representation capabilities. The reasoning engine performs reasoning based on user-input questions and obtains reasoning results. The user interface is used for interaction with the user via command line. The output generator outputs user-specified objects in a user-specified format according to user-input instructions.

Citation Information

Patent Citations

  • Multi-domain expert system joint reasoning method and system

    CN112036571A