Knowledge graph-based request processing methods, apparatus, terminal devices, and storage media

By performing semantic parsing and matching reliability calculation on natural language requests and iteratively updating semantic elements, the problem of wasted computing resources caused by semantic ambiguity in existing technologies is solved, and more efficient graph reasoning and accurate request processing are achieved.

CN123117360APending Publication Date: 2026-11-17广州知韫科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611593344.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-15
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing technologies, when processing natural language requests, are prone to graph traversal mismatches due to inaccurate semantic parsing, which increases the waste of computing resources and deviations in request processing results.

Method used

Natural language requests are broken down into multiple semantic elements through semantic parsing and matched with a pre-built skill graph. The matching reliability is calculated, and the semantic elements are iteratively updated until the reliability reaches a threshold. After the graph reasoning rules are determined, graph reasoning is performed in the knowledge graph.

Benefits of technology

It reduces the consumption of computing resources in graph data processing, improves the accuracy of request processing results, and reduces invalid node access and relation edge traversal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123117360A_ABST
    Figure CN123117360A_ABST
Patent Text Reader

Abstract

This invention discloses a request processing method, apparatus, terminal device, and storage medium based on a knowledge graph, belonging to the field of computer data processing technology. Specifically, it involves: semantically parsing a natural language request; matching the parsed semantic elements with a skill graph to obtain a set of candidate processing skills and calculating a matching confidence score; iteratively updating semantic elements when the matching confidence score is lower than a preset threshold; in each iteration, retrieving candidate values ​​for the target semantic element from the skill graph and updating the target semantic element to the candidate values ​​indicated by the selection information, thereby re-matching the set of candidate processing skills; and determining graph inference rules based on the current set of candidate processing skills and performing graph inference in the business knowledge graph to obtain the request processing result. Therefore, by implementing this invention, the computational resource consumption in the graph data processing process can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer data processing technology, and in particular to a request processing method, apparatus, terminal device, and storage medium based on knowledge graphs. Background Technology

[0002] As business data grows, business entities and their relationships are typically organized in the form of a business knowledge graph. After receiving a natural language request, the system needs to perform semantic parsing, determine the corresponding graph reasoning rules based on the parsing results, and perform multi-hop access along nodes and relationship edges in the business knowledge graph to obtain the request processing result. Because natural language expressions may contain omissions, polysemy, or ambiguous referents, the semantic conditions obtained from the parsing may be incomplete or inaccurate.

[0003] Existing technologies typically match processing skills directly based on the parsing results of natural language requests and perform graph reasoning. Even when no processing skill can be matched, or when multiple processing skills are matched simultaneously, the processing rules may still be determined based on the current parsing results, and graph reasoning may still be performed. This approach is prone to triggering graph traversals that do not match the request content when the processing skill is not uniquely determined, leading to deviations in the request processing results and increasing invalid node visits and relation edge traversals, resulting in wasted computational resources during graph data processing. Summary of the Invention

[0004] This invention provides a knowledge graph-based request processing method, apparatus, terminal device, and storage medium, which can reduce the consumption of computing resources in the process of graph data processing.

[0005] This invention provides a knowledge graph-based request processing method, including: Receive a natural language request, perform semantic parsing on the natural language request, and obtain multiple semantic elements; Each of the semantic elements is matched with a pre-constructed skill graph to obtain a set of candidate processing skills. The matching confidence is calculated based on the number of processing skills in the set of candidate processing skills and the number of semantic elements that match each of the processing skills. When the matching confidence is lower than a preset threshold, the semantic element is iteratively updated until the matching confidence is not lower than the preset threshold, or the number of iterations reaches a preset threshold. In each iteration, the semantic element with the fewest matched processing skills is determined as the target semantic element, and multiple candidate values ​​of the target semantic element are obtained from the skill graph. Selection information related to each candidate value is received, the target semantic element is updated to the candidate value indicated by the selection information, the candidate processing skill set is rematched, and the matching confidence is recalculated. When the matching confidence obtained in any calculation is not lower than the preset threshold, the graph reasoning rule is determined according to the candidate processing skill set corresponding to the matching confidence obtained in any calculation, and the graph reasoning is performed in the pre-constructed business knowledge graph according to the graph reasoning rule to obtain the request processing result of the natural language request.

[0006] This invention, through semantic parsing and decomposition of natural language requests into multiple semantic elements, transforms unstructured request content into structured data that can trigger conditional matching, reducing the impact of differences in natural language expression on subsequent processing skill matching. By matching each semantic element with a skill graph and calculating the matching confidence based on the number of candidate processing skills and the number of semantic elements matched by each processing skill, the matching status of the request semantics can be quantified into an indicator for controlling graph inference execution, avoiding direct execution of graph inference when candidate processing skills are unclear. Furthermore, when the matching confidence is lower than a preset threshold, adjustments are made based on the number of matched processing skills. It iteratively updates the semantic elements with the least amount of data, stopping iteration when the matching confidence reaches a preset threshold or the number of iterations for semantic element updates reaches a preset threshold. This limits the scope of each update round to the semantic elements with the weakest matching strength, while avoiding repeated matching and updates for requests that cannot converge, thus reducing invalid interactions and computational resource consumption. Furthermore, after the matching confidence reaches a preset threshold, graph inference rules are determined based on the current candidate processing skill set and graph inference is performed in the business knowledge graph. This avoids graph traversal operations under low confidence conditions, reduces computational resource consumption caused by invalid graph inference, and improves the accuracy of request processing results. Compared to existing technologies that may still directly perform graph inference when the request semantics are ambiguous, this application can reduce the computational resource consumption during graph data processing.

[0007] Furthermore, the step of determining the semantic element with the fewest matched processing skills as the target semantic element, and obtaining multiple candidate values ​​for the target semantic element from the skill graph, includes: The number of processing skills matched by each semantic element in the candidate processing skill set is obtained respectively, and the semantic element with the fewest matched processing skills is determined as the target semantic element. Determine the element type corresponding to the target semantic element, traverse the trigger conditions of each processing skill in the skill graph, and extract the values ​​belonging to the element type; The extracted values ​​are deduplicated to obtain multiple candidate values ​​for the target semantic element.

[0008] This invention, through statistical analysis of the number of processing skills matched by each semantic element, selects the semantic element with the fewest matches and extracts candidate values ​​of the same type and after deduplication from the triggering conditions of the processing skills. This enables the update object to be focused on the semantic element with the weakest current matching degree and reduces invalid selection and duplicate matching processing caused by duplicate candidate values.

[0009] Further, receiving selection information related to each of the candidate values ​​and updating the target semantic element to the candidate value indicated by the selection information includes: Generate element types containing the target semantic elements and value selection prompts for each of the candidate values, and output the value selection prompts; Receive selection information for the value selection prompt information, and determine the candidate value indicated by the selection information as the target value; Set the value of the target semantic element to the target value, and keep the other semantic elements in each semantic element unchanged except for the target semantic element.

