Edge label constraint-based k-core community query method and system and computer equipment

By introducing ALC indexes and corresponding query strategies into the knowledge graph, the problems of low query efficiency and large index space overhead caused by underutilization of edge labels in the prior art are solved, and efficient k-core community query is achieved.

CN119884429APending Publication Date: 2025-04-25HUNAN GUOZHONG ZHILIAN CONSTR MASCH RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411972479.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The prior art fails to fully utilize the semantic content of edge labels when querying based on k-core community in the knowledge graph, resulting in low query efficiency and large index space overhead, making it difficult to achieve efficient query in large-scale knowledge graphs.

Method used

A k-core community query method based on edge label constraints is proposed. By introducing ALC index, the k-core community query problem of edge label constraints in the knowledge graph is efficiently handled. The method includes obtaining a tag-induced subgraph, updating a k-core subgraph, calculating a minimum tag set and an ALC index, and querying based on the ALC index.

Benefits of technology

It significantly improves the efficiency of k-core community queries based on knowledge graph edge label constraints, reduces index space overhead, and achieves faster and more accurate query result positioning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119884429A_ABST
    Figure CN119884429A_ABST
Patent Text Reader

Abstract

The invention discloses a k-core community query method and system based on edge label constraints and computer equipment, studies a label constraint k-core query problem on a knowledge graph for the first time, and provides an ALC index system for processing k-core community query based on the edge label constraints of the knowledge graph. According to the system, a set of label sets is calculated for all possible k values of each vertex, and the label sets can accurately describe the inclusion relation of k-core internal labels. The indexing mechanism can efficiently judge whether the vertex belongs to the k-core defined by the specific query tag set or not. Afterwards, all the vertexes contained in the k-core under the edge label constraint can be quickly retrieved and obtained by utilizing the index, and by combining with a query processing technology designed by the indexing method, the method has remarkable effects in improving the efficiency of k-core community query based on the knowledge graph edge label constraint and reducing the overhead of an index space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of community query based on knowledge graph analysis, and in particular to a k-core community query method, system and computer device based on edge label constraints. Background Art

[0002] Knowledge graphs have been widely used in many fields, such as social networks, biological networks, and transaction networks. It is particularly important to implement efficient analysis of these networks. Among them, community query based on k-core constitutes a core issue in knowledge graph analysis. As a well-known model in the field of community query, k-core has attracted widespread attention in the academic community in the past decade.

[0003] In a given knowledge graph G, k-core is defined as a large connected subgraph of G, where each vertex is connected to at least k other vertices in the k-core subgraph. k-core has a wide variety of real-world applications, including community detection and network visualization. In addition, many existing studies also use k-core identification technology as an effective means to optimize the search space before calculating complex models.

[0004] Currently, research on k-core computation can be divided into two main categories. The first category of research is dedicated to computing all k-cores on a simple graph G for every possible value of k, a process known as core decomposition. Core decomposition can be done efficiently with a time complexity of O(m), where m represents the number of edges in G. The second category of research focuses on how to update the k-core in real time when edge insertion or deletion occurs on a simple graph, i.e., the core maintenance problem.

[0005] Although the calculation of k-core has been widely discussed in academia, unfortunately, these studies often fail to fully pay attention to the importance of edge labels in knowledge graphs. In fact, knowledge graphs generally have the characteristics of edge labels, which contain rich semantic content and are crucial for in-depth analysis of graph structures and cannot be ignored.

[0006] Taking the social media knowledge graph as an example, when users establish connections due to sharing similar interests, edges with specific edge labels are formed (such as music, sports, politics and other interest types). When a new user is eager to join a community with similar interests, we naturally want to use the filtering function of edge labels to build a semantically sensitive k-core model for the user. By doing so, we can more accurately locate the online community that best matches the interests of the new user, thereby providing a more personalized and high-quality community experience.

[0007] In this paper, we focus on a novel problem: k-core community query based on knowledge graph edge label constraints. Specifically, given a knowledge graph G, a subset L of its edge label set, and an integer k, our core goal is to identify a subgraph of the graph G that meets two conditions: first, the degree of each vertex in the subgraph is at least k; second, all edges contained in the subgraph conform to a label in the edge label set L.

