A search method and device for a large-scale graph structure knowledge graph

By searching the first summary subgraph with high matching degree in the summary graph and querying the answer with the highest matching degree in the knowledge graph, the problems of high complexity and low accuracy of large-scale graph structure knowledge graph search are solved, and efficient search results are achieved.

CN117332047BActive Publication Date: 2026-07-21CHINA CONSTRUCTION BANK
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA CONSTRUCTION BANK
Filing Date
2023-11-02
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing direct traversal search methods suffer from high search complexity and low accuracy when searching large-scale graph-structured knowledge graphs.

Method used

By pre-constructing summary graphs and knowledge graphs, and adopting an interactive query approach of "pattern first, instance later", the system first searches for the first summary subgraph with a high matching degree in the summary graph, and then queries the answer with the highest matching degree in the knowledge graph.

Benefits of technology

It effectively reduces the search space, improves search efficiency and accuracy, and enables the discovery of semantic associations from fragmented triple graphs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117332047B_ABST
    Figure CN117332047B_ABST
Patent Text Reader

Abstract

The application provides a large-scale graph structure knowledge graph search method and device, which comprises the following steps: obtaining a keyword group input by a user; querying at least one first abstract subgraph matched with the keyword group in a pre-constructed abstract graph based on a keyword search engine of the knowledge graph, and feeding back the first abstract subgraph to the user; obtaining a second abstract subgraph determined by the user from the first abstract subgraph; querying an answer matched with the second abstract subgraph in a pre-constructed knowledge graph based on a graph query engine of the knowledge graph, and feeding back the final answer to the user. In the embodiment of the application, the first abstract subgraph with high matching degree is searched in the abstract graph based on the keyword, and is returned to the user, and then the second abstract subgraph determined from the first abstract subgraph is queried in the knowledge graph to obtain the answer with the highest matching degree, i.e. the instance, so that the interactive query mode of 'first mode and then instance' is realized, and the purposes of reducing the search space, improving the search efficiency and the correctness are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of big data processing technology, and in particular to a search method and apparatus for large-scale graph-structured knowledge graphs. Background Technology

[0002] A knowledge graph is a knowledge base with a graph-like organizational structure consisting of interconnected entities, their attributes, and relationships.

[0003] Current methods primarily employ direct traversal search to search large-scale graph-structured knowledge graphs. The specific process involves directly traversing the graph database based on keywords and then returning the search results. However, this direct traversal search method has the following problems: first, directly traversing and querying a graph database with massive numbers of nodes is complex and time-consuming; second, the accuracy of the search results is low, returning a large number of highly repetitive or similar results to the user, failing to meet the user's search intent.

[0004] Therefore, it can be seen that using the existing direct traversal search method to search large-scale graph-structured knowledge graphs has the problems of high search complexity and low accuracy. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a search method and apparatus for large-scale graph structure knowledge graphs to solve the problems of high search complexity and low accuracy in existing direct traversal search methods for searching large-scale graph structure knowledge graphs.

[0006] To address the above problems, embodiments of the present invention provide the following technical solutions:

[0007] The first aspect of this invention discloses a search method for large-scale graph-structured knowledge graphs, the search method comprising:

[0008] Get the keywords entered by the user;

[0009] The knowledge graph-based keyword search engine queries at least one first summary subgraph that matches the keyword in a pre-built summary graph and returns the first summary subgraph to the user.

[0010] Obtain the second summary subgraph determined by the user from the first summary subgraph;

[0011] The knowledge graph-based graph query engine queries the answer that matches the second summary subgraph in the pre-built knowledge graph and returns the final answer to the user.

[0012] The knowledge graph is constructed based on a large-scale graph structure knowledge graph, and the summary graph is constructed based on the knowledge graph.

[0013] Preferably, the pre-construction process of the knowledge graph includes:

[0014] Retrieve data structures from large-scale graph-structured knowledge graphs;

[0015] Extract instances, classes, and attribute values ​​from the data structure;

[0016] Based on the instances, classes, and attribute values, corresponding instance nodes, class nodes, and attribute value nodes are created to obtain a knowledge graph.

[0017] Preferably, the pre-constructed summary graph comprises:

[0018] Extract instances, classes, and attributes from the knowledge graph, as well as the hierarchical relationships between instances and classes, and the relationships between attribute values ​​and instances;

[0019] Based on the dependency relationship between the instance and the class, the instance is classified as a class node of the class to which it is dependent;

[0020] Based on the relationship between the attribute values ​​and instances, an index is created for the attribute values ​​that are related to the instances, and the index is pointed to the class node to which the instance belongs, thus obtaining a summary graph.

