A knowledge graph simplification method, device and related products

By extracting and solving the circular loop clauses in the knowledge graph, a loop simplification strategy is obtained, which solves the problem of low circular loop removal efficiency in the prior art, and improves the simplification efficiency of the knowledge graph and the cost-effectiveness of loop elimination.

CN119783784APending Publication Date: 2025-04-08NEUSOFT CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411858016.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

When the prior art simplifies large-scale knowledge graphs, the removal efficiency of the circular loop is low, resulting in low simplification efficiency of the knowledge graph.

Method used

By obtaining the target knowledge graph, extracting its loop loop clause, and solving for each loop loop, a loop simplification strategy is obtained, which instructs the removal of the loop edge with the smallest weight to simplify the loop loop.

Benefits of technology

Improves the simplification efficiency of the knowledge graph, reduces the cost of circular loop elimination, and reduces the time complexity of loop extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119783784A_ABST
    Figure CN119783784A_ABST
Patent Text Reader

Abstract

The present application discloses a method, device and related products for simplifying a knowledge graph. The target knowledge graph is extracted and processed to obtain loop clauses corresponding to multiple loops in the target knowledge graph; for each loop, the loop clause corresponding to the loop is solved to obtain the loop simplification strategy corresponding to the loop; for multiple loops, simplified loops corresponding to the multiple loops are obtained according to the loop simplification strategies corresponding to the multiple loops, and the simplified knowledge graph corresponding to the target knowledge graph is obtained according to the simplified loops corresponding to the multiple loops. In this way, the present application can avoid the low efficiency problem caused by repeated loop scanning in the related technical solutions, and can also minimize the weight of the removed loop edges in the removed loop, thereby minimizing the elimination cost of the loop, thereby improving the simplification efficiency of the knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of knowledge graph technology, and in particular to a knowledge graph simplification method, device and related products. Background Art

[0002] With the continuous growth of data volume and the continuous changes in business needs, more and more companies usually achieve data integration and fast query by building and applying knowledge graphs, and can also integrate knowledge graphs in different fields to form a more complete large-scale knowledge graph. However, there may be error loops in such large-scale knowledge graphs, which may lead to incorrect associations between cross-domain data, thus affecting the accuracy of the knowledge graph.

[0003] In the related art, loop edges are usually removed from the loop through repeated loop scanning operations to simplify large-scale knowledge graphs. However, the related technical solution can only remove one edge in the loop at a time, and repeat the operation until the loop is eliminated, which may lead to low efficiency in simplifying the knowledge graph. Therefore, how to improve the efficiency of simplifying the knowledge graph is a key issue that technicians in this field are concerned about. Summary of the invention

[0004] Based on the above problems, the present application provides a knowledge graph simplification method, device and related products to improve the simplification efficiency of the knowledge graph.

[0005] The embodiments of the present application disclose the following technical solutions:

[0006] The first aspect of the present application provides a method for simplifying a knowledge graph. The method for simplifying a knowledge graph includes:

[0007] Obtain the target knowledge graph;

[0008] Performing extraction processing on the target knowledge graph to obtain loop clauses corresponding to multiple loops in the target knowledge graph;

[0009] For each loop, solve the loop clause corresponding to the loop to obtain a loop simplification strategy corresponding to the loop, wherein the loop simplification strategy is used to indicate that n loop edges in the loop are removed, the sum of the weights of the n loop edges is the smallest, and n is greater than or equal to 1;

[0010] For the multiple loops, according to the loop simplification strategies respectively corresponding to the multiple loops, the simplified loops respectively corresponding to the multiple loops are obtained, and according to the simplified loops respectively corresponding to the multiple loops, the simplified knowledge graph corresponding to the target knowledge graph is obtained.

[0011] In an achievable implementation, the extracting process is performed on the target knowledge graph to obtain loop clauses corresponding to multiple loops in the target knowledge graph, including:

[0012] Performing graph preprocessing on the target knowledge graph to obtain a preprocessed target knowledge graph;

[0013] Performing loop extraction processing on the preprocessed target knowledge graph to obtain multiple cyclic loops in the preprocessed target knowledge graph;

[0014] Perform loop encoding processing on multiple loops in the preprocessed target knowledge graph to obtain loop clauses corresponding to the multiple loops in the preprocessed target knowledge graph;

[0015] The loop clauses corresponding to the multiple loops in the preprocessed target knowledge graph are used as the loop clauses corresponding to the multiple loops in the target knowledge graph.

[0016] In an achievable implementation, performing loop encoding processing on the multiple loops in the preprocessed target knowledge graph to obtain loop clauses corresponding to the multiple loops in the preprocessed target knowledge graph respectively includes:

[0017] Performing loop analysis on multiple loops in the preprocessed target knowledge graph to obtain loop edge sets corresponding to the multiple loops in the preprocessed target knowledge graph;

[0018] For each loop, loop encoding is performed on the loop edge set corresponding to the loop to obtain the loop hard clauses and loop soft clause sets corresponding to the loop, where one loop edge corresponds to one loop soft clause;

[0019] For the multiple loops, the loop hard clauses and loop soft clause sets corresponding to the multiple loops are used as the loop clauses corresponding to the multiple loops in the preprocessed target knowledge graph.

[0020] In an achievable implementation, before solving the loop clause corresponding to each loop to obtain the loop simplification strategy corresponding to the loop, the method further includes:

[0021] For each loop, the loop soft clause set in the loop clause corresponding to the loop is assigned to obtain a soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop, wherein one loop soft clause corresponds to one soft clause variable;

[0022] For each loop, a weight distribution process is performed on the loop soft clause set in the loop clause corresponding to the loop to obtain a soft clause weight set corresponding to the loop soft clause set in the loop clause corresponding to the loop, wherein one loop soft clause corresponds to a soft clause weight, and each soft clause weight in the soft clause weight set is the same.

[0023] In an achievable implementation, for each loop, solving the loop clause corresponding to the loop to obtain the loop simplification strategy corresponding to the loop includes:

[0024] For each loop, based on the soft clause variable set and soft clause weight set corresponding to the loop soft clause set in the loop clause corresponding to the loop, the loop hard clause in the loop clause corresponding to the loop is solved to obtain the loop solution result of the loop;