[0008] However, solving this k-core community query problem based on edge label constraints of knowledge graphs is not an easy task. First, the traditional k-core core decomposition method is incapable of being used in practical applications due to its time-consuming stripping process and inefficient query performance. Secondly, even if we try to use index-based algorithms to improve query efficiency, we still face many challenges. For example, an intuitive indexing strategy is to maintain the corresponding core decomposition results for each possible label set. However, this method is not feasible in practice because the size of the label set is often very large, resulting in an unacceptable index size. At the same time, the index construction process is also extremely time-consuming, which seriously limits the scalability of this method on large-scale knowledge graphs. Summary of the invention

[0009] In view of the above technical problems, the present invention provides a k-core community query method, system and computer device based on edge label constraints.

[0010] The technical solution adopted by the present invention to solve the technical problem is:

[0011] A k-core community query method based on edge label constraints, the method comprising the following steps:

[0012] S100: Obtain a knowledge graph G = (V, E, L) and a label set L', and obtain a label induced subgraph G[L'] of the knowledge graph G on the label set L'; wherein V represents a vertex set, E represents an edge set, and L represents an edge label set. The edge set E[L'] of the subgraph consists of all edges (u, v) that satisfy (u, v, l)∈E and l∈L';

[0013] S200: Obtain an arbitrary k value, determine the number of adjacent edges of each vertex in the label induced subgraph, that is, the degree, update the label induced subgraph according to the relationship between the degree of each vertex and the k value, obtain a k-core subgraph of the label induced subgraph, and obtain a core list and a core list set of the edge label induced subgraph according to multiple k-core subgraphs;

[0014] S300: For any vertex v and k value, determine the minimum label set LC of vertex V under the k value condition by scanning the core list set of label induced subgraphsk (v);

[0015] S400: Calculate the ALC index, sort according to the maximum k value corresponding to the minimum label set of each vertex, and obtain the minimum label set under all combinations of point v and k value;

[0016] S500: Obtain the positive integer k and query label set L' input by the user, and obtain the k-core community based on the knowledge graph edge label constraint based on the ACL index. The k-core community satisfies that the degree of each vertex in the subgraph is at least k and each edge label l∈L', and all vertices of the subgraph are the result set of the query.

[0017] Preferably, in S100, in the process of calculating the label induced subgraph G[L'] for the knowledge graph G and the label set L', if there are multiple edges connecting two vertices, the multiple edges are merged into a single edge.

[0018] Preferably, S200 includes:

[0019] S210: Obtain an arbitrary k value and determine the number of adjacent edges, i.e., the degree, of each vertex in the label induced subgraph;

[0020] S220: When the degree of a node is less than the k value, the node and its connected edges are removed from the label induced subgraph, and the degrees of all nodes adjacent to the removed node are updated;

[0021] S230: Repeat S220 until there are no more nodes with degrees less than the k value in the label induced subgraph, and obtain the k-core subgraph of the label induced subgraph. List all vertices on the k-core subgraph to obtain the core list of the edge label induced subgraph. The core lists of multiple edge label induced subgraphs constitute a core list set.

[0022] Preferably, in S230, all vertices on the k-core subgraph are listed to obtain a core list of the edge label induced subgraph, and the core lists of multiple edge label induced subgraphs constitute a core list set, specifically:

[0023]

[0024] in is the core list set of the knowledge graph, CL k (G) is the core list of the knowledge graph, k max Represents the k value of the largest k-core subgraph in G.

[0025] Preferably, S300 includes:

[0026] S310: For any vertex v and k value, determine the label set to which the vertex v belongs from the core list of the edge label induced subgraph;

[0027] S320: Filter out a set from these label sets that does not belong to any other label set, which is the minimum label set LC of v under the k value condition. k (v).

[0028] Preferably, S500 includes:

[0029] S510: using the core list to collect vertices with a core number of at least k in the knowledge graph, and pruning other vertices that have not been collected;

[0030] S520: Let k max is the maximum k value of the k-core subgraph on the knowledge graph, and iteratively processes each k', k <k’<k max , check each vertex u, if LC k There exists L' in (u) such that Then u is added to the result set, and finally the query result set is obtained.

[0031] The k-core community query system based on edge label constraints includes a label induced subgraph acquisition module, a core list set determination module, a minimum label set determination module, an ALC index determination module and a query module.

[0032] The label induced subgraph acquisition module is used to obtain the knowledge graph G = (V, E, L) and the label set L', and obtain the label induced subgraph G[L'] of the knowledge graph G on the label set L'; wherein V represents the vertex set, E represents the edge set, and L represents the edge label set. The edge set E[L'] of the subgraph consists of all edges (u, v) that satisfy (u, v, l)∈E and l∈L';

