Mode compatible perception completion method for long-tail entity reasoning of time sequence mapping knowledge domain
By constructing a sequence of historical events for entities and time-adaptive projection, and dynamically calculating the soft weights of neighbors, the semantic collapse and behavioral pattern loss problems of long-tail entities in temporal knowledge graphs are solved, achieving high-precision knowledge completion and future event prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-03
AI Technical Summary
In existing temporal knowledge graphs, long-tail entities suffer from semantic collapse and missing behavioral patterns due to sparse neighbors, resulting in a significant decrease in inference accuracy. Traditional neighbor aggregation strategies are prone to accumulating errors in sparse scenarios, lack the ability to model time dynamic dependencies, and are difficult to distinguish between random events and behavioral patterns.
By constructing a sequence of historical events for entities, learning the temporal pattern basis of entities, and combining time-adaptive projection and pattern compatibility evaluation, the soft weights of neighbors are dynamically calculated to generate time-enhanced entity representations, thereby achieving knowledge graph completion and future event prediction.
In cases of missing neighbors or sparse structure, it maintains stable inference performance, improves the representation quality and completion accuracy of long-tail entities, alleviates information distortion problems, and achieves higher representation quality and completion accuracy.
Smart Images

Figure CN121787579A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of knowledge graph reasoning technology, and in particular to a pattern-compatible perceptual completion method for long-tail entity reasoning in temporal knowledge graphs. Background Technology
[0002] With the development of artificial intelligence and knowledge-driven reasoning systems, temporal knowledge graphs (TKGs) have been widely applied in complex business scenarios such as event prediction, risk analysis, recommendation systems, and financial forecasting. In these graphs, facts are recorded in the form of quadruples. It uses joint modeling of entities, relationships, and time to depict the dynamic structure of events as they evolve over time.
[0003] However, due to the inherent long-tail characteristic of real-world entity distribution, many entities appear only a limited number of times in the graph, resulting in extremely sparse correlation information across historical moments. This characteristic leads to three key problems: (1) Weakened structural information leads to reasoning failure: Long-tailed entities lack neighbor-supported topological structures, making it difficult for reasoning models based on graph convolution or attention propagation to extract associated semantics during the representation learning stage, resulting in entity embeddings degenerating into noise and the scoring function severely biasing high-frequency entities.
[0004] (2) Traditional neighbor aggregation strategies produce misleading biases: Existing models usually aggregate neighbor representations in chronological order, but they lack the ability to identify the structural stability of historical events and are more prone to accumulating errors in sparse neighbor scenarios. For long-tail entities, their limited number of neighbors are often not representative on the time axis, and direct aggregation will amplify local noise and cause information distortion.
[0005] (3) Insufficient ability to model time dynamic dependence: Although existing studies have captured the evolutionary patterns of entities through RNN / GRU and other methods, these methods mainly learn the entity state update rather than the pattern structure of entity behavior. For long-tailed entities, although historical events are sparse, the behavioral patterns are often stable. Existing technologies ignore the potential pattern modeling ability at the pattern level.
[0006] Existing methods attempt to improve upon this approach by, for example, aggregating neighbors using snapshot graph structures to enhance entity representation; introducing temporal encoding to model temporal decay or relative temporal differences; and using attention mechanisms to enhance the differentiation of neighbor contributions. However, the above methods still have two fundamental limitations: ① They can only rely on the topological and semantic information of neighboring entities, and collapse occurs when neighbors are missing; ② They cannot form an abstract temporal behavioral basis based on historical events, making it difficult for the model to distinguish between random events and behavioral patterns.
[0007] These shortcomings have resulted in long-tail entities consistently lagging significantly behind head entities in reasoning performance, becoming one of the core bottlenecks encountered in expanding the reasoning capabilities of temporal knowledge graphs. Therefore, a new dynamic reasoning mechanism is needed that does not rely on the number of neighbors but on the behavioral patterns of the entities themselves, enabling long-tail entities to generate stable and reliable representations even in the absence of neighbor information. Summary of the Invention
[0008] To address the problems of semantic collapse, missing behavioral patterns, and significantly reduced reasoning accuracy caused by sparse neighbors in existing temporal knowledge graphs, this invention proposes a pattern-compatible perceptual completion method for reasoning about long-tail entities in temporal knowledge graphs.
[0009] The technical solution of the present invention is as follows: a pattern-compatible perceptual completion method for long-tail entity reasoning of temporal knowledge graphs, which obtains the historical temporal knowledge graph of the target domain and represents it as a sequence of subgraphs with timestamps; Construct an entity history event sequence based on a subgraph sequence with timestamps and determine the target fact quadruple to be completed under the current timestamp. The missing content of the target fact quadruple is the head entity, the tail entity, or the relation. A temporal pattern basis learning model is constructed to encode and learn entities and relations in a time-stamped subgraph sequence. The temporal pattern basis learning model includes an event representation module, a pattern compatibility evaluation module, and a time-enhanced aggregation module. The event representation module vectorizes each entity and its associated events within the historical time window to generate a time-sensitive entity event embedding sequence. The pattern compatibility evaluation module is used to model the historical entity event embedding sequence as a whole based on the time-sensitive entity event embedding sequence through time-aware encoding and attention aggregation mechanism, and learn to obtain entity temporal pattern vectors to represent the long-term behavioral characteristics and evolutionary laws of entities. By combining the similarity between entity temporal patterns, the semantic consistency score of entities and relations, and the decay factor based on time interval, the module evaluates the degree of influence of neighboring entities on the target entity at the current timestamp, and calculates the normalized soft weights of neighboring nodes. The time-enhanced aggregation module performs weighted message aggregation on the feature information of neighboring entities based on the soft weight, and generates a time-enhanced entity representation that integrates historical pattern information and current time semantics; the time-enhanced entity representation and relation representation are time-adapted and mapped by the time projection function to obtain the dynamic entity representation and dynamic relation representation corresponding to the current timestamp; The dynamic entity representation and dynamic relation representation are input into the scoring function to generate candidate entities or candidate relations, thereby completing the fact quadruple and updating the current timestamp subgraph sequence.
[0010] The historical time-series knowledge graph is represented as a sequence of subgraphs with timestamps:
[0011] in, Represents timestamp subgraph, For a collection of entities, For a set of relations, A set of fact quadruples; used for timestamps The reasoning task, its predecessor A time window is formed by several historical timestamps:
[0012] in, This represents the length of the time window.
[0013] The first step of the event representation module is to construct a sequence of historical events for an entity. From the time window The historical events in which it participated are collected to form a sequence of physical historical events:
[0014] in, For the first The relationship type of an event, To and Entities that interact The timestamp of the event. This indicates the entity's role in the event. The number of historical events; the sequence of historical events of the entity is used for subsequent time-series pattern learning and retains the time sequence information of the events.
[0015] The second step of the event representation module is to generate event hidden state representations for entity historical event sequences. Each event in Construct event vectors:
[0016] in, For time coding functions, The earliest event timestamp in the sequence, symbol " " indicates a vector concatenation operation; Event hidden states are generated iteratively through a temporal coding network:
[0017] in, For the first The hidden state vector of each event. and For learnable parameters, time decay factor , These are learnable parameters.
[0018] The third step of the event representation module is to perform attention-weighted aggregation on the event latent state sequence to generate time-sensitive entity event embeddings:
[0019]
[0020] in, For learnable attention vectors, For attention weights, For entities The temporal pattern basis vectors.
[0021] The mode compatibility assessment module includes the following steps: (1) Time-adaptive state generation: For query entities and its neighboring entities Obtain the historical time-series pattern base of neighboring entities And determine the most recent occurrence time. Projecting the historical pattern base onto the current prediction time :
[0022] in, For learnable projection matrices, For time encoding functions; (2) Construction of compatibility input vector: The historical pattern base of the query entity and its neighboring entities. Time adaptation status and relative time encoding Concatenate the vectors to form a compatible input vector: .
[0023] Calculate the schema compatibility score and relation semantic consistency score of neighboring entities:
[0024]
[0025] in, For the Sigmoid function, For entity vectors, For relation vectors, Represents the neighbor entity 𝑜 in relation to the query entity. Pattern compatibility score at time t The semantic consistency score between entities and relations is calculated, and the reasonableness of the entity-relation-entity triple is measured by vector distance.
[0026] The soft weights of neighboring entities are calculated using the time decay factor and then normalized.
[0027]
[0028] in, The time decay coefficient, , The time decay factor, Indicates the neighboring entity at the current time The weight of the impact on the queried entity.
[0029] The time-enhanced aggregation module is based on the soft weight of neighboring entities. Message aggregation is performed on neighbor information to generate updated entity representations:
[0030] in, For the initial representation of the entity, For learnable matrices, For activation function, This represents the number of aggregation layers.
[0031] Final aggregated entity representation With relation vector Construct a scoring function to rank candidate entities or events, enabling knowledge graph completion or future event prediction:
[0032] in, The final aggregation layer is defined by a scoring function used to measure the credibility or similarity of candidate quadruples, and to rank candidate sets that are missing head entities, tail entities, or relations.
[0033] The beneficial effects of this invention are as follows: (1) Constructing a temporal pattern base based on the entity historical event sequence: This method does not depend on the number of neighbors, but directly learns long-term stable behavioral representations from the entity historical event sequence to make up for the information breakage caused by the lack of topological structure, and realizes the paradigm shift from structure dependence to pattern dependence.
[0034] (2) Introducing a time-adaptive projection mechanism to achieve cross-time reasoning: It supports cross-time projection of the pattern base learned by the entity in the historical time, so that it has the ability to adapt to any reasoning time point, thereby solving the problem of discontinuous state prediction caused by time sparsity of long-tail entities.
[0035] (3) Dynamic neighbor soft selection aggregation mechanism based on pattern compatibility: This method no longer relies uniformly on neighbor entities during the inference stage, but calculates the consistency between the neighbor behavior pattern and the target entity behavior pattern through the compatibility function, and filters information sources in a soft weight manner, thereby alleviating the noise amplification problem of traditional aggregation strategies in sparse scenarios from the root.
[0036] This invention can maintain stable inference performance even when neighbors are missing or the structure is sparse. It significantly alleviates the problem of weakened long-tail entity information through pattern abstraction and time projection mechanisms, achieving higher representation quality and completion accuracy, and has broad application prospects. Attached Figure Description
[0037] Figure 1 This is a flowchart of the temporal knowledge graph reasoning method based on temporal pattern-based learning and pattern compatibility weighted aggregation used in embodiments of the present invention. Figure 2 This is a diagram illustrating the temporal pattern basis learning and temporal awareness graph aggregation process used in embodiments of the present invention. Detailed Implementation
[0038] To make the technical solution, objectives, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be noted that the provided embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0039] This invention proposes a pattern-compatible perceptual completion method for long-tail entity reasoning in temporal knowledge graphs. Its core idea is to dynamically weight neighbor information by analyzing the behavioral patterns of entities over time, thereby achieving knowledge completion and future event prediction for long-tail entities. The overall method includes the following steps: First, obtain the entity's historical event sequence; second, encode the entity's historical event sequence using a temporal pattern basis; then, project the temporal pattern basis onto the prediction time point to generate a time-adapted state; next, calculate the soft weights of neighbor entities based on pattern compatibility; then, use the soft weights to perform message aggregation and generate an updated entity representation; finally, rank candidate entities or events using a scoring function to complete the knowledge graph completion or future event prediction. The following provides a detailed explanation of each step: S1. To characterize the long-term behavioral features of an entity, this invention constructs a sequence of historical events centered on the entity. For any entity... Collect all historical events in which it participated:
[0040] And sorted in ascending order by timestamp, forming a sequence of historical events of the entity:
[0041] in, Indicates and The other entity that interacts with For correspondence type, This indicates the entity's role in the event (main entity or tail entity). This sequence serves as the sole input for subsequent temporal pattern learning.
[0042] S2, Entity Temporal Pattern Basis Encoding Construct an event vector for each event in the historical event sequence:
[0043] in, This represents a time-coding function that reflects the relative time information of an event. Subsequently, the event vector sequence is fed into a temporal coding network (MLP) to generate hidden representations.
[0044] To account for the time decay effect, a time decay factor is introduced:
[0045]
[0046] in, These are learnable parameters. The iterative update formula for the hidden state is:
[0047] Next, the hidden states in the sequence are aggregated using attention weighting to obtain the temporal pattern basis vector of the entity:
[0048]
[0049] in, This vector represents the pattern description of an entity at all historical points in time, and it will serve as the basis for the entity's temporal pattern in subsequent steps.
[0050] S3. Project the time series model basis onto the current prediction time. Generate time-aware state Wherein, the input is the temporal pattern basis of the entity. and current reasoning time First, determine the time of the entity's most recent occurrence. Then the time series pattern basis is projected onto the current time. :
[0051]
[0052] in, For learnable projection matrices, This is a time encoding function.
[0053] The projection result Represents the entity in time The time-adapted state will serve as the input for the next step of calculating the neighbor entity weights.
[0054] S4. Calculate the soft weights of neighboring entities based on pattern compatibility. For the query entity... with neighboring entities The historical patterns and time adaptation status of both are integrated into a compatibility input vector:
[0055] in, and This is used to encode the relative time information of the queried entity and its neighboring entities from the current time. The compatibility input is used to calculate the pattern compatibility score via a multilayer perceptron.
[0056] in, The Sigmoid function maps the scores to the [0,1] interval. This is then combined with the relational semantic consistency score:
[0057] And time decay factor:
[0058] Multiply the three together and sort by the neighbor set. Normalization yields the final soft weights:
[0059] This weight reflects the degree of influence of neighboring entities on the queried entity at the current time, realizing the dynamic integration of historical patterns, time adaptation, and relational semantics.
[0060] S5. Using the soft weights obtained in step S4, perform message aggregation to generate the updated entity representation:
[0061] in, For the initial representation of the entity, For learnable matrices, The activation function is ReLU. By iteratively aggregating neighbor information, the representation of each entity gradually incorporates the historical patterns, temporal adaptation, and relational semantic features of its neighbors, thereby achieving an enhanced representation of long-tail entities.
[0062] S6. Sort candidate entities or events according to the scoring function to achieve knowledge graph completion or future event prediction:
[0063] in, and These are the final aggregated entity representations, This indicates the final aggregation layer number. The scoring function combines entity representations and relation vectors to calculate the similarity or credibility of candidate facts, sorts the candidate sets for missing head entities, tail entities, or relations, and finally outputs the completion result or prediction result.
[0064] Throughout the process, each step is closely linked: historical event sequences provide input for temporal pattern encoding; temporal pattern bases, after time adaptation, provide a basis for neighbor compatibility calculation; soft weights guide message aggregation to generate enhanced entity representations; and finally, a scoring function is combined to complete knowledge reasoning and completion, thereby realizing long-tail entity enhancement and future event prediction in dynamic temporal knowledge graphs.
[0065] The embodiments disclosed above are preferred embodiments of the present invention, but the present invention is not limited thereto. Those skilled in the art can design other embodiments based on the above methods without departing from the principles of the present invention, and these embodiments all fall within the protection scope of the present invention.
Claims
1. A pattern-compatible perceptual completion method for long-tail entity reasoning in temporal knowledge graphs, characterized in that, Obtain the historical time-series knowledge graph of the target domain, represented as a sequence of subgraphs with timestamps; Construct an entity history event sequence based on a subgraph sequence with timestamps and determine the target fact quadruple to be completed under the current timestamp. The missing content of the target fact quadruple is the head entity, the tail entity, or the relation. A temporal pattern basis learning model is constructed to encode and learn entities and relations in a time-stamped subgraph sequence. The temporal pattern basis learning model includes an event representation module, a pattern compatibility evaluation module, and a time-enhanced aggregation module. The event representation module vectorizes each entity and its associated events within the historical time window to generate a time-sensitive entity event embedding sequence. The pattern compatibility evaluation module is used to model the historical entity event embedding sequence as a whole based on the time-sensitive entity event embedding sequence through time-aware encoding and attention aggregation mechanism, and learn to obtain entity temporal pattern vectors to represent the long-term behavioral characteristics and evolutionary laws of entities. By combining the similarity between entity temporal patterns, the semantic consistency score of entities and relations, and the decay factor based on time interval, the module evaluates the degree of influence of neighboring entities on the target entity at the current timestamp, and calculates the normalized soft weights of neighboring nodes. The time-enhanced aggregation module performs weighted message aggregation on the feature information of neighboring entities based on the soft weight, and generates a time-enhanced entity representation that integrates historical pattern information and current time semantics; the time-enhanced entity representation and relation representation are time-adapted and mapped by the time projection function to obtain the dynamic entity representation and dynamic relation representation corresponding to the current timestamp; The dynamic entity representation and dynamic relation representation are input into the scoring function to generate candidate entities or candidate relations, thereby completing the fact quadruple and updating the current timestamp subgraph sequence.
2. The pattern compatibility-aware completion method for long-tail entity reasoning in time-series knowledge graphs according to claim 1, characterized in that, The historical time-series knowledge graph is represented as a sequence of subgraphs with timestamps: ; in, Represents timestamp subgraph, For a collection of entities, For a set of relations, A set of fact quadruples; used for timestamps The reasoning task, its predecessor A time window is formed by several historical timestamps: ; in, This represents the length of the time window.
3. The pattern compatibility-aware completion method for long-tail entity reasoning in temporal knowledge graphs according to claim 1, characterized in that, The first step of the event representation module is to construct a sequence of historical events for an entity. From the time window The historical events in which it participated are collected to form a sequence of physical historical events: ; in, For the first The relationship type of an event, To and Entities that interact, The timestamp of the event. This indicates the entity's role in the event. The number of historical events; the sequence of historical events of the entity is used for subsequent time-series pattern learning and retains the time sequence information of the events.
4. The pattern compatibility-aware completion method for long-tail entity reasoning in temporal knowledge graphs according to claim 3, characterized in that, The second step of the event representation module is to generate event hidden state representations for entity historical event sequences. Every event in Construct event vectors: ; in, For time coding functions, The earliest event timestamp in the sequence, symbol " " indicates a vector concatenation operation; Event hidden states are generated iteratively using a temporal coding network: ; in, For the first The hidden state vector of each event. and For learnable parameters, time decay factor , These are learnable parameters.
5. The pattern compatibility-aware completion method for long-tail entity reasoning in temporal knowledge graphs according to claim 4, characterized in that, The third step of the event representation module is to perform attention-weighted aggregation on the event latent state sequence to generate time-sensitive entity event embeddings: ; ; in, For learnable attention vectors, For attention weights, For entities The temporal pattern basis vectors.
6. The pattern compatibility-aware completion method for long-tail entity reasoning in temporal knowledge graphs according to claim 5, characterized in that, The mode compatibility assessment module includes the following steps: (1) Time-adaptive state generation: For query entities and its neighboring entities Obtain the historical time-series pattern base of neighboring entities And determine the most recent occurrence time. Projecting the historical pattern base onto the current prediction time : ; in, For learnable projection matrices, For time encoding functions; (2) Construction of compatibility input vector: The historical pattern base of the query entity and its neighboring entities. Time adaptation status and relative time encoding Concatenate the vectors to form a compatible input vector: 。 7. The pattern compatibility-aware completion method for long-tail entity reasoning in temporal knowledge graphs according to claim 6, characterized in that, Calculate the schema compatibility score and relation semantic consistency score of neighboring entities: ; ; in, For the Sigmoid function, For entity vectors, For relation vectors, Represents the neighbor entity 𝑜 in relation to the query entity. Pattern compatibility score at time t The semantic consistency score between entities and relations is calculated, and the reasonableness of the entity-relation-entity triple is measured by vector distance.
8. The pattern compatibility-aware completion method for long-tail entity reasoning in temporal knowledge graphs according to claim 7, characterized in that, The soft weights of neighboring entities are calculated using the time decay factor and then normalized. ; ; in, The time decay coefficient, , The time decay factor, Indicates the neighboring entity at the current time The weight of the impact on the queried entity.
9. The pattern compatibility-aware completion method for long-tail entity reasoning in temporal knowledge graphs according to claim 8, characterized in that, The time-enhanced aggregation module is based on the soft weight of neighboring entities. Message aggregation is performed on neighbor information to generate updated entity representations: ; in, For the initial representation of the entity, For learnable matrices, For activation function, This represents the number of aggregation layers.
10. The pattern-compatible perceptual completion method for long-tail entity reasoning in temporal knowledge graphs according to claim 9, characterized in that, Final aggregated entity representation With relation vector Construct a scoring function to rank candidate entities or events, enabling knowledge graph completion or future event prediction: ; in, The final aggregation layer is defined by a scoring function used to measure the credibility or similarity of candidate quadruples, and to rank candidate sets that are missing head entities, tail entities, or relations.