[0025] If the loop solution result indicates that the sum of the weights of n loop edges corresponding to false values ​​of soft clause variables in the soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop is the smallest, a loop simplification strategy corresponding to the loop is generated according to the loop solution result.

[0026] In an achievable implementation, for each loop, based on a soft clause variable set and a soft clause weight set corresponding to a loop soft clause set in a loop clause corresponding to the loop, a clause solution is performed on a loop hard clause in the loop clause corresponding to the loop, to obtain a loop solution result of the loop, including:

[0027] For each loop, based on the soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop, the variables of the loop hard clause in the loop clause corresponding to the loop are solved to obtain the clause solution value of the loop hard clause in the loop clause corresponding to the loop;

[0028] If the clause solution value is a true value, based on the soft clause weight set corresponding to the loop soft clause set in the loop clause corresponding to the loop loop, the soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop loop is weighted to obtain the loop solution result of the loop loop.

[0029] In an achievable implementation, the graph preprocessing the target knowledge graph to obtain the preprocessed target knowledge graph includes:

[0030] Traversing the target knowledge graph to obtain p leaf nodes and q reflexive relations in the target knowledge graph, wherein p is greater than or equal to 1, and q is greater than or equal to 1;

[0031] The p leaf nodes and the q reflexive relations are removed to obtain a preprocessed target knowledge graph.

[0032] The second aspect of the present application provides a knowledge graph simplification device. The knowledge graph simplification device includes:

[0033] A knowledge graph acquisition unit, used to acquire a target knowledge graph;

[0034] A knowledge graph extraction unit, used to extract the target knowledge graph to obtain loop clauses corresponding to multiple loops in the target knowledge graph;

[0035] A simplification strategy obtaining unit is used to solve the loop clause corresponding to each loop for each loop, and obtain a loop simplification strategy corresponding to the loop, wherein the loop simplification strategy is used to indicate that n loop edges in the loop are to be removed, the sum of the weights of the n loop edges is the smallest, and n is greater than or equal to 1;

[0036] The knowledge graph simplification unit is used to obtain the simplified loops corresponding to the multiple loops according to the loop simplification strategies respectively corresponding to the multiple loops, and obtain the simplified knowledge graph corresponding to the target knowledge graph according to the simplified loops respectively corresponding to the multiple loops.

[0037] In an achievable implementation, the knowledge graph extraction unit includes:

[0038] A graph preprocessing unit, used to perform graph preprocessing on the target knowledge graph to obtain a preprocessed target knowledge graph;

[0039] A loop obtaining unit, used for performing loop extraction processing on the preprocessed target knowledge graph to obtain multiple loops in the preprocessed target knowledge graph;

[0040] A loop encoding processing unit, used to perform loop encoding processing on multiple loops in the preprocessed target knowledge graph to obtain loop clauses corresponding to the multiple loops in the preprocessed target knowledge graph;

[0041] A loop clause determination unit is used to use the loop clauses corresponding to the multiple loops in the preprocessed target knowledge graph as the loop clauses corresponding to the multiple loops in the target knowledge graph.

[0042] In an achievable implementation manner, the loop coding processing unit is specifically configured to:

[0043] Performing loop analysis on multiple loops in the preprocessed target knowledge graph to obtain loop edge sets corresponding to the multiple loops in the preprocessed target knowledge graph;

[0044] For each loop, loop encoding is performed on the loop edge set corresponding to the loop to obtain the loop hard clauses and loop soft clause sets corresponding to the loop, where one loop edge corresponds to one loop soft clause;

[0045] For the multiple loops, the loop hard clauses and loop soft clause sets corresponding to the multiple loops are used as the loop clauses corresponding to the multiple loops in the preprocessed target knowledge graph.

[0046] In one feasible embodiment, the device further includes:

[0047] A soft clause variable set obtaining unit is used to, for each loop, perform value assignment processing on a loop soft clause set in a loop clause corresponding to the loop, and obtain a soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop, wherein one loop soft clause corresponds to one soft clause variable;

[0048] The soft clause weight set obtaining unit is used to perform weight allocation processing on the loop soft clause set in the loop clause corresponding to each loop, and obtain the soft clause weight set corresponding to the loop soft clause set in the loop clause corresponding to the loop, wherein one loop soft clause corresponds to one soft clause weight, and each soft clause weight in the soft clause weight set is the same.

[0049] In an achievable implementation manner, the simplified strategy obtaining unit is specifically used to:

[0050] For each loop, based on the soft clause variable set and soft clause weight set corresponding to the loop soft clause set in the loop clause corresponding to the loop, the loop hard clause in the loop clause corresponding to the loop is solved to obtain the loop solution result of the loop;

[0051] If the loop solution result indicates that the sum of the weights of n loop edges corresponding to false values ​​of soft clause variables in the soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop is the smallest, a loop simplification strategy corresponding to the loop is generated according to the loop solution result.

[0052] In an achievable implementation, the simplified strategy obtaining unit is further specifically used for:

[0053] For each loop, based on the soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop, the variables of the loop hard clause in the loop clause corresponding to the loop are solved to obtain the clause solution value of the loop hard clause in the loop clause corresponding to the loop;

[0054] If the clause solution value is a true value, based on the soft clause weight set corresponding to the loop soft clause set in the loop clause corresponding to the loop loop, the soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop loop is weighted to obtain the loop solution result of the loop loop.

[0055] In an achievable implementation, the graph preprocessing unit is specifically used for:

[0056] Traversing the target knowledge graph to obtain p leaf nodes and q reflexive relations in the target knowledge graph, wherein p is greater than or equal to 1, and q is greater than or equal to 1;

[0057] The p leaf nodes and the q reflexive relations are removed to obtain a preprocessed target knowledge graph.

[0058] A third aspect of the present application provides a computer device. The computer device includes:

[0059] a memory having a computer program stored thereon;

[0060] A processor is used to execute the computer program in the memory to implement the steps of the knowledge graph simplification method provided in the first aspect.

[0061] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps of the knowledge graph simplification method provided in the first aspect are implemented.

