Knowledge graph data mining and recommendation method based on dynamic suboptimal minimum spanning tree
The dynamic suboptimal minimum spanning tree method is used to find content in the knowledge graph, which solves the problems of content duplication and delay, quickly takes into account the importance and diversity of the content, and reduces the delay time of the recommendation system.
Patent Information
- Application Number
- CN202010372955.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-06
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2040-05-06
AI Technical Summary
Existing recommendation algorithms have problems with content duplication and delay when searching for content in the knowledge graph, resulting in reduced user experience, and the existing minimum spanning tree algorithm cannot effectively solve the problem of delay and diversity.
The dynamic suboptimal minimum spanning tree method is used to construct a minimum spanning tree by matching the query results with isomorphic subgraphs, and cuts edges to form multiple connected branches in an incremental update manner, and returns the node with the highest importance as the query As a result, the importance and diversity of content can be quickly considered.
It effectively reduces the delay time of the recommendation system, eliminates content duplication, and realizes the importance and diversity of content while reducing waiting time. It becomes the first recommendation algorithm that focuses on both importance and diversity.
Smart Images

Figure CN113626678B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of knowledge graph data mining, and specifically relates to a recommendation method that utilizes a dynamic suboptimal minimum spanning tree to simultaneously take into account the importance and diversity of search content. Background Art
[0002] With the diversification of online social platforms and entertainment platforms, providing users with high-quality recommended content or search results based on their preferences or query commands input by users has become the main goal of the recommendation system. Some well-known platforms such as Zhihu and Bilibili have their own recommendation algorithms. Although it is a relatively mature technology, the recommendation system is still one of the research hotspots today. The existing recommendation algorithms only pay attention to the quality and popularity of the recommended content, and often recommend similar but not identical content, that is, the two contents are not exactly the same, but there are great similarities in the content (such as Bilibili recommends the same video uploaded by different users), which reduces the user experience.
[0003] In addition, many databases currently use the knowledge graph data structure to store data, and the process of querying in the knowledge graph can be abstracted as the process of finding isomorphic subgraphs. Since the process of finding isomorphic subgraphs is NP-hard, and the existing recommendation algorithms often first find all tuples that meet the requirements, then filter them according to a preset algorithm, and finally return the high-quality parts, the recommendation system often has a certain delay when working, and such delays will further reduce the user experience. Summary of the invention
[0004] In order to overcome the problem of repeated and delayed recommended content in existing recommendation algorithms, the purpose of the present invention is to provide a knowledge graph data mining and recommendation method based on a dynamic suboptimal minimum spanning tree, which can simultaneously take into account the importance and diversity of promoted content and reduce user waiting time.
[0005] The purpose of the present invention is achieved through the following technical solutions:
[0006] A knowledge graph data mining and recommendation method based on a dynamic suboptimal minimum spanning tree, the steps of which are:
[0007] 1) According to the subgraph corresponding to the query condition, isomorphic subgraph matching is performed in the knowledge graph to obtain several query results; each query result is then abstracted into a node;
[0008] 2) The importance of each query result is taken as the sum of the importance of each entity in the query result as the weight of the corresponding node, and the difference between the query results is taken as the edge weight to construct the minimum spanning tree of the query results;
[0009] 3) Cut the edges in the minimum spanning tree to form multiple different connected branches, and each connected branch returns the node with the highest importance in the connected branch as the query result output.
[0010] Furthermore, the minimum spanning tree is dynamically updated in an incremental manner, and the method is as follows: isomorphic subgraphs are matched in the knowledge graph according to the subgraphs corresponding to the query conditions, multiple batches of query results are obtained in chronological order, a minimum spanning tree is constructed using the first batch of query results, and the query results are output; then for the subsequent i-th batch of query results, each query result in the i-th batch of query results is abstracted into a node and added to the current minimum spanning tree to obtain a new minimum spanning tree, and then an edge with the shortest distance to the original minimum spanning tree is found from the new minimum spanning tree to connect, as the new minimum spanning tree, and then the edges in the current minimum spanning tree are cut to form multiple different connected branches, and each connected branch returns the node with the highest importance in the connected branch as the query result output.
[0011] Furthermore, the method for finding the shortest edge is: first randomly select some points from the original minimum spanning tree, find the shortest edge between these points and the new minimum spanning tree, and when the points selected multiple times can no longer reduce the shortest distance found or the number of searches reaches a threshold, use the shortest distance edge currently found as the edge connecting the new minimum spanning tree with the original minimum spanning tree.
[0012] Furthermore, the fewer the identical nodes in the two query results are, the greater the difference between the two query results is.
[0013] Furthermore, in step 3), when the edge in the minimum spanning tree is cut, if the midpoint weight of the new connected branch generated after the edge A selected for cutting is cut is the highest, then the edge A is cut on the edge in the minimum spanning tree to form multiple different connected branches.
[0014] Further, using Calculate the probability of each edge and select the edge with the highest probability for cutting; where w is the weight of the node with the largest weight in the new connected branch, d is the weight of the edge, maxw is the weight of the node with the largest weight in the entire minimum spanning tree, n is the number of nodes contained in the isomorphic subgraph searched by the user, and α is a constant that reflects the user's preference.
[0015] On the whole, the present invention is based on the idea of clustering, hoping that similar query results can be clustered together, and then the most popular and important results are found in each category and recommended to users. In this way, through clustering, duplications can be eliminated by finding the most popular results in each category. However, if existing clustering algorithms such as (K-means) want to achieve the above functions, they often need to obtain all the results that meet the query requirements first and then cluster them, which cannot solve the problem of delay.
[0016] Since the importance can be guaranteed by searching for the most important results in each cluster, the main difficulty of this problem is how to complete clustering and ensure diversity while reducing latency. To address this problem, the present invention abstracts each query result as a point, uses the importance of the query result as the point weight, and uses the degree of difference between the query results as the edge weight (the fewer identical nodes in the two isomorphic subgraphs queried, the greater the difference). It is hoped that a minimum spanning tree of the query results can be constructed to temporarily store the query results, and then the edges in the minimum spanning tree are cut. Under the premise of considering the impact on importance, some edges with the highest difference are selected for cutting to form multiple different connected branches, each connected branch is a cluster, and the most important points in each connected branch are returned. Since a minimum spanning tree is generated, each point will inevitably tend to be connected to points with low difference, thereby achieving the purpose of clustering.
[0017] It is noted that the existing minimum spanning tree algorithms, whether prime or krustal, need to have all query results in advance like clustering, and still cannot solve the delay problem. Therefore, the present invention adopts an incremental addition method to dynamically generate a suboptimal minimum spanning tree to approximate the minimum spanning tree, that is, first accurately generate a minimum spanning tree for some query results, and after cutting the tree, the first batch of recommended content is first recommended to the user, and then the newly mined query results are added to the tree in batches. Each batch of query results will now form a minimum spanning tree internally, and then find a minimum edge with the original tree to connect the two trees to generate a new tree (that is, the current total tree), and then cut the current total tree to find the most important node as the output result, so as to provide the second batch of recommended content to the user. This dynamic generation method can effectively reduce the delay time of the recommendation system.
[0018] It is noted that in the existing process of mining isomorphic subgraphs in knowledge graphs, adjacent returned matching results often have high similarity (such as the general depth-first search plus backtracking method). Therefore, in this method, the minimum spanning tree is first formed in each increment, and then the generation method of finding edges connected to the original total tree is chosen, which will be very close to the true minimum spanning tree.
[0019] Beneficial effects of the present invention:
[0020] Through incremental updates, a suboptimal minimum spanning tree is dynamically generated to synchronously complete clustering tasks during the query process, ensuring that there is no need to wait for all isomorphic subgraphs to be matched, reducing the latency of the algorithm. At the same time, the edges are divided into multiple clusters, and then the most important results in each category are returned among the multiple clusters. This method can effectively solve the problem of duplicate recommended content in existing recommendation algorithms. According to the research results of the present invention, this is currently the first recommendation algorithm that focuses on both importance and diversity. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic diagram of a knowledge graph.
[0022] Figure 2 It is a tuple that a query instruction hopes to query.
[0023] Figure 3 It is the process of splitting an existing tree into multiple connected branches and selecting the most important matches in each branch.
[0024] Figure 4 It is a process of merging the minimum spanning tree formed by the newly obtained matching with the original tree.
[0025] Figure 5 It is the overall flow chart of the present invention. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the examples in the accompanying drawings. It should be understood that the specific examples described herein are only used to explain the present invention and are not used to limit the present invention.
[0027] Figure 1 It is a knowledge graph, and the numbers on the nodes represent their importance. Figure 2 It is a process that simulates a user's query. The user wants to find a triple of movie-director-director nationality with a romantic theme. In the past, recommendation algorithms often queried (movie one, director one, nationality one) and (movie one, director two, nationality two), which resulted in duplicate recommendations. In fact, (movie one, director one, nationality one) and (movie two, director two, nationality two) are better recommendation results because they take both importance and diversity into account.
[0028] The overall flow chart of the present invention is as follows: Figure 5As shown, first, according to the subgraph corresponding to the query condition, isomorphic subgraph matching is performed in the knowledge graph to obtain several query results; then each query result is abstracted into a node, and the importance of each query result is taken as the sum of the importance of each entity in the query result as the weight of the corresponding node, and the degree of difference between the query results is taken as the edge weight; then, based on the dynamic suboptimal minimum spanning tree, the present invention can quickly complete the knowledge graph query result recommendation that takes into account the diversity and importance of the query results. The specific implementation steps are as follows: in the process of isomorphic subgraph matching of the knowledge graph, different matching results are obtained as query results using existing algorithms, and each query result is abstracted into a point, and the sum of the importance of each entity in the query result is taken as the point weight. For example, for the triple of the above-mentioned movie-director-director nationality, we use the sum of the movie rating and the director's fame as the point weight, and the degree of difference between the query results as the edge weight (the present invention believes that the more different nodes in the two isomorphic subgraphs queried, the greater the difference). After obtaining a certain number of query results, the present invention first uses the traditional Prime algorithm (reference RC. PrimeShortest connection networks and Some generalizations The Bell System Technical Journal; Volume: 36, Issue: 6, Nov. 1957) generate a small-scale minimum spanning tree, then select appropriate edges in this tree to cut, and return the most important point for each connected branch as the query result, such as Figure 3 As shown, the curve is the edge selected for cutting, and the black nodes are the most important matching results selected in each connected branch, which quickly provides the user with the first batch of recommended content for browsing, thereby reducing the user's waiting time and improving the user experience. As for how to choose the right edge for cutting, since the present invention hopes that the similarity between the connected branches obtained by the cutting operation is low, the edges with high weights should be selected for cutting as much as possible. However, the problem is that in the application scenario, the value space of edge weights is relatively small, and it is very likely that the edge weights will be the same. At the same time, different edges with the same edge weights may have connected branches with different importance after cutting. Therefore, when cutting the edge, the point weight of the most important point in the new connected branch brought about by cutting this edge is also examined (the point weight refers to the weight of the point with the highest weight in the new connected branch). The higher the point weight, the more likely it is to cut this edge; or use Calculate the probability of each edge and select the edge with the highest probability for cutting, where w is the weight of the maximum weight point in the new connected branch, d is the weight of the edge, that is, the degree of difference between the two endpoints of the edge, maxw is the weight of the maximum weight point in the entire spanning tree, n is the number of nodes contained in the isomorphic subgraph searched by the user (for example, for the triple of movie-director-director's nationality, then n=3), α is a constant reflecting user preference, which is used to decide whether we pay more attention to diversity or importance in the recommendation process. Here, we can combine the existing method of using machine learning to learn user preferences, and explore the user's preference between diversity and importance through the user's past browsing (for example, some users have a single interest point and often like to watch similar content), and then we can decide the specific cutting method and how many edges to cut according to the user's preference.
[0029] While the user is browsing the first batch of recommended content of the present invention, the mining process of the knowledge graph is still in progress. The present invention dynamically updates the original tree in an incremental manner, that is, adding newly mined query results to the tree in batches. Each batch of query results will now form a minimum spanning tree internally, and then find an edge with the shortest distance to the original tree, and use the found edge to connect the two trees to generate a new tree. The specific process is as follows: Figure 4 As shown, the new tree can repeat the process of cutting edges and finding the most important nodes as the output results to provide users with the second batch of recommended content. This dynamic generation method can effectively reduce the delay time of the recommendation system.
[0030] For finding a suitable edge to connect two trees, the solution adopted by the present invention is to randomly select and look at the downward trend, that is, randomly select some points from the original minimum spanning tree, and find the shortest distance between these points and the newly added tree. When the points selected multiple times can no longer reduce the existing shortest distance or the number of searches reaches the threshold, the two trees are connected with the currently found minimum edge. This ensures that the selected edge is close to the optimal one, and the preset threshold ensures that not too much time is consumed in this process.
[0031] It is noted that in the existing process of mining isomorphic subgraphs in knowledge graphs, adjacent returned matching results often have high similarity (such as the general depth-first search plus backtracking method). Therefore, in this method, the minimum spanning tree is first formed in each increment and then the edge connection is found between the original total tree, which is very close to the true minimum spanning tree.
Claims
1. A knowledge graph data mining and recommendation method based on a dynamic suboptimal minimum spanning tree, the steps of which are: 1) According to the subgraph corresponding to the query condition, isomorphic subgraph matching is performed in the knowledge graph to obtain several query results; each query result is then abstracted into a node; 2) The sum of the importance of each entity in each query result is used as the weight of the corresponding node, and the degree of difference between the query results is used as the edge weight to construct the minimum spanning tree of the query results; the fewer the same nodes in two isomorphic subgraphs, the greater the difference between the two isomorphic subgraphs; 3) When cutting the edge in the minimum spanning tree, if the midpoint weight of the new connected branch generated by cutting the selected edge A is the highest, then the edge A is used as the edge to cut the minimum spanning tree to form multiple different connected branches, and each connected branch returns the node with the highest importance in the connected branch as the query result output; when the edge weights are the same, use Calculate the probability of each edge and select the edge with the highest probability for cutting, where w is the weight of the node with the largest weight in the new connected branch, d is the weight of the edge, maxw is the weight of the node with the largest weight in the entire minimum spanning tree, n is the number of nodes contained in the isomorphic subgraph searched by the user, and α is a constant reflecting the user's preference.
2. The method according to claim 1, characterized in that The minimum spanning tree is dynamically updated in an incremental manner. The method is as follows: isomorphic subgraphs are matched in the knowledge graph according to the subgraphs corresponding to the query conditions, multiple batches of query results are obtained in chronological order, a minimum spanning tree is constructed using the first batch of query results, and the query results are output; Then, for the subsequent i-th batch of query results, each query result in the i-th batch of query results is abstracted into a node and added to the current minimum spanning tree to obtain a new minimum spanning tree. Then, an edge with the shortest distance to the original minimum spanning tree is found from the new minimum spanning tree to connect it as the new minimum spanning tree. Then, the edges in the current minimum spanning tree are cut to form multiple different connected branches. Each connected branch returns the node with the highest importance in the connected branch as the query result output.
3. The method according to claim 2, characterized in that The method for finding the shortest edge is: first randomly select some points from the original minimum spanning tree, and find the shortest edge between these points and the new minimum spanning tree. When the points selected multiple times can no longer reduce the shortest distance found or the number of searches reaches the threshold, the shortest distance edge currently found is used as the edge connecting the new minimum spanning tree with the original minimum spanning tree.