[0021] Preferably, the knowledge graph-based keyword search engine queries at least one first summary subgraph that matches the keyword in a pre-constructed summary graph, and returns the first summary subgraph to the user, including:

[0022] The input keywords are mapped to keyword elements to obtain the keyword elements of the corresponding keywords; or, if the keywords are keyword groups, the input keyword groups are mapped to keyword elements to obtain the keyword elements of the keywords in the corresponding keyword groups.

[0023] The keyword search engine based on the knowledge graph searches for substructures that connect the keyword elements in a pre-built summary graph;

[0024] The searched substructures are scored, and the K substructures corresponding to the scores from largest to smallest are used as the first summary subgraph that matches the keyword.

[0025] The first summary subgraph is output and displayed to the user.

[0026] Preferably, the knowledge graph-based graph query engine queries the pre-built knowledge graph for answers that match the second summary subgraph, and returns the final answer to the user, including:

[0027] Determine the class nodes in the second summary subgraph, wherein the class nodes include one or more;

[0028] If it is a class node, based on the graph query engine of the knowledge graph, query the first set of instances whose attribute value is the keyword among all instances belonging to the class node, and return the first set of instances as the final answer to the user;

[0029] If there are multiple class nodes, the graph query engine based on the knowledge graph will start from the first class node and query the first set of instances whose attribute value is the first keyword in the keyword group among all instances belonging to the first class node.

[0030] Select a candidate instance from the first instance set, query all instances connected to the candidate instance that belong to the second type of node and contain an attribute value of the second keyword in the keyword group. If the query fails, return to the step of selecting a candidate instance from the first instance set until there are no instances to choose from in the first instance set. Determine that the candidate answer based on the first type of node is empty, and execute the query for the next type of node.

[0031] If the query is successful, the candidate instance is determined as the alternative answer, and a second instance set is obtained. Then, a candidate instance is selected from the second instance set, and all instances connected to the candidate instance are queried to find instances that belong to the third type of node and contain an attribute value of the third keyword in the keyword group.

[0032] Until the query based on the last class node in the second summary subgraph is completed, all candidate answers will be obtained as the final answer that matches the second summary subgraph;

[0033] The final answer found in the query will be output and displayed to the user.

[0034] Preferably, before providing the final answer to the user, the process also includes:

[0035] If the answer matching the second summary subgraph contains an empty result, delete the empty result to obtain the final answer.

[0036] A second aspect of the present invention provides a search device for a large-scale graph-structured knowledge graph, the search device comprising:

[0037] The summary graph search module is used to obtain the keywords input by the user; the keyword search engine based on the knowledge graph queries at least one first summary subgraph that matches the keywords in the pre-built summary graph, and returns the first summary subgraph to the user;

[0038] A knowledge graph search module is used to obtain a second summary subgraph determined by the user from the first summary subgraph; a knowledge graph-based graph query engine queries the pre-built knowledge graph for answers that match the second summary subgraph, and returns the final answer to the user; wherein, the knowledge graph is constructed based on a large-scale graph structure knowledge graph, and the summary graph is constructed based on the knowledge graph;

[0039] The results display module is used to show the user the first summary subgraph and the final answer found in the query.

[0040] Preferably, it further includes: a pre-built module; the pre-built module includes: a knowledge graph construction unit and a summary graph construction unit;

[0041] The knowledge graph construction unit is used to obtain the data structure in a large-scale graph structure knowledge graph; extract instances, classes, and attribute values ​​from the data structure; and establish corresponding instance nodes, class nodes, and attribute value nodes based on the instances, classes, and attribute values ​​to obtain the knowledge graph.

[0042] The summary graph construction unit is used to extract instances, classes, and attributes from the knowledge graph, as well as the dependency relationships between instances and classes, and the relationships between attribute values ​​and instances; based on the dependency relationships between instances and classes, the instance is assigned to a class node of the class to which it has a dependency relationship; based on the relationships between attribute values ​​and instances, an index is created for the attribute values ​​that have a relationship with the instance, and the index is pointed to the class node to which the instance belongs, thus obtaining the summary graph.

[0043] Preferably, the summary graph search module includes:

[0044] The keyword matching unit is used to map the input keywords to keyword elements to obtain the keyword elements of the corresponding keywords; or, if the keywords are keyword groups, to map the input keyword groups to keyword elements to obtain the keyword elements of the keywords in the corresponding keyword groups.

[0045] The summary graph search unit is used to search for substructures connecting the keyword elements in the pre-constructed summary graph based on the keyword search engine of the knowledge graph;

[0046] The scoring unit is used to score the searched substructures and take the K substructures corresponding to the scores from largest to smallest as the first summary subgraph that matches the key group.