[0062] Compared with the prior art, this application has the following beneficial effects:

[0063] In the present application, the target knowledge graph can be first obtained, and then the target knowledge graph can be extracted and processed to obtain the loop clauses corresponding to the multiple loops in the target knowledge graph, and finally for each loop, the loop clause corresponding to the loop is solved to obtain the loop simplification strategy corresponding to the loop, and for multiple loops, according to the loop simplification strategies corresponding to the multiple loops, the simplified loops corresponding to the multiple loops are obtained, and according to the simplified loops corresponding to the multiple loops, the simplified knowledge graph corresponding to the target knowledge graph is obtained. It should be noted that the target knowledge graph is obtained by merging the first knowledge graph and the second knowledge graph, and the field to which the first knowledge graph belongs is different from the field to which the second knowledge graph belongs, wherein the loop simplification strategy is used to indicate the removal of n loop edges in the loop, the sum of the weights of the n loop edges is the smallest, and n is greater than or equal to 1.

[0064] It can be seen that in the present application, by performing an extraction process on the target knowledge graph once, the loop clauses corresponding to the multiple loops in the target knowledge graph can be obtained. At this time, the loop clauses corresponding to each loop can be solved to obtain the loop simplification strategy corresponding to each loop. The loop simplification strategy can minimize the weight of the loop edges removed from the loop, so that the loop can be simplified based on the loop simplification strategy, and then a simplified knowledge graph can be obtained. In this way, the present application can avoid the low efficiency problem caused by repeated loop scanning in the related technical solutions, and can also minimize the weight of the loop edges removed from the removed loop, thereby minimizing the cost of eliminating the loop, thereby improving the simplification efficiency of the knowledge graph. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0066] Figure 1 Schematic diagram of the knowledge graph provided for related technologies;

[0067] Figure 2 A simplified schematic diagram of the knowledge graph provided for the relevant technology;

[0068] Figure 3 A flowchart of a method for simplifying a knowledge graph provided in an embodiment of the present application;

[0069] Figure 4A flowchart of obtaining a loop clause in a simplified method of a knowledge graph provided in an embodiment of the present application;

[0070] Figure 5 A schematic diagram of removing nodes in a knowledge graph simplification method provided in an embodiment of the present application;

[0071] Figure 6 A flowchart of a loop simplification strategy obtained in a knowledge graph simplification method provided in an embodiment of the present application;

[0072] Figure 7 A simplified flow chart of a loop in a knowledge graph simplification method provided in an embodiment of the present application;

[0073] Figure 8 A schematic diagram of the structure of a simplified device for a knowledge graph provided in an embodiment of the present application. DETAILED DESCRIPTION

[0074] As described above, with the continuous growth of data volume and the continuous changes in business needs, more and more companies usually achieve data integration and fast query by building and applying knowledge graphs, and can also integrate knowledge graphs in different fields to form a more complete large-scale knowledge graph. However, there may be error loops in such large-scale knowledge graphs, which may lead to incorrect associations between cross-domain data, thereby affecting the accuracy of the knowledge graph.

[0075] like Figure 1 As shown, Figure 1 Schematic diagram of the knowledge graph provided for related technologies, in Figure 1 (a) shows knowledge graph A and knowledge graph B, which are knowledge graphs of different course learning sequences. Knowledge graph A includes the learning sequence of C language, data structure and algorithm, and knowledge graph B includes the learning sequence of advanced mathematics, algorithm, calculus and data structure. Figure 1 (b) shows the knowledge graph C (i.e., the integrated knowledge graph A and knowledge graph B). There is an incorrect loop in the knowledge graph C, i.e., the learning order of data structure, algorithm, calculus and data structure, which affects the accuracy of the knowledge graph.

[0076] In the related art, loop edges are usually removed from loops through repeated loop scanning operations to simplify large-scale knowledge graphs. However, the related technical solution can only remove one edge in the loop each time, and repeat the operation until the loop is eliminated, which may result in low efficiency in simplifying the knowledge graph. Figure 2 As shown, Figure 2 A simplified schematic diagram of the knowledge graph provided for related technologies, in Figure 2 The knowledge graph is shown in the figure. At this time, a loop scan is performed on the knowledge graph to obtain a set of loop edges (i.e., the loop edges for node A include AB, BC, CD and DA, AB, BE, EF, FG, GC, CD and DA; the loop edges for node B include BC, CD, DA and AB, BE, EF, FG, GC, CD, DA and AB; the loop edges for node C include CD, DA, AB and BC, CD, DA, AB, BE, EF, FG and GC; the loop edges for node D include DA, AB, BC and CD, DA, AB, BE, EF, FG, GC and CD; the loop edges for node E include EF, FG and GE; the loop edges for node F include FG, GE and EF; the loop edges for node G include GE, EF and FG).

[0077] After that, the number of times each loop edge in the loop edge set appears can be counted (i.e., loop edge AB appears 8 times, loop edge BC appears 8 times, loop edge CD appears 8 times, loop edge DA appears 8 times, loop edge EF appears 7 times, loop edge FG appears 7 times, loop edge BE appears 4 times, loop edge GC appears 4 times, and loop edge GE appears 3 times). And select a loop edge with the highest number of appearances to eliminate, as well as the loop scanning operation of the loop and the selection and elimination operations of the loop edges, until the loop edge set is an empty set, that is, there are no loop edges in the loop edge set, at which time the elimination of the loop loop is completed. Therefore, how to improve the simplification efficiency of the knowledge graph is a key issue that technicians in this field are concerned about.

[0078] It should be noted that in the relevant technical solutions, if there are multiple loop edges with the highest number of occurrences, manual intervention is usually required to determine the loop edges that need to be removed, which makes the relevant technical solutions unable to efficiently simplify the knowledge graph. As the scale of the knowledge graph continues to expand, the number of nodes and loop edges in the knowledge graph increases dramatically, which may also increase the time complexity of repeated loop scanning operations.