[0010] This invention, by outputting value selection prompts containing the target semantic element type and candidate values, and only writing the candidate values ​​indicated by the selection information into the target semantic element while keeping other semantic elements unchanged, can limit each round of semantic update to a single element, avoid the introduction of new matching deviations due to the simultaneous changes of multiple semantic elements, and reduce the processing complexity of subsequent rematching.

[0011] Further, the step of matching each of the semantic elements with a pre-constructed skill graph to obtain a candidate processing skill set includes: Read the trigger conditions of each processing skill in the skill graph; wherein, the trigger conditions include at least one trigger item; For any trigger item, read the value of the semantic element with the same element type as the trigger item from each of the semantic elements, and compare the read value with the matching value of the trigger item according to the matching method of the trigger item to obtain the matching result of the trigger item; When the triggering condition includes one trigger item, the matching result of the trigger item is determined as the condition matching result of the corresponding processing skill; when the triggering condition includes multiple trigger items, the matching results of each trigger item are combined according to the preset logical relationship between each trigger item to obtain the condition matching result of the corresponding processing skill. The processing skills that match the corresponding conditions are combined to obtain a set of candidate processing skills.

[0012] This invention compares semantic elements item by item according to the element type, matching method and matching value of the trigger item, and combines the matching results of each trigger item according to a preset logical relationship when there are multiple trigger items. This enables the screening of processing skills to be constrained by multiple trigger conditions at the same time, reduces the number of processing skills that do not meet the trigger conditions from entering the candidate processing skill set, and reduces the trigger risk of error graph reasoning.

[0013] Further, the step of calculating the matching confidence based on the number of processing skills in the candidate processing skill set and the number of semantic elements matching each processing skill includes: When the candidate processing skill set is empty, the matching confidence is set to a first preset value; When the candidate processing skill set includes multiple processing skills, the matching confidence level is determined to be a second preset value; When the candidate processing skill set includes only one processing skill, and the processing skill only matches some semantic elements, the matching confidence is determined to be the third preset value; When the candidate processing skill set includes only one processing skill, and the processing skill matches all semantic elements, the matching confidence is determined as a fourth preset value; wherein, the first preset value, the second preset value, the third preset value and the fourth preset value increase sequentially, the first preset value and the second preset value are both lower than the preset threshold, and the third preset value and the fourth preset value are both greater than the preset threshold.

[0014] This invention sets matching confidence levels with a clear magnitude relationship to preset thresholds for scenarios where the candidate processing skill set is empty, includes multiple processing skills, partially matches a unique processing skill, and fully matches a unique processing skill. This prevents graph reasoning from being executed when there are no candidate processing skills or multiple candidate processing skills exist. When the candidate processing skill is unique, graph reasoning is executed based on the degree of semantic element matching, thereby reducing unnecessary semantic element updates and repeated matching processing in scenarios with only one candidate.

[0015] Further, the step of performing graph reasoning in the pre-built business knowledge graph according to the graph reasoning rules to obtain the request processing result of the natural language request includes: Read the object semantic elements used to represent the operation object from each of the semantic elements, determine the entity corresponding to the object semantic elements as the starting entity, and locate the starting node corresponding to the starting entity in the business knowledge graph; According to the graph reasoning rules, starting from the starting node, the associated nodes are visited hop by hop along the relational edges in the business knowledge graph, and the nodes visited and the relational edges traversed in each hop are recorded; wherein, when the number of hops visited reaches the maximum number of reasoning hops limited by the graph reasoning rules, or when there are no relational edges that can be visited, the visit is stopped. Based on the nodes and relation edges visited at each hop, the request processing result is obtained.

[0016] This invention, by starting with the entity corresponding to the operation object as the starting node, visits the relational edges in the business knowledge graph hop by hop according to the graph reasoning rules, and stops when the maximum reasoning hop count is reached or there are no more relational edges that can be visited, can limit the data access scope of graph reasoning to the nodes and relational edges related to the request, thereby reducing the consumption of computing resources caused by unbounded traversal.

[0017] Furthermore, the receiving of the natural language request involves semantic parsing of the natural language request to obtain multiple semantic elements, including: The natural language request is input into a pre-trained large language model, so that the large language model extracts field content from the natural language request according to preset fields, writes the extracted field content into the corresponding preset fields, and sets the preset fields that cannot be identified from the natural language request to null values. Each of the preset fields and its corresponding field content is determined as a semantic element.

[0018] This invention, through a pre-trained large language model, extracts field content from natural language requests according to preset fields and sets unrecognized fields to null values. This transforms natural language requests into semantic elements with a unified field structure, preventing unrecognized content from being inferred as valid values ​​and reducing the risk of triggering incorrect matching and erroneous graph reasoning.

[0019] Another embodiment of the present invention provides a knowledge graph-based request processing apparatus, comprising: the apparatus being configured to perform the steps of a knowledge graph-based request processing method as described in the present invention.

[0020] Another embodiment of the present invention provides a terminal device, including: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, it implements the steps of a knowledge graph-based request processing method as described in the present invention.

[0021] Another embodiment of the present invention provides a computer-readable storage medium item, including: a stored computer program, which, when the computer program is running, controls the device where the computer-readable storage medium is located to perform steps of a knowledge graph-based request processing method as described in the present invention. Attached Figure Description

[0022] Figure 1 This is a flowchart illustrating an embodiment of the knowledge graph-based request processing method provided by the present invention. Figure 2 This is a schematic diagram of the structure of one embodiment of the knowledge graph-based request processing device provided by the present invention. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0025] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0026] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0027] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0028] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).

[0029] See Figure 1 To address the problem that existing technologies may still directly perform graph reasoning when the request semantics are ambiguous, an embodiment of the present invention provides a request processing method based on a knowledge graph, including steps S101 to S104: Step S101: Receive a natural language request, perform semantic parsing on the natural language request, and obtain multiple semantic elements.

[0030] It should be noted that receiving a natural language request and performing semantic parsing on the natural language request to obtain multiple semantic elements means: receiving a business request input by a user in natural language form, identifying the content related to subsequent processing in the business request through semantic parsing, and converting the identified content into structured data. A semantic element may include an element type and the corresponding value for that element type. For example, an element type may include a business domain, action type, operation object, or time range, and the corresponding value may be procurement, reconciliation, order number, or a preset time period, respectively. For element types not explicitly expressed in the natural language request, the corresponding value can be set to null. Through the above processing, the natural language request can be converted from unstructured text into multiple semantic elements that can participate in subsequent matching processing.

[0031] Preferably, the step of receiving a natural language request and performing semantic parsing on the natural language request to obtain multiple semantic elements includes: The natural language request is input into a pre-trained large language model, so that the large language model extracts field content from the natural language request according to preset fields, writes the extracted field content into the corresponding preset fields, and sets the preset fields that cannot be identified from the natural language request to null values. Each of the preset fields and its corresponding field content is determined as a semantic element.