[0033] A core list set determination module is used to obtain an arbitrary k value, determine the number of adjacent edges of each vertex in the label induced subgraph, that is, the degree, update the label induced subgraph according to the relationship between the degree of each vertex and the k value, obtain the k-core subgraph of the label induced subgraph, and obtain the core list and core list set of the edge label induced subgraph based on multiple k-core subgraphs;

[0034] The minimum label set determination module is used to determine the minimum label set LC of vertex v under the k value condition by scanning the core list set of the label induced subgraph for any vertex v and k value. k (v);

[0035] ALC index determination module, used to calculate the ALC index, sort according to the maximum k value corresponding to the minimum label set of each vertex, and obtain the minimum label set under all combinations of point v and k value;

[0036] The query module is used to obtain the positive integer k and query label set L' input by the user, and obtain the k-core community based on the edge label constraints of the knowledge graph based on the ACL index. The k-core community satisfies that the degree of each vertex in the subgraph is at least k and each edge label l∈L', and all vertices of the subgraph are the result set of the query.

[0037] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of a k-core community query method based on edge label constraints when executing the computer program.

[0038] The above-mentioned k-core community query method, system and computer device based on edge label constraints studied the label-constrained k-core query problem on the knowledge graph for the first time, and proposed an ALC index for processing k-core community queries based on knowledge graph edge label constraints. The query processing technology designed in combination with the index method has a significant effect in improving the efficiency of k-core community queries based on knowledge graph edge label constraints and reducing index space overhead. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a flowchart of a k-core community query method based on edge label constraints in one embodiment of the present invention;

[0040] Figure 2 A knowledge graph in one embodiment of the present invention;

[0041] Figure 3 is an edge label induced subgraph in one embodiment of the present invention;

[0042] Figure 4 is a core list of an edge label induced subgraph in one embodiment of the present invention;

[0043] Figure 5 This is an example of the ALC index of the knowledge graph G in one embodiment of the present invention. DETAILED DESCRIPTION

[0044] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings.

[0045] In one embodiment, Figure 1 As shown, the k-core community query method based on edge label constraints includes the following steps:

[0046] S100: Obtain a knowledge graph G = (V, E, L) and a label set L', and obtain a label induced subgraph G[L'] of the knowledge graph G on the label set L'; wherein V represents a vertex set, E represents an edge set, and L represents an edge label set. The edge set E[L'] of the subgraph consists of all edges (u, v) that satisfy (u, v, l)∈E and l∈L';

[0047] S200: Obtain an arbitrary k value, determine the number of adjacent edges of each vertex in the label induced subgraph, that is, the degree, update the label induced subgraph according to the relationship between the degree of each vertex and the k value, obtain a k-core subgraph of the label induced subgraph, and obtain a core list and a core list set of the edge label induced subgraph according to multiple k-core subgraphs;

[0048] S300: For any vertex v and k value, determine the minimum label set LC of vertex v under the k value condition by scanning the core list set of label induced subgraphs k (v);

[0049] S400: Calculate the ALC index, sort according to the maximum k value corresponding to the minimum label set of each vertex, and obtain the minimum label set under all combinations of point v and k value;

[0050] S500: Obtain the positive integer k and query label set L' input by the user, and obtain the k-core community based on the knowledge graph edge label constraint based on the ACL index. The k-core community satisfies that the degree of each vertex in the subgraph is at least k and each edge label l∈L', and all vertices of the subgraph are the result set of the query.