[0079] In view of the above problems, a solution is provided in the embodiment of the present application, and a method, device and related products for simplifying a knowledge graph are proposed, aiming to improve the simplification efficiency of the knowledge graph. In the technical solution of the present application, the target knowledge graph obtained by merging the first knowledge graph and the second knowledge graph can be first obtained, and then the target knowledge graph can be extracted and processed to obtain the loop clauses corresponding to the multiple loops in the target knowledge graph. At this time, for each loop, the loop clause corresponding to the loop can be solved and processed to obtain the loop simplification strategy corresponding to the loop, wherein the loop simplification strategy is used to indicate that n loop edges in the loop are removed, and the sum of the weights of the n loop edges is the smallest. Finally, for multiple loops, the simplified loops corresponding to the multiple loops can be obtained according to the loop simplification strategies corresponding to the multiple loops, and the simplified knowledge graph corresponding to the target knowledge graph can be obtained according to the simplified loops corresponding to the multiple loops. In this way, the present application can not only avoid the low efficiency problem caused by repeated loop scanning in the related technical solutions, but also minimize the weight of the removed loop edges in the removed loop, thereby minimizing the cost of eliminating the loop, thereby improving the simplification efficiency of the knowledge graph, and the present application can also reduce the time complexity of loop extraction.

[0080] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0081] Next, the technical terms that may appear in this application are explained.

[0082] Loop: A loop refers to a cyclic structure that appears in a knowledge graph when it comes to the inclusion relationship between categories. It may include self-loops, mutual inclusion relationships between two nodes, and more complex loop forms between multiple nodes.

[0083] MAXSAT: MAXSAT is the maximum Boolean satisfaction problem, which is an NP-hard combinatorial optimization problem.

[0084] See also Figure 3 , which is a flow chart of a simplified method for knowledge graphing provided in an embodiment of the present application. Figure 3 The simplified approach to the knowledge graph shown includes:

[0085] S301: Obtain the target knowledge graph.

[0086] In this step, the target knowledge graph is obtained by merging the first knowledge graph and the second knowledge graph. The field to which the first knowledge graph belongs is different from the field to which the second knowledge graph belongs. For example, the field to which the first knowledge graph belongs is the biomedical field, and the field to which the second knowledge graph belongs is the food science field. At this time, the first knowledge graph in the biomedical field and the second knowledge graph in the food science field can be merged to obtain a cross-domain (i.e., biomedical and food science) target knowledge graph.

[0087] It should be noted that in this application, knowledge graphs in multiple different fields can be merged to obtain a target knowledge graph. The number of knowledge graphs that can be merged is not limited here, and they can be merged according to actual needs in practical applications. In addition, the fields to which the knowledge graphs to be merged belong are not limited in this application, and the fields to which they belong can be determined according to needs in practical applications.

[0088] S302: Extract the target knowledge graph to obtain loop clauses corresponding to multiple loops in the target knowledge graph.

[0089] In this step, the target knowledge graph can be completely extracted once to obtain multiple loops in the target knowledge graph, and then the multiple loops in the target knowledge graph can be processed to obtain loop clauses corresponding to the multiple loops in the target knowledge graph. In this way, by determining the loop clauses, it is convenient to determine the loop edges to be removed from the loops in the subsequent implementation.

[0090] Next, combine Figure 4 The process of obtaining the loop clause in this application is introduced. Figure 4 As shown, Figure 4 A flowchart of obtaining a loop clause in a simplified method of a knowledge graph provided in an embodiment of the present application, Figure 4 The method includes steps S3021 to S3024, and the specific details of steps S3021 to S3024 are as follows:

[0091] S3021: Perform graph preprocessing on the target knowledge graph to obtain a preprocessed target knowledge graph.

[0092] In this step, the target knowledge graph can be traversed to obtain p leaf nodes and q reflexive relationships in the target knowledge graph, where p is greater than or equal to 1, and q is greater than or equal to 1. It can be understood that a leaf node is a node without a subclass in the knowledge graph. Since a leaf node cannot be part of any loop, the leaf nodes in the target knowledge graph are determined by traversal at this time, which can facilitate the subsequent removal of the leaf nodes. And a reflexive relationship is a direct relationship from a node to itself, such as an identical relationship. Since a reflexive relationship can form its own closed loop, the reflexive relationship will not provide useful information for the analysis of subclass relationships. At this time, the reflexive relationship in the target knowledge graph is determined by traversal, which can facilitate the subsequent removal of the reflexive relationship.

[0093] After this, the nodes corresponding to the p leaf nodes and the q reflexive relations can be removed to obtain the preprocessed target knowledge graph. By removing the leaf nodes and the nodes corresponding to the reflexive relations in the target knowledge graph in advance, the subsequent extraction efficiency of the loops in the target knowledge graph can be improved to a certain extent. It should be noted that in the present application, not only the nodes corresponding to the leaf nodes and the reflexive relations can be removed, but also the loop edges related to the leaf nodes can be removed, and the loop edges related to the nodes corresponding to the reflexive relations can also be removed.

[0094] like Figure 5 As shown, Figure 5 A schematic diagram of removing nodes in a method for simplifying a knowledge graph provided in an embodiment of the present application, in Figure 5 (a) shows the situation where there are leaf nodes in the knowledge graph a. The leaf nodes in the knowledge graph a are leaf node C and leaf node D. At this time, the leaf node C and its related loop edges (i.e., the loop edges corresponding to AC) and the leaf node D and its related loop edges (i.e., the loop edges corresponding to BD) are removed, and the node A and node B in the knowledge graph a and their related loop edges (i.e., the loop edges corresponding to AB) can be obtained.

[0095] exist Figure 5 (b) shows the situation where there is a reflexive relationship in the knowledge graph. The nodes in the knowledge graph b are node E and node E, and the loop edge from node E to node E. At this time, node E and the loop edge from node E can be removed to obtain node E in the knowledge graph b. In this way, the leaf nodes and reflexive relationships in the target knowledge graph are removed, the efficiency of subsequent extraction of loops is improved, and the time complexity and space complexity of subsequent loop extraction are greatly reduced.

[0096] S3022: Perform loop extraction processing on the preprocessed target knowledge graph to obtain multiple loops in the preprocessed target knowledge graph.

