A knowledge graph-based natural language interaction software framework system and a construction method thereof
By employing a knowledge graph-based three-layer storage architecture and a user instruction interpretation engine, combined with the assistance of a large language model, the high cost and low reliability issues of large language models in vertical domains are resolved, enabling secure and accurate natural language interaction, suitable for software systems in vertical domains.
Patent Information
- Application Number
- CN202310638728.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2043-05-31
AI Technical Summary
Existing technologies for large language models in vertical domains suffer from high training and deployment costs, and the accuracy of generated content is difficult to ensure. The content credibility and model interpretability are also poor, which limits their application.
It adopts a three-layer storage architecture based on knowledge graphs and a user instruction interpretation engine. Through instruction input, parsing, reasoning and execution, combined with the assistance of large language models or special language models, it realizes natural language interaction, reduces the dependence on large language models and improves the accuracy and credibility of interaction.
It enables safer, more accurate, and more reliable natural language interaction within vertical domains, reduces interaction costs in proprietary scenarios, and provides high interpretability and versatility, making it suitable for software systems in vertical domains.
Smart Images

Figure CN116860985B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of natural language processing, specifically the field of knowledge graph knowledge representation and reasoning, and specifically relates to a knowledge graph-based natural language interaction software framework and its construction method. Background Technology
[0002] With the development and popularization of computer technology, human-computer interaction methods are constantly evolving. Currently, most software still uses keyboard and mouse interaction, which is accurate enough, but usually requires users to be familiar with and master various elements and operations, resulting in relatively high interaction costs for users. In recent years, large language models have improved the efficiency of human-computer interaction through natural language, providing a more natural and intelligent interaction method and enhancing the user experience. Human-computer interaction based on natural language has shown new possibilities and development potential, and is expected to become the standard interaction paradigm for various software and platforms in the future. However, large language models have high training and deployment costs, and the accuracy of generated content is difficult to ensure, resulting in poor content credibility and model interpretability, which limits their application in vertical fields. Summary of the Invention
[0003] The purpose of this invention is to provide a knowledge graph-based natural language interaction software framework and its construction method to solve the problems existing in the application of traditional human-computer interaction methods and large language models in specific scenarios. This invention utilizes knowledge graphs to provide structured representations of specific scenarios and knowledge graph-based reasoning, thereby reducing the dependence on large language models while realizing natural language interaction methods, and achieving more convenient, safer, more accurate and more reliable natural language interaction.
[0004] To achieve the above objectives, the present invention adopts the following technical solution:
[0005] A method for constructing a natural language interaction software framework based on knowledge graphs includes the following steps:
[0006] Command input: Converts user-input commands into text format;
[0007] Instruction parsing: Parse the text-based instructions to determine the user's intent and parse the business type and content step by step;
[0008] Instruction reasoning: Using a three-tier storage architecture based on knowledge graphs, reasoning is performed on the parsed business types and business content;
[0009] Reasoning and Judgment: Repeat the instruction parsing and instruction reasoning process until the reasoning is successful. Then, generate operation instructions through the instruction parsing process and execute the operation instructions. If the reasoning fails, introduce a large language model or a special language model to assist the instruction parsing process to parse the user input. The large language model or special language model supplements the parsing results of the instruction parsing and decomposes the generation task into sub-tasks that can be directly processed by the knowledge graph. Then, repeat the instruction parsing process.
[0010] Execute operation instructions: Pass the user instructions obtained from instruction parsing to the dedicated scenario software system for execution, and return the execution results.
[0011] Preferably, the user-input instructions include at least one of text information and voice information.
[0012] Preferably, the voice information is converted into text information through a neural network.
[0013] Preferably, the knowledge graph-based three-layer storage architecture stores system knowledge and software knowledge.
[0014] Preferably, the proprietary scenario software system is a software system for a specific vertical field.
[0015] Preferably, the content of the knowledge graph-based three-layer storage architecture includes:
[0016] Business Knowledge Layer: This includes the system business graph provided by the system, the software basic business graph provided by software functions, and the knowledge mining business graph obtained from user operation behavior. The system business graph in the business knowledge layer is constructed by extracting and integrating data and relationships from the target business domain knowledge through manual extraction or triplet extraction algorithms. The software basic business graph in the business knowledge layer is constructed by extracting and integrating data and relationships from the software operation knowledge provided by the target proprietary scenario software through manual extraction or triplet extraction algorithms. The knowledge mining business graph is obtained by extracting and integrating data and relationships from high-level business operation knowledge provided through knowledge mining.
[0017] User Instance Layer: This includes user behavior graphs generated by user software operations, software operation graphs generated by internal software calls, and user profile graphs abstracted from user information. The user behavior graph is obtained by extracting and integrating data and relationships from the specific user's operational behavior. The software operation graph is obtained by extracting and integrating data and relationships from software operation data generated by user commands. The user profile graph is obtained by statistically analyzing and extracting and integrating data and relationships from the specific user's operational data.
[0018] Physical Data Layer: This includes the underlying software data for software operation, external access data generated by the software's access to external information, and network interface data that the software needs to access the network for. The basic data required to build the target software is manually organized and stored in a database to create machine-accessible underlying software data. Externally accessible data, including work logs, is also manually organized and stored in a database to create machine-accessible underlying software data. Finally, network interface data within the system is manually organized and stored in a database to create machine-accessible underlying software data.
[0019] Preferably, the method for constructing the business knowledge layer and the user instance layer includes the following process:
[0020] The knowledge graph constructed in the business knowledge layer and user instance layer includes entity nodes and execution nodes;
[0021] Among them, entity nodes provide relevant information about abstract elements in specific scenarios and store the attributes of abstract elements, while execution nodes execute business logic functions.
[0022] Among them, the execution nodes are divided into business logic nodes and business execution nodes. The business logic nodes are used to describe the execution logic of the business and contain reasoning code that can be executed by the interpretation engine to assist the reasoning process of the knowledge graph.
[0023] Business logic nodes are unique nodes for a business. They define the business name, the system inputs and user inputs required by the business, and pass the inputs to the business execution nodes after obtaining them. The business execution nodes correspond to the software execution interface and generate operation instructions for interacting with the target software with the assistance of the user instruction interpretation engine.
[0024] This invention also provides a knowledge graph-based natural language interaction software framework, including a user natural language input module, a user command interpretation engine, a knowledge graph-based three-layer storage architecture, a software system, and a large language model or a special language model;
[0025] Among them, the user natural language input module is used to collect user input instructions and convert the user input instructions into text form, and send the text form instructions to the user instruction interpretation engine;
[0026] The user instruction interpretation engine is used to receive the output of the user's natural language input module, parse the text-based instructions, determine the user's intent, and parse the business type and business content step by step.
[0027] A three-tier storage architecture based on knowledge graphs is used to receive the current parsed content of the engine from user instructions and to carry out reasoning based on the knowledge graph.
[0028] If the reasoning based on the knowledge graph-based three-layer storage architecture is successful, the user instruction interpretation engine generates operation instructions and sends them to the dedicated scenario software system. If the reasoning fails, a large language model or a special language model is introduced to assist the user instruction interpretation engine in parsing the user input. The large language model or the special language model supplements the parsing results of the user instruction engine and decomposes the generation task into sub-tasks that the knowledge graph can directly process. The user instruction interpretation engine then processes these sub-tasks. The user instruction interpretation engine and the knowledge graph-based three-layer storage architecture repeat the operation until the reasoning based on the knowledge graph-based three-layer storage architecture is successful.
[0029] The user instruction interpretation engine successfully generates operation instructions and passes them to the dedicated scene software system for execution, and the dedicated scene software system provides feedback on the execution results.
[0030] The present invention also provides an electronic device, comprising:
[0031] One or more processors;
[0032] A storage device on which one or more programs are stored;
[0033] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for constructing a knowledge graph-based natural language interaction software framework as described above.
[0034] The present invention also provides a storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the method for constructing a knowledge graph-based natural language interaction software framework as described above.
[0035] Compared with the prior art, the present invention has the following technical benefits:
[0036] This invention proposes a general knowledge graph-based natural language interaction software framework, avoiding the shortcomings of using large language models to achieve natural language interaction in specialized scenarios. It provides a highly portable and versatile new possibility for transforming interaction methods in vertical domain-specific scenarios. This invention defines a method for converting natural language into operational commands, centered on a three-layer knowledge graph-based architecture and a user command interpretation engine. The knowledge graph-based three-layer architecture can improve the accuracy of the user command interpretation engine while providing high interpretability, helping the engine to better understand user intent and generate operational commands more accurately. This invention can reduce the cost of natural language interaction in specialized scenarios in a new revolution in software interaction methods, and has significant practical implications for achieving safer, more accurate, and more reliable natural language interaction in vertical domains. Attached Figure Description
[0037] Figure 1 This is a flowchart illustrating the business implementation process of the present invention;
[0038] Figure 2 This is a diagram illustrating the overall system architecture in an embodiment of the present invention.
[0039] Figure 3 This is a three-layer storage architecture based on knowledge graphs in this embodiment of the invention;
[0040] Figure 4 This is the interactive interface in the embodiments of the present invention;
[0041] Figure 5 This is the business knowledge layer in the embodiments of the present invention;
[0042] Figure 6 This describes the business implementation process in an embodiment of the present invention. Detailed Implementation
[0043] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. These embodiments are used to explain the present invention, but are not intended to limit the scope of the invention.
[0044] This invention defines the steps of user-software interaction based on a knowledge graph-based natural language interaction software framework as follows: Figure 1 As shown:
[0045] Step 1: The user inputs commands via text or voice. The user's natural language input module collects the user's input and converts it into text format, which is then sent to the user command interpretation engine.
[0046] Step 2: After receiving user input, the user instruction interpretation engine parses the user input, determines the user's intent, and parses the business type and business content step by step.
[0047] Step 3: The three-layer storage architecture based on the knowledge graph receives the current parsed content of the user instruction interpretation engine, and performs reasoning based on the knowledge graph;
[0048] Step 4: Repeat steps 2 and 3 until the reasoning is successful. The user instruction interpretation engine generates operation instructions and proceeds to step 5. If the reasoning fails, a large language model or a special language model will be introduced to assist the user instruction interpretation engine in parsing the user input. The large language model or the special language model will supplement the parsing results of the user instruction engine and decompose the generation task into sub-tasks that can be directly processed by the knowledge graph. Return to step 2.
[0049] Step 5: The user instruction interpretation engine transmits the successfully generated operation instructions to the dedicated scene software system for execution and feeds back the execution results to the user.
[0050] Within this framework, the system comprises five sub-modules, and the system framework is as follows: Figure 2 As shown:
[0051] The user's input includes either text information or voice information, and the voice information is converted into text information through a neural network.
[0052] The user instruction parsing engine is responsible for parsing the text information generated by user input and interacting with other modules.
[0053] Among them, the three-layer storage architecture based on knowledge graphs stores system knowledge and software knowledge;
[0054] Among them, the software system refers to a software system in a specific vertical field;
[0055] Among them, the large language model or special language model is responsible for supplementing the results of the user instruction engine and decomposing the generation task into sub-tasks that the knowledge graph can directly process.
[0056] In this framework, the architecture of the three-tier storage architecture based on knowledge graphs is as follows: Figure 3 As shown, it contains three levels:
[0057] The first layer is the business knowledge layer. This includes the system business graph provided by the system, the basic software business graph provided by software functions, and the knowledge-mined business graph obtained from user operation behavior. The system business graph in the business knowledge layer is constructed by extracting and integrating data and relationships from the target business domain knowledge using manual or triplet extraction algorithms. The basic software business graph in the business knowledge layer is also constructed by extracting and integrating data and relationships from the software operation knowledge provided by the target specific scenario software using manual or triplet extraction algorithms. Finally, the knowledge-mined business graph is obtained by extracting and integrating data and relationships from high-level business operation knowledge provided through knowledge mining.
[0058] The second layer is the user instance layer. This includes user behavior graphs generated from user software operations, software operation graphs generated from internal software calls, and user profile graphs abstracted from user information. The user behavior graph is obtained by extracting and integrating data and relationships from specific user operations. The software operation graph is obtained by extracting and integrating data and relationships from software operation data generated from user commands. The user profile graph is obtained by statistically analyzing and extracting and integrating data and relationships from specific user operations.
[0059] The third layer is the physical data layer. This includes the underlying software data for software operation, external access data generated by the software's access to external information, and network interface data that the software needs to access the network for. The basic data required to build the target software is manually organized and stored in a database to create machine-accessible underlying software data. Externally accessible data, such as work logs, is also manually organized and stored in a database to create machine-accessible underlying software data. Finally, network interface data within the system is manually organized and stored in a database to create machine-accessible underlying software data.
[0060] The construction methods for the first and second layers of the knowledge graph in the three-layer knowledge graph-based storage architecture are as follows:
[0061] The knowledge graph constructed in the business knowledge layer and user instance layer includes entity nodes and execution nodes. Entity nodes provide relevant information about abstract elements in specific scenarios and store the attributes of these abstract elements. Execution nodes execute business logic functions. Execution nodes are further divided into business logic nodes and business execution nodes. Business logic nodes describe the execution logic of the business and contain reasoning code that can be executed by the interpretation engine, assisting the reasoning process of the knowledge graph. Business logic nodes are business-specific nodes that define the business name, the system inputs and user inputs required by the business, and pass the inputs to the business execution nodes after obtaining them. The business execution nodes correspond to software execution interfaces and, with the assistance of the user instruction interpretation engine, generate operation instructions for interacting with the target software.
[0062] Once the system is built, users can input natural language to achieve the software system's specified output.
[0063] Example
[0064] In this embodiment, the current proprietary scenario is image drawing software. The software system itself includes keyboard and mouse interaction and a drawing display window. By adjusting the system architecture through this invention, a natural language interaction method is implemented, allowing users to complete functions such as image drawing, image attribute setting, and image deletion in the drawing window simply by inputting natural language commands. The advantage of this invention lies in achieving accurate parsing of user input through a user command interpretation engine and a three-layer storage architecture based on a knowledge graph, making the business implementation method of natural language interaction safer, more accurate, and more reliable.
[0065] First, based on the invention's business implementation process and overall architecture, five sub-modules are constructed: a user natural language input module, a user command interpretation engine, a three-tier storage architecture based on knowledge graphs, a software system, and a large language model. These modules are then combined to complete the system construction.
[0066] like Figure 4The software interaction page shown includes an image display area, a keyboard and mouse operation area, and a command input area. The image display area and the keyboard and mouse operation area belong to the software system; the command input area belongs to the user's natural language input module; the remaining modules are not displayed in the user interface but are internal system functions that implement natural language input and result display.
[0067] like Figure 5 The business knowledge graph shown provides a structured representation of the system and business-related knowledge of the drawing software. The knowledge graph describes the window elements of the drawing software and their relationships. In addition, the knowledge graph contains common business logic nodes in drawing scenarios such as creation, setting, and querying. The corresponding business execution nodes can be found from these business logic nodes. The business logic nodes and business execution nodes assist the user instruction interpretation engine in accurately analyzing user input and help the user instruction interpretation engine accurately complete the conversion of natural language into operation commands.
[0068] like Figure 6 The general business process is as follows: If the user input is "Draw a blue circle with a radius of 60 pixels at pixel (100, 200)," the user's natural language input module passes the user input to the user instruction interpretation engine. The user instruction interpretation engine first determines the user's intent as "create" based on the business logic nodes of the business knowledge graph. Based on the user input and system input at the create business logic node, the user instruction interpretation engine analyzes the creation type and obtains "circle." Then, based on the entity node of "circle" in the knowledge graph, it obtains the specified parameters. The user instruction interpretation engine analyzes and matches the user input based on these specified parameters, obtaining "x=100, y=200, r=60, color=blue." After parameter matching, the user instruction interpretation engine can generate the corresponding instruction based on the business execution node "create" and pass it to the software system. The software system will then draw a circle and display it to the user.
[0069] If the user inputs "draw a sun", the user's natural language input module passes the user input to the user instruction interpretation engine. The user instruction interpretation engine first determines the user's intent as "create" based on the business logic nodes of the business knowledge graph. Since no available creation type can be found, the user instruction interpretation engine passes the user input to the large language model for subtask generation. The user instruction interpretation engine then generates instructions for each subtask and passes them sequentially to the software system for feedback display.
[0070] As can be seen, this invention can reduce the implementation cost of natural language interaction in proprietary scenarios, and provides a general architecture and implementation method for natural language interaction for general software. It has important practical significance for achieving safer, more accurate and more reliable natural language interaction in vertical fields.
Claims
1. A method for constructing a knowledge graph-based natural language interaction software framework, characterized in that, The method comprises the following processes: instruction input: converting the user input instruction into a text form instruction; instruction analysis: analyzing the text form instruction, judging the user intention, and analyzing the business type and business content step by step; instruction reasoning: reasoning the analyzed business type and business content by using a three-layer storage architecture based on a knowledge graph; the three-layer storage architecture based on the knowledge graph comprises: a business knowledge layer, a user instance layer, and a physical data layer; the business knowledge layer comprises a system business graph, a software basic business graph provided by a software function, and a knowledge mining business graph obtained by user operation behavior; the system business graph is obtained by data and relationship extraction and integration of business domain knowledge of a target by manual or triple extraction algorithm; the software basic business graph is obtained by data and relationship extraction and integration of software operation knowledge provided by a target specific scene software by manual or triple extraction algorithm; the knowledge mining business graph is obtained by data and relationship extraction and integration of high-level business operation knowledge provided by knowledge mining; the user instance layer comprises a user behavior graph, a software operation graph, and a user portrait graph; the user behavior graph is obtained by data and relationship extraction and integration of specific user operation behavior; the software operation graph is obtained by data and relationship extraction and integration of software operation data generated by user instruction; the user portrait graph is obtained by data and relationship extraction and integration of statistical analysis of specific user operation data; the physical data layer comprises software bottom layer data of software running information, external access data generated by software external information access, and network interface data obtained by network access required by software; the software bottom layer data is established by database for machine access by manual arrangement of basic data required by a target software; the software bottom layer data is established by database for machine access by manual arrangement of external accessible data, including work log; the software bottom layer data is established by database for machine access by manual arrangement of network interface data in the system; reasoning judgment: repeating the instruction analysis and instruction reasoning processes until reasoning is successful, then generating an operation instruction through the instruction analysis process, and then executing the operation instruction; if reasoning fails, introducing a large language model or a special language model to assist the instruction analysis process to analyze the user input, the large language model or the special language model supplementing the analysis result of the instruction analysis, and decomposing the generated task into subtasks that can be directly processed by the knowledge graph, then repeating the instruction analysis process; executing the operation instruction: delivering the user instruction obtained by the instruction analysis to the specific scene software system for execution, and feeding back the execution result. 2.The method of claim 1, wherein, The user input instruction comprises at least one of text information and voice information. 3.The method of claim 2, wherein, The voice information is converted into text information through a neural network.
4. The method of claim 1, wherein the method further comprises: The three-layer storage architecture based on the knowledge graph stores system knowledge and software knowledge. 5.The method of claim 1, wherein, The proprietary scenario software system is a software system for a specific vertical field. 6.The method of claim 1, wherein, The construction method of the business knowledge layer and the user instance layer includes the following processes: The knowledge graph constructed in the business knowledge layer and the user instance layer includes entity nodes and execution nodes. The entity nodes provide related information of abstract elements in the proprietary scenario and store attributes of the abstract elements, and the execution nodes execute business logic functions. The execution nodes are divided into business logic nodes and business execution nodes. The business logic nodes are used to describe the execution logic of the business and contain inference codes that can be executed by the interpretation engine to assist the inference process of the knowledge graph.
7. A knowledge graph based natural language interaction software framework system, characterized in that, The business logic nodes are specific nodes of the business. The business logic nodes specify the business name, system input and user input required by the business, and pass the input to the business execution nodes after obtaining the input. The business execution nodes correspond to software execution interfaces and generate operation instructions for interacting with target software under the assistance of the user instruction interpretation engine. The system includes a user natural language input module, a user instruction interpretation engine, a three-layer storage architecture based on a knowledge graph, a software system, and a large language model or a special language model. The user natural language input module is used to collect user input instructions and convert them into text instructions. The user instruction interpretation engine receives the output of the user natural language input module and analyzes the text instructions to determine the user's intent and analyze the business type and content step by step. The three-layer storage architecture based on the knowledge graph is used to receive the current parsing content of the user instruction interpretation engine, and expand reasoning based on the knowledge graph; the content of the three-layer storage architecture based on the knowledge graph includes: a business knowledge layer, which includes a system business graph, a software basic business graph provided by software functions, and a knowledge mining business graph obtained by user operation behavior; the system business graph in the business knowledge layer is constructed by data and relationship extraction and integration of business domain knowledge of a target through manual or triple extraction algorithm; the software basic business graph in the business knowledge layer is constructed by data and relationship extraction and integration of software operation knowledge provided by a target specific scene software through manual or triple extraction algorithm; the knowledge mining business graph is obtained by data and relationship extraction and integration of high-level business operation knowledge provided by knowledge mining; a user instance layer, which includes a user behavior graph generated by user software operation, a software operation graph generated by software internal call, and a user portrait graph abstracted from user information; the user behavior graph is obtained by data and relationship extraction and integration of specific user operation behavior; the software operation graph is obtained by data and relationship extraction and integration of software operation data generated by user instruction; the user portrait graph is obtained by data and relationship extraction and integration of statistical analysis of specific user operation data; a physical data layer, which includes software bottom layer data of software running information, external access data generated by software access to external information, and network interface data obtained by software access to the network; the software bottom layer data is established by database for machine access by manual arrangement of basic data required for constructing a target software; the software bottom layer data is established by database for machine access by manual arrangement of external accessible data, including arrangement of work logs; the software bottom layer data is established by database for machine access by manual arrangement of network interface data in the system; If the three-layer storage architecture based on the knowledge graph succeeds in reasoning, the user instruction interpretation engine generates operation instructions, and sends the operation instructions to the specific scene software system; if the reasoning fails, a large language model or a special language model is introduced to assist the user instruction interpretation engine in parsing the user input, the large language model or the special language model supplements the parsing result of the user instruction engine, and decomposes the generated task into subtasks that can be directly processed by the knowledge graph, and the user instruction interpretation engine processes the subtasks again; the user instruction interpretation engine and the three-layer storage architecture based on the knowledge graph repeatedly perform operations until the three-layer storage architecture based on the knowledge graph succeeds in reasoning; The user instruction interpretation engine transmits the successfully generated operation instructions to the specific scene software system for execution, and the specific scene software system feeds back the execution result.
8. An electronic device, comprising: comprise: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement a construction method of the knowledge graph-based natural language interaction software framework as claimed in any one of claims 1 to 6.
9. A storage medium, characterized by A computer program is stored thereon, wherein the computer program is executed by a processor to implement a construction method of the knowledge graph-based natural language interaction software framework as claimed in any one of claims 1 to 6.
Citation Information
Patent Citations
Natural language interaction method and system for virtual robot
CN109271498A
Voice interaction method, device thereof and equipment and computer readable medium
CN113099054A