[0051] Specifically, the core of the present invention focuses on an index designed specifically for solving the k-core community query problem based on the edge label constraints of the knowledge graph and its corresponding query strategy. The ALC index (Advanced Label-Constrained Index) is innovatively introduced. This new index structure is designed to efficiently handle such queries. Subsequently, relying on the ALC index, a set of k-core community query solutions based on the edge label constraints of the knowledge graph was carefully constructed in order to greatly improve the query efficiency. The k-core community query problem based on the edge label constraints of the knowledge graph can be described as: given a knowledge graph G, a subset L of its edge label set, and a non-negative integer k, the goal of the present invention is to determine a subgraph of the graph G, which must meet two conditions: one is that the degree of each vertex in the subgraph is at least k; the other is that all edges contained in the subgraph meet a certain label in the edge label set L. Through the use of the ALC index and its query solution, subgraphs that meet these conditions can be located more quickly and accurately, thereby effectively improving the efficiency and accuracy of the query.

[0052] In one embodiment, in S100, in the process of calculating the label induced subgraph G[L'] for the knowledge graph G and the label set L', if there are multiple edges connecting two vertices, the multiple edges are merged into a single edge.

[0053] Specifically, the label induced subgraph is a simple graph. In the process of calculating the induced subgraph G[L'] for the knowledge graph G and the label set L', if there are multiple edges connecting two vertices, these edges need to be merged into a single edge to ensure that the obtained subgraph is a simple graph. Figure 2 The following is a knowledge graph G, where the edge label set L is {a, b, c, d}. Figure 2 is an edge label induced subgraph of graph G, with edge label set {a,b,c}.

[0054] In one embodiment, S200 includes:

[0055] S210: Obtain an arbitrary k value and determine the number of adjacent edges, i.e., the degree, of each vertex in the label induced subgraph;

[0056] S220: When the degree of a node is less than the k value, the node and its connected edges are removed from the label induced subgraph, and the degrees of all nodes adjacent to the removed node are updated;

[0057] S230: Repeat S220 until there are no more nodes with degrees less than the k value in the label induced subgraph, and obtain the k-core subgraph of the label induced subgraph. List all vertices on the k-core subgraph to obtain the core list of the edge label induced subgraph. The core lists of multiple edge label induced subgraphs constitute a core list set.

[0058] In one embodiment, in S230, all vertices on the k-core subgraph are listed to obtain a core list of the edge label induced subgraph, and the core lists of multiple edge label induced subgraphs constitute a core list set, specifically:

[0059]

[0060] in is the core list set of the knowledge graph, CL k (G) is the core list of the knowledge graph, k max Represents the k value of the largest k-core subgraph in G.

[0061] Specifically, given a graph G = (V, E), a positive integer k, the kernel list of graph G is denoted as CL k (G), the core list of graph G is a list of all vertices of the k-core subgraph on graph G, Represents the set of core lists on the graph G. In order to calculate the core list, we first need to determine the induced subgraph G[L'] corresponding to any L subset L'; then, in G[L'], for all possible k values, its k-core subgraph will be calculated one by one. The specific process is as follows: for any k value, examine the degree of each node in the graph one by one from G[L']; if the degree of a node is less than k, remove it and its connected edges from the graph. Next, update the degree of all nodes adjacent to the removed node. The above steps need to be repeated until there are no nodes with degrees less than k in the graph. At this time, the k-core subgraph of G[L'] is obtained.

[0062] Figure 4 Shows Figure 3 Given a label-induced subgraph G[{a, b, c}] and k=3, the corresponding 3-core result set C 3 (G[{a, b, c}]) = {v0, v6, v7, v8, v9}. Note that the corresponding 2-core result set C 2 (G[{a, b, c}]) includes all points, but in order to reduce the storage cost C 3 There is no point C in (G[{a, b, c}]) 2 (G[{a, b, c}]).

[0063] In one embodiment, S300 includes:

[0064] S310: For any vertex v and k value, determine the label set to which the vertex v belongs from the core list of the edge label induced subgraph;

[0065] S320: Filter out a set from these label sets that does not belong to any other label set, which is the minimum label set LC of v under the k value condition. k (v).

[0066] Specifically, the present invention defines a special concept for a given point v and a specific value k. If a label set L' is identified as the minimum label set LC of point v under condition k k (v), then it must satisfy the following conditions: the subgraph G[L'] induced by L' must be a k-core subgraph containing the point v, and there does not exist any proper subset L of L' (that is, L" is a subset of L', but L" is not equal to L') that can make G[L"] also a k-core subgraph containing the point v.

[0067] For any point v and value k, LC can be directly calculated by scanning the kernel list set of edge label induced subgraphs k(v). Specifically, for each point v, we first need to determine which label sets in the kernel list it belongs to, which induced subgraphs correspond to them. Then, we filter out those sets from these label sets that are not any other label sets. These filtered sets are the minimum label sets LC for point v under condition k. k (v) Example Figure 4 In the example, the minimum label set of point v0 under the condition of k = 2 is LC2(v0) = {{b},{a,d}}.

[0068] Furthermore, the ALC index is the minimum label set LC for all combinations of points v and values ​​k. k (v). To understand this concept more intuitively, Figure 5 A specific example is given. The value of LC2(v0) is {{b},{a,d}}. In the ALC index, all points are sorted, that is, they are sorted according to the maximum k value corresponding to the minimum label set of each point. Taking point v0 as an example, its LC3(v0) is not empty but LC4(v0) is empty. Therefore, it can be determined that the maximum k value corresponding to the minimum label set of v0 is 3, and v0 is sorted to the corresponding position accordingly.

[0069] In one embodiment, S500 includes:

[0070] S510: using the core list to collect vertices with a core number of at least k in the knowledge graph, and pruning other vertices that have not been collected;

[0071] S520: Let k max is the maximum k value of the k-core subgraph on the knowledge graph, and iteratively processes each k', k <k’<k max , check each vertex u, if LC k There exists L' in (u) such that Then u is added to the result set, and finally the query result set is obtained.

[0072] Specifically, the present invention proposes a k-core community query execution method based on ALC index and knowledge graph edge label constraints. The user inputs the knowledge graph G = (V, E, L), a positive integer k and a query label set L'. The present invention quickly obtains the k-core community based on the knowledge graph edge label constraints according to the ALC index of the knowledge graph G. This community satisfies that the degree of each vertex in the subgraph is at least k and each edge label l∈L', and all vertices of the subgraph are the result set of the query. For example, for Figure 2 In the label graph G, the user gives a label set L'={a,b,c}, k=3, and the query result is {v0,v6,v7,v8,v9}.

[0073] Further, in S510, it is assumed that L'={a, b, c}, k=3, such as Figure 5 As shown in the ALC index, the maximum k value corresponding to the minimum label set of v13 is 2, so v13 is pruned first; in S520, if Figure 5 In the example, the ALC indexes of v0, v6, v7, v8, and v9 contain {a, b, c}. Therefore, for the user-given label set L = {a, b, c}, k = 3, the query result is {v0, v6, v7, v8, v9}.

[0074] The ALC index proposed in this invention significantly reduces the index space overhead from O(n*2 |L| ) is reduced to in represents the average number of labels, n represents the number of vertices in the graph G, and m represents the number of edges in the label-induced subgraph G(L).

[0075] In addition, the k-core community query method based on ALC index and knowledge graph edge label constraint proposed in this paper ensures high query efficiency, and the query complexity is Less than the time cost of traversing the entire graph by traditional algorithms O(m), c k (G) represents the vertices on the graph G with at least k cores. represents the average number of labels.

[0076] The present invention is committed to innovatively proposing an index structure designed specifically for processing k-core community queries based on knowledge graph edge label constraints. The core concept is to build a sophisticated index system that calculates a set of label sets for each vertex for all possible k values, and these label sets can accurately characterize the inclusion relationship of labels within the k-core. This indexing mechanism can efficiently determine whether a vertex belongs to the k-core defined by a specific query label set. Subsequently, using this index, all vertices contained in the k-core can be quickly retrieved and obtained, thereby significantly improving the execution efficiency of k-core community queries based on knowledge graph edge label constraints.

[0077] The community query technology based on k-core on the index-based knowledge graph proposed by the present invention can be applied to the cloud map platform of the engineering machinery industry, and has a wide range of application prospects. It can not only provide strong technical support for the drawing of the panoramic map of the industrial chain, but also help enterprises quickly extract closely cooperating enterprise groups from massive data to form a clear enterprise community map; it can also be further applied to multiple key links such as the formulation of enterprise market strategies, partner screening, and potential business opportunity mining. By deeply analyzing the composition, scale, activity and other information of these enterprise communities, enterprises can more accurately grasp market dynamics, optimize resource allocation, and enhance competitiveness. Further, optimize resource allocation: with the help of this technology, enterprises can more accurately identify closely cooperating enterprise communities, so as to carry out cooperation and communication in a targeted manner, avoid waste of resources, and improve cooperation efficiency; enhance market competitiveness: by deeply analyzing enterprise community information, enterprises can timely discover potential market opportunities and competitors, provide data support for the formulation of more accurate market strategies, and thus occupy a favorable position in the fierce market competition; promote industrial upgrading: the application of the present invention is conducive to promoting the digital transformation and intelligent upgrading of the consulting field of engineering machinery enterprises, and improving the service level and competitiveness of the entire industry.

[0078] The k-core community query system based on edge label constraints includes a label induced subgraph acquisition module, a core list set determination module, a minimum label set determination module, an ALC index determination module and a query module.

[0079] The label induced subgraph acquisition module is used to obtain the knowledge graph G = (V, E, L) and the label set L', and obtain the label induced subgraph G[L'] of the knowledge graph G on the label set L'; wherein V represents the vertex set, E represents the edge set, and L represents the edge label set. The edge set E[L'] of the subgraph consists of all edges (u, v) that satisfy (u, v, l)∈E and l∈L';

[0080] A core list set determination module is used to obtain an arbitrary k value, determine the number of adjacent edges of each vertex in the label induced subgraph, that is, the degree, update the label induced subgraph according to the relationship between the degree of each vertex and the k value, obtain the k-core subgraph of the label induced subgraph, and obtain the core list and core list set of the edge label induced subgraph based on multiple k-core subgraphs;

[0081] The minimum label set determination module is used to determine the minimum label set LC of vertex v under the k value condition by scanning the core list set of the label induced subgraph for any vertex v and k value. k (v);

[0082] ALC index determination module, used to calculate the ALC index, sort according to the maximum k value corresponding to the minimum label set of each vertex, and obtain the minimum label set under all combinations of point v and k value;

[0083] The query module is used to obtain the positive integer k and query label set L' input by the user, and obtain the k-core community based on the edge label constraints of the knowledge graph based on the ACL index. The k-core community satisfies that the degree of each vertex in the subgraph is at least k and each edge label l∈L', and all vertices of the subgraph are the result set of the query.

[0084] For the specific limitations of the k-core community query system based on edge label constraints, please refer to the limitations of the k-core community query method based on edge label constraints above, which will not be repeated here. The various modules in the above-mentioned k-core community query system based on edge label constraints can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0085] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of a k-core community query method based on edge label constraints when executing the computer program.

[0086] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0087] The above is a detailed introduction to the k-core community query method, system and computer device based on edge label constraints provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the core idea of ​​the present invention. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. The k-core community query method based on edge label constraints is characterized by: The method comprises the following steps: S100: Obtain a knowledge graph G = (V, E, L) and a label set L', and obtain a label induced subgraph G[L'] of the knowledge graph G on the label set L'; wherein V represents a vertex set, E represents an edge set, and L represents an edge label set. The edge set E[L'] of the subgraph consists of all edges (u, v) that satisfy (u, v, l)∈E and l∈L'; S200: Obtain an arbitrary k value, determine the number of adjacent edges of each vertex in the label induced subgraph, that is, the degree, update the label induced subgraph according to the relationship between the degree of each vertex and the k value, obtain a k-core subgraph of the label induced subgraph, and obtain a core list and a core list set of the edge label induced subgraph according to multiple k-core subgraphs; S300: For any vertex v and k value, determine the minimum label set LC of vertex V under the k value condition by scanning the core list set of label induced subgraphs k (v); S400: Calculate the ALC index, sort according to the maximum k value corresponding to the minimum label set of each vertex, and obtain the minimum label set under all combinations of point v and k value; S500: Obtain the positive integer k and query label set L' input by the user, and obtain the k-core community based on the knowledge graph edge label constraint based on the ACL index. The k-core community satisfies that the degree of each vertex in the subgraph is at least k and each edge label l∈L', and all vertices of the subgraph are the result set of the query.