[0032] In one embodiment, the user's original natural language request text is input into a pre-trained large language model, which extracts corresponding field content from the natural language request text according to preset fields and outputs structured key-value pairs. The preset fields include domain, action_type, entity, and time_range (additional constraints). The large language model writes the extracted field content into the corresponding preset fields, and sets the content of preset fields that cannot be identified from the natural language request text to null values. Each preset field and its corresponding field content are defined as a semantic element, where the preset field serves as the element type of the semantic element, and the field content serves as the value of the semantic element.

[0033] Step S102: Match each of the semantic elements with the pre-constructed skill graph to obtain a set of candidate processing skills, and calculate the matching confidence based on the number of processing skills in the set of candidate processing skills and the number of semantic elements that match each of the processing skills.

[0034] It should be noted that each semantic element is matched with a pre-constructed skill graph to obtain a candidate processing skill set. The matching confidence is calculated based on the number of processing skills in the candidate skill set and the number of semantic elements matching each processing skill. This means that the pre-constructed skill graph records multiple processing skills and their corresponding trigger conditions. The trigger conditions limit the semantic elements applicable to each processing skill. During matching, the element type and value of each semantic element are compared with the trigger conditions of each processing skill. Processing skills whose trigger conditions are met are added to the candidate processing skill set. The number of processing skills in the candidate processing skill set reflects whether the processing skill corresponding to the current semantic element is unique, and the number of semantic elements matching each processing skill reflects the completeness of the current semantic element. Calculating the matching confidence based on these two aspects quantifies the matching status between the current natural language request and the candidate processing skills, providing a control basis for whether to perform graph reasoning subsequently.

[0035] In one embodiment, the process of pre-constructing the skill graph includes a skill registration process. When registering a new processing skill, the `dependsOn` attribute of the new processing skill is read, and the directed acyclic graph of skills is traversed along the dependency edges corresponding to the `dependsOn` attribute to obtain the complete dependency chain of the new processing skill. Based on the triplet budget of the new processing skill itself and the triplet budgets of each dependent processing skill in the dependency chain, the effective cumulative budget `EffectiveBudget` of the new processing skill is calculated. `EffectiveBudget` is compared with the budget limit corresponding to the `IntentType` to which the new processing skill belongs. When `EffectiveBudget` exceeds the budget limit, a conflict warning message including the out-of-limit dependency path is output, or the registration of the new processing skill is rejected. When `EffectiveBudget` does not exceed the budget limit, the registration of the new processing skill is completed. During graph inference, the inference resource parameters corresponding to the target processing skill and its dependent processing skills can also be injected into the graph inference process all at once to control the cumulative resource consumption during cross-processing skill calls.

[0036] Preferably, each of the semantic elements is matched with a pre-constructed skill graph to obtain a set of candidate processing skills, including: Read the trigger conditions of each processing skill in the skill graph; wherein, the trigger conditions include at least one trigger item; For any trigger item, read the value of the semantic element with the same element type as the trigger item from each of the semantic elements, and compare the read value with the matching value of the trigger item according to the matching method of the trigger item to obtain the matching result of the trigger item; When the triggering condition includes one trigger item, the matching result of the trigger item is determined as the condition matching result of the corresponding processing skill; when the triggering condition includes multiple trigger items, the matching results of each trigger item are combined according to the preset logical relationship between each trigger item to obtain the condition matching result of the corresponding processing skill. The processing skills that match the corresponding conditions are combined to obtain a set of candidate processing skills.

[0037] In one embodiment, the obtained semantic elements are used to perform a SPARQL graph query on the Skills ontology to obtain a set of candidate processing skills. The Skills ontology adopts a knowledge graph structure, where each skill node represents a processing skill, and each skill node contains attributes such as `triggerCondition`, `dependsOn`, and `isAtomic`. The `triggerCondition` includes at least one trigger item, and each trigger item includes an element type, a matching method, and a matching value. During the SPARQL graph query, skill nodes with `status=active` are queried, and the `triggerCondition` of each skill node is read. For any trigger item, the values ​​of semantic elements with the same element type as the trigger item are read from the multiple semantic elements, and the read values ​​are compared with the matching value of the trigger item according to the matching method of the trigger item to obtain the matching result of the trigger item. For example, for two trigger items with element types "domain" and "action type", the REGEX matching method can be used to compare them separately to obtain the first matching result for the domain trigger item and the second matching result for the action type trigger item. When a skill node's triggerCondition includes only one trigger item, the matching result of that trigger item is determined as the conditional matching result of the skill node. When a triggerCondition includes multiple trigger items, the matching results of each trigger item are combined according to a preset logical relationship between the multiple trigger items to obtain the conditional matching result of the skill node. For example, an AND operation is performed on the first matching result and the second matching result. Skill nodes whose conditional matching results indicate successful matching are determined as candidate processing skills, and the candidate processing skills are combined into a candidate processing skill set. Subsequently, the key inference parameters corresponding to the candidate processing skills can be read for subsequent graph inference. In other embodiments, the preset logical relationship between multiple trigger items may also include OR, NOT, or combinations thereof.

[0038] Preferably, calculating the matching confidence based on the number of processing skills in the candidate processing skill set and the number of semantic elements matching each processing skill includes: When the candidate processing skill set is empty, the matching confidence is set to a first preset value; When the candidate processing skill set includes multiple processing skills, the matching confidence level is determined to be a second preset value; When the candidate processing skill set includes only one processing skill, and the processing skill only matches some semantic elements, the matching confidence is determined to be the third preset value; When the candidate processing skill set includes only one processing skill, and the processing skill matches all semantic elements, the matching confidence is determined as a fourth preset value; wherein, the first preset value, the second preset value, the third preset value and the fourth preset value increase sequentially, the first preset value and the second preset value are both lower than the preset threshold, and the third preset value and the fourth preset value are both greater than the preset threshold.

[0039] In one embodiment, the number of semantic elements matching each processing skill in the candidate processing skill set is counted, and the matching confidence is determined based on the number of candidate processing skills and the number of semantic elements matching each processing skill. Assuming a preset threshold of 0.7, when no processing skill is matched, the corresponding matching confidence is determined as a first preset value, such as 0.2; when multiple processing skills are matched, the corresponding matching confidence is determined as a second preset value, such as 0.5; when a processing skill is matched and the number of semantic elements matching that processing skill is less than the total number of semantic elements, the corresponding matching confidence is determined as a third preset value, such as 0.8; when a processing skill is matched and the number of semantic elements matching that processing skill is equal to the total number of semantic elements, the corresponding matching confidence is determined as a fourth preset value, such as 0.95. The first, second, third, and fourth preset values ​​increase sequentially, with the first and second preset values ​​both lower than the preset threshold, and the third and fourth preset values ​​both greater than the preset threshold.