[0097] In this step, a complete loop extraction process can be performed on the preprocessed target knowledge graph to obtain multiple loops in the preprocessed target knowledge graph. It should be noted that at this time, the multiple loops obtained after the loop extraction process are all the loops in the preprocessed target knowledge graph, which is convenient for the subsequent removal of loop edges corresponding to all loops, which can reduce the time complexity of loop extraction to a certain extent.

[0098] In an achievable implementation, the time complexity of performing the loop extraction operation on the preprocessed target knowledge graph can be calculated using the following time complexity calculation formula. The time complexity calculation formula is as follows:

[0099] O((n+e)(c+1))

[0100] Among them, O is the time complexity of extracting all loops in the target knowledge graph after preprocessing, n is the number of nodes of all nodes in the target knowledge graph after preprocessing, e is the number of loop edges of all loops in the target knowledge graph after preprocessing, and c is the number of loops of all loops in the target knowledge graph after preprocessing.

[0101] It should also be noted that in the present application, a depth-first search algorithm (i.e., DFS algorithm) can be used to implement loop extraction operations, and other algorithms that can implement loop extraction operations can also be used in the present application. No specific limitations are made here, and the algorithm can also be selected in actual applications.

[0102] Furthermore, in the present application, the DFS algorithm can be used to traverse each node in the preprocessed target knowledge graph, and for each traversed node, all edges on its path are recorded. During the DFS process, the access path of each node is recorded for subsequent analysis to determine whether there is a loop. And during the node traversal process, it can be checked whether there are repeatedly visited nodes on the access path of the node to determine the loop in the preprocessed target knowledge graph. It should be noted that the process of traversing nodes using the DFS algorithm is a prior art and will not be repeated here.

[0103] S3023: Perform loop encoding processing on the multiple loops in the preprocessed target knowledge graph to obtain loop clauses corresponding to the multiple loops in the preprocessed target knowledge graph.

[0104] In this step, loop encoding processing can be performed on multiple loops in the preprocessed target knowledge graph to obtain loop clauses corresponding to the multiple loops in the preprocessed target knowledge graph, that is, encoded as a problem that can be solved by the MAXSAT solver. In this way, it is convenient to calculate and determine the loop edges that need to be removed in the loop based on the loop clause.

[0105] Specifically, in the present application, loop analysis can be performed on multiple loops in the preprocessed target knowledge graph to obtain loop edge sets corresponding to the multiple loops in the preprocessed target knowledge graph, that is, there is a loop edge set corresponding to a loop in the preprocessed target knowledge graph. After that, for each loop, loop encoding can be performed on the loop edge set corresponding to the loop loop to obtain the loop hard clause and loop soft clause set corresponding to the loop loop, wherein one loop edge in the loop edge set corresponds to obtaining a loop soft clause in the loop soft clause set, and all loop edges in the loop edge set correspond to obtaining loop hard clauses.

[0106] In some examples, if a loop in the preprocessed target knowledge graph is A→B→C→D, the loop edge set corresponding to the loop is AB, BC, CD and DA. At this time, the loop edge set can be loop-encoded to obtain the loop hard clause corresponding to the loop, that is, And obtain the loop soft clause set corresponding to the loop, that is,

[0107] Finally, for multiple loops, the loop hard clauses and loop soft clause sets corresponding to the multiple loops can be used as the loop clauses corresponding to the multiple loops in the preprocessed target knowledge graph, that is, the loop hard clauses and loop soft clause sets corresponding to each loop can be used as the loop clauses corresponding to each loop in the preprocessed target knowledge graph. In this way, the loop hard clauses and loop soft clause sets can be calculated in the subsequent process to determine the loop edges that need to be removed in the loop, which can reduce the cost of simplifying the loop to a certain extent.

[0108] S3024: Use the loop clauses corresponding to the multiple loops in the preprocessed target knowledge graph as the loop clauses corresponding to the multiple loops in the target knowledge graph.

[0109] In this step, the loop clause corresponding to each loop in the preprocessed target knowledge graph can be used as the loop clause corresponding to each loop in the target knowledge graph.

[0110] S303: For each loop, solve the loop clause corresponding to the loop to obtain the loop simplification strategy corresponding to the loop.

[0111] In this step, the loop simplification strategy is used to indicate the removal of n loop edges in the loop, the sum of the weights of the n loop edges is the smallest, and n is greater than or equal to 1. That is, in the present application, either one loop edge in the loop can be removed, or multiple loop edges in the loop can be removed, which aims to obtain the loop edge removal solution with the optimal cost.

[0112] It should be noted that the MAXSAT solver can be used in the present application to implement the solution operation for the loop clause. Specifically, before executing the solution processing for each loop clause corresponding to the loop clause and obtaining the loop simplification strategy operation corresponding to the loop, the present application can also perform assignment processing one by one on each loop soft clause in the loop soft clause set in the loop clause corresponding to the loop, so as to obtain the soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop, wherein one loop soft clause corresponds to one soft clause variable.

[0113] In some examples, if each loop soft clause in the loop soft clause set is At this point, each loop soft clause can be assigned a value to obtain the soft clause variable corresponding to each loop soft clause, that is, soft clause1 can be assigned true; soft clause2 can be assigned true; soft clause3 can be assigned true; and softclause4 can be assigned false. Among them, true represents a true value, that is, the loop edge exists in the target knowledge graph, and false represents a false value, that is, the loop edge needs to be removed from the target knowledge graph. It should be noted that when the present application assigns a value to the loop soft clause set, it is necessary to assign a value of false to at least one loop soft clause in the loop soft clause set to ensure that when the soft clause variable is subsequently brought into the loop hard clause for calculation, the value output of the loop hard clause can be true, so as to ensure that the loop can be eliminated.

[0114] Further, in the present application, for each loop, each loop soft clause in the loop soft clause set in the loop clause corresponding to the loop can be weighted one by one to obtain a soft clause weight set corresponding to the loop soft clause set in the loop clause corresponding to the loop, wherein one loop soft clause corresponds to a soft clause weight, and each soft clause weight in the soft clause weight set is the same. It can be understood that in the present application, for subsequent simple calculations, the soft clause weight corresponding to each loop soft clause can be set to a fixed identical weight, that is, it can be set to 1.