[0047] The first output unit is used to output and display the first summary subgraph to the user.

[0048] Preferably, the knowledge graph search module includes:

[0049] A preparation unit is configured to determine class nodes in the second summary subgraph, wherein the class nodes include one or more;

[0050] The knowledge graph search unit is used, if it is a class node, to query the first set of instances whose attribute value is the keyword among all instances belonging to the class node based on the graph query engine of the knowledge graph, and to use the first set of instances as the final answer found.

[0051] Furthermore, the knowledge graph search unit is configured to, if there are multiple class nodes, based on the graph query engine of the knowledge graph, start from the first class node and query a first set of instances belonging to the first class node whose attribute value is the first keyword in the keyword group; select a candidate instance from the first set of instances and query all instances connected to the candidate instance that belong to the second class node and contain instances whose attribute value is the second keyword in the keyword group; if the query fails, return to the step of selecting a candidate instance from the first set of instances until there are no instances to choose from in the first set of instances, determining that the candidate answer based on the first class node is empty, and execute the query for the next class node; if the query succeeds, determine the candidate instance as a candidate answer and obtain a second set of instances, continue to select a candidate instance from the second set of instances, and query all instances connected to the candidate instance that belong to the third class node and contain instances whose attribute value is the third keyword in the keyword group; until the query based on the last class node in the second summary subgraph is completed, obtain all candidate answers as the final answer matching the second summary subgraph;

[0052] The second output unit is used to output and display the final answer found in the query to the user.

[0053] Based on the above embodiments of the present invention, a search method and apparatus for a large-scale graph-structured knowledge graph are provided. The method involves: acquiring a keyword group input by a user; using a keyword search engine based on the knowledge graph to query at least one first summary subgraph matching the keyword group in a pre-constructed summary graph, and returning the first summary subgraph to the user; acquiring a second summary subgraph determined by the user from the first summary subgraph; and using a graph query engine based on the knowledge graph to query an answer matching the second summary subgraph in the pre-constructed knowledge graph, and returning the final answer to the user. In this embodiment, firstly, a first summary subgraph with high matching degree is searched in the summary graph based on keywords and returned to the user. Then, based on the second summary subgraph determined from the first summary subgraph, the answer with the highest matching degree, i.e., an instance, is queried in the knowledge graph. This interactive query method of "pattern first, instance later" achieves the purpose of reducing the search space, improving search efficiency, and increasing accuracy. Attached Figure Description

[0054] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0055] Figure 1 A flowchart illustrating a search method for a large-scale graph-structured knowledge graph provided in an embodiment of the present invention;

[0056] Figure 2 This is a schematic diagram of the structure of a search device for a large-scale graph-structured knowledge graph provided in an embodiment of the present invention. Detailed Implementation

[0057] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0058] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0059] As is known from the background art, existing direct traversal search methods for searching large-scale graph-structured knowledge graphs suffer from high search complexity and low accuracy. Therefore, this invention discloses a search method and apparatus for large-scale graph-structured knowledge graphs. It pre-constructs knowledge graphs and summary graphs, and based on keywords, uses an interactive query approach of "pattern first, instance later" to effectively mine semantically related information from fragmented triple graphs (resources, attributes, and attribute values), thereby reducing the search space and improving search efficiency and accuracy.

[0060] A triple can be represented as <resource, attribute, attribute value>, and in the embodiments of the invention, a triple represents <instance, class, attribute value>.

[0061] In this embodiment of the invention, a knowledge graph is a knowledge base with a graph-like organizational structure, consisting of interconnected entities and their attributes and relationships.

[0062] like Figure 1 The image shows a method for searching a large-scale graph-structured knowledge graph, as disclosed in an embodiment of the present invention, which mainly includes the following steps:

[0063] S101: Obtain the keywords entered by the user.

[0064] In S101, the keyword can be a single keyword or a keyword group, that is, a keyword group containing multiple keywords.

[0065] S102: The knowledge graph-based keyword search engine queries at least one first summary subgraph that matches the keyword in the pre-built summary graph and returns the first summary subgraph to the user.

[0066] In S102, the summary graph is pre-built based on a knowledge graph. In this embodiment of the invention, the knowledge graph is also pre-built. This knowledge graph is pre-built based on a large-scale graph structure knowledge graph.

[0067] A knowledge graph contains three types of nodes: E-nodes represent instances, C-nodes represent classes, and V-nodes represent attribute values.

[0068] A knowledge graph is a graph composed of instance nodes, class nodes, attribute value nodes, and the relationships between them.

[0069] A summary graph is a graph composed of class nodes and the relationships between classes. In this graph, all instances belonging to the same class are grouped into the same class node, and the class node is appended with the attribute values ​​corresponding to the instances to which they belong.