[0040] Step S103: When the matching confidence is lower than a preset threshold, iteratively perform semantic element update until the matching confidence is not lower than the preset threshold, or the number of iterations reaches a preset number threshold; wherein, in each iteration, the semantic element with the fewest matched processing skills is determined as the target semantic element, and multiple candidate values ​​of the target semantic element are obtained from the skill graph, selection information related to each candidate value is received, the target semantic element is updated to the candidate value indicated by the selection information, the candidate processing skill set is rematched, and the matching confidence is recalculated.

[0041] It should be noted that when the matching confidence is lower than a preset threshold, iterative semantic element updates are performed until the matching confidence is not lower than the preset threshold, or the number of iterations reaches a preset threshold. This means that when the matching confidence is lower than the preset threshold, it indicates that the current semantic elements are insufficient to accurately determine the processing skills used for graph reasoning. In this case, graph reasoning is not performed directly, but semantic element updates are performed instead. In each round of updates, the number of processing skills matched by each semantic element can be counted. The semantic element with the fewest matched processing skills is determined as the target semantic element. Multiple candidate values ​​for the target semantic element are obtained from the skill graph, and the candidate values ​​are output to the user. After receiving the user's selection information for the candidate values, the target semantic element is updated to the candidate value indicated by the selection information, and the candidate processing skill set is rematched and the matching confidence is recalculated based on the updated semantic elements. If the recalculated matching confidence is still lower than the preset threshold, the next round of updates is performed; if it is not lower than the preset threshold, the iteration stops. If the current matching confidence score is still lower than the preset threshold when the number of iterations for semantic element updates reaches the preset threshold, the current request processing task will be terminated early, and an unresolved parsing message will be output. By setting a preset threshold, repeated semantic element updates can be avoided when the matching confidence score consistently fails to reach the preset threshold, thus reducing invalid matches and redundant calculations.

[0042] Preferably, the step of determining the semantic element with the fewest matched processing skills as the target semantic element, and obtaining multiple candidate values ​​of the target semantic element from the skill graph, includes: The number of processing skills matched by each semantic element in the candidate processing skill set is obtained respectively, and the semantic element with the fewest matched processing skills is determined as the target semantic element. Determine the element type corresponding to the target semantic element, traverse the trigger conditions of each processing skill in the skill graph, and extract the values ​​belonging to the element type; The extracted values ​​are deduplicated to obtain multiple candidate values ​​for the target semantic element.

[0043] In one embodiment, semantic elements include three categories: domain, action_type, and entity. After obtaining the candidate processing skill set, the number of processing skills matched by each type of semantic element in the candidate processing skill set is counted, and the semantic element with the fewest matched processing skills is determined as the target semantic element. Alternatively, the ratio between the number of processing skills matched by a semantic element and the total number of processing skills in the candidate processing skill set can be used as the SPARQL matching coverage rate. In this case, the semantic element with the lowest coverage rate is the semantic element with the fewest matched processing skills. Subsequently, the element type corresponding to the target semantic element is determined, the triggerCondition of each processing skill in the candidate processing skill set is traversed, the matching values ​​belonging to the element type in the triggerCondition are extracted, and the extracted matching values ​​are deduplicated to obtain multiple candidate values ​​for the target semantic element.

[0044] Preferably, receiving selection information related to each of the candidate values ​​and updating the target semantic element to the candidate value indicated by the selection information includes: Generate element types containing the target semantic elements and value selection prompts for each of the candidate values, and output the value selection prompts; Receive selection information for the value selection prompt information, and determine the candidate value indicated by the selection information as the target value; Set the value of the target semantic element to the target value, and keep the other semantic elements in each semantic element unchanged except for the target semantic element.

[0045] In one embodiment, after determining the target semantic element, a selection prompt message containing the element type of the target semantic element and each candidate value is generated and output. For example, when the target semantic element is "domain", the selection prompt message could be "Do you mean the financial domain or the inventory domain?"; when the target semantic element is "action_type", the selection prompt message could be "Do you want to perform a query operation or a reconciliation operation?"; when the target semantic element is "entity", the selection prompt message could be "Do you mean purchase order A or purchase order B?". The system receives the selection information returned by the user in response to the selection prompt message, determines the candidate value indicated by the selection information as the target value, sets the value of the target semantic element to the target value, and keeps the values ​​of other semantic elements unchanged, thus ensuring that only one semantic element is updated per user interaction.

[0046] Furthermore, the semantic element values ​​corresponding to the selection information can be stored in the session context so that the semantic element values ​​can be reused in subsequent request processing within the same session, reducing repeated selections.

[0047] In another embodiment, when the candidate processing skill set includes multiple processing skills, a preset number of candidate intents can be generated based on the semantic elements matching each processing skill, and a list of candidate intents can be output to the user. Candidate intents may include the name of the corresponding processing skill, the associated IntentType, and the matched semantic elements to help the user understand the request processing direction corresponding to each candidate processing skill. While outputting the list of candidate intents, value selection prompts are still generated according to the target semantic elements, and the target semantic elements are updated based on the user's selection information returned for the candidate values.

[0048] Step S104: When the matching confidence obtained in any calculation is not lower than the preset threshold, a graph reasoning rule is determined according to the candidate processing skill set corresponding to the matching confidence obtained in any calculation, and graph reasoning is performed in the pre-constructed business knowledge graph according to the graph reasoning rule to obtain the request processing result of the natural language request.

[0049] It should be noted that when the matching confidence score obtained in any calculation is not lower than the preset threshold, the graph reasoning rule is determined based on the candidate processing skill set corresponding to the matching confidence score obtained in any calculation. Then, according to the graph reasoning rule, graph reasoning is performed in the pre-built business knowledge graph to obtain the request processing result of the natural language request. This means that when the matching confidence score obtained after the first match or any round of updates is not lower than the preset threshold, it indicates that the current semantic element has met the conditions for performing graph reasoning. At this time, the corresponding processing skill can be determined based on the current candidate processing skill set, and the graph reasoning rule associated with that processing skill can be obtained. The graph reasoning rule can limit the starting entity, relation edges, access direction, maximum reasoning hop count, or result generation method used in graph reasoning. When performing graph reasoning, the starting node can be located in the pre-built business knowledge graph based on the operation object in the semantic element. Starting from the starting node, the associated nodes are visited hop by hop along the relation edges according to the graph reasoning rule, and the visited nodes and the traversed relation edges are recorded. After the stopping condition defined by the graph reasoning rule is met, the request processing result of the natural language request is generated based on the visited node data and relation edge data. Therefore, graph reasoning can be performed only after the matching confidence reaches a preset threshold, avoiding direct graph traversal under low confidence conditions and reducing the computational resource consumption caused by invalid node visits and relation edge traversals.