2. The method according to claim 1, characterized in that In S100, in the process of calculating the label induced subgraph G[L'] for the knowledge graph G and the label set L', if there are multiple edges connecting two vertices, the multiple edges are merged into a single edge.

3. The method according to claim 2, characterized in that S200 includes: S210: Obtain an arbitrary k value and determine the number of adjacent edges, i.e., the degree, of each vertex in the label induced subgraph; S220: When the degree of a node is less than the k value, the node and its connected edges are removed from the label induced subgraph, and the degrees of all nodes adjacent to the removed node are updated; S230: Repeat S220 until there are no more nodes with degrees less than the k value in the label induced subgraph, and obtain the k-core subgraph of the label induced subgraph. List all vertices on the k-core subgraph to obtain the core list of the edge label induced subgraph. The core lists of multiple edge label induced subgraphs constitute a core list set.

4. The method according to claim 3, characterized in that In S230, all vertices on the k-core subgraph are listed to obtain a core list of the edge label induced subgraph. The core lists of multiple edge label induced subgraphs constitute a core list set, which is specifically: in is the core list set of the knowledge graph, CL k (G) is the core list of the knowledge graph, k max Represents the k value of the largest k-core subgraph in G.

5. The method according to claim 4, characterized in that S300 includes: S310: For any vertex v and k value, determine the label set to which the vertex v belongs from the core list of the edge label induced subgraph; S320: Filter out a set from these label sets that does not belong to any other label set, which is the minimum label set LC of v under the k value condition. k (v).

6. The method according to claim 5, characterized in that S500 includes: S510: using the core list to collect vertices with a core number of at least k in the knowledge graph, and pruning other vertices that have not been collected; S520: Let k max is the maximum k value of the k-core subgraph on the knowledge graph, and iteratively processes each k', k <k’<k max , check each vertex u, if LC k There exists L' in (u) such that Then u is added to the result set, and finally the query result set is obtained.

7. The k-core community query system based on edge label constraints is characterized by: It includes a label-induced subgraph acquisition module, a core list set determination module, a minimum label set determination module, an ALC index determination module and a query module. The label induced subgraph acquisition module is used to obtain the knowledge graph G = (V, E, L) and the label set L', and obtain the label induced subgraph G[L'] of the knowledge graph G on the label set L'; wherein V represents the vertex set, E represents the edge set, and L represents the edge label set. The edge set E[L'] of the subgraph consists of all edges (u, v) that satisfy (u, v, l)∈E and l∈L'; A core list set determination module is used to obtain an arbitrary k value, determine the number of adjacent edges of each vertex in the label induced subgraph, that is, the degree, update the label induced subgraph according to the relationship between the degree of each vertex and the k value, obtain the k-core subgraph of the label induced subgraph, and obtain the core list and core list set of the edge label induced subgraph based on multiple k-core subgraphs; The minimum label set determination module is used to determine the minimum label set LC of vertex v under the k value condition by scanning the core list set of the label induced subgraph for any vertex v and k value. k (v); ALC index determination module, used to calculate the ALC index, sort according to the maximum k value corresponding to the minimum label set of each vertex, and obtain the minimum label set under all combinations of point v and k value; The query module is used to obtain the positive integer k and query label set L' input by the user, and obtain the k-core community based on the edge label constraints of the knowledge graph based on the ACL index. The k-core community satisfies that the degree of each vertex in the subgraph is at least k and each edge label l∈L', and all vertices of the subgraph are the result set of the query.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.