[0070] In S102, the abstract subgraph also refers to the abstract pattern. That is, the first abstract subgraph is the first abstract pattern.

[0071] In the specific execution of S102, the keyword search engine of the knowledge graph is used to search the pre-built summary graph based on the keywords. It can find instances (answers) that match the keywords and the classes to which they belong. That is, it can find one or more subgraph structures composed of classes, instances and additional attribute values. This subgraph structure is the first summary subgraph in the embodiment of the present invention.

[0072] In one embodiment of the present invention, a keyword search engine based on a knowledge graph queries at least one first summary subgraph that matches the keyword in a pre-constructed summary graph, and then returns the first summary subgraph to the user. This specifically includes the following steps:

[0073] S1021: Map the input keywords to keyword elements to obtain the keyword elements of the corresponding keywords; or, if the keywords are keyword groups, map the input keyword groups to keyword elements to obtain the keyword elements of the keywords in the corresponding keyword groups.

[0074] In the specific execution of S1021, the input keywords or keyword groups are mapped to keyword elements based on the index in the summary diagram, thereby obtaining the keyword elements of the corresponding keywords or keyword groups, that is, the attribute values ​​corresponding to the keywords or keyword groups.

[0075] S1022: The keyword search engine based on the knowledge graph searches for substructures that connect the keyword elements in the pre-built summary graph.

[0076] In S1022, the substructures of the keyword elements are connected, that is, the class to which the attribute value determined by the index belongs.

[0077] S1023: Score the searched substructures, and use the K substructures corresponding to the scores from largest to smallest as the first summary subgraph that matches the keyword.

[0078] In the specific execution of S1023, the searched substructures are scored, and the Top-k substructures are selected as the first summary subgraph that matches the keywords.

[0079] Among them, Top-k are the top k summary subgraphs with the highest probability obtained from the summary graph based on keywords.

[0080] S1024: Output and display the first summary subgraph to the user.

[0081] S103: Obtain the second summary subgraph determined by the user from the first summary subgraph.

[0082] During the execution of S103, the first summary subgraph obtained from S102 is displayed to the user, allowing the user to select a second summary subgraph from the displayed first summary subgraph.

[0083] In other words, the first summary subgraph, which is most likely to be the optimal answer found in the summary graph, will be returned to the user, who can then select one of these first summary subgraphs as the second summary subgraph to continue the search.

[0084] S104: The knowledge graph-based graph query engine queries the pre-built knowledge graph for the answer that matches the second summary subgraph and returns the final answer to the user.

[0085] In S104, the knowledge graph is pre-built based on a large-scale graph structure knowledge graph. A knowledge graph is a graph composed of instance nodes, class nodes, and attribute value nodes, as well as the relationships between them.

[0086] In the specific execution of S104, the graph query engine of the knowledge graph is used to search the pre-built knowledge graph based on the second summary subgraph. The search can find the answer, i.e. the instance, that belongs to the second summary subgraph and matches the keyword, and the final answer found is fed back to the user.

[0087] In one embodiment of the present invention, a knowledge graph-based graph query engine queries the pre-constructed knowledge graph for answers that match the second summary subgraph, and then returns the final answer to the user. This specifically includes the following steps:

[0088] S1041: Determine the class nodes in the second summary subgraph, wherein the class nodes include one or more.

[0089] If there is only one class node, execute S1042. If there are multiple class nodes, execute S1043.

[0090] S1042: Based on the graph query engine of the knowledge graph, query the first set of instances whose attribute value is the keyword among all instances belonging to the class node, and return the first set of instances as the final answer found to the user.

[0091] S1043: Based on the knowledge graph, the graph query engine starts from the first class node and queries the first set of instances whose attribute value is the first keyword in the keyword group among all instances belonging to the first class node.

[0092] S1044: Select a candidate instance from the first instance set, query all instances connected to the candidate instance that belong to the second type of node and contain an instance whose attribute value is the second keyword in the keyword group. If the query fails, execute S1044. If there are no instances to choose from in the first instance set, determine that the candidate answer based on the first type of node is empty, and execute the query for the next type of node.

[0093] If the query is successful, execute S1045.

[0094] S1045: Determine the candidate instance as the alternative answer and obtain the second instance set. Continue to select a candidate instance from the second instance set and query all instances connected to the candidate instance that belong to the third type of node and contain an instance whose attribute value is the third keyword in the keyword group.

[0095] The process is repeated in sequence as described in S1044 and S1045 until the query based on the last class node in the second summary subgraph is completed. All candidate answers will be obtained as the final answer that matches the second summary subgraph.

[0096] S1046: Output and display the final answer found in the query to the user.