[0050] In one embodiment, when the matching confidence score obtained in any calculation is not lower than a preset threshold, the target processing skill is determined based on the candidate processing skill set corresponding to the matching confidence score, and the Skill URI, parameter schema, compliance verification rules, and graph inference rules corresponding to the target processing skill are read from the skill graph (e.g., Skills ontology). Before performing graph inference, the Skill URI, parameter schema, and compliance verification rules of the target processing skill are locked, and the parameter values ​​in the semantic elements are verified against the parameter schema and compliance verification rules; when the parameter values ​​pass the verification, graph inference is performed according to the graph inference rules. The selection of the target processing skill, the parameter schema, and the compliance verification rules are determined by pre-built information in the skill graph, and the parameter values ​​in the semantic elements are obtained by parsing natural language requests to limit the uncertain content in the graph inference process to parameter values.

[0051] In one embodiment, after determining the target processing skill, the IntentType associated with the target processing skill is read, and the maxHops (maximum inference hops) and triplesBudget (triple traversal budget) corresponding to the target processing skill are determined according to the preset correspondence between IntentType and inference resource parameters. IntentType can include types such as Query, Reconcile, Validate, Aggregate, Recommend, and Execute, with different IntentTypes corresponding to different maxHops and triplesBudget. The determined maxHops and triplesBudget are written into the graph inference rules to control the node access depth and triple traversal scale during subsequent graph inference, ensuring that different types of requests are executed within the corresponding inference resource scope.

[0052] Preferably, the step of performing graph reasoning in the pre-constructed business knowledge graph according to the graph reasoning rules to obtain the request processing result of the natural language request includes: Read the object semantic elements used to represent the operation object from each of the semantic elements, determine the entity corresponding to the object semantic elements as the starting entity, and locate the starting node corresponding to the starting entity in the business knowledge graph; According to the graph reasoning rules, starting from the starting node, the associated nodes are visited hop by hop along the relational edges in the business knowledge graph, and the nodes visited and the relational edges traversed in each hop are recorded; wherein, when the number of hops visited reaches the maximum number of reasoning hops limited by the graph reasoning rules, or when there are no relational edges that can be visited, the visit is stopped. Based on the nodes and relation edges visited at each hop, the request processing result is obtained.

[0053] In one embodiment, when performing graph reasoning according to graph reasoning rules, the object semantic elements representing the operation object are first read from each semantic element. The entity corresponding to the object semantic element is determined as the starting entity, and the starting node corresponding to the starting entity is located in the pre-built business knowledge graph. In the ontology retrieval stage, candidate subgraphs are extracted from the business knowledge graph with the starting node as the center, based on the maxHops and triplesBudget defined by the graph reasoning rules. In the context injection stage, data access permissions, business constraints, and output format constraints are injected into the candidate subgraphs. Subsequently, in the multi-hop graph reasoning stage, starting from the starting node, the associated nodes are visited hop-by-hop along the relation edges in the candidate subgraphs, and the nodes visited, the relation edges traversed, and the corresponding triple data are recorded for each hop. When the number of hops reaches maxHops, or there are no relation edges that can be visited further, the visit stops. During the hop-by-hop visit process, the number of traversed triples and the execution time can also be counted, and when the resource consumption exceeds triplesBudget, a degradation process of reducing the number of reasoning hops or increasing the relation edge weight threshold can be performed.

[0054] Furthermore, during the multi-hop graph inference phase, the number of inference hops visited, the number of triples traversed, and the execution time are counted in real time. When the number of traversed triples exceeds triplesBudget, the first level of degradation processing is performed to reduce the remaining inference hops. If the number of remaining inference hops still exceeds triplesBudget after reduction, the second level of degradation processing is performed to increase the predicate weight threshold of relation edges to filter low-relevance relation edges. If the number of hops still exceeds triplesBudget after the second level of degradation processing, the third level of degradation processing is performed, triggering a semantic element update process to narrow the scope of the operation object or adjust the request semantics. During hop-by-hop access, when the actual number of hops visited exceeds the preset safe number of hops or the execution time exceeds the preset duration threshold, circuit breaking is triggered, stopping the current graph inference, and generating partial request processing results based on the visited nodes and relation edges, or outputting a prompt message indicating that graph inference cannot be completed.

[0055] In one embodiment, after stopping hop-by-hop access, the nodes and relation edges accessed by each hop are combined into a candidate inference fact set. During the consistency verification phase, the candidate inference fact set is verified for consistency and legality using an ontology inferencer and constraint verification rules, and data that contradicts each other or does not meet business constraints is eliminated. During the conclusion generation phase, the request processing result is generated based on the verified node data and relation edge data, and the graph inference path corresponding to the request processing result is recorded. During the output phase, the output format template is selected according to the IntentType corresponding to the current request, and the request processing result is output according to the output format template. During the memory writing phase, the semantic elements of this request, the SkillURI of the target processing skill, the graph inference path, and the request processing result are stored in the inference memory for use in processing subsequent identical or similar requests.

[0056] This invention, through semantic parsing and decomposition of natural language requests into multiple semantic elements, transforms unstructured request content into structured data that can trigger conditional matching, reducing the impact of differences in natural language expression on subsequent processing skill matching. By matching each semantic element with a skill graph and calculating the matching confidence based on the number of candidate processing skills and the number of semantic elements matched by each processing skill, the matching status of the request semantics can be quantified into an indicator for controlling graph inference execution, avoiding direct execution of graph inference when candidate processing skills are unclear. Furthermore, when the matching confidence is lower than a preset threshold, adjustments are made based on the number of matched processing skills. Iterative updates are performed on the semantic elements with the fewest elements, and iteration stops when the matching confidence reaches a preset threshold or the number of iterations for semantic element updates reaches a preset threshold. This limits the scope of each round of updates to the semantic elements with the weakest matching degree at present, while avoiding repeated matching and updates for requests that cannot converge, thus reducing invalid interactions and computational resource consumption. After the matching confidence reaches a preset threshold, graph reasoning rules are determined based on the current candidate processing skill set and graph reasoning is performed in the business knowledge graph. This avoids graph traversal operations under low confidence conditions, reduces computational resource consumption caused by invalid graph reasoning, and improves the accuracy of request processing results.

[0057] Optionally, in this embodiment of the invention, determining the semantic element with the fewest matched processing skills as the target semantic element, and obtaining multiple candidate values ​​of the target semantic element from the skill graph, includes: The number of processing skills matched by each semantic element in the candidate processing skill set is obtained respectively, and the semantic element with the fewest matched processing skills is determined as the target semantic element. Determine the element type corresponding to the target semantic element, traverse the trigger conditions of each processing skill in the skill graph, and extract the values ​​belonging to the element type; The extracted values ​​are deduplicated to obtain multiple candidate values ​​for the target semantic element.

[0058] This invention, through statistical analysis of the number of processing skills matched by each semantic element, selects the semantic element with the fewest matches and extracts candidate values ​​of the same type and after deduplication from the triggering conditions of the processing skills. This enables the update object to be focused on the semantic element with the weakest current matching degree and reduces invalid selection and duplicate matching processing caused by duplicate candidate values.