[0115] It should be noted that the present application can also set the soft clause weight of the loop soft clause according to the frequency of occurrence of the loop edge in the knowledge graph. For example, the frequency of occurrence of loop edge AB in the knowledge graph is 10 times, and the frequency of occurrence of loop edge BC in the knowledge graph is 9 times. At this time, the soft clause weight of the loop soft clause corresponding to loop edge AB can be set to 1, and the soft clause weight of the loop soft clause corresponding to loop edge BC can be set to 0.9, that is, loop edge AB can be removed preferentially in the subsequent process. In this way, the loop soft clause and its soft clause weight are pre-determined in the present application, which can facilitate the subsequent solution of the loop hard clause, so that the circular loop in the knowledge graph can be destroyed at the minimum cost.

[0116] Next, combine Figure 6 The following describes the process of obtaining the loop simplification strategy in this application. Figure 6 As shown, Figure 6 A flowchart of a loop simplification strategy obtained in a knowledge graph simplification method provided in an embodiment of the present application, Figure 6 The method includes steps S3031 and S3032, and the specific details of steps S3031 and S3032 are as follows:

[0117] S3031: For each loop, based on the soft clause variable set and soft clause weight set corresponding to the loop soft clause set in the loop clause corresponding to the loop, clause solving is performed on the loop hard clause in the loop clause corresponding to the loop to obtain the loop solving result of the loop.

[0118] Specifically, for each loop, in the present application, based on the soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop, the loop hard clause in the loop clause corresponding to the loop can be solved for variables to obtain the clause solution value of the loop hard clause in the loop clause corresponding to the loop. In this way, in the present application, it can be determined whether loop edge removal is required based on the clause solution value.

[0119] Furthermore, if the clause solution value is a true value, then the soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop loop can be weighted based on the soft clause weight set corresponding to the loop soft clause set in the loop clause corresponding to the loop loop, that is, the sum of the weights of the soft clause variables in the soft clause variable set that are false values ​​is determined to obtain the loop solution result of the loop loop. If the clause solution value is a false value (that is, the case where the soft clause variables are all true values), the subsequent steps can be stopped at this time.

[0120] In some examples, if the loop is A→B→C→D, the loop hard clause in the loop clause corresponding to the loop includes The loop soft clause set in the loop clause corresponding to the loop loop includes The soft clause variable set corresponding to the loop soft clause set in the loop loop clause corresponding to the loop loop includes soft clause1 is true; soft clause2 is true; soft clause3 is true; soft clause4 is false. At this time, the soft clause variable set can be brought into the loop hard clause to obtain the clause solution value of the loop hard clause, that is, when the hard clause is true and soft clause4 is false, the weight of the soft clause variable set is 1. In this way, the loop solution result can be generated to indicate that the weight of the corresponding loop edge is the smallest when the soft clause variable in the soft clause variable set is false.

[0121] S3032: If the loop solution result indicates that the sum of the weights of n loop edges corresponding to false values ​​of soft clause variables in the soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop is the smallest, generate a loop simplification strategy corresponding to the loop according to the loop solution result.

[0122] It can be understood that if all soft clause variables in the soft clause variable set are false values, then the sum of the weights of the n loop edges corresponding to the false values ​​of the soft clause variables in the soft clause variable set is the largest. In this step, the sum of the weights of the n loop edges corresponding to the false values ​​of the soft clause variables in the soft clause variable set is the smallest. It can be understood that if one of the soft clause variables in the soft clause variable set is a false value, the cycle can be broken, and then the sum of the weights of the n loop edges corresponding to the false value of the soft clause variable is the smallest.

[0123] And if the loop solution result does not indicate that the sum of the weights of the n loop edges corresponding to the false values ​​of the soft clause variables in the soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop loop is the smallest, then the above-mentioned assignment operation process for the loop soft clause can be looped until the loop solution result indicates that the sum of the weights of the n loop edges corresponding to the false values ​​of the soft clause variables in the soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop loop is the smallest.

[0124] Furthermore, since it has been determined that the clause solution value of the loop hard clause in the loop is true, and the sum of the weights of the n loop edges corresponding to the soft clause variables in the soft clause variable set corresponding to the loop soft clause set is the smallest, the loop simplification strategy corresponding to the loop can be generated at this time, that is, the n loop edges in the loop need to be removed in the subsequent process. In this way, in this application, the elimination cost of the loop can be minimized without manual intervention, and while significantly saving the elimination cost, more node information in the knowledge graph can be retained as much as possible, and the simplification efficiency of the knowledge graph can also be improved.

[0125] S304: For the multiple loops, according to the loop simplification strategies respectively corresponding to the multiple loops, obtain the simplified loops respectively corresponding to the multiple loops, and according to the simplified loops respectively corresponding to the multiple loops, obtain the simplified knowledge graph corresponding to the target knowledge graph.

[0126] In this step, for multiple loops, loop simplification processing can be performed on multiple loops according to the loop simplification strategies corresponding to the multiple loops, so as to obtain simplified loops corresponding to the multiple loops. After that, according to the simplified loops corresponding to the multiple loops, the simplified knowledge graph corresponding to the target knowledge graph can be obtained, that is, the knowledge graph without loops. In this way, the present application can complete the simplification of loops and knowledge graphs at one time to reduce the elimination cost of loops and improve the simplification efficiency of knowledge graphs.

[0127] like Figure 7 As shown, Figure 7 A simplified flow chart of a loop in a knowledge graph simplification method provided in an embodiment of the present application, in Figure 7: The target knowledge graph is shown in , and loop extraction is performed on the knowledge graph to obtain multiple loops in the knowledge graph, that is, the loop for node A includes A→B→C→D, A→B→E→F→G→C→D; the loop for node B includes B→C→D→A, B→E→F→G→C→D→A; the loop for node C includes C→D→A→B, C→D→A→B→E→F→G; ​​the loop for node D includes D→A→B→C, D→A→B→E→F→G→C; the loop for node E includes E→F→G; ​​the loop for node F includes F→G→E; the loop for node G includes G→E→F.