[0097] In one embodiment of the present invention, before executing S104 to return the final answer found to the user, the method further includes: if the answer matching the second summary subgraph contains an empty result, deleting the empty result to obtain the final answer.

[0098] A search method for a large-scale graph-structured knowledge graph, based on embodiments of the present invention, involves: acquiring a keyword group input by a user; using a keyword search engine based on the knowledge graph to query at least one first summary subgraph matching the keyword group in a pre-constructed summary graph, and returning the first summary subgraph to the user; acquiring a second summary subgraph determined by the user from the first summary subgraph; and using a graph query engine based on the knowledge graph to query the answer matching the second summary subgraph in the pre-constructed knowledge graph, and returning the final answer to the user. In this embodiment, firstly, a first summary subgraph with high matching degree is searched in the summary graph based on keywords and returned to the user; then, based on the second summary subgraph determined from the first summary subgraph, the answer with the highest matching degree, i.e., the instance, is queried in the knowledge graph. Through this interactive query method of "pattern first, instance later," semantic association information is effectively extracted from fragmented triple graphs, achieving the goals of reducing the search space, improving search efficiency, and increasing accuracy.

[0099] Based on the above embodiments of the present invention, a search method for a large-scale graph-structured knowledge graph is disclosed, wherein the specific process of constructing the knowledge graph is as follows:

[0100] Step 1: Obtain the data structure in the large-scale graph structure knowledge graph.

[0101] The specific execution of step 1 is as follows: download the RDF format file from the source graph database and determine the data structure of the knowledge graph composed of the RDF format file.

[0102] These RDF format files include: the ontology description owl file dbpedia_owl, the instance_types_en_nt file describing which class an instance belongs to, the instance_properties_en_nt file describing instance properties, and the instance_relationships_en_nt file describing the relationships between instances.

[0103] RDF (Resource Description Framework) is a data model that uses XML syntax to describe the characteristics of resources and the relationships between resources.

[0104] Step 2: Extract instances, classes, and attribute values ​​from the data structure.

[0105] The specific process of step 2 is as follows: extract instances, classes, and attribute values ​​from the data structure of the knowledge graph based on the RDF format file obtained in step 1. Attribute values ​​refer to the attribute values ​​of instances, and there are relationships between attribute values ​​and instances.

[0106] Step 3: Based on the instance, class, and attribute value, establish corresponding instance nodes, class nodes, and attribute value nodes to obtain the knowledge graph.

[0107] The specific execution of step 3 is as follows: Based on the extracted instance, class, and attribute value, corresponding instance nodes, class nodes, and attribute value nodes are created respectively.

[0108] This results in a knowledge graph containing three types of nodes: E-nodes represent instances, C-nodes represent classes, and V-nodes represent attribute values.

[0109] Based on the knowledge graph constructed above, we will continue to construct a summary graph.

[0110] The pre-constructed components of this summary diagram include:

[0111] Step 4: Extract instances, classes, and attributes from the knowledge graph, as well as the hierarchical relationships between instances and classes, and the relationships between attribute values ​​and instances.

[0112] Step 5: Based on the dependency relationship between the instance and the class, classify the instance as a class node of the class with which it has a dependency relationship.

[0113] The specific execution step 5 is as follows: Based on the dependency relationship between the instances and classes, all instances belonging to the same class are grouped into the same class node. In this way, the association between instances is transformed into the association between classes, thereby simplifying the knowledge graph.

[0114] Step 6: Based on the relationship between the attribute values ​​and instances, create an index for the attribute values ​​that are related to the instances, and point the index to the class node to which the instance belongs, to obtain a summary graph.

[0115] To avoid losing instance property values ​​after executing step 5, execute step 6.

[0116] The specific execution step 6 is as follows: Based on the relationship between attribute values ​​and instances, a summary graph is created that can attach the attribute values ​​corresponding to an instance to the class node to which the instance belongs. This ensures the integrity of the information about instances, classes, and attribute values.

[0117] In this embodiment of the invention, the summary graph is equivalent to a simplified knowledge graph, and also to a simplified source graph database.

[0118] In the specific construction of knowledge graphs and summary graphs:

[0119] Storage optimization for classes and instances (storing classes and instances as numeric types using HashMap)<String,Integer> HashMap<Integer,Stringr> To reverse the mapping between vertex numbers and vertex names;

[0120] Index building: ClassInstanceIndex is an index built for a class, containing all instances of the class.

[0121] EntityIndex is an index built on the attribute values ​​of instances, which are the query keywords entered by the user. It indicates which instances contain this attribute value.