[0059] Optionally, in this embodiment of the invention, receiving selection information related to each of the candidate values ​​and updating the target semantic element to the candidate value indicated by the selection information includes: Generate element types containing the target semantic elements and value selection prompts for each of the candidate values, and output the value selection prompts; Receive selection information for the value selection prompt information, and determine the candidate value indicated by the selection information as the target value; Set the value of the target semantic element to the target value, and keep the other semantic elements in each semantic element unchanged except for the target semantic element.

[0060] This invention, by outputting value selection prompts containing the target semantic element type and candidate values, and only writing the candidate values ​​indicated by the selection information into the target semantic element while keeping other semantic elements unchanged, can limit each round of semantic update to a single element, avoid the introduction of new matching deviations due to the simultaneous changes of multiple semantic elements, and reduce the processing complexity of subsequent rematching.

[0061] Optionally, in this embodiment of the invention, the step of matching each of the semantic elements with a pre-constructed skill graph to obtain a candidate processing skill set includes: Read the trigger conditions of each processing skill in the skill graph; wherein, the trigger conditions include at least one trigger item; For any trigger item, read the value of the semantic element with the same element type as the trigger item from each of the semantic elements, and compare the read value with the matching value of the trigger item according to the matching method of the trigger item to obtain the matching result of the trigger item; When the triggering condition includes one trigger item, the matching result of the trigger item is determined as the condition matching result of the corresponding processing skill; when the triggering condition includes multiple trigger items, the matching results of each trigger item are combined according to the preset logical relationship between each trigger item to obtain the condition matching result of the corresponding processing skill. The processing skills that match the corresponding conditions are combined to obtain a set of candidate processing skills.

[0062] This invention compares semantic elements item by item according to the element type, matching method and matching value of the trigger item, and combines the matching results of each trigger item according to a preset logical relationship when there are multiple trigger items. This enables the screening of processing skills to be constrained by multiple trigger conditions at the same time, reduces the number of processing skills that do not meet the trigger conditions from entering the candidate processing skill set, and reduces the trigger risk of error graph reasoning.

[0063] Optionally, in this embodiment of the invention, calculating the matching confidence based on the number of processing skills in the candidate processing skill set and the number of semantic elements matching each processing skill includes: When the candidate processing skill set is empty, the matching confidence is set to a first preset value; When the candidate processing skill set includes multiple processing skills, the matching confidence level is determined to be a second preset value; When the candidate processing skill set includes only one processing skill, and the processing skill only matches some semantic elements, the matching confidence is determined to be the third preset value; When the candidate processing skill set includes only one processing skill, and the processing skill matches all semantic elements, the matching confidence is determined as a fourth preset value; wherein, the first preset value, the second preset value, the third preset value and the fourth preset value increase sequentially, the first preset value and the second preset value are both lower than the preset threshold, and the third preset value and the fourth preset value are both greater than the preset threshold.

[0064] This invention sets matching confidence levels with a clear magnitude relationship to preset thresholds for scenarios where the candidate processing skill set is empty, includes multiple processing skills, partially matches a unique processing skill, and fully matches a unique processing skill. This prevents graph reasoning from being executed when there are no candidate processing skills or multiple candidate processing skills exist. When the candidate processing skill is unique, graph reasoning is executed based on the degree of semantic element matching, thereby reducing unnecessary semantic element updates and repeated matching processing in scenarios with only one candidate.

[0065] Optionally, in this embodiment of the invention, the step of performing graph reasoning in a pre-built business knowledge graph according to the graph reasoning rules to obtain the request processing result of the natural language request includes: Read the object semantic elements used to represent the operation object from each of the semantic elements, determine the entity corresponding to the object semantic elements as the starting entity, and locate the starting node corresponding to the starting entity in the business knowledge graph; According to the graph reasoning rules, starting from the starting node, the associated nodes are visited hop by hop along the relational edges in the business knowledge graph, and the nodes visited and the relational edges traversed in each hop are recorded; wherein, when the number of hops visited reaches the maximum number of reasoning hops limited by the graph reasoning rules, or when there are no relational edges that can be visited, the visit is stopped. Based on the nodes and relation edges visited at each hop, the request processing result is obtained.

[0066] This invention, by starting with the entity corresponding to the operation object as the starting node, visits the relational edges in the business knowledge graph hop by hop according to the graph reasoning rules, and stops when the maximum reasoning hop count is reached or there are no more relational edges that can be visited, can limit the data access scope of graph reasoning to the nodes and relational edges related to the request, thereby reducing the consumption of computing resources caused by unbounded traversal.

[0067] Optionally, in this embodiment of the invention, receiving a natural language request and performing semantic parsing on the natural language request to obtain multiple semantic elements includes: The natural language request is input into a pre-trained large language model, so that the large language model extracts field content from the natural language request according to preset fields, writes the extracted field content into the corresponding preset fields, and sets the preset fields that cannot be identified from the natural language request to null values. Each of the preset fields and its corresponding field content is determined as a semantic element.

[0068] This invention, through a pre-trained large language model, extracts field content from natural language requests according to preset fields and sets unrecognized fields to null values. This transforms natural language requests into semantic elements with a unified field structure, preventing unrecognized content from being inferred as valid values ​​and reducing the risk of triggering incorrect matching and erroneous graph reasoning.

[0069] like Figure 2 As shown, based on the above method embodiments, corresponding apparatus embodiments are provided; An embodiment of the present invention provides a request processing device based on a knowledge graph, including: a semantic parsing module 201, a semantic matching module 202, an element updating module 203, and a graph reasoning module 204; The semantic parsing module 201 is used to receive a natural language request, perform semantic parsing on the natural language request, and obtain multiple semantic elements. The semantic matching module 202 is used to match each of the semantic elements with a pre-constructed skill graph to obtain a set of candidate processing skills, and to calculate the matching confidence based on the number of processing skills in the set of candidate processing skills and the number of semantic elements that match each of the processing skills. The element update module 203 is used to iteratively perform semantic element updates when the matching confidence is lower than a preset threshold, until the matching confidence is not lower than the preset threshold, or the number of iterations reaches a preset number threshold; wherein, in each iteration, the semantic element with the fewest matched processing skills is determined as the target semantic element, and multiple candidate values ​​of the target semantic element are obtained from the skill graph, selection information related to each candidate value is received, the target semantic element is updated to the candidate value indicated by the selection information, the candidate processing skill set is rematched, and the matching confidence is recalculated; The graph reasoning module 204 is used to determine graph reasoning rules based on the candidate processing skill set corresponding to the matching confidence level obtained in any calculation when the matching confidence level is not lower than the preset threshold, and to perform graph reasoning in the pre-constructed business knowledge graph according to the graph reasoning rules to obtain the request processing result of the natural language request.

[0070] Optionally, in this embodiment of the invention, the element update module 203 includes: a target semantic element determination submodule, a value extraction submodule, and a value deduplication submodule; The target semantic element determination submodule is used to obtain the number of processing skills matched by each semantic element in the candidate processing skill set, and determine the semantic element with the fewest matched processing skills as the target semantic element. The value extraction submodule is used to determine the element type corresponding to the target semantic element, traverse the trigger conditions of each processing skill in the skill graph, and extract the value belonging to the element type. The value deduplication submodule is used to deduplicatize the extracted values ​​to obtain multiple candidate values ​​for the target semantic element.