[0128] At this time, loop encoding processing is performed on multiple loops to obtain loop hard sentences and loop soft clause sets corresponding to multiple loops, namely hard1:! X AB or! X BC or! X CD or! X DA ;soft1:!X AB ,soft2: !X BC ,soft3: !X CD ,soft4:!X DA It should be noted that this is only an example of partial loop coding for the loop of node A, and loop coding for loops of other nodes can also be performed according to this process, which will not be described in detail here.

[0129] After that, the loop hard sentences and loop soft clause sets corresponding to the multiple loops can be solved to obtain loop simplification strategies corresponding to the multiple loops, through which the loop edges DA and loop edges GE in the knowledge graph can be removed to simplify the loops. It should be noted that since the same loops may exist between nodes, it is sufficient to perform a loop edge removal operation on the same loop at this time.

[0130] In summary, in this embodiment, it is possible to avoid the low efficiency problem caused by repeated loop scanning in the related technical solutions, and to minimize the weight of the removed loop edges in the removed loop, thereby minimizing the cost of eliminating the loop, thereby improving the simplification efficiency of the knowledge graph, and the present application can also reduce the time complexity of loop extraction.

[0131] Based on the knowledge graph simplification method provided in the aforementioned embodiment, the present application also provides a knowledge graph simplification device accordingly. Figure 8 A schematic diagram of a simplified knowledge graph device provided in an embodiment of the present application. Figure 8 As shown, the simplified device of the knowledge graph includes:

[0132] A knowledge graph acquisition unit 801 is used to acquire a target knowledge graph;

[0133] A knowledge graph extraction unit 802 is used to extract the target knowledge graph to obtain loop clauses corresponding to multiple loops in the target knowledge graph;

[0134] A simplification strategy obtaining unit 803 is used to solve the loop clause corresponding to each loop for each loop, and obtain a loop simplification strategy corresponding to the loop, wherein the loop simplification strategy is used to indicate that n loop edges in the loop are to be removed, the sum of the weights of the n loop edges is the smallest, and n is greater than or equal to 1;

[0135] The knowledge graph simplification unit 804 is used to obtain, for the multiple loops, the simplified loops corresponding to the multiple loops according to the loop simplification strategies respectively corresponding to the multiple loops, and obtain the simplified knowledge graph corresponding to the target knowledge graph according to the simplified loops respectively corresponding to the multiple loops.

[0136] In an achievable implementation, the knowledge graph extraction unit 802 includes:

[0137] A graph preprocessing unit, used to perform graph preprocessing on the target knowledge graph to obtain a preprocessed target knowledge graph;

[0138] A loop obtaining unit, used for performing loop extraction processing on the preprocessed target knowledge graph to obtain multiple loops in the preprocessed target knowledge graph;

[0139] A loop encoding processing unit, used to perform loop encoding processing on multiple loops in the preprocessed target knowledge graph to obtain loop clauses corresponding to the multiple loops in the preprocessed target knowledge graph;

[0140] A loop clause determination unit is used to use the loop clauses corresponding to the multiple loops in the preprocessed target knowledge graph as the loop clauses corresponding to the multiple loops in the target knowledge graph.

[0141] In an achievable implementation manner, the loop coding processing unit is specifically configured to:

[0142] Performing loop analysis on multiple loops in the preprocessed target knowledge graph to obtain loop edge sets corresponding to the multiple loops in the preprocessed target knowledge graph;

[0143] For each loop, loop encoding is performed on the loop edge set corresponding to the loop to obtain the loop hard clauses and loop soft clause sets corresponding to the loop, where one loop edge corresponds to one loop soft clause;

[0144] For the multiple loops, the loop hard clauses and loop soft clause sets corresponding to the multiple loops are used as the loop clauses corresponding to the multiple loops in the preprocessed target knowledge graph.

[0145] In one feasible embodiment, the device further includes:

[0146] A soft clause variable set obtaining unit is used to, for each loop, perform value assignment processing on a loop soft clause set in a loop clause corresponding to the loop, and obtain a soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop, wherein one loop soft clause corresponds to one soft clause variable;

[0147] The soft clause weight set obtaining unit is used to perform weight allocation processing on the loop soft clause set in the loop clause corresponding to each loop, and obtain the soft clause weight set corresponding to the loop soft clause set in the loop clause corresponding to the loop, wherein one loop soft clause corresponds to one soft clause weight, and each soft clause weight in the soft clause weight set is the same.

[0148] In an achievable implementation, the simplified strategy obtaining unit 803 is specifically configured to:

[0149] For each loop, based on the soft clause variable set and soft clause weight set corresponding to the loop soft clause set in the loop clause corresponding to the loop, the loop hard clause in the loop clause corresponding to the loop is solved to obtain the loop solution result of the loop;

[0150] If the loop solution result indicates that the sum of the weights of n loop edges corresponding to false values ​​of soft clause variables in the soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop is the smallest, a loop simplification strategy corresponding to the loop is generated according to the loop solution result.

[0151] In an achievable implementation manner, the simplified strategy obtaining unit 803 is further specifically configured to:

[0152] For each loop, based on the soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop, the variables of the loop hard clause in the loop clause corresponding to the loop are solved to obtain the clause solution value of the loop hard clause in the loop clause corresponding to the loop;

[0153] If the clause solution value is a true value, based on the soft clause weight set corresponding to the loop soft clause set in the loop clause corresponding to the loop loop, the soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop loop is weighted to obtain the loop solution result of the loop loop.

[0154] In an achievable implementation, the graph preprocessing unit is specifically used for:

[0155] Traversing the target knowledge graph to obtain p leaf nodes and q reflexive relations in the target knowledge graph, wherein p is greater than or equal to 1, and q is greater than or equal to 1;

[0156] The p leaf nodes and the q reflexive relations are removed to obtain a preprocessed target knowledge graph.

[0157] The knowledge graph simplification device provided in the embodiment of the present application has the same beneficial effects as the knowledge graph simplification method provided in the above-mentioned embodiment.

[0158] The present application also provides a computer device. The computer device includes:

[0159] A memory having a computer program stored therein.

[0160] A processor is used to execute a computer program in a memory to implement some or all of the steps in the knowledge graph simplification method introduced in the above embodiments.