[0122] In this embodiment of the invention, a first summary subgraph with a high matching degree is searched in the pre-constructed summary graph based on keywords and returned to the user. Then, the answer with the highest matching degree, i.e., the instance, is queried in the pre-constructed knowledge graph based on the second summary subgraph determined from the first summary subgraph. The interactive query method of "pattern first, instance later" achieves the purpose of reducing the search space and improving search efficiency and accuracy.

[0123] To more intuitively illustrate the search method for a large-scale graph structure knowledge graph disclosed in this embodiment of the invention, an example is given here.

[0124] First, obtain the user-input query keyword group {key1,key2,key3};

[0125] Secondly, by searching the summary graph, the summary subgraph {class1, class2, class3} is obtained;

[0126] Secondly, the information queried by the user is obtained by matching the summary subgraph in the knowledge graph.

[0127] The specific process of querying the knowledge graph based on the summary subgraph is as follows:

[0128] Based on the first node `class1` in the summary subgraph, query all instances of it whose attribute value includes `key1`, resulting in a set of instances {instance11, instance12, ...} that meet the condition. Take an instance from this set and continue querying. If this fails, continue querying with the next instance in a loop until a successful query is obtained.

[0129] Assuming the query successfully retrieves instance11, the query then searches for instances belonging to class2 and containing the attribute value key2 among all instances connected to instance11, resulting in the instance set {instance21, instance22, ...}. Similarly, this iterative matching continues until instance31 is found through instance21, at which point the query ends, yielding the final result.

[0130] In this embodiment of the invention, the first summary subgraph with a high matching degree is first searched in the summary graph based on keywords and returned to the user. Then, the answer with the highest matching degree, i.e. the instance, is queried in the knowledge graph based on the second summary subgraph determined from the first summary subgraph. The interactive query method of "pattern first, instance later" is used to reduce the search space and improve the search efficiency and accuracy.

[0131] Based on the search method for large-scale graph structure knowledge graphs disclosed in the above embodiments of the present invention, the present invention also discloses a search device for large-scale graph structure knowledge graphs, such as... Figure 2 As shown, the search device includes: a summary graph search module 20, a knowledge graph search module 21, and a results display module 22.

[0132] The summary graph search module 20 is used to obtain the keywords input by the user; the keyword search engine based on the knowledge graph queries at least one first summary subgraph that matches the keywords in the pre-built summary graph, and returns the first summary subgraph to the user.

[0133] The knowledge graph search module 21 is used to obtain a second summary subgraph determined by the user from the first summary subgraph; the knowledge graph-based graph query engine queries the answer that matches the second summary subgraph in the pre-built knowledge graph and returns the final answer to the user; wherein, the knowledge graph is constructed based on a large-scale graph structure knowledge graph, and the summary graph is constructed based on the knowledge graph.

[0134] The results display module 22 is used to display the first summary subgraph and the final answer found to the user.

[0135] In one embodiment of the present invention, the search device further includes: a pre-construction module; the pre-construction module includes: a knowledge graph construction unit and a summary graph construction unit;

[0136] The knowledge graph construction unit is used to obtain the data structure in a large-scale graph structure knowledge graph; extract instances, classes, and attribute values ​​from the data structure; and establish corresponding instance nodes, class nodes, and attribute value nodes based on the instances, classes, and attribute values ​​to obtain the knowledge graph.

[0137] The summary graph construction unit is used to extract instances, classes, and attributes from the knowledge graph, as well as the dependency relationships between instances and classes, and the relationships between attribute values ​​and instances; based on the dependency relationships between instances and classes, the instance is assigned to a class node of the class to which it has a dependency relationship; based on the relationships between attribute values ​​and instances, an index is created for the attribute values ​​that have a relationship with the instance, and the index is pointed to the class node to which the instance belongs, thus obtaining the summary graph.

[0138] In one embodiment of the present invention, the summary graph search module 20 includes:

[0139] The keyword matching unit is used to map the input keywords to keyword elements to obtain the keyword elements of the corresponding keywords; or, if the keywords are keyword groups, to map the input keyword groups to keyword elements to obtain the keyword elements of the keywords in the corresponding keyword groups.

[0140] The summary graph search unit is used to search for substructures connecting the keyword elements in the pre-built summary graph based on the keyword search engine of the knowledge graph.

[0141] The scoring unit is used to score the searched substructures, and the K substructures corresponding to the scores from largest to smallest are used as the first summary subgraph that matches the keyword group.

[0142] The first output unit is used to output and display the first summary subgraph to the user.

[0143] In one embodiment of the present invention, the knowledge graph search module 21 includes:

[0144] A preparation unit is used to determine class nodes in the second summary subgraph, wherein the class nodes include one or more.