[0071] This invention, through statistical analysis of the number of processing skills matched by each semantic element, selects the semantic element with the fewest matches and extracts candidate values ​​of the same type and after deduplication from the triggering conditions of the processing skills. This enables the update object to be focused on the semantic element with the weakest current matching degree and reduces invalid selection and duplicate matching processing caused by duplicate candidate values.

[0072] Optionally, in this embodiment of the invention, the element update module 203 further includes: a value selection prompt information generation submodule, a selection information receiving submodule, and a target value setting submodule; The value selection prompt information generation submodule is used to generate element types containing the target semantic elements and value selection prompt information for each of the candidate values, and output the value selection prompt information. The selection information receiving submodule is used to receive selection information for the value selection prompt information, and determine the candidate value indicated by the selection information as the target value; The target value setting submodule is used to set the value of the target semantic element to the target value, while keeping the other semantic elements in each semantic element unchanged except for the target semantic element.

[0073] This invention, by outputting value selection prompts containing the target semantic element type and candidate values, and only writing the candidate values ​​indicated by the selection information into the target semantic element while keeping other semantic elements unchanged, can limit each round of semantic update to a single element, avoid the introduction of new matching deviations due to the simultaneous changes of multiple semantic elements, and reduce the processing complexity of subsequent rematching.

[0074] Optionally, in this embodiment of the invention, the semantic matching module 202 includes: a trigger condition reading submodule, a trigger item matching submodule, a condition matching result generation submodule, and a candidate processing skill set generation submodule; The trigger condition reading submodule is used to read the trigger conditions of each processing skill in the skill graph; wherein, the trigger condition includes at least one trigger item; The trigger matching submodule is used to read the values ​​of semantic elements of the same type as the trigger from each of the semantic elements for any trigger, and compare the read values ​​with the matching values ​​of the trigger according to the matching method of the trigger to obtain the matching result of the trigger. The condition matching result generation submodule is used to determine the matching result of the trigger item as the condition matching result of the corresponding processing skill when the trigger condition includes one trigger item; and to combine the matching results of each trigger item according to the preset logical relationship between each trigger item to obtain the condition matching result of the corresponding processing skill when the trigger condition includes multiple trigger items. The candidate processing skill set generation submodule is used to combine processing skills that have a successful matching result according to the corresponding conditions to obtain a candidate processing skill set.

[0075] This invention compares semantic elements item by item according to the element type, matching method and matching value of the trigger item, and combines the matching results of each trigger item according to a preset logical relationship when there are multiple trigger items. This enables the screening of processing skills to be constrained by multiple trigger conditions at the same time, reduces the number of processing skills that do not meet the trigger conditions from entering the candidate processing skill set, and reduces the trigger risk of error graph reasoning.

[0076] Optionally, in this embodiment of the invention, the semantic matching module 202 further includes: a first matching confidence determination submodule, a second matching confidence determination submodule, a third matching confidence determination submodule, and a fourth matching confidence determination submodule; The first matching confidence determination submodule is used to determine the matching confidence as a first preset value when the candidate processing skill set is empty; The second matching confidence determination submodule is used to determine the matching confidence as a second preset value when the candidate processing skill set includes multiple processing skills; The third matching confidence determination submodule is used to determine the matching confidence as a third preset value when the candidate processing skill set includes only one processing skill and the processing skill only matches some semantic elements. The fourth matching confidence determination submodule is used to determine the matching confidence as a fourth preset value when the candidate processing skill set includes only one processing skill and the processing skill matches all semantic elements; wherein, the first preset value, the second preset value, the third preset value and the fourth preset value increase sequentially, the first preset value and the second preset value are both lower than the preset threshold, and the third preset value and the fourth preset value are both greater than the preset threshold.

[0077] This invention sets matching confidence levels with a clear magnitude relationship to preset thresholds for scenarios where the candidate processing skill set is empty, includes multiple processing skills, partially matches a unique processing skill, and fully matches a unique processing skill. This prevents graph reasoning from being executed when there are no candidate processing skills or multiple candidate processing skills exist. When the candidate processing skill is unique, graph reasoning is executed based on the degree of semantic element matching, thereby reducing unnecessary semantic element updates and repeated matching processing in scenarios with only one candidate.

[0078] Optionally, in this embodiment of the invention, the graph reasoning module 204 includes: a starting node positioning submodule, a graph reasoning submodule, and a request processing result generation submodule; The starting node positioning submodule is used to read object semantic elements that represent the operation object from each of the semantic elements, determine the entity corresponding to the object semantic elements as the starting entity, and locate the starting node corresponding to the starting entity in the business knowledge graph. The graph reasoning submodule is used to visit associated nodes hop by hop along the relational edges in the business knowledge graph, starting from the starting node, according to the graph reasoning rules, and record the nodes visited and the relational edges traversed in each hop; wherein, when the number of hops visited reaches the maximum number of reasoning hops limited by the graph reasoning rules, or when there are no relational edges that can be visited, the access is stopped. The request processing result generation submodule is used to obtain the request processing result based on the nodes and relationship edges visited by each hop.

[0079] This invention, by starting with the entity corresponding to the operation object as the starting node, visits the relational edges in the business knowledge graph hop by hop according to the graph reasoning rules, and stops when the maximum reasoning hop count is reached or there are no more relational edges that can be visited, can limit the data access scope of graph reasoning to the nodes and relational edges related to the request, thereby reducing the consumption of computing resources caused by unbounded traversal.

[0080] Optionally, in this embodiment of the invention, the semantic parsing module 201 includes: a field extraction submodule and a semantic element determination submodule; The field extraction submodule is used to input the natural language request into a pre-trained large language model, so that the large language model extracts field content from the natural language request according to preset fields, writes the extracted field content into the corresponding preset fields, and sets preset fields that cannot be identified from the natural language request to null values. The semantic element determination submodule is used to determine each preset field and its corresponding field content as semantic elements.

[0081] This invention, through a pre-trained large language model, extracts field content from natural language requests according to preset fields and sets unrecognized fields to null values. This transforms natural language requests into semantic elements with a unified field structure, preventing unrecognized content from being inferred as valid values ​​and reducing the risk of triggering incorrect matching and erroneous graph reasoning.

[0082] It is understood that the above-described device embodiments correspond to the method embodiments of the present invention, and can implement a knowledge graph-based request processing method provided by any of the above-described method embodiments of the present invention.

