Distributed knowledge graph reasoning method based on belief propagation
By dividing the knowledge graph into knowledge subgraphs and generating directed propagation paths, the problem of inconsistent confidence of boundary entities is solved, the reasoning efficiency and stability are improved, and redundant propagation and computational overhead are reduced.
Patent Information
- Application Number
- CN202611644844.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-23
- Publication Date
- 2026-11-20
AI Technical Summary
In existing distributed knowledge graph reasoning methods, inconsistent confidence levels of boundary entities cannot be recalculated as needed, and loops exist in the propagation paths within subgraphs, leading to redundant propagation, resulting in low reasoning efficiency and unstable results.
The original knowledge graph is divided into multiple knowledge subgraphs according to the entity relationship density, and an independent reasoning node is assigned to each knowledge subgraph. The confidence offset of the boundary entities is calculated through the convergence node, a directional propagation path is generated, and the confidence increment is passed hop by hop to update the entity confidence, thereby suppressing the spread of boundary error and improving the orderliness of local propagation.
By dynamically identifying boundary confidence offsets, a loop-free directional propagation path is generated, reducing redundant computation and communication overhead, and improving the efficiency and convergence stability of distributed knowledge graph reasoning.
Smart Images

Figure CN123140260A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of distributed knowledge graph reasoning technology, specifically a distributed knowledge graph reasoning method based on confidence propagation. Background Technology
[0002] Distributed knowledge graphs disperse entities and relation edges across multiple storage or computing nodes. Knowledge graph inference requires propagating entity confidence scores across the local graph data of each node and fusing inference results from different shards through cross-node relation edges. Entity confidence score propagation proceeds hop-by-hop along relation edges. At shard boundaries, the same entity may participate in inference across multiple shards simultaneously, and its confidence score representation can easily differ across shards. Existing distributed knowledge graph inference methods typically perform confidence score propagation independently within each shard or perform global synchronization at fixed intervals. Intra-shard propagation mostly employs static graph topology order or random neighbor sampling strategies. Entity confidence score updates do not consider the most recent update time order of entities, and when loops exist in the propagation path, historical confidence scores are repeatedly introduced into subsequent updates. Boundary entities between shards are usually aligned only through periodic full aggregation or simple averaging, lacking quantitative judgment of the degree of difference in boundary confidence scores. Shards with large boundary entity confidence score offsets cannot be identified and recalculated in a timely manner, and boundary errors continue to propagate along cross-shard relations. The number of entities and relation density vary significantly across different partitions. Fixed full synchronization introduces a large amount of subgraph computation and communication unrelated to the current inference state. For partitions requiring repropagation, the static propagation direction is prone to conflict with the actual entity update order, causing confidence increments to be repeatedly propagated along loop-containing paths, resulting in slow local inference convergence and fluctuating results. Distributed knowledge graph inference needs to identify the knowledge subgraphs to be recalculated based on the boundary entity confidence offsets and construct loop-free directed propagation paths according to the entity confidence update sequence to reduce boundary error propagation and local propagation redundancy. Summary of the Invention
[0003] To address the issues of inconsistent confidence levels of boundary entities in existing distributed knowledge graph reasoning methods, which prevent recalculation as needed, and redundant propagation due to loops in the propagation path within subgraphs, this invention provides a distributed knowledge graph reasoning method based on confidence propagation. This method divides the original knowledge graph according to entity relationship density and assigns independent reasoning nodes. At the convergence node, it filters knowledge subgraphs that need to be re-propagated based on the boundary entity confidence offset. Then, it adjusts the propagation direction according to the entity confidence update sequence to generate a directional propagation path. The confidence increment is then propagated along this path to update the entity confidence, suppressing the diffusion of boundary errors across knowledge subgraphs and making local propagation more orderly.
[0004] To achieve the above objectives, the present invention provides the following technical solution: The present invention provides a distributed knowledge graph reasoning method based on confidence propagation, comprising: acquiring a distributed storage original knowledge graph; dividing the original knowledge graph into multiple knowledge subgraphs according to entity relation density; and assigning an independent reasoning node to each knowledge subgraph; within each reasoning node, initializing the confidence vector of each entity according to the path length of the inter-entity relation in the knowledge subgraph under its jurisdiction; selecting one reasoning node as a convergence node, and sending the entity confidence vectors calculated by the other reasoning nodes to the convergence node. The aggregation node constructs a global confidence matrix based on multiple received confidence vectors and calculates the confidence offset of boundary entities between each knowledge subgraph. Based on the confidence offset of the boundary entities, it determines the set of knowledge subgraphs that need to re-propagate confidence. For each knowledge subgraph within the set, it adjusts the confidence propagation direction according to the confidence update sequence of its internal entities, generating a directed propagation path. Along the directed propagation path, it propagates the confidence increment of the corresponding entity hop-by-hop, accumulating the received confidence increment at each entity to update the entity confidence of the original knowledge graph. This scheme divides a large-scale knowledge graph into multiple knowledge subgraphs, which are processed in parallel by independent inference nodes, reducing the computational pressure on single nodes and communication bottlenecks. By comparing the confidence offsets of boundary entities at the aggregation node, it only performs local re-propagation on subgraphs with larger offsets, reducing global redundant computation and improving the efficiency and convergence stability of distributed knowledge graph inference.
[0005] As a preferred technical solution of the present invention, the original knowledge graph is divided into multiple knowledge subgraphs according to the entity relation density, including: traversing each entity in the original knowledge graph, counting the number of edges connected to each entity as the relation density value of that entity; selecting entities with relation density values greater than a preset threshold as core entities, and centering on each core entity, grouping all entities whose relation hop count from the core entity does not exceed a set value into the same initial subgraph; detecting overlapping entities among multiple initial subgraphs, and assigning overlapping entities to one of the initial subgraphs according to the relation density ratio of the multiple initial subgraphs to which they belong, so that each entity uniquely belongs to one subgraph, thus obtaining multiple knowledge subgraphs. Through core entity expansion and overlapping entity affiliation resolution, the internal structure of the subgraphs is kept compact, cross-subgraph redundancy is reduced, and a complete subgraph structure is provided for subsequent local reasoning.
[0006] As a preferred embodiment of the present invention, an independent inference node is allocated to each knowledge subgraph, including: obtaining the number of entities and relation edges contained in each of the multiple knowledge subgraphs, and calculating the inference load value of each knowledge subgraph; sorting the multiple knowledge subgraphs in descending order of inference load value to obtain a sorted subgraph sequence; and sequentially allocating idle physical nodes to each knowledge subgraph in the sorted subgraph sequence. If no idle physical nodes exist, the current knowledge subgraph is merged with the allocated knowledge subgraph with the smallest inference load value, and the merged inference nodes are reallocated. This method, which allocates inference nodes based on load sorting and idle resources, can balance the computational load of each inference node and improve resource utilization and inference throughput in a distributed environment.
[0007] As a preferred embodiment of the present invention, the confidence vector of each entity is initialized based on the path length of the relationship between entities in the knowledge subgraph. This includes: selecting the entity with the largest in-degree in the current knowledge subgraph as the anchor entity, and setting the initial value of the anchor entity's confidence vector to a preset unit vector; for other entities in the current knowledge subgraph, calculating the shortest path length between the other entity and the anchor entity, and determining the initial weight of each dimension in the other entity's confidence vector based on the shortest path length; and normalizing the confidence vectors of all entities in the current knowledge subgraph so that the sum of squares of each dimension of the confidence vector of each entity is a fixed constant. The initial weight of each dimension in the confidence vector is inversely proportional to the shortest path length, and the dimension number corresponds to the neighbor entity number of the anchor entity. By initializing the confidence based on the path length of the anchor, the initial confidence distribution is related to the local structure, reducing instability in the early stages of propagation.
[0008] As a preferred technical solution of the present invention, a global confidence matrix is constructed, and the confidence offset of boundary entities between each knowledge subgraph is calculated. This includes: extracting the confidence vectors of entities located at the boundaries of the knowledge subgraph and connected to other knowledge subgraphs from the entity confidence vectors received from each knowledge subgraph, as boundary confidence vectors; aligning all boundary confidence vectors according to the globally unique identifiers of the entities to form a global confidence matrix; for each pair of connected boundary entities in the global confidence matrix, calculating the absolute value of the difference between the confidence vectors of these two boundary entities, and using the absolute value of the difference as the confidence offset of that pair of boundary entities. By globally aligning the confidence vectors of boundary entities and calculating the offset, the degree of inconsistency in the inference results between subgraphs can be accurately identified.
[0009] As a preferred embodiment of the present invention, the set of knowledge subgraphs requiring repropagation of confidence is determined based on the confidence offset of boundary entities. This includes: statistically analyzing the confidence offset of all boundary entities associated with each knowledge subgraph; calculating the average of all confidence offsets associated with the same knowledge subgraph as the average boundary offset of that knowledge subgraph; comparing the average boundary offset of each knowledge subgraph with a preset offset allowance value; and selecting all knowledge subgraphs whose average boundary offset is greater than the preset offset allowance value and including them in the set of knowledge subgraphs requiring repropagation of confidence. By comparing the average boundary offset with the allowance value, computational resources can be concentrated to handle local confidence discrepancies, avoiding redundant recalculation of the entire graph.
[0010] As a preferred technical solution of the present invention, the confidence propagation direction is adjusted according to the confidence update sequence of the internal entities to generate a directed propagation path, including: for each knowledge subgraph in the knowledge subgraph set, obtaining the timestamp of the most recent confidence update of each entity in the knowledge subgraph, and sorting the entities according to the order of the timestamps; starting from the entity with the earliest timestamp, pointing along the relation edge to the next entity adjacent to the timestamp to form an initial propagation path; detecting whether there is a loop in the initial propagation path, if a loop exists, removing the relation edge corresponding to the entity with the latest timestamp in the loop, so that the remaining entities and relation edges constitute a loop-free directed propagation path, which serves as the directed propagation path. By generating a loop-free directed propagation path according to the time sequence, loop propagation and repeated updates can be reduced, and the stability of the propagation process can be improved.
[0011] As a preferred embodiment of the present invention, the confidence increment of the corresponding entity is propagated hop-by-hop along the directional propagation path, including: starting from the starting entity of the directional propagation path, calculating the difference between the current confidence vector of the starting entity and its previous confidence vector, as the confidence increment of the starting entity; propagating the confidence increment along the direction of the directional propagation path to the next hop entity, and multiplying it by a preset attenuation coefficient of the relationship edge between the starting entity and the next hop entity during the propagation process; after receiving the attenuated confidence increment, the next hop entity updates the direction of the confidence increment with its own current confidence vector, and continues to propagate it to the next next hop entity, until the end entity of the directional propagation path. This propagation method diffuses the local confidence change hop-by-hop along the path, and controls the scope of influence through the attenuation coefficient, avoiding excessive amplification of the increment during propagation.
[0012] As a preferred embodiment of the present invention, the received confidence increments are accumulated at each entity to update the entity confidence of the original knowledge graph. This includes: for each entity that has received at least one confidence increment, the sum of the confidence increments received by the entity from all adjacent upstream entities is calculated as the entity's cumulative increment; the entity's current confidence vector is added to the cumulative increment to obtain the entity's updated confidence vector; the entity's updated confidence vector is used as the entity's new confidence value in the original knowledge graph, and the timestamp of this update is recorded. By accumulating multiple upstream increments and recording update timestamps, the entity confidence maintains consistency and traceability under multi-path propagation.
[0013] The technical effects and advantages provided by the present invention in the above technical solution are as follows: By extracting the confidence vectors of entities located at the boundaries of knowledge subgraphs and connected to other knowledge subgraphs from the entity confidence vectors received from each knowledge subgraph by the aggregation node, a global confidence matrix is obtained. For each pair of connected boundary entities, the absolute value of the difference in confidence vectors is calculated as the confidence offset of the boundary entity. The average of the confidence offsets of all boundary entities associated with the same knowledge subgraph is then calculated as the mean boundary offset. Knowledge subgraphs with a mean boundary offset greater than a preset allowable offset value are included in the set of knowledge subgraphs requiring repropagation of confidence. This method quantifies the degree of inconsistency across subgraphs into the vector difference of boundary entities, using the mean subgraph boundary offset as the criterion for repropagation. This allows the recalculation range to be dynamically determined according to the distribution of boundary confidence deviations during the inference process. Local incremental propagation is only performed on subgraphs where the boundary confidence offset exceeds the allowable value, avoiding the redundant calculation and communication overhead caused by global fixed-round synchronization of subgraphs without boundary deviations. Simultaneously, it can suppress the continued propagation of boundary entity confidence errors along cross-subgraph relationship edges, accelerating the global consistency convergence of distributed knowledge graph inference. For a knowledge subgraph that requires repropagation of confidence, the timestamp of the most recent confidence update for each entity is obtained and sorted chronologically. Starting from the entity with the earliest timestamp, an initial propagation path is formed by pointing along the relation edges to the next entity with the adjacent timestamp. Loops in the path are detected, and the relation edges corresponding to the entities with the latest timestamps in the loops are removed, resulting in a loop-free directed propagation path. Along this directed propagation path, starting from the initial entity, the difference between the current confidence vector and the previous confidence vector is calculated as the confidence increment. When propagating to the next hop entity, this increment is multiplied by a preset attenuation coefficient of the corresponding relation edge. The next hop entity receives the attenuated increment, updates the increment direction with its current confidence vector, and continues propagating to the end of the path. The propagation direction is consistent with the order of entity confidence update time, which can reduce the repeated superposition and oscillation of confidence caused by path loops in static or random propagation. The increment is transmitted hop by hop along a non-loop directional path. The entity obtains an increment that matches the upstream update time order at each hop, avoids the multiple backpropagation of historical confidence in the same local structure, reduces invalid iterations and redundant updates, and accelerates the stabilization of the built-in confidence state of the distributed subgraph. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0015] Figure 1 This is a flowchart of a distributed knowledge graph reasoning method based on confidence propagation; Figure 2This is a flowchart of the knowledge subgraph entity confidence vector initialization process; Figure 3 This is a schematic diagram of the distribution of confidence offsets of entities at the boundary of a knowledge subgraph. Figure 4 This is a schematic diagram of the entity confidence vector and its cumulative increment update. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] See Figure 1 This invention provides a distributed knowledge graph reasoning method based on confidence propagation. The method includes: acquiring a distributed, stored original knowledge graph; dividing the original knowledge graph into multiple knowledge subgraphs according to entity relationship density; and assigning an independent reasoning node to each knowledge subgraph; within each reasoning node, initializing the confidence vector of each entity based on the path length of the inter-entity relationship in the knowledge subgraph under its jurisdiction; selecting one reasoning node as a aggregation node, and sending the entity confidence vectors calculated by other reasoning nodes to the aggregation node; the aggregation node constructing a global confidence matrix based on the received multiple confidence vectors, and calculating the confidence offset of boundary entities between each knowledge subgraph; determining the set of knowledge subgraphs that need to re-propagate confidence based on the confidence offset of the boundary entities; for each knowledge subgraph within the knowledge subgraph set, adjusting the confidence propagation direction according to the confidence update sequence of its internal entities, and generating a directed propagation path; propagating the confidence increment of the corresponding entity hop-by-hop along the directed propagation path, and accumulating the received confidence increment at each entity to update the entity confidence of the original knowledge graph.
[0018] The original knowledge graph is stored in a distributed manner, and is divided into multiple knowledge subgraphs based on entity relationship density. Each knowledge subgraph corresponds to an independent inference node. Each inference node initializes its entity confidence vector locally based on the path length of relationships between entities in its subordinate knowledge subgraph. The aggregation node receives entity confidence vectors from other inference nodes, constructs a global confidence matrix with boundary entities as objects, calculates the boundary entity confidence offsets between knowledge subgraphs, and selects a set of knowledge subgraphs that require re-propagation of confidence based on these offsets. For the selected knowledge subgraphs, a loop-free directed propagation path is generated based on the confidence update sequence of internal entities. The entity confidence increment is propagated hop-by-hop along this path, and the received increment is accumulated at each entity, completing the update of entity confidence in the original knowledge graph.
[0019] In practice, after obtaining the original knowledge graph from distributed storage, a traversal operation is performed on each entity in the original knowledge graph, and the number of edges connecting each entity is counted. The counted edge count is used as the relation density value of the entity. The relation density value is calculated based on the adjacency list data of the original knowledge graph. The number of outgoing edges and incoming edges for each entity are counted separately and then summed to obtain the total number of edges connecting the entity. The total number of edges connecting an entity is the relation density value of that entity.
[0020] In practice, a relation density threshold is pre-set. This threshold is determined based on the average relation density values of all entities in the original knowledge graph. The sum of the relation density values of all entities in the original knowledge graph is calculated, then divided by the total number of entities to obtain the average relation density. The relation density threshold is set to 1.5 times this average. The relation density value of each entity is compared to the relation density threshold, and entities with relation density values greater than the threshold are selected as core entities.
[0021] In implementation, a range of relationship hop counts is set. This range is set to 2. Using each core entity as the center, the shortest relationship path length between other entities in the original knowledge graph and the core entity is calculated. Entities whose shortest relationship path length with the core entity does not exceed the relationship hop count range are grouped into the same initial subgraph. If an entity is grouped into different initial subgraphs by multiple core entities simultaneously, it is considered an overlapping entity.
[0022] For overlapping entities, in the specific implementation, the sum of the relation density values of all entities in each initial subgraph to which the overlapping entity belongs is calculated to obtain the total relation density of each initial subgraph. The proportion of the relation density value of the overlapping entity in each initial subgraph to the total relation density of the corresponding initial subgraph is calculated as the relation density ratio of the overlapping entity in the corresponding initial subgraph. The overlapping entity is assigned to the initial subgraph with the largest relation density ratio. If multiple initial subgraphs have the same relation density ratio, the overlapping entity is assigned to the initial subgraph with the largest relation density value of the core entity in that corresponding initial subgraph. After allocation, each entity uniquely belongs to one knowledge subgraph, resulting in multiple knowledge subgraphs.
[0023] In practice, when assigning independent inference nodes to each knowledge subgraph, the number of entities and the number of relation edges contained in each knowledge subgraph are obtained. The number of relation edges is the total number of original knowledge graph relation edges between two entities within the knowledge subgraph.
[0024] In practical implementation, the calculation method for the inference load value is defined. The inference load value is calculated using the following formula:
[0025] in, Indicates the first Inference load values for each knowledge subgraph; Indicates the first The number of entities in a knowledge subgraph; Indicates the first The number of relation edges in a knowledge subgraph; This represents the entity quantity weight, and its value is determined based on the computational cost during the initialization of the entity confidence vector. The entity quantity weight is set to 0.6. The weight representing the number of relation edges is determined based on the computational cost of propagating confidence along the relation edges hop by hop during the confidence propagation process. The weight for the number of relation edges is set to 0.4. The weights for the number of entities (0.6) and the number of relation edges (0.4) are set because the initialization of the entity confidence vector involves independent computation for each entity, while the propagation computation on the relation edges depends on the vector interaction between the entities at both ends of the edge. The computational cost of entities is slightly higher than that of relation edge propagation, hence the weight for the number of entities is set to 0.6 and the weight for the number of relation edges is set to 0.4.
[0026] Optionally, the entity number weight and relation edge number weight can also be adjusted according to the actual computational resource ratio of the inference node, but the sum of the two is 1.
[0027] In practice, multiple knowledge subgraphs are sorted in descending order of inference load value to obtain a sorted subgraph sequence. One knowledge subgraph is then sequentially selected from this sequence, and it is determined whether any physical nodes with idle computing resources exist in the current set of available physical nodes. Idle physical nodes are those that have not been assigned any knowledge subgraphs and meet the conditions for running an inference node. If an idle physical node exists, the currently selected knowledge subgraph is assigned to it as an independent inference node. If no idle physical node exists, the knowledge subgraph with the smallest inference load value is selected from the already assigned knowledge subgraphs. The currently selected knowledge subgraph is then merged with this selected subgraph, and the inference load value of the merged subgraph is recalculated. The merged inference node is then reallocated within the physical node set. When reallocating the merged inference node, the physical node that originally hosted the merged knowledge subgraph is given priority.
[0028] In practice, the number of entities in the formula for calculating the reasoning load value of the merged knowledge subgraph is the sum of the number of entities in the two knowledge subgraphs before the merger, and the number of relation edges is the sum of the number of relation edges in the two knowledge subgraphs before the merger minus the number of relation edges that are repeatedly calculated between the two knowledge subgraphs. The number of relation edges that are repeatedly calculated between the two knowledge subgraphs is the number of original knowledge graph relation edges corresponding to the overlapping entity pairs between the two knowledge subgraphs before the merger.
[0029] In specific implementation, please refer to Figure 2 Within each inference node, the confidence vector of each entity is initialized based on the path length of the relationships between entities in the knowledge subgraph under its jurisdiction. The in-degree value of all entities in the current knowledge subgraph is obtained; the in-degree value is the number of relation edges pointing to that entity. The in-degree values of all entities are compared, and the entity with the largest in-degree value is selected as the anchor entity. If multiple entities have the same largest in-degree value, the entity with the smallest globally unique identifier among these entities is selected as the anchor entity.
[0030] In practice, the initial value of the confidence vector for the anchor entity is set to a preset unit vector. The preset unit vector is a confidence vector where the first dimension is 1 and the remaining dimensions are 0. The number of dimensions of the confidence vector is set to the total number of entities within the current knowledge subgraph.
[0031] In practice, all neighboring entities of the anchor entity are obtained. Neighboring entities are those that have direct relationships with the anchor entity. All neighboring entities of the anchor entity are sorted in ascending order according to their globally unique identifiers and assigned neighbor entity numbers 1, 2, ..., m, where m represents the total number of neighboring entities of the anchor entity.
[0032] In practice, for other entities in the current knowledge subgraph (excluding the anchor entity), the shortest path length between the other entities and the anchor entity is calculated. This shortest path length is obtained by performing a breadth-first search within the current knowledge subgraph. Using the anchor entity as the starting node and other entities as the nodes to be searched, the number of relation edges on the shortest path from the other entity to the anchor entity is recorded, and this number is used as the shortest path length between the other entities and the anchor entity.
[0033] In practice, the initial weights of each dimension in the confidence vector of other entities are determined based on the shortest relationship path length. Each dimension in the confidence vector corresponds to one entity. The dimension number is consistent with the neighbor entity number of the anchor entity. For dimensions with a dimension number not exceeding m in the confidence vector, the dimension number corresponds to the neighbor entity number of the anchor entity; for dimensions with a dimension number exceeding m in the confidence vector, the initial weight is set to 0.
[0034] In practice, the initial weight of the p-th dimension in the confidence vector of other entities is calculated using the following formula:
[0035] in Indicates the first In the confidence vector of the nth other entity Initial weights for each dimension; Indicates the first The shortest path length between each other entity and the anchor entity; Indicates the first The neighbor entity indicator value of the nth other entity, when the nth The first other entity The entity corresponding to the dimension is the _th When the direct neighbor of another entity, The value is 1, when the first The first other entity The entity corresponding to the dimension is not the first. When the direct neighbor of another entity, The value is 0. The constant 1 in the denominator is used to avoid division by zero when the shortest relation path length is 0, and at the same time, it makes the initial weight inversely proportional to the shortest relation path length.
[0036] In practice, after initializing the confidence vectors of all entities within the current knowledge subgraph, the confidence vectors of all entities within the current knowledge subgraph are normalized so that the sum of squares of each dimension of the confidence vector of each entity is a fixed constant. This fixed constant is set to 1. The normalization method is as follows: calculate the sum of squares of the weights of each dimension of the confidence vector of each entity, take the square root of the sum of squares to obtain the normalization factor, and divide the weight value of each dimension in the entity's confidence vector by the normalization factor.
[0037] In some embodiments, the initial weights of each dimension in the confidence vector are inversely proportional to the shortest relation path length, and the dimension number corresponds to the neighbor entity number of the anchor entity. The neighbor entity number of the anchor entity is only used to identify the direct neighbor entity of the anchor entity and does not participate in the calculation of the initial weights of other entities' dimensions. When the entity corresponding to a certain dimension of another entity is a direct neighbor entity of that other entity, the initial weight of that dimension includes the neighbor entity indicator value; when the entity corresponding to a certain dimension of another entity is not a direct neighbor entity of that other entity, the initial weight of that dimension is 0.
[0038] In some embodiments, the confidence vector of the anchor entity is a preset unit vector before normalization. After normalization, the preset unit vector remains unchanged because the sum of the squares of each dimension of the preset unit vector is 1, which satisfies the normalization requirement of a fixed constant of 1.
[0039] In practice, the entity confidence vector obtained during initialization is used by subsequent aggregation nodes to construct the global confidence matrix and for the confidence propagation process.
[0040] In practice, after selecting one inference node as the aggregation node, the other inference nodes send their calculated entity confidence vectors to the aggregation node. Upon receiving the entity confidence vectors from the other inference nodes, the aggregation node extracts the confidence vectors of boundary entities from the entity confidence vectors corresponding to each knowledge subgraph. A boundary entity is an entity that simultaneously satisfies two conditions: the entity is located in the boundary region of its knowledge subgraph, and there is a direct relational connection between the entity and an entity in another knowledge subgraph from the original knowledge graph. The boundary region is determined by the existence of at least one relational edge within the entity's knowledge subgraph pointing to an entity in another knowledge subgraph. The extracted confidence vectors of the boundary entities are then used as the boundary confidence vectors.
[0041] In practice, all boundary confidence vectors are aligned and arranged according to the globally unique identifiers of the entities, forming a global confidence matrix. Each row in the global confidence matrix represents a boundary entity, each column represents a dimension of the confidence vector, and each element in the global confidence matrix is the weight value of a boundary entity's confidence vector in the corresponding dimension. The rows in the global confidence matrix are arranged in ascending order according to the globally unique identifiers of the entities.
[0042] In practice, for each pair of boundary entities with a relationship connection in the global confidence matrix, the absolute value of the difference between the confidence vectors of the two boundary entities is calculated. A relationship connection means that the two boundary entities have a direct relationship edge in the original knowledge graph. The confidence offset is calculated using the following formula:
[0043] in, Represents boundary entities and boundary entities The confidence offset between them; Represents the boundary entities in the global confidence matrix. The corresponding confidence vector is at the th The weight values of each dimension; Represents the boundary entities in the global confidence matrix. The corresponding confidence vector is at the th The weight values for each dimension; This represents the total number of dimensions of the confidence vector; This indicates the absolute value operation; This indicates a summation operation.
[0044] In practice, the confidence vectors of the two boundary entities are subtracted dimension by dimension, and the absolute value of the difference in each dimension is taken. Then, the absolute values of all dimensions are summed, and the resulting value is used as the confidence offset of the two boundary entities.
[0045] In practice, the confidence offset of all boundary entities associated with each knowledge subgraph is calculated. A boundary entity pair associated with a knowledge subgraph refers to a pair of boundary entities in which at least one boundary entity belongs to that knowledge subgraph. The sum of the confidence offsets corresponding to all boundary entity pairs associated with the same knowledge subgraph is calculated, and then divided by the number of boundary entity pairs associated with the same knowledge subgraph to obtain the average boundary offset of the same knowledge subgraph.
[0046] In practice, a preset offset allowance is set. This preset offset allowance is determined based on the average level of the confidence offsets of all boundary entity pairs with relationships in the global confidence matrix. The sum of the confidence offsets of all boundary entity pairs with relationships in the global confidence matrix is calculated, divided by the total number of boundary entity pairs with relationships, to obtain the global average offset. The preset offset allowance is set to 1.2 times the global average offset. The rationale for setting this 1.2 times is to allow a fluctuation of up to 20% in the confidence offset of boundary entities relative to the global average. A fluctuation exceeding 20% indicates that the inconsistency between the confidence distribution at the boundary of this knowledge subgraph and other knowledge subgraphs has affected the consistency of the global inference results, requiring a repropagation of confidence.
[0047] In practice, the average boundary offset of each knowledge subgraph is compared with a preset offset allowance value. All knowledge subgraphs with an average boundary offset greater than the preset offset allowance value are included in the set of knowledge subgraphs requiring repropagation of confidence. Knowledge subgraphs with an average boundary offset less than or equal to the preset offset allowance value are not included in the set of knowledge subgraphs requiring repropagation of confidence.
[0048] See Figure 3 The figure illustrates the distribution of confidence offsets for boundary entity pairs in one of the above embodiments. The horizontal axis represents the numerical value of the confidence offset, and the vertical axis represents the number of boundary entity pairs corresponding to the confidence offset. The blue bars reflect the distribution characteristics of the number of boundary entity pairs in different confidence offset intervals. It can be observed in the figure that the distribution of the number exhibits a right-hand long-tail shape, with the confidence offset of most boundary entity pairs concentrated between 0 and 5, and the number of boundary entity pairs decreasing significantly as the offset increases.
[0049] The global offset average, marked by the orange dashed line in the figure, is located at approximately 3.8, representing the average level of confidence offset for all boundary entities with related connections. The green dotted line represents the preset offset allowance value, set at 1.2 times the global offset average, approximately 4.6. This preset offset allowance value is used to determine whether the confidence distribution of the knowledge subgraph boundary treatment has reached the threshold for triggering repropagation confidence.
[0050] As shown in the figure, the confidence offset of most boundary entity pairs is lower than the preset offset allowable value, indicating that the confidence differences between the knowledge subgraphs corresponding to these boundary entities are small, which meets the requirements of global reasoning consistency. On the other hand, there are still some boundary entity pairs whose confidence offset exceeds the preset offset allowable value, indicating that the confidence of the boundary handling of related knowledge subgraphs is inconsistent, and their corresponding knowledge subgraphs need to be included in the set of repropagation confidence.
[0051] In practice, for each knowledge subgraph within the set of knowledge subgraphs that requires repropagation of confidence, the timestamp of the most recent confidence update for each entity within the knowledge subgraph is obtained. The timestamp records the system time, in milliseconds, when the entity completed the previous round of confidence updates. Entities within the knowledge subgraph are then sorted according to the order of their timestamps, with the entity with the earliest timestamp at the beginning of the entity sequence and the entity with the latest timestamp at the end.
[0052] In practice, the initial propagation path starts from the entity with the earliest timestamp after sorting and points along the relation edge to the next entity with the next adjacent timestamp. For two adjacent entities after sorting, if there is a direct relation edge between them, and the starting point of the direct relation edge is the entity with the earlier timestamp and the ending point is the entity with the later timestamp, then the direct relation edge between the two entities is retained in the initial propagation path. The initial propagation path consists of entity nodes and directed relation edges within the knowledge subgraph.
[0053] In the specific implementation, the initial propagation path is checked for loops. A depth-first search is used to traverse the entity nodes in the initial propagation path, maintaining a set of visited entities. When traversing to the current entity node, if the current entity node already exists in the set of visited entities, the initial propagation path is considered to contain a loop. For detected loops, the timestamps of the most recent confidence updates for all entity nodes in the loop are obtained, and the timestamp sizes are compared to determine the entity node with the latest timestamp. The relation edges corresponding to the entity node with the latest timestamp are removed. The relation edges corresponding to the entity node with the latest timestamp are directed relation edges originating from the entity node with the latest timestamp and pointing to the next entity node adjacent to the latest timestamp. After removal, the remaining entity nodes and the remaining relation edges constitute a loop-free directed propagation path, which serves as the directional propagation path.
[0054] In practice, the confidence increment of the corresponding entity is propagated hop-by-hop along the directed propagation path. This begins with the starting entity in the directed propagation path, which is the entity node with the earliest sorted timestamp in the path. The current confidence vector of the starting entity is the confidence vector obtained after the most recent confidence update. The previous confidence vector of the starting entity is the confidence vector before the most recent confidence update. The difference between the current confidence vector and the previous confidence vector is calculated by subtracting the corresponding dimension value of the previous confidence vector from the current confidence vector dimension by dimension. This difference vector serves as the confidence increment of the starting entity.
[0055] In practice, the preset attenuation coefficient of the relationship edge between the starting entity and the next-hop entity on the directional propagation path is obtained. The preset attenuation coefficient is determined according to the type of relationship edge. Relationship edge types include Type I relationship edges and Type II relationship edges. Type I relationship edges represent direct relationships with high strength between two entities, while Type II relationship edges represent direct relationships with low strength between two entities. The preset attenuation coefficient for Type I relationship edges is set to 0.8, and for Type II relationship edges it is set to 0.6. The basis for setting 0.8 and 0.6 is that the confidence level decreases as the relationship strength decreases during propagation along the relationship edge. The relationship strength of Type I relationship edges is higher than that of Type II relationship edges; therefore, the preset attenuation coefficient for Type I relationship edges is greater than that for Type II relationship edges. The values of 0.8 and 0.6 ensure that the confidence level retains a relatively high proportion of information after one propagation, while also reflecting the attenuation differences between different relationship edge types.
[0056] In practice, the confidence increment of the starting entity is propagated to the next-hop entity along the direction of the directional propagation path, and multiplied by a preset attenuation coefficient of the relationship edge between the starting entity and the next-hop entity during the propagation process. The confidence increment propagated to the next-hop entity is calculated using the following formula:
[0057] in, This represents the confidence increment passed to the next-hop entity; This represents the preset decay coefficient of the relationship edge between the starting entity and the next-hop entity; This represents the confidence increment of the starting entity.
[0058] In practice, after receiving the transmitted confidence increment, the next-hop entity updates the direction of the transmitted confidence increment using its current confidence vector. The method for updating the direction is as follows: obtain the unit vector of the next-hop entity's current confidence vector, use the transmitted confidence increment as the length value, and multiply it by the unit vector of the next-hop entity's current confidence vector to obtain the direction-updated confidence increment. The direction-updated confidence increment continues to be transmitted to the next-hop entity until the endpoint of the directed propagation path. The endpoint entity is the entity node with the latest sorted timestamp in the directed propagation path.
[0059] In practice, for each entity that receives at least one confidence increment along the directed propagation path, the identification number is... The adjacent upstream entities of the entity. The adjacent upstream entities satisfy the following two conditions: the adjacent upstream entity is the same as the entity numbered... There are direct relationship edges between entities; in the directed propagation path, adjacent upstream entities are related to entities numbered... Directed edges between entities originate from the adjacent upstream entity and are numbered... The entity is the endpoint, and the adjacent upstream entity has already moved to the numbered [entity name]. The entity has passed at least one confidence increment.
[0060] In specific implementation, the number is An entity may receive confidence increments from multiple adjacent upstream entities. The statistical number is... The sum of confidence increments received by an entity from all its neighboring upstream entities is used as the identifier for the entity. The cumulative increment of the entities. The summation is performed dimension-by-dimensionally. For each dimension of the confidence vector, the confidence increments from different neighboring upstream entities are summed along the corresponding dimension, resulting in the value numbered... The cumulative increment of an entity in the corresponding dimension.
[0061] In specific implementation, the number is obtained as follows: The current confidence vector of the entity. Numbered as The current confidence vector of the entity is numbered as follows: The confidence vector of the entity that existed before this update, i.e., the one with the number [number]. The confidence vector of an entity obtained after the most recent confidence update or initialization.
[0062] In specific implementation, the number will be... The current confidence vector of the entity and its number The cumulative increment of the entity is calculated by vector addition to obtain the entity with the number […]. The updated confidence vector of the entity. Vector addition is performed using the following formula:
[0063] in, Indicates the number is The updated confidence vector of the entity; Indicates the number is The current confidence vector of the entity; Indicates the number is The cumulative increment of the entity; the plus sign indicates a dimension-wise vector addition operation, that is, updating the value of each dimension of the confidence vector to be the sum of the corresponding dimension value of the current confidence vector and the corresponding dimension value of the cumulative increment.
[0064] In specific implementation, the number will be... The updated confidence vector of the entity is represented by the number . The new confidence value of the entity in the original knowledge graph. The new confidence value replaces the number. The original confidence values of the entities are used for subsequent global confidence matrix construction, boundary entity confidence offset calculation, and confidence propagation.
[0065] In practice, the timestamp of this update is recorded. The timestamp is the system time in milliseconds when the vector addition operation was performed, expressed using Coordinated Universal Time (UTC). The timestamp of this update is written to the system time numbered [number missing]. The timestamp field of the entity is used to determine the confidence update sequence of the entity within the knowledge subgraph.
[0066] In some embodiments, when the number is When the number of adjacent upstream entities of an entity is 0, the number is... The cumulative increment of the entity is a zero vector, numbered as The updated confidence vector of the entity is equal to the one numbered... The current confidence vector of the entity, numbered as The timestamp of the entity is still updated to the current system time.
[0067] In some embodiments, the updated confidence vector obtained by vector addition is not normalized, and the value after the confidence increment is accumulated is used as the new confidence value of the entity in the original knowledge graph.
[0068] See Figure 4 In the graph, the horizontal axis represents the entity number, ranging from 0 to 500, and the vertical axis represents the confidence vector dimension value of the corresponding entity. The graph contains three types of data curves and scatter points, corresponding to the numbers in the above embodiment. The cumulative increment of the entity, the updated confidence vector, and the current confidence vector.
[0069] The blue solid line represents the current confidence vector, whose value fluctuates between 3 and 8, showing a relatively uniform discrete trend. The orange dashed line represents the updated confidence vector, which is generally higher than the current confidence vector, with a dimension value ranging from approximately 4 to 10. This shows that the updated confidence vector increases to varying degrees across all entities, reflecting the process in the above embodiment where the cumulative increment is added to the current confidence vector through vector addition.
[0070] The green inverted triangle scatter points represent the cumulative increments, with values mainly concentrated between 0 and 2, and the overall distribution is relatively sparse. This indicates that the magnitude of the cumulative increment is relatively small for each entity, consistent with the description of the confidence increment being accumulated dimension by dimension in the previous embodiment. The low value of the cumulative increment further explains that the difference between the updated confidence vector and the current confidence vector mainly comes from the superposition effect of the cumulative increments.
[0071] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A distributed knowledge graph reasoning method based on confidence propagation, characterized in that, The method includes: Obtain the original knowledge graph stored in a distributed manner, divide the original knowledge graph into multiple knowledge subgraphs according to the entity relationship density, and assign an independent reasoning node to each knowledge subgraph; Within each inference node, the confidence vector of each entity is initialized based on the path length of the relationship between entities in the knowledge subgraph under its jurisdiction. One inference node is selected as the aggregation node, and the other inference nodes send their calculated entity confidence vectors to the aggregation node. The aggregation node constructs a global confidence matrix based on the received multiple confidence vectors and calculates the confidence offset of the boundary entities between each knowledge subgraph. Based on the confidence offset of the boundary entities, determine the set of knowledge subgraphs that need to repropagate the confidence. For each knowledge subgraph in the knowledge subgraph set, the confidence propagation direction is adjusted according to the confidence update time sequence of the entities inside it, and a directional propagation path is generated. Along the directional propagation path, the confidence increment of the corresponding entity is passed hop by hop, and the received confidence increment is accumulated at each entity to update the entity confidence of the original knowledge graph.
2. The distributed knowledge graph reasoning method based on confidence propagation according to claim 1, characterized in that, The step of dividing the original knowledge graph into multiple knowledge subgraphs according to entity relation density includes: Traverse each entity in the original knowledge graph and count the number of edges connected to each entity, which is used as the relation density value of that entity. Entities with a relation density value greater than a preset threshold are selected as core entities. With each core entity as the center, all entities whose relation hop count from the core entity does not exceed a set value are grouped into the same initial subgraph. Detect overlapping entities among multiple initial subgraphs, and assign the overlapping entities to one of the initial subgraphs according to the relationship density ratio of the multiple initial subgraphs to which they belong, so that each entity uniquely belongs to one subgraph, thereby obtaining the multiple knowledge subgraphs.
3. The distributed knowledge graph reasoning method based on confidence propagation according to claim 1, characterized in that, The allocation of independent reasoning nodes to each knowledge subgraph includes: Obtain the number of entities and the number of relation edges contained in each of the multiple knowledge subgraphs, and calculate the inference load value of each knowledge subgraph; The multiple knowledge subgraphs are sorted in descending order of inference load values to obtain a sorted sequence of subgraphs. Each knowledge subgraph in the sorted subgraph sequence is assigned a physical node with available computing resources. If no physical node is available, the current knowledge subgraph is merged with the knowledge subgraph with the minimum inference load value that has been assigned, and the merged inference nodes are reassigned.
4. The distributed knowledge graph reasoning method based on confidence propagation according to claim 1, characterized in that, The initialization of the confidence vector for each entity based on the path length of the relationship between entities in the knowledge subgraph includes: Select the entity with the largest in-degree in the current knowledge subgraph as the anchor entity, and set the initial value of the confidence vector of the anchor entity to a preset unit vector; For other entities in the current knowledge subgraph, calculate the shortest relation path length between the other entity and the anchor entity, and determine the initial weights of each dimension in the confidence vector of the other entity based on the shortest relation path length. The confidence vectors of all entities within the current knowledge subgraph are normalized so that the sum of the squares of each dimension of the confidence vector of each entity is a fixed constant.
5. The distributed knowledge graph reasoning method based on confidence propagation according to claim 1, characterized in that, The construction of the global confidence matrix and the calculation of the confidence offset of boundary entities between each knowledge subgraph include: From the entity confidence vectors received from each knowledge subgraph, extract the confidence vectors of entities located at the boundary of the knowledge subgraph and connected to other knowledge subgraphs, and use them as boundary confidence vectors. All boundary confidence vectors are aligned and arranged according to the globally unique identifier of the entity to form the global confidence matrix; For each pair of boundary entities connected by a relationship in the global confidence matrix, the absolute value of the difference between the confidence vectors of the two boundary entities is calculated, and the absolute value of the difference is used as the confidence offset of the pair of boundary entities.
6. The distributed knowledge graph reasoning method based on confidence propagation according to claim 5, characterized in that, The step of determining the set of knowledge subgraphs that need to repropagate confidence based on the confidence offset of the boundary entities includes: Calculate the confidence offset of all boundary entities associated with each knowledge subgraph, and use the average of all confidence offsets associated with the same knowledge subgraph as the mean boundary offset of that knowledge subgraph. The mean boundary offset of each knowledge subgraph is compared with a preset offset allowance value. All knowledge subgraphs with a mean boundary offset greater than the preset offset allowance value are selected and included in the set of knowledge subgraphs that need to repropagate confidence.
7. The distributed knowledge graph reasoning method based on confidence propagation according to claim 1, characterized in that, The step of adjusting the confidence propagation direction and generating a directed propagation path based on the confidence update sequence of its internal entities includes: For each knowledge subgraph in the knowledge subgraph set, obtain the timestamp of the most recent confidence update for each entity in the knowledge subgraph, and sort the entities according to the order of the timestamps; Starting from the entity with the earliest timestamp after sorting, the path is traversed along the relation edge to the next entity with the adjacent timestamp, forming the initial propagation path; If a loop exists in the initial propagation path, remove the relation edge corresponding to the entity with the latest timestamp in the loop, so that the remaining entities and relation edges form a loop-free directed propagation path, which is the directional propagation path.
8. The distributed knowledge graph reasoning method based on confidence propagation according to claim 7, characterized in that, The step of propagating the confidence increment of the corresponding entity hop-by-hop along the directional propagation path includes: Starting from the initial entity of the directional propagation path, calculate the difference between the current confidence vector of the initial entity and its previous confidence vector, and use it as the confidence increment of the initial entity; The confidence increment is transmitted to the next-hop entity along the direction of the directional propagation path, and multiplied by a preset attenuation coefficient of the relationship edge between the starting entity and the next-hop entity during the transmission process; After receiving the decayed confidence increment, the next-hop entity updates the direction of the confidence increment with its own current confidence vector and continues to pass it to the next next-hop entity until the end entity of the directional propagation path.
9. The distributed knowledge graph reasoning method based on confidence propagation according to claim 8, characterized in that, The step of accumulating the received confidence increment at each entity to update the entity confidence of the original knowledge graph includes: For each entity that receives at least one confidence increment, the sum of the confidence increments received by that entity from all its neighboring upstream entities is counted as the cumulative increment for that entity. The current confidence vector of the entity is added to the cumulative increment to obtain the updated confidence vector of the entity. The updated confidence vector of the entity is used as the new confidence value of the entity in the original knowledge graph, and the timestamp of this update is recorded.
10. The distributed knowledge graph reasoning method based on confidence propagation according to claim 4, characterized in that, The initial weights of each dimension in the confidence vector are inversely proportional to the length of the shortest relationship path, and the dimension number corresponds to the neighbor entity number of the anchor entity.