[0145] The knowledge graph search unit is used, if it is a class node, to query the first set of instances whose attribute value is the keyword among all instances belonging to the class node based on the graph query engine of the knowledge graph, and to use the first set of instances as the final answer found.

[0146] Furthermore, the knowledge graph search unit is configured to, if there are multiple class nodes, based on the graph query engine of the knowledge graph, start from the first class node and query a first set of instances belonging to the first class node whose attribute value is the first keyword in the keyword group; select a candidate instance from the first set of instances and query all instances connected to the candidate instance that belong to the second class node and contain instances whose attribute value is the second keyword in the keyword group; if the query fails, return to the step of selecting a candidate instance from the first set of instances until there are no instances to choose from in the first set of instances, determine that the candidate answer based on the first class node is empty, and execute the query for the next class node; if the query is successful, determine the candidate instance as a candidate answer and obtain a second set of instances, continue to select a candidate instance from the second set of instances, query all instances connected to the candidate instance that belong to the third class node and contain instances whose attribute value is the third keyword in the keyword group; until the query based on the last class node in the second summary subgraph is completed, obtain all candidate answers as the final answer matching the second summary subgraph.

[0147] The second output unit is used to output and display the final answer found in the query to the user.

[0148] In one embodiment of the present invention, the knowledge graph search module 21 is further configured to, before feeding back the final answer found to the user, delete the empty result if the answer matching the second summary subgraph contains an empty result, and obtain the final answer.

[0149] A search device for a large-scale graph-structured knowledge graph, based on an embodiment of the present invention, first searches for a first summary subgraph with high matching degree in the summary graph based on keywords and returns it to the user. Then, based on the second summary subgraph determined from the first summary subgraph, it queries the knowledge graph for the answer with the highest matching degree, i.e., the instance. Through the interactive query method of "pattern first, instance later", semantic association information is effectively extracted from fragmented triple graphs, thereby reducing the search space and improving search efficiency and accuracy.

[0150] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0151] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0152] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A search method for large-scale graph-structured knowledge graphs, characterized in that, The search method includes: Obtain keywords input by the user; the keywords are a single keyword or a group of keywords. The knowledge graph-based keyword search engine queries at least one first summary subgraph that matches the keyword in a pre-built summary graph and returns the first summary subgraph to the user. Obtain the second summary subgraph determined by the user from the first summary subgraph; The knowledge graph-based graph query engine queries the answer that matches the second summary subgraph in the pre-built knowledge graph and returns the final answer to the user. The knowledge graph is constructed based on a large-scale graph structure knowledge graph, and the summary graph is constructed based on the knowledge graph. Specifically, the knowledge graph-based graph query engine searches for answers that match the second summary subgraph within a pre-built knowledge graph, and then returns the final answers to the user, including: Determine the class nodes in the second summary subgraph, wherein the class nodes include one or more; If it is a class node, based on the graph query engine of the knowledge graph, query the first set of instances whose attribute value is the keyword among all instances belonging to the class node, and return the first set of instances as the final answer to the user; If there are multiple class nodes, the graph query engine based on the knowledge graph will start from the first class node and query the first set of instances whose attribute value is the first keyword in the keyword group among all instances belonging to the first class node. Select a candidate instance from the first instance set, query all instances connected to the candidate instance that belong to the second type of node and contain an attribute value of the second keyword in the keyword group. If the query fails, return to the step of selecting a candidate instance from the first instance set until there are no instances to choose from in the first instance set. Determine that the candidate answer based on the first type of node is empty, and execute the query for the next type of node. If the query is successful, the candidate instance is determined as the alternative answer, and a second instance set is obtained. Then, a candidate instance is selected from the second instance set, and all instances connected to the candidate instance are queried to find instances that belong to the third type of node and contain an attribute value of the third keyword in the keyword group. Until the query based on the last class node in the second summary subgraph is completed, all candidate answers will be obtained as the final answer that matches the second summary subgraph; The final answer found in the query will be output and displayed to the user.

2. The search method according to claim 1, characterized in that, The pre-construction process of the knowledge graph includes: Retrieve data structures from large-scale graph-structured knowledge graphs; Extract instances, classes, and attribute values ​​from the data structure; Based on the instances, classes, and attribute values, corresponding instance nodes, class nodes, and attribute value nodes are created to obtain a knowledge graph.

3. The search method according to claim 2, characterized in that, The pre-constructed components of the summary graph include: Extract instances, classes, and attributes from the knowledge graph, as well as the hierarchical relationships between instances and classes, and the relationships between attribute values ​​and instances; Based on the dependency relationship between the instance and the class, the instance is classified as a class node of the class to which it is dependent; Based on the relationship between the attribute values ​​and instances, an index is created for the attribute values ​​that are related to the instances, and the index is pointed to the class node to which the instance belongs, thus obtaining a summary graph.

