Link prediction method and system for time sequence knowledge graph
By introducing graph convolution networks and timing dynamic processing modules into knowledge graph inference, combined with the self-attention mechanism, the problem of difficulty in capturing complex time characteristics in the existing technology is solved, and efficient and accurate timing knowledge graph inference is achieved.
Patent Information
- Application Number
- CN202411960013.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-08
AI Technical Summary
Existing knowledge graph inference methods are difficult to effectively capture complex time characteristics, such as repetition, periodicity and persistence, which leads to the inference results being unsatisfactory and inefficient in computing, which cannot meet the needs of practical applications.
The timing knowledge graph link prediction method based on graph convolution network (GCN) and timing dynamic processing module is adopted to extract graph structure characteristics through relationship graph convolution network (RGCN), and the timing dynamic information is captured using historical frequency units (HFU) and historical correspondence units (HCU), and dynamically adjust the weights between nodes in combination with the self-attention mechanism.
Effectively capture the complex temporal characteristics of historical events, improve the accuracy and efficiency of timing reasoning, be able to interact with historical data within different time periods, quickly predict future events, and provide accurate inference results.
Smart Images

Figure CN119783825A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of knowledge graphs and time series data analysis, and specifically to a time series knowledge graph link prediction method and system based on a graph convolutional network (GCN) and a time series dynamic processing module. Background Art
[0002] With the development of big data, artificial intelligence, and knowledge graph technology, the application of knowledge graphs in agricultural production management, precision planting, and intelligent agricultural decision-making has become increasingly important. Knowledge graphs represent crops, environmental factors (such as climate, soil moisture, etc.) and their relationships, and construct a data representation method with high semantic association, which greatly improves the availability and intelligence of agricultural information. However, entities and relationships in actual agricultural scenarios often have the characteristics of temporal evolution; for example, the changes in crop growth status in different seasons, the dynamic impact of meteorological conditions on crop growth, or the spatiotemporal characteristics of pest and disease transmission. These temporal characteristics bring huge challenges to the reasoning of agricultural knowledge graphs, especially in scenarios that require accurate prediction of crop growth status or optimization of resource allocation. How to effectively capture the laws of temporal evolution has become the key to solving the problem of agricultural intelligence.
[0003] Most existing knowledge graph reasoning methods are based on static graph structures and lack the ability to effectively model temporal information. In static knowledge graphs, entity relationships are usually simplified to a time-agnostic way for reasoning, which makes the model unable to effectively capture complex temporal features such as the periodicity, repetitiveness, and duration of events. In practical applications, temporal information has a crucial impact on the reasoning results. For example, the frequent occurrence of events may mean a high probability of similar events occurring again in the future, while the impact of past events will gradually decay in the long run. These phenomena cannot be fully modeled by traditional static knowledge graph link prediction methods.
[0004] Current temporal knowledge graph reasoning methods face many challenges. First, existing models have difficulty capturing the complex temporal characteristics of historical events, such as repetitiveness, periodicity, and continuity, resulting in less than ideal accuracy of reasoning results. Second, these models are usually unable to effectively integrate graph structure information with temporal information, which limits the model's ability to handle entity relationships and temporal dependencies. In addition, as the scale of the knowledge graph increases, the computational efficiency of the model decreases significantly, especially when dealing with long time spans, the reasoning speed and performance cannot meet the needs of actual applications. Finally, many models fail to make full use of historical events and ignore the important role of historical events in current and future reasoning, resulting in a lack of in-depth understanding of the historical context in the reasoning process.
[0005] Therefore, there is an urgent need for a time series knowledge graph reasoning method that can effectively capture complex time features in the time series knowledge graph, process historical information and dynamic changes in real time, and improve reasoning accuracy and efficiency. This method should be able to interact with historical data in different time periods, make full use of time dependencies, quickly predict future events, and provide accurate reasoning results. Summary of the invention
[0006] Purpose of the invention: In order to overcome the above shortcomings, the purpose of the present invention is to provide a method and system for predicting links in a temporal knowledge graph based on a graph convolutional network (GCN) and a temporal dynamic processing module. Combining the graph convolutional network with the temporal dynamic processing technology, the method can effectively capture the complex temporal characteristics of historical events and fully consider the dynamic evolution law of the temporal knowledge graph. The method is suitable for processing knowledge graph reasoning tasks with time dependencies and can improve the accuracy and efficiency of temporal reasoning.
[0007] In order to solve the above technical problems, the present invention provides a link prediction method for a temporal knowledge graph, the method comprising the following steps: S1: Extract entity, relationship and timestamp information from the original data source, build a temporal knowledge graph containing nodes (entities) and edges (relationships), and record the evolution of entities and relationships over time through timestamps; S2: Clean the constructed time series knowledge graph, remove redundant, invalid or repeated entities and relationships, format timestamps uniformly, and slice the time series data according to the set time unit for subsequent time series analysis; S3: The preprocessed temporal knowledge graph is input into the graph structure processing module, and the structural features of the graph are extracted using the relational graph convolutional network (RGCN) with a self-attention mechanism. RGCN updates the node embedding by aggregating node neighbor information. The self-attention mechanism assigns attention weights according to the similarity between neighbor nodes and the current node to enhance the interaction effect between nodes. S4: The time series dynamic processing module captures time series dynamic information through the historical frequency unit (HFU) and the historical correspondence unit (HCU). The HFU adjusts the weight according to the historical event frequency and the time decay factor. The HCU calculates the similarity between the current time point and the historical time point to extract relevant historical information and improve the accuracy of time series modeling. S5: Combine the outputs of the graph structure processing module and the temporal dynamic processing module to generate the reasoning results of the temporal knowledge graph and predict the future evolution of relationships. Specifically, the structural features output by the graph structure processing module and the temporal features output by the temporal dynamic processing module are integrated into the same representation space through a weighted fusion mechanism, and the fused features are input into a unified reasoning layer to generate a prediction of the evolution of future relationships.
[0008] As a preferred embodiment of the present application, in S1, the method further comprises the following steps: Initialize the time series knowledge graph data and import raw data such as entities, relationships, and timestamps from existing databases or preset data sources.
[0009] As a preferred embodiment of the present application, in S2, the method further comprises the following steps: S21: Clean the data in the time series knowledge graph to remove redundant, invalid or erroneous data records; S22: Standardize the timestamps and convert all the timestamps into a unified format; S23: Preprocessing of entities and relationships to ensure that each entity and relationship has a unique identifier and establish the association relationship between them; S24: Time series sharding, dividing the data into multiple sub-time periods according to the time window.
[0010] As a preferred embodiment of the present application, in S22, the method further includes the following steps: S221: Convert all timestamps to a preset date format; S222: Calculate the duration of the start and end time of the event and use it as a time feature.
[0011] As a preferred embodiment of the present application, in S23, the method further includes the following steps: S231: Assign a unique identifier to each entity to ensure that each entity has a unique number; S232: Classify and label the relationships between entities, ensuring that each relationship has a clear type; S233: Establish an index of entities and relationships. By building the index, subsequent entity and relationship search and matching are accelerated.
[0012] As a preferred embodiment of the present application, in S24, the method further includes the following steps: S241: Determine the time window: select an appropriate time window size for data sharding; S242: Generate sub-time periods: divide the data into multiple sub-time periods; S243: Allocate time period labels: assign labels or indexes to each segmented time period.
[0013] As a preferred embodiment of the present application, in S3, the method further comprises the following steps: S31: Use a relational graph convolutional network to extract local structural information in the graph and model the relationship between entities through a neighborhood aggregation mechanism to generate embedded representations of nodes and edges; S32: Self-attention mechanism: calculate the similarity score between each node and its neighbors and dynamically adjust the attention weights of neighbor nodes based on the similarity score.
[0014] As a preferred embodiment of the present application, in S4, the method further comprises the following steps: S41: Adjust the impact of historical events on the current moment by recording the frequency of occurrence and relationship strength of historical events and using the time decay factor; including: recording the number of times each event in the time series knowledge graph occurs at different time points, recording the strength of the relationship between entities and recording the duration or frequency of the relationship between entities, tracking the continuous participation or influence of entities on the relationship, and dynamically adjusting the impact of historical events using the time decay factor; S42: By calculating the similarity between historical time points and current time points, the weight of historical information is dynamically adjusted to ensure that the model can effectively capture complex time dependencies; including: calculating the cosine similarity between the current time point and the historical time point and giving greater weight to historical events with higher similarity based on the similarity calculation results, extracting historical events that are most relevant to the current moment and ignoring irrelevant events.
[0015] As a preferred embodiment of the present application, in S5, the method further comprises the following steps: S51: Map the structural features and temporal features to a shared representation space and fuse the structural features and temporal features through a weighted fusion mechanism; S52: Input the fused features into a unified reasoning layer for link prediction of the temporal knowledge graph.
[0016] The present application also provides a link prediction system for a temporal knowledge graph using the link prediction method, comprising: The historical frequency unit is used to record the frequency of occurrence and relationship strength of historical events, and use the time decay factor to adjust the impact of historical events on the current moment; The historical correspondence unit is used to dynamically adjust the weight of historical information by calculating the similarity between historical time points and current time points, ensuring that the model can effectively capture complex time dependencies; The graph construction module is used to construct a time series knowledge graph based on the entities, relationships and timestamp information in the original data; A data processing module, used for performing data preprocessing according to the temporal knowledge graph; A graph structure processing module, used to extract structural features using a relational graph convolutional network according to the temporal knowledge graph; The time series dynamic processing module is used to calculate the similarity between the current time point and the historical time point and process the information of historical events; The link prediction module is used to map the structural features and temporal features to a shared representation space and fuse the structural features and temporal features through a weighted fusion mechanism, and then input the fused features into a unified reasoning layer for link prediction of the temporal knowledge graph.
[0017] The above technical solution of the present application has the following advantages compared with the prior art: 1. This application starts with the construction of a temporal knowledge graph, and improves the accuracy and efficiency of temporal reasoning by integrating graph structure processing and temporal dynamic processing. The local structural features of entities and their neighboring nodes are extracted through the relational graph convolutional network (RGCN), and the self-attention mechanism is introduced to dynamically adjust the weights between nodes to enhance the ability to capture complex relationships and graph features; then, the temporal dynamic processing module records the frequency of events and the strength of relationships through the historical frequency unit (HFU), and adjusts the impact of historical events on the current moment in combination with the time decay factor; the historical correspondence unit (HCU) calculates the similarity between historical time points and current time points to extract the most relevant historical information at the current moment; finally, the model combines graph structure features with temporal dynamic features to achieve accurate prediction of future relationship evolution, and is suitable for temporal reasoning tasks in multiple application scenarios.
[0018] 2. Through the self-attention mechanism, it can effectively distinguish the importance of different relationships, reduce over-smoothing, improve the distinctiveness of node representation, and enhance sensitivity to time changes. This enhanced RGCN can extract richer and more meaningful features in complex graph data, thereby improving the performance of downstream tasks (such as link prediction, node classification, etc.). BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0020] Figure 1 It is a flowchart of a link prediction method for a temporal knowledge graph provided by an embodiment of the present invention.
[0021] Figure 2 It is a schematic diagram of an RGCN module with a self-attention mechanism provided in an embodiment of the present invention.
[0022] Figure 3 It is a flow chart of a data preprocessing method provided by an embodiment of the present invention.
[0023] Figure 4It is a flowchart of a method combining a self-attention mechanism provided in an embodiment of the present invention.
[0024] Figure 5 It is a flow chart of a method for adding a historical frequency unit and a historical corresponding unit provided by an embodiment of the present invention.
[0025] Figure 6 It is a schematic diagram of a historical frequency module HFU provided by an embodiment of the present invention.
[0026] Figure 7 It is a schematic diagram of a history correspondence module HCU provided in an embodiment of the present invention.
[0027] Figure 8 It is a schematic diagram of module connections of a link prediction system for a temporal knowledge graph provided by an embodiment of the present invention.
[0028] Description of the Figures in the Specification: 101. Historical frequency unit, 102. Historical correspondence unit, 103. Graph construction module, 104. Data processing module, 105. Graph structure processing module, 106. Time series dynamic processing module, 107. Link prediction module. DETAILED DESCRIPTION
[0029] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0030] In order to solve the above technical problems, this application proposes a link prediction method for temporal knowledge graphs. In order to better demonstrate the application of this method, this application will further elaborate on the typical scenario of crop growth.
[0031] Therefore, reference Figure 1 and Figure 2 As shown, in some embodiments, a link prediction method for a temporal knowledge graph is involved, and the method includes the following steps: S1: Construct an agricultural time-series knowledge graph, which includes entities such as crops, environmental factors, management measures, and their relationships and timestamp information, representing the evolution of these entities and their relationships over time.
[0032] Specifically, in S1, the process of building a temporal knowledge graph includes: S11: Initialize the agricultural time series knowledge graph data, import the original data such as crop entities, relationships between crops and timestamps from existing databases or other data sources, ensure that the data set contains time series information, and capture the time series dynamic relationship during the growth process of crops.
[0033] S2: Process the entities, relationships and timestamp information in the agricultural time series knowledge graph data to clean it, remove redundant and invalid information, and shard the time series data for subsequent time series dependency analysis.
[0034] Specifically, refer to Figure 3 As shown, in S2, the process of processing the temporal knowledge graph data includes: S21: Clean the data. Clean the imported data to remove redundant, invalid or erroneous data records (such as growth stages or meteorological data recorded repeatedly in the same time period) to ensure high data quality and no duplication or incomplete items.
[0035] Among them, in S21, the data cleaning process includes: S211: Remove duplicate records, check whether there are duplicate entity, relationship or event records in the agricultural dataset, and remove these redundant data.
[0036] S212: Fill missing values. For records with missing values, use a reasonable filling method to complete them. For records with missing time information, estimate them based on the context or adjacent time points.
[0037] S213: Eliminate invalid data and remove illogical or invalid records (such as unavailable growth stages or records with negative precipitation).
[0038] S22: Standardize the timestamps in the data and convert all timestamps in different formats into a unified date and time format to ensure the comparability between timestamps, thereby facilitating subsequent time series analysis.
[0039] Among them, in S22, the timestamp standardization process includes: S221: Convert all timestamps in different formats to the standard ISO 8601 date format (YYYY-MM-DDHH), using regular expressions or predefined conversion functions to process date and time fields in different formats.
[0040] S222: For the time interval representing the start time and end time of the event (such as "the wheat tillering period lasts for 10 days"), calculate the duration of the time interval (end time - start time) and use it as a new time feature. This step can generate a new time attribute through the time difference calculation formula.
[0041] S23: Preprocessing of entities and relationships, classifying and organizing the entities and relationships of crops, ensuring that each crop entity and relationship has a unique identifier (ID), and establishing the association relationship between them.
[0042] Among them, in S23, the preprocessing process of entities and relationships includes: S231: Assign a unique identifier to each entity (such as "Wheat 001" or "Soil Moisture - Farm A"), and use a hash algorithm or auto-increment primary key to ensure that each entity has a unique ID to avoid data conflicts or duplications.
[0043] S232: Classify and label the relationships between entities (e.g. "wheat-precipitation" is an influencing relationship, and "wheat-temperature" is an auxiliary relationship), ensuring that each relationship has a clear type (e.g. cooperative relationship, belonging relationship, etc.) to facilitate subsequent modeling and reasoning.
[0044] S233: Establish an index of entities and relationships. By building an index (based on the structure of a hash table), subsequent entity and relationship search and matching are accelerated.
[0045] S24: Time series sharding: sharding the data into time windows according to the timestamp, and dividing the data with a long time span into multiple sub-time periods for subsequent time series dependency analysis.
[0046] Among them, in S24, the time series sharding process includes: S241: Determine the time window, and select an appropriate time window size according to the requirements of the analysis task to segment the data with a long time span; for example, the wheat growth status data is segmented by week to facilitate subsequent time series analysis.
[0047] S242: Generate sub-time periods, and divide the data into multiple sub-time periods according to the time window, to ensure that the events, relationships, and entity information in each time period remain intact.
[0048] S243: Allocate time period labels, and assign labels or indexes to each segmented time period to facilitate the model to identify and process event information in different time periods.
[0049] S3: The preprocessed agricultural knowledge graph data is input into the graph structure processing module to extract graph features, and the relational graph convolutional network (RGCN) is used to extract the structural features in the graph data.
[0050] Specifically, refer to Figure 4 As shown, in S3, the process of combining the self-attention mechanism includes: S31: The graph structure processing module uses the relational graph convolutional network (RGCN) to extract local structural information in the graph, models the relationship between entities through the neighborhood aggregation mechanism, integrates the information of crop nodes (such as "wheat plot 1") and their neighbor nodes (such as "temperature" and "precipitation"), and generates embedded representations of nodes and edges; S32: According to the temporal knowledge graph link prediction method of claim 1, it is characterized in that in step S2, the graph structure processing module is also combined with a self-attention mechanism, which first calculates the similarity score between each node and its neighbors, and then assigns different attention weights to the neighbor nodes based on these scores. After the introduction of the self-attention mechanism, the update formula of RGCN is further expanded to: in, represents the embedding representation of node v at layer l+1, Represents the attention weight of neighbor node u on target node v. This weight is calculated through the self-attention mechanism and represents the influence of neighbor node u on node v. The self-attention mechanism can dynamically adjust this weight to highlight important neighbor node information; is the activation function, is the weight shared by the layers, used to project the features of the nodes into the new feature space; is the entity embedding of neighbor node u at the lth layer.
[0051] S4: The graph embedding and time information output from the graph structure processing module are input into the time series dynamic processing module, and the information of historical events is processed through the historical frequency unit (HFU) and the historical correspondence unit (HCU), and the impact of historical events on the current crop growth prediction is dynamically adjusted.
[0052] Specifically, refer to Figure 5 As shown, in S4, the process of adding the historical frequency unit (HFU) and the historical correspondence unit (HCU) includes: S41: The Historical Frequency Unit (HFU) records the frequency of occurrence and relationship strength of environmental factors during the growth of crops, and uses the time decay factor to adjust the impact of historical events on the current moment according to the passage of time.
[0053] Among them, reference Figure 6 As shown, in S41, the process of adjusting the impact of historical events on the current moment includes: S411: For each event in the time series knowledge graph (such as "wheat field 1-humidity-high-timestamp"), count its frequency of occurrence in history; illustratively, for example, record the number of occurrences of the event that the humidity is "high" during the wheat tillering period in different time periods as input for humidity frequency to growth prediction.
[0054] S412: In addition to frequency, the HFU also records the strength of the relationship between entities; for example, whether a continuous increase in humidity significantly affects wheat tiller height.
[0055] S413: The influence of historical events is dynamically adjusted using a time decay factor. As time goes by, the influence of historical events on the current prediction gradually weakens. Specifically, a decay formula can be used; for example: in, is the influence of the event on the current moment, λ is the time decay factor, is the current time, is the time when the event occurs. As the difference between the time when the event occurs and the current time increases, the influence gradually weakens.
[0056] S42: The History Correspondence Unit (HCU) extracts the historical information most relevant to the current moment from the history. By calculating the similarity between the historical time point and the current time point, it can effectively capture complex time dependencies, ensuring that the model not only relies on the frequency information in time, but also dynamically adjusts the weight of the historical information.
[0057] Among them, reference Figure 7 As shown, in S42, the process of dynamically adjusting the weight of historical information includes: S421: Calculate the similarity between the historical time point and the current time point. By calculating the cosine similarity between the current time point and the historical time point, determine which historical events are most relevant to the current prediction. The similarity calculation method is: in, and The embedding vectors are respectively the current time point and the historical time point. According to the similarity results, higher weights are given to related historical events. For example, time points with higher similarity between the current temperature and the historical temperature are given greater weights to increase their contribution to the current prediction.
[0058] S422: Based on the similarity calculation results, HCU will dynamically adjust the weights of relevant historical events. Historical events with higher relevance will be given greater weights to ensure that these events have a greater influence on the current prediction in reasoning.
[0059] S423: Extract the most relevant historical information. After similarity calculation, HCU will extract the historical information most relevant to the current moment. Through this operation, the model can automatically select the historical events that best meet the current prediction needs and ignore irrelevant historical information, thereby improving the accuracy of reasoning and extracting the most relevant humidity and temperature information from the historical time period with the highest similarity for the prediction of the growth status of the current jointing period.
[0060] S5: By combining the graph structure processing module with the temporal dynamic processing module, the temporal knowledge graph reasoning results of the crop growth process are generated, and the evolution of the relationship between future crop growth status, management measures and environmental changes is predicted.
[0061] Specifically, in S5, the output process of fusing the graph structure processing module and the temporal dynamic processing module includes: S51: Map the structural features output by the graph structure processing module and the temporal features output by the temporal dynamic processing module to a shared representation space, integrate the two types of information through a weighted fusion mechanism, input the fused features into a unified reasoning layer, and output the growth status prediction results for a certain period of time in the future.
[0062] For example, leaf area index and biomass at the end of the tillering period of wheat can be predicted to generate specific agronomic recommendations (such as whether additional irrigation or fertilization is needed).
[0063] Therefore, in order to verify the effectiveness of the proposed invention example, this example algorithm is compared with the existing advanced algorithms on the datasets ICEWS14, ICEWS05-15 and ICEWS18. For specific experimental results, please refer to Figure 2 As shown. After the model converges, this example algorithm shows significant improvement in the two key indicators of MRR (Mean Reciprocal Rank) and Hits@K (K is 1, 3, 10); this shows that this example algorithm has obvious advantages in prediction accuracy, modeling ability of time series relationships, and the ability to cover potential correct answers. These technical advantages are of great significance for the practical application of time series knowledge graphs (such as time-sensitive knowledge reasoning and dynamic knowledge recommendation), and fully verify the innovation and technological advancement of the present invention.
[0064] The specific data are shown in the following table: refer to Figure 2 As shown, in the self-attention mechanism, node v is assigned attention weight by calculating the similarity with its neighbor node u; Figure 2 The feature update process is shown in Figure 2, where the weights are adjusted based on the similarity between the neighboring nodes and the current node.
[0065] In some embodiments, the self-attention mechanism in S3 further includes: The present application also relates to a relational graph convolutional network (RGCN) model based on a self-attention mechanism. First, a self-attention mechanism is introduced into the traditional RGCN, and the model calculates the similarity scores between nodes. Specifically, the self-attention mechanism linearly transforms the embedding vectors of nodes v and u through the transformation matrix W, and calculates their combined representation. After being processed by a nonlinear activation function, a preliminary similarity score is obtained. Then, the scores of all neighbor nodes are normalized so that the sum of their weights is 1. The neighbor nodes with higher similarity scores have a greater influence on node v.
[0066] Then update the node embedding using the following formula: in, and Layer The entity embedding of the moment, is the normalization constant, is the weight parameter, σ is the activation function. Secondly, the self-attention module is integrated in each layer of RGCN, so that the model can better focus on important relationships and enhance the effectiveness of information transfer. Finally, by connecting all entity embeddings, the entity representation under the timestamp is formed, and the expression is: in, Represents the entity representation at timestamp t, reflecting the characteristics of all nodes at this moment.
[0067] Through the self-attention mechanism, the model can effectively distinguish the importance of different relationships, reduce over-smoothing, improve the distinguishability of node representations, and enhance sensitivity to time changes. This enhanced RGCN can extract richer and more meaningful features in complex graph data, thereby improving the performance of downstream tasks (such as link prediction, node classification, etc.).
[0068] refer to Figure 6 As shown, the time decay factor mechanism is involved to dynamically adjust the influence of historical events on current predictions. The specific formula is: The influence of historical events I According to the current time The time difference with the time of historical events Linear attenuation is performed, λ is the attenuation factor, and as the time difference increases, the influence of historical events gradually weakens.
[0069] Therefore, as the time difference increases, the influence of historical events gradually weakens, making recent events have greater weight on current predictions. This linear decay mechanism is simple and efficient, and can balance short-term and long-term dependencies, ensuring that periodic or high-frequency events are appropriately weighted in future reasoning, significantly improving the prediction accuracy and processing efficiency of the model.
[0070] Therefore, this application actually proposes a link prediction method for time series knowledge graphs, which solves the shortcomings of existing models in capturing complex time features (such as periodicity, repeatability and persistence) by introducing graph structure processing modules and time series dynamic processing modules. The model first standardizes the timestamp data in the time series knowledge graph and extracts structural features through the relational graph convolutional network (RGCN). At the same time, historical events are dynamically adjusted through historical frequency units (HFU) and historical correspondence units (HCU) to further enhance the modeling capabilities of time dependency and event periodicity. Finally, the model greatly improves the reasoning accuracy and the ability to predict future relationship evolution by integrating structural and time series information. This method has strong technical advantages and can effectively integrate time series information with knowledge graph structure to accurately capture complex time features such as periodicity, repeatability and persistence. This method is suitable for tasks that require processing time series knowledge graph reasoning, especially in predicting the evolution of entity relationships with high accuracy and flexibility.
[0071] In some embodiments, reference Figure 8 As shown, the present application also relates to a link prediction system for a temporal knowledge graph using the above link prediction method, comprising: The historical frequency unit is used to record the frequency of occurrence and relationship strength of historical events, and use the time decay factor to adjust the impact of historical events on the current moment; The historical correspondence unit is used to dynamically adjust the weight of historical information by calculating the similarity between historical time points and current time points, ensuring that the model can effectively capture complex time dependencies; The graph construction module is used to construct a time series knowledge graph based on the entities, relationships and timestamp information in the original data; A data processing module, used for performing data preprocessing according to the temporal knowledge graph; A graph structure processing module, used to extract structural features using a relational graph convolutional network according to the temporal knowledge graph; The time series dynamic processing module is used to calculate the similarity between the current time point and the historical time point and process the information of historical events; The link prediction module is used to map the structural features and temporal features to a shared representation space and fuse the structural features and temporal features through a weighted fusion mechanism, and then input the fused features into a unified reasoning layer for link prediction of the temporal knowledge graph.
[0072] In some embodiments, the present application also relates to a computer medium having a computer program stored thereon, and the computer program is executed by a processor to implement the link prediction method for a temporal knowledge graph as described above.
[0073] In some embodiments, the present application also relates to a computer, comprising the computer medium described above. In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0074] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A link prediction method for temporal knowledge graph, characterized in that: The following steps are involved: S1: Construct a temporal knowledge graph based on the entities, relationships and timestamp information in the original data; S2: Perform data preprocessing according to the temporal knowledge graph; S3: According to the temporal knowledge graph, a relational graph convolutional network is used to extract structural features; S4: Calculate the similarity between the current time point and the historical time point, and process the information of historical events; S5: Generate the results of temporal knowledge graph reasoning and perform link prediction on the evolution of future relations.
2. A link prediction method for temporal knowledge graph according to claim 1, characterized in that: In S1, the method further comprises the following steps: Initialize the time series knowledge graph data and import raw data such as entities, relationships, and timestamps from existing databases or preset data sources.
3. A link prediction method for temporal knowledge graph according to claim 1, characterized in that: In S2, the method further comprises the following steps: S21: Clean the data in the time series knowledge graph to remove redundant, invalid or erroneous data records; S22: Standardize the timestamps and convert all the timestamps into a unified format; S23: Preprocessing of entities and relationships to ensure that each entity and relationship has a unique identifier and establish the association relationship between them; S24: Time series sharding, dividing the data into multiple sub-time periods according to the time window.
4. A link prediction method for temporal knowledge graph according to claim 3, characterized in that: In S22, the method further comprises the following steps: S221: Convert all timestamps to a preset date format; S222: Calculate the duration of the start and end time of the event and use it as a time feature.
5. The link prediction method for time series knowledge graph according to claim 3 is characterized in that: In S23, the method further comprises the following steps: S231: Assign a unique identifier to each entity to ensure that each entity has a unique number; S232: Classify and label the relationships between entities, ensuring that each relationship has a clear type; S233: Establish an index of entities and relationships. By building the index, subsequent entity and relationship search and matching are accelerated.
6. A link prediction method for temporal knowledge graph according to claim 3, characterized in that: In S24, the method further comprises the following steps: S241: Determine the time window: select an appropriate time window size for data sharding; S242: Generate sub-time periods: divide the data into multiple sub-time periods; S243: Allocate time period labels: assign labels or indexes to each segmented time period.
7. The link prediction method for time series knowledge graph according to claim 1, characterized in that: In S3, the method further comprises the following steps: S31: Use a relational graph convolutional network to extract local structural information in the graph and model the relationship between entities through a neighborhood aggregation mechanism to generate embedded representations of nodes and edges; S32: Self-attention mechanism: calculate the similarity score between each node and its neighbors and dynamically adjust the attention weights of neighbor nodes based on the similarity score.
8. The link prediction method for temporal knowledge graph according to claim 1, characterized in that: In S4, the method further comprises the following steps: S41: Adjust the impact of historical events on the current moment by recording the frequency of occurrence and relationship strength of historical events and using the time decay factor; including: recording the number of times each event in the time series knowledge graph occurs at different time points, recording the strength of the relationship between entities and recording the duration or frequency of the relationship between entities, tracking the continuous participation or influence of entities on the relationship, and dynamically adjusting the impact of historical events using the time decay factor; S42: By calculating the similarity between historical time points and current time points, the weight of historical information is dynamically adjusted to ensure that the model can effectively capture complex time dependencies; including: calculating the cosine similarity between the current time point and the historical time point and giving greater weight to historical events with higher similarity based on the similarity calculation results, extracting historical events that are most relevant to the current moment and ignoring irrelevant events.
9. The link prediction method for temporal knowledge graph according to claim 1, characterized in that: In S5, the method further comprises the following steps: S51: Map the structural features and temporal features to a shared representation space and fuse the structural features and temporal features through a weighted fusion mechanism; S52: Input the fused features into a unified reasoning layer for link prediction of the temporal knowledge graph.
10. A link prediction system for a temporal knowledge graph using the link prediction method according to any one of claims 1 to 9, characterized in that: include: The historical frequency unit is used to record the frequency of occurrence and relationship strength of historical events, and use the time decay factor to adjust the impact of historical events on the current moment; The historical correspondence unit is used to dynamically adjust the weight of historical information by calculating the similarity between historical time points and current time points, ensuring that the model can effectively capture complex time dependencies; The graph construction module is used to construct a time series knowledge graph based on the entities, relationships and timestamp information in the original data; A data processing module, used for performing data preprocessing according to the temporal knowledge graph; A graph structure processing module, used to extract structural features using a relational graph convolutional network according to the temporal knowledge graph; The time series dynamic processing module is used to calculate the similarity between the current time point and the historical time point and process the information of historical events; The link prediction module is used to map the structural features and temporal features to a shared representation space and fuse the structural features and temporal features through a weighted fusion mechanism, and then input the fused features into a unified reasoning layer for link prediction of the temporal knowledge graph.
Citation Information
Cited By
Cooperative control method for double bionic dexterous hands based on multi-agent system
CN120480930A