[0083] This invention embodiment uses a semantic parsing module 201 to perform semantic parsing on natural language requests and break them down into multiple semantic elements. This converts unstructured request content into structured data that can trigger conditional matching, reducing the impact of differences in natural language expression on subsequent processing skill matching. The semantic matching module 202 matches each semantic element with a skill graph and calculates the matching confidence based on the number of candidate processing skills and the number of semantic elements matched by each processing skill. This quantifies the matching status of the request semantics into an indicator for controlling graph reasoning execution, avoiding direct execution of graph reasoning when candidate processing skills are unclear. The element update module 2... 03 When the matching confidence is lower than the preset threshold, the semantic element with the fewest matching processing skills is iteratively located, and the semantic element is updated using selection information before rematching and recalculating the matching confidence. This can limit the scope of each round of updates to the semantic element with the weakest matching degree, reducing repeated confirmation and invalid updates of other semantic elements. After the matching confidence reaches the preset threshold, the graph reasoning module 204 determines the graph reasoning rules based on the current candidate processing skill set and performs graph reasoning in the business knowledge graph. This can avoid graph traversal operations under low confidence conditions, reduce the consumption of computing resources caused by invalid graph reasoning, and improve the accuracy of request processing results.

[0084] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can specifically be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0085] Based on the above embodiment of a knowledge graph-based request processing method, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a knowledge graph-based request processing method according to any embodiment of the present invention.

[0086] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.

[0087] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0088] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.

[0089] Based on the above-described method embodiments, another embodiment of the present invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute a knowledge graph-based request processing method as described in any of the above-described method embodiments of the present invention.

[0090] The modules / units integrated in the device / terminal equipment, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0091] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A knowledge graph based request processing method, characterized in that, include: Receive a natural language request, perform semantic parsing on the natural language request, and obtain multiple semantic elements; Each of the semantic elements is matched with a pre-constructed skill graph to obtain a set of candidate processing skills. The matching confidence is calculated based on the number of processing skills in the set of candidate processing skills and the number of semantic elements that match each of the processing skills. When the matching confidence is lower than a preset threshold, the semantic element is iteratively updated until the matching confidence is not lower than the preset threshold, or the number of iterations reaches a preset threshold. In each iteration, the semantic element with the fewest matched processing skills is determined as the target semantic element, and multiple candidate values ​​of the target semantic element are obtained from the skill graph. Selection information related to each candidate value is received, the target semantic element is updated to the candidate value indicated by the selection information, the candidate processing skill set is rematched, and the matching confidence is recalculated. When the matching confidence obtained in any calculation is not lower than the preset threshold, the graph reasoning rule is determined according to the candidate processing skill set corresponding to the matching confidence obtained in any calculation, and the graph reasoning is performed in the pre-constructed business knowledge graph according to the graph reasoning rule to obtain the request processing result of the natural language request. 2.The knowledge graph-based request processing method of claim 1, wherein, The step of determining the semantic element with the fewest matched processing skills as the target semantic element, and obtaining multiple candidate values ​​for the target semantic element from the skill graph, includes: The number of processing skills matched by each semantic element in the candidate processing skill set is obtained respectively, and the semantic element with the fewest matched processing skills is determined as the target semantic element. Determine the element type corresponding to the target semantic element, traverse the trigger conditions of each processing skill in the skill graph, and extract the values ​​belonging to the element type; The extracted values ​​are deduplicated to obtain multiple candidate values ​​for the target semantic element. 3.The knowledge graph based request processing method of claim 1, wherein, The step of receiving selection information related to each of the candidate values ​​and updating the target semantic element to the candidate value indicated by the selection information includes: Generate element types containing the target semantic elements and value selection prompts for each of the candidate values, and output the value selection prompts; Receive selection information for the value selection prompt information, and determine the candidate value indicated by the selection information as the target value; Set the value of the target semantic element to the target value, and keep the other semantic elements in each semantic element unchanged except for the target semantic element. 4.The knowledge graph based request processing method of claim 1, wherein, The step of matching each of the semantic elements with a pre-constructed skill graph to obtain a candidate processing skill set includes: Read the trigger conditions of each processing skill in the skill graph; wherein, the trigger conditions include at least one trigger item; For any trigger item, read the value of the semantic element with the same element type as the trigger item from each of the semantic elements, and compare the read value with the matching value of the trigger item according to the matching method of the trigger item to obtain the matching result of the trigger item; When the triggering condition includes one trigger item, the matching result of the trigger item is determined as the condition matching result of the corresponding processing skill; when the triggering condition includes multiple trigger items, the matching results of each trigger item are combined according to the preset logical relationship between each trigger item to obtain the condition matching result of the corresponding processing skill. The processing skills that match the corresponding conditions are combined to obtain a set of candidate processing skills. 5.The knowledge graph based request processing method of claim 1, wherein, The step of calculating the matching confidence based on the number of processing skills in the candidate processing skill set and the number of semantic elements matching each processing skill includes: When the candidate processing skill set is empty, the matching confidence is set to a first preset value; When the candidate processing skill set includes multiple processing skills, the matching confidence level is determined to be a second preset value; When the candidate processing skill set includes only one processing skill, and the processing skill only matches some semantic elements, the matching confidence is determined to be the third preset value; When the candidate processing skill set includes only one processing skill, and the processing skill matches all semantic elements, the matching confidence is determined as a fourth preset value; wherein, the first preset value, the second preset value, the third preset value and the fourth preset value increase sequentially, the first preset value and the second preset value are both lower than the preset threshold, and the third preset value and the fourth preset value are both greater than the preset threshold. 6.The knowledge graph based request processing method of claim 1, wherein, The step of performing graph reasoning in the pre-built business knowledge graph according to the graph reasoning rules to obtain the request processing result of the natural language request includes: Read the object semantic elements used to represent the operation object from each of the semantic elements, determine the entity corresponding to the object semantic elements as the starting entity, and locate the starting node corresponding to the starting entity in the business knowledge graph; According to the graph reasoning rules, starting from the starting node, the associated nodes are visited hop by hop along the relational edges in the business knowledge graph, and the nodes visited and the relational edges traversed in each hop are recorded; wherein, when the number of hops visited reaches the maximum number of reasoning hops limited by the graph reasoning rules, or when there are no relational edges that can be visited, the visit is stopped. Based on the nodes and relation edges visited at each hop, the request processing result is obtained. 7.The knowledge graph based request processing method of claim 1, wherein, The process of receiving a natural language request and performing semantic parsing on the natural language request yields multiple semantic elements, including: The natural language request is input into a pre-trained large language model, so that the large language model extracts field content from the natural language request according to preset fields, writes the extracted field content into the corresponding preset fields, and sets the preset fields that cannot be identified from the natural language request to null values. Each of the preset fields and its corresponding field content is determined as a semantic element. 8.A knowledge graph based request processing apparatus, characterized by comprising: include: The apparatus is used to perform a knowledge graph-based request processing method as described in any one of claims 1-7.

9. A terminal device, comprising: include: A processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements a knowledge graph-based request processing method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, include: A stored computer program, wherein, when the computer program is executed, it controls the device containing the computer-readable storage medium to perform a knowledge graph-based request processing method as described in any one of claims 1-7.