4. The search method according to claim 1, characterized in that, A knowledge graph-based keyword search engine queries at least one first summary subgraph that matches the keyword within a pre-built summary graph, and then returns the first summary subgraph to the user, including: The input keywords are mapped to keyword elements to obtain the keyword elements of the corresponding keywords; or, if the keywords are keyword groups, the input keyword groups are mapped to keyword elements to obtain the keyword elements of the keywords in the corresponding keyword groups. The keyword search engine based on the knowledge graph searches for substructures that connect the keyword elements in a pre-built summary graph; The searched substructures are scored, and the K substructures corresponding to the scores from largest to smallest are used as the first summary subgraph that matches the keyword. The first summary subgraph is output and displayed to the user.

5. The search method according to any one of claims 1 to 4, characterized in that, Before providing the final answer to the user, the process also includes: If the answer matching the second summary subgraph contains an empty result, delete the empty result to obtain the final answer.

6. A search device for a large-scale graph-structured knowledge graph, characterized in that, The search device includes: The summary graph search module is used to obtain keywords input by the user; the keyword search engine based on the knowledge graph queries at least one first summary subgraph that matches the keyword in the pre-built summary graph, and returns the first summary subgraph to the user; the keyword is a keyword or a group of keywords; A knowledge graph search module is used to obtain a second summary subgraph determined by the user from the first summary subgraph; a knowledge graph-based graph query engine queries the pre-built knowledge graph for answers that match the second summary subgraph, and returns the final answer to the user; wherein, the knowledge graph is constructed based on a large-scale graph structure knowledge graph, and the summary graph is constructed based on the knowledge graph; The results display module is used to show the user the first summary subgraph and the final answer found in the query; The knowledge graph search module includes: A preparation unit is configured to determine class nodes in the second summary subgraph, wherein the class nodes include one or more; The knowledge graph search unit is used, if it is a class node, to query the first set of instances whose attribute value is the keyword among all instances belonging to the class node based on the graph query engine of the knowledge graph, and to use the first set of instances as the final answer found. Furthermore, the knowledge graph search unit is configured to, if there are multiple class nodes, based on the graph query engine of the knowledge graph, start from the first class node and query a first set of instances belonging to the first class node whose attribute value is the first keyword in the keyword group; select a candidate instance from the first set of instances and query all instances connected to the candidate instance that belong to the second class node and contain instances whose attribute value is the second keyword in the keyword group; if the query fails, return to the step of selecting a candidate instance from the first set of instances until there are no instances to choose from in the first set of instances, determining that the candidate answer based on the first class node is empty, and execute the query for the next class node; if the query succeeds, determine the candidate instance as a candidate answer and obtain a second set of instances, continue to select a candidate instance from the second set of instances, and query all instances connected to the candidate instance that belong to the third class node and contain instances whose attribute value is the third keyword in the keyword group; until the query based on the last class node in the second summary subgraph is completed, obtain all candidate answers as the final answer matching the second summary subgraph; The second output unit is used to output and display the final answer found in the query to the user.

7. The search device according to claim 6, characterized in that, Also includes: Pre-built modules; The pre-built module includes: a knowledge graph construction unit and a summary graph construction unit; The knowledge graph construction unit is used to obtain the data structure in a large-scale graph structure knowledge graph; extract instances, classes, and attribute values ​​from the data structure; and establish corresponding instance nodes, class nodes, and attribute value nodes based on the instances, classes, and attribute values ​​to obtain the knowledge graph. The summary graph construction unit is used to extract instances, classes, and attributes from the knowledge graph, as well as the dependency relationships between instances and classes, and the relationships between attribute values ​​and instances; based on the dependency relationships between instances and classes, the instance is assigned to a class node of the class to which it has a dependency relationship; based on the relationships between attribute values ​​and instances, an index is created for the attribute values ​​that have a relationship with the instance, and the index is pointed to the class node to which the instance belongs, thus obtaining the summary graph.

8. The search device according to claim 6, characterized in that, The summary graph search module includes: The keyword matching unit is used to map the input keywords to keyword elements to obtain the keyword elements of the corresponding keywords; or, if the keywords are keyword groups, to map the input keyword groups to keyword elements to obtain the keyword elements of the keywords in the corresponding keyword groups. The summary graph search unit is used to search for substructures connecting the keyword elements in the pre-constructed summary graph based on the keyword search engine of the knowledge graph; The scoring unit is used to score the searched substructures and select the K substructures corresponding to the scores from largest to smallest as the first summary subgraph that matches the keyword. The first output unit is used to output and display the first summary subgraph to the user.