[0161] The present application also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, some or all of the steps in the knowledge graph simplification method described in the above embodiment are implemented.

[0162] It should be noted that the "first" and "second" (if any) in the names such as "first" and "second" mentioned in the embodiments of the present application are only used as name identifiers and do not represent the first or second in order.

[0163] It should also be noted that the various embodiments in this specification are described in a progressive manner, and the same and similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and equipment embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments. The device and equipment embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components indicated as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0164] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for simplifying a knowledge graph, characterized in that: include: Obtain the target knowledge graph; Performing extraction processing on the target knowledge graph to obtain loop clauses corresponding to multiple loops in the target knowledge graph; For each loop, solve the loop clause corresponding to the loop to obtain a loop simplification strategy corresponding to the loop, wherein the loop simplification strategy is used to indicate that n loop edges in the loop are removed, the sum of the weights of the n loop edges is the smallest, and n is greater than or equal to 1; For the multiple loops, according to the loop simplification strategies respectively corresponding to the multiple loops, the simplified loops respectively corresponding to the multiple loops are obtained, and according to the simplified loops respectively corresponding to the multiple loops, the simplified knowledge graph corresponding to the target knowledge graph is obtained.

2. The method according to claim 1, characterized in that The extracting process of the target knowledge graph to obtain loop clauses corresponding to multiple loops in the target knowledge graph includes: Performing graph preprocessing on the target knowledge graph to obtain a preprocessed target knowledge graph; Performing loop extraction processing on the preprocessed target knowledge graph to obtain multiple cyclic loops in the preprocessed target knowledge graph; Perform loop encoding processing on multiple loops in the preprocessed target knowledge graph to obtain loop clauses corresponding to the multiple loops in the preprocessed target knowledge graph; The loop clauses corresponding to the multiple loops in the preprocessed target knowledge graph are used as the loop clauses corresponding to the multiple loops in the target knowledge graph.

3. The method according to claim 2, characterized in that The performing loop encoding processing on the multiple loops in the preprocessed target knowledge graph to obtain loop clauses corresponding to the multiple loops in the preprocessed target knowledge graph respectively includes: Performing loop analysis on multiple loops in the preprocessed target knowledge graph to obtain loop edge sets corresponding to the multiple loops in the preprocessed target knowledge graph; For each loop, loop encoding is performed on the loop edge set corresponding to the loop to obtain the loop hard clauses and loop soft clause sets corresponding to the loop, where one loop edge corresponds to one loop soft clause; For the multiple loops, the loop hard clauses and loop soft clause sets corresponding to the multiple loops are used as the loop clauses corresponding to the multiple loops in the preprocessed target knowledge graph.

4. The method according to claim 3, characterized in that Before solving the loop clause corresponding to each loop for each loop to obtain the loop simplification strategy corresponding to the loop, the method further includes: For each loop, the loop soft clause set in the loop clause corresponding to the loop is assigned to obtain a soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop, wherein one loop soft clause corresponds to one soft clause variable; For each loop, a weight distribution process is performed on the loop soft clause set in the loop clause corresponding to the loop to obtain a soft clause weight set corresponding to the loop soft clause set in the loop clause corresponding to the loop, wherein one loop soft clause corresponds to a soft clause weight, and each soft clause weight in the soft clause weight set is the same.

5. The method according to claim 4, characterized in that For each loop, solving the loop clause corresponding to the loop to obtain the loop simplification strategy corresponding to the loop includes: For each loop, based on the soft clause variable set and soft clause weight set corresponding to the loop soft clause set in the loop clause corresponding to the loop, the loop hard clause in the loop clause corresponding to the loop is solved to obtain the loop solution result of the loop; If the loop solution result indicates that the sum of the weights of n loop edges corresponding to false values ​​of soft clause variables in the soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop is the smallest, a loop simplification strategy corresponding to the loop is generated according to the loop solution result.

6. The method according to claim 5, characterized in that For each loop, based on the soft clause variable set and the soft clause weight set corresponding to the loop soft clause set in the loop clause corresponding to the loop, clause solving is performed on the loop hard clause in the loop clause corresponding to the loop, to obtain the loop solving result of the loop, including: For each loop, based on the soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop, the variables of the loop hard clause in the loop clause corresponding to the loop are solved to obtain the clause solution value of the loop hard clause in the loop clause corresponding to the loop; If the clause solution value is a true value, based on the soft clause weight set corresponding to the loop soft clause set in the loop clause corresponding to the loop loop, the soft clause variable set corresponding to the loop soft clause set in the loop clause corresponding to the loop loop is weighted to obtain the loop solution result of the loop loop.

7. The method according to claim 2, characterized in that The performing graph preprocessing on the target knowledge graph to obtain the preprocessed target knowledge graph includes: Traversing the target knowledge graph to obtain p leaf nodes and q reflexive relations in the target knowledge graph, wherein p is greater than or equal to 1, and q is greater than or equal to 1; The p leaf nodes and the q reflexive relations are removed to obtain a preprocessed target knowledge graph.

8. A knowledge graph simplification device, characterized in that: include: A knowledge graph acquisition unit, used to acquire a target knowledge graph; A knowledge graph extraction unit, used to extract the target knowledge graph to obtain loop clauses corresponding to multiple loops in the target knowledge graph; A simplification strategy obtaining unit is used to solve the loop clause corresponding to each loop for each loop, and obtain a loop simplification strategy corresponding to the loop, wherein the loop simplification strategy is used to indicate that n loop edges in the loop are to be removed, the sum of the weights of the n loop edges is the smallest, and n is greater than or equal to 1; The knowledge graph simplification unit is used to obtain the simplified loops corresponding to the multiple loops according to the loop simplification strategies respectively corresponding to the multiple loops, and obtain the simplified knowledge graph corresponding to the target knowledge graph according to the simplified loops respectively corresponding to the multiple loops.

9. A computer device, characterized in that: include: a memory having a computer program stored thereon; A processor, used to execute the computer program in the memory to implement the steps of the knowledge graph simplification method described in claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the knowledge graph simplification method described in claims 1-7 are implemented.