A supply chain knowledge graph construction method based on time sequence dynamic perception and large language model
By using a method based on temporal dynamic perception and a large language model, the problems of insufficient time dynamic modeling and inefficient long-cycle dependency capture in complex equipment supply chains are solved. This enables dynamic evolution modeling of knowledge graphs and efficient utilization of domain knowledge, thereby improving the effectiveness of risk assessment and emergency dispatch.
Patent Information
- Application Number
- CN202511455403.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-13
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-10-13
AI Technical Summary
Existing methods for constructing temporal knowledge graphs suffer from insufficient time dynamic modeling, inefficient long-cycle dependency capture, and lack of domain semantic fusion in complex equipment supply chains, which limits their application effectiveness in risk assessment and emergency dispatch.
We adopt a method based on temporal dynamic perception and large language model. By combining a time-aware embedding module, a graph structure aggregation module, and a gated temporal evolution module with a pre-trained large language model, we can dynamically capture the temporal evolution rules of entities and relations and generate candidate entities or relations to complete fact quadruples.
It realizes dynamic evolution modeling and long-cycle dependency capture of knowledge graphs for complex equipment supply chains, improves end-to-end traceability and decision support capabilities, and ensures the reliability and interpretability of the construction results.
Smart Images

Figure CN120930757B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of knowledge graph construction technology, and in particular to a method for constructing a supply chain knowledge graph based on temporal dynamic perception and a large language model. Background Technology
[0002] As the complex equipment manufacturing industry evolves towards intelligence and globalization, supply chain networks have developed into large-scale, complex systems encompassing multi-level suppliers, cross-regional nodes, and dynamic interactive events. In typical complex equipment fields such as aero-engines and high-end CNC machine tools, a single product involves over a thousand suppliers, and supply disruptions of key components (such as turbine blades and precision bearings) can trigger cascading reactions lasting for months. Such systems face three temporal challenges in knowledge graph representation: supply chain disruptions, such as the Suez Canal blockage in 2021 leading to global shipping delays, and supplier relationship migrations, such as automakers urgently switching suppliers due to chip shortages, require precise quantification of the non-linear changes of entities / relationships over time; the impact of key events has a significant lag, requiring the modeling of causal chains across time windows, such as changes in semiconductor lithography machine component suppliers, which require tracing the technology cooperation graph over three years to predict capacity risks; and sudden events, such as factory shutdowns caused by the pandemic, can lead to data gaps, requiring the integration of domain semantics for reasoning and completion.
[0003] However, existing methods for constructing temporal knowledge graphs, while incorporating a time dimension, still have limitations. First, dynamic time modeling is insufficient. Existing methods often treat time as a static, additional feature, failing to establish an intrinsic connection between time and the evolution of entities / relationships. The time-encoding model proposed in "A Reasoning Model Integrating Time Encoding and Time-Distributed Attention, Computer Technology and Development, 2025, Vol. 35, No. 6, pp. 182-188," while introducing a time-influence factor, lacks a dynamic scaling mechanism for time decay effects, making it difficult to accurately model the time-varying intensity of supply chain emergencies. Second, long-cycle dependency capture is inefficient. RNN-based temporal models are limited by short-term memory and cannot effectively capture causal chains across time windows. For example, patent CN120408064A integrates graph attention networks through GRU, but its differentiated processing of historical snapshots is insufficient, leading to inadequate modeling of the lagging impact of key events. Third, domain semantic fusion is lacking. Existing technologies have not effectively combined semantic generation capabilities to address the problem of knowledge sparsity. Patent CN120235597A directly applies Transformer to decode timing embedding, but fails to adapt to the unique "order-inventory-logistics" domain knowledge of the supply chain, resulting in poor interpretability.
[0004] These issues limit the effectiveness of complex equipment supply chain knowledge graphs in scenarios such as risk assessment and emergency dispatch. Therefore, there is an urgent need for a novel construction method that deeply integrates time-dynamic characteristics, accurately models the evolution of entities / relationships, and efficiently utilizes the semantic generation capabilities of large language models to improve the traceability and decision support capabilities of the entire supply chain. Summary of the Invention
[0005] To address the issues of insufficient time sensitivity, difficulty in modeling long-cycle dependencies, and high cost of domain knowledge adaptation caused by static embedding in temporal knowledge graphs, this invention proposes a supply chain knowledge graph construction method based on temporal dynamic perception and a large language model.
[0006] The technical solution of this invention is as follows: A method for constructing a supply chain knowledge graph based on temporal dynamic perception and a large language model, comprising the following steps:
[0007] Obtain the historical time-series knowledge graph of the complex equipment supply chain and represent it as a sequence of time-stamped subgraphs; based on the time-stamped subgraph sequence, determine the fact quadruple to be completed at the current time stamp, where the missing content is the head entity, tail entity, or relation;
[0008] A time-series dynamic perception model is constructed to encode and learn the timestamped subgraph sequence; the time-series dynamic perception model includes a time-aware embedding module, a graph structure aggregation module, and a gated time-series evolution module;
[0009] The time-aware embedding module generates a time-sensitive entity embedding matrix for entities in each subgraph within the historical time window, and generates a time-sensitive relationship embedding matrix for relationships in each subgraph within the historical time window.
[0010] In the graph structure aggregation module, a time-sensitive entity embedding matrix is input to the entity aggregator to generate an aggregated embedding representation of the target entity; a time-sensitive relation embedding matrix is input to the relation aggregator to generate an aggregated embedding representation of the target relation; both the aggregated embedding representations of the target entity and the aggregated embedding representations of the target relation are input to the gated temporal evolution module.
[0011] The gated temporal evolution module uses a gated cyclic unit to establish an autoregressive model to learn the dependencies of subgraphs in the time series, generating entity temporal evolution representations and relational temporal evolution representations;
[0012] The temporal evolution representations of entities and relations are input into a pre-trained large language model, which generates candidate entities or candidate relations to complete the fact quadruples and update the subgraph sequence of the current timestamp.
[0013] The historical time-series knowledge graph is specifically as follows:
[0014] Historical time-series knowledge graphs are represented as sequences of timestamped subgraphs. ,in Indicates the current timestamp In the subgraph, E is the set of entities, and R is the set of relations. For a set of fact quadruples, The head entity representing the facts, The tail entity representing the facts, Representational relationship; for the current timestamp The construction task, its predecessor A historical subgraph sequence with timestamps is defined as Historical time window definition ,in This is the preset time window length.
[0015] The time-aware embedding module is specifically:
[0016] For any timestamp entity and relationships Generate initial embedding vectors for each entity. Initial embedding vector of relations ,in, For entities The initial state, For relationship The initial state, , For the embedded dimension;
[0017] Calculate timestamps For entities Time influence factor of each feature and timestamp Relationship Time influence factor of each feature :
[0018]
[0019]
[0020] in, , It is a learnable weight matrix. Normalize along the vector dimension, It's a timestamp. The initial embedding vectors, including the initial entity embedding vector and the initial relation embedding vector, are initialized using a Time2Vec variant based on supply chain cycle characteristics:
[0021]
[0022] in, These are the period frequency parameters of the original Time2Vec. This represents the phase offset of a periodic function. , The supply chain event attenuation coefficient is introduced for the non-periodic variation function. This is the supply chain time sparsity compensation coefficient. Let be the projection matrix of the linear terms;
[0023] Calculate the time scaling factor To model the time decay effect:
[0024]
[0025] in, For the current prediction timestamp With historical timestamps The absolute time difference For smoothing coefficients;
[0026] Through time influence factor and time scaling factor Integrate time information into timestamps From the initial entity embedding vector and the initial relation embedding vector, obtain the entity embedding vector containing time information. and relational embedding vectors containing time information :
[0027]
[0028]
[0029] Where ReLU is the modified linear unit activation function. and These represent scalar multiplication and Hadamard product, respectively.
[0030] Combined timestamps By analyzing all entity embedding vectors containing time information and relation embedding vectors containing time information, a time-sensitive entity embedding matrix is obtained. Embedding matrix of time-sensitive relationships :
[0031]
[0032]
[0033] in, , It is the number of entities. , It represents the number of relationships.
[0034] The graph structure aggregation module is specifically as follows:
[0035] The entity aggregator is a graph neural network model that receives time-sensitive entity embedding matrices. By aggregating the neighbor entity information of the target entity, an aggregated embedded representation of the target entity is generated. ;
[0036] The relation aggregator is a graph neural network model that receives time-sensitive relation embedding matrices. By aggregating the neighbor entity information of the target relationship, an aggregated embedding representation of the target relationship is generated. ;
[0037] in, Represents timestamp Lower entity Aggregate embedding representation, Represents timestamp Relationship Aggregate embedding representation, and As input to the gated temporal evolution module, it is used to model the temporal evolution representation of entities and the temporal evolution representation of relations.
[0038] The gated timing evolution module is specifically as follows:
[0039] The target entity aggregation embedding representation and the target relation aggregation embedding representation output by the graph structure aggregation module are arranged in chronological order to form an entity aggregation embedding sequence. and relational aggregation embedding sequence ,in, Represents entity aggregation embedding sequence, Represents a relational aggregation embedding sequence. ;
[0040] Each GRU unit includes a reset gate. Update door Candidate hidden state and the current hidden state The system resets the degree of forgetting of historical information controlled by the gate, updates the proportion of new information integrated into the gate, adjusts historical information based on the candidate hidden state based on the reset gate, and balances the old and new information by combining the current hidden state with the updated gate.
[0041] Input entity aggregation embedding sequence Iterative calculations are performed using the first GRU unit:
[0042]
[0043]
[0044]
[0045]
[0046] in, For entity GRU at timestamp The reset door, For entity GRU at timestamp The update gate, For entity GRU at timestamp The candidate hidden state, For entity GRU at timestamp The current hidden state, For the Sigmoid function, , , For a learnable parameter matrix, For entity GRU at timestamp The hidden state is initially a zero vector;
[0047] Input relation aggregation embedding sequence Iterative calculations are performed using the second GRU unit:
[0048]
[0049]
[0050]
[0051]
[0052] in, For relational GRU in timestamp The reset door, For relational GRU in timestamp The update gate, For relational GRU in timestamp The candidate hidden state, For relational GRU in timestamp The current hidden state, For the Sigmoid function, , , For a learnable parameter matrix, For relational GRU in timestamp The hidden state is initially a zero vector;
[0053] The entity is encoded by the hidden state of the last time step of the entity GRU by iteratively calculating the hidden state of all timestamps within the time window. Temporal evolution representation The relation is encoded by the hidden state of the last time step of the relation GRU. Temporal evolution representation ,in, This represents the hidden state of the entity's GRU at the last time step. For the hidden state of the relation GRU at the last time step, , , For entity aggregation, embed sequence, For relation aggregation, embed sequences;
[0054] Will , They are input together into a pre-trained large language model to generate candidate entities or candidate relations.
[0055] The pre-trained large language model employs a LoRA fine-tuning strategy for domain adaptation, specifically:
[0056] In the weight matrix of the pre-trained large language model Injecting low-rank parameter increments Update it to The low-rank parameter increment This can be represented by low-rank decomposition as follows:
[0057]
[0058] in, The left matrix of the low-rank decomposition. It is the right matrix of the low-rank decomposition. It is rank and satisfies , , Weight matrices The number of rows and columns.
[0059] The pre-trained large language model generates candidate entities or candidate relations to complete the fact quadruples, specifically:
[0060] The entity temporal evolution representation and relational temporal evolution representation output by the gated temporal evolution module are converted into natural language descriptions through a text decoder to generate entity semantically enhanced descriptions and relational semantically enhanced descriptions.
[0061] Obtain contextual information for a pre-trained large language model, wherein the contextual information is obtained based on historical subgraph sequences. The known fact quadruple Generate negative samples and extract neighbor information;
[0062] The generation of negative samples specifically involves the following steps: For a fact quadruple to be completed, if a tail entity is missing, then based on the known head entity and relation, extract the set of tail entities connected to the head entity under that relation, and randomly sample tail entities not in that set as negative samples; if a head entity is missing, then based on the known tail entity and relation, extract the set of head entities connected to the tail entity under that relation, and randomly sample head entities not in that set as negative samples; if a relation is missing, then based on the known head entity and tail entity, extract the set of relations connecting the head entity and tail entity, and randomly sample relations not in that set as negative samples.
[0063] The extraction of neighbor information involves obtaining the set of neighbors that are directly or indirectly connected to the known entity in the historical subgraph of the fact quadruple to be completed, satisfying the custom path depth, and controlling the information scale through random sampling; if the content to be completed is a relation, then the set of neighbor entities of the known head entity and tail entity is obtained, and the information scale is also controlled through sampling.
[0064] Transform the knowledge graph completion task into a question-answering task, and construct a prompt template based on contextual information;
[0065] The fact quadruple to be completed at the current timestamp , and Input a pre-trained large language model and decode it to generate a candidate set;
[0066] The candidate set generated by the pre-trained large language model is double-validated. First, predictions that conflict with the existing knowledge graph are filtered out. Then, the rationality of the generated entities is evaluated by the auxiliary large language model. If the set threshold is met, it is determined to be a valid new fact and used to update the subgraph sequence of the current timestamp.
[0067] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0068] By integrating time-influence factors and time scaling factors into the time-aware embedding module, the temporal evolution patterns of entities and relationships are dynamically captured, addressing the shortcomings of traditional static embedding methods in modeling dynamic events in the supply chain. Furthermore, by designing dual GRU units in the gated temporal evolution module to process entity sequences and relationship sequences respectively, and utilizing reset and update gates to regulate cross-window information flow, the ability to capture long-cycle dependencies is significantly improved, overcoming the information truncation defects caused by fixed time windows. Through a LoRA fine-tuning strategy, a low-rank adaptation matrix is introduced into the pre-trained large language model, preserving general semantic understanding capabilities while deeply integrating supply chain domain knowledge, reducing training resource consumption and improving the domain consistency of the generated results. The method described in this invention achieves a balance between dynamic evolution modeling, long-cycle dependency capture, and efficient utilization of domain knowledge in the construction of temporal knowledge graphs for complex equipment supply chains, ensuring the reliability and interpretability of the constructed results. Attached Figure Description
[0069] Figure 1 This is a flowchart of the supply chain knowledge graph construction method based on time-series dynamic perception and large language model used in embodiments of the present invention;
[0070] Figure 2 This is a process diagram of the time-series dynamic sensing model used in the embodiments of the present invention;
[0071] Figure 3 This is a flowchart illustrating the application of the pre-trained large language model used in embodiments of the present invention. Detailed Implementation
[0072] 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.
[0073] A supply chain knowledge graph construction method based on temporal dynamic perception and a large language model extracts the evolutionary features of entities and relationships through a temporal dynamic perception model and integrates the semantic reasoning capabilities of a large language model to achieve knowledge graph construction. The temporal dynamic perception model comprises a collaborative three-level structure: a time-aware embedding module, targeting each subgraph within a historical time window, quantifies the time decay effect and nonlinear time-varying characteristics of supply chain events through dynamic fusion of time influence factors and time scaling factors, generating time-sensitive entity embedding matrices and time-sensitive relationship embedding matrices; a graph structure aggregation module uses entity aggregators and relationship aggregators to perform multi-hop neighbor aggregation, extracting entity association structures and relational semantic information; and a gated temporal evolution module designs dual GRU units to independently process entity sequences and relationship sequences, regulating cross-window information flow through reset and update gates to generate temporal evolution representations of entities and relationships that encode long-term dependencies. The pre-trained large language model is injected with supply chain domain knowledge through the LoRA fine-tuning strategy, which reduces training resource overhead while retaining the general semantic understanding ability of the pre-trained large language model. It also constructs a question-and-answer prompt template to guide the pre-trained large language model to generate candidate entities / relationships, ensuring reliable construction.
[0074] The following is a detailed description of a specific implementation method for constructing a supply chain knowledge graph based on temporal dynamic perception and a large language model, which aims to help understand the technical solution and operation steps of the present invention.
[0075] See Figure 1 The method includes the following steps:
[0076] S110. Obtain the historical time-series knowledge graph of the complex equipment supply chain and represent it as a sequence of subgraphs with timestamps; based on the sequence of subgraphs with timestamps, determine the fact quadruple to be completed under the current timestamp, whose missing content includes head entity, tail entity or relation;
[0077] S120. Construct a time-series dynamic perception model, including a time-aware embedding module, a graph structure aggregation module, and a gated time-series evolution module. The time-aware embedding module generates a time-sensitive entity embedding matrix for entities in each subgraph within a historical time window and a time-sensitive relation embedding matrix for relations in each subgraph within a historical time window. The graph structure aggregation module inputs the time-sensitive entity embedding matrix into an entity aggregator and the time-sensitive relation embedding matrix into a relation aggregator to further mine the structural and semantic information of entities and relations. The gated time-series evolution module uses a gated recurrent unit (GRU) to establish an autoregressive model to learn the dependencies of subgraphs in the time series, generating entity time-series evolution representations and relation time-series evolution representations.
[0078] S130. Input the entity temporal evolution representation and the relation temporal evolution representation into the pre-trained large language model, and generate candidate entities or candidate relations by the pre-trained large language model to complete the fact quadruple and update the subgraph sequence of the current timestamp.
[0079] In this embodiment, the detailed implementation steps of step S110 include:
[0080] S111. Data Acquisition and Preprocessing: Historical interaction data is extracted from the complex equipment supply chain database, including structured data such as purchase orders, logistics records, and production plans, as well as unstructured data such as contract texts and equipment logs. A joint extraction model based on BERT-BiLSTM-CRF is used to extract entities and relationships from the unstructured text, constructing an initial knowledge graph. Timestamps are normalized; in this embodiment, they are divided by week to ensure consistent time intervals and eliminate time-conflicting entries, thus forming a historical time-series knowledge graph.
[0081] S112. Timestamp Subgraph Partitioning: Representing the historical time-series knowledge graph as a continuous sequence of subgraphs based on timestamps. Each subgraph Includes all entity, relation, and fact quadruples within this time window. If the time interval is one week, then Indicates the first Weekly supply chain status. Define historical time windows. ,in, In this embodiment, the preset time window length is taken as... .
[0082] S113. Constructing Quadruples to be Completed: Detecting the Current Subgraph Based on Rule-Based and Statistical Methods The missing facts in the problem are formalized as a quadruple to be completed, with the missing head entity being the missing fact. Missing tail entity and missing relationship .
[0083] As described in steps S111-S113 above, this invention constructs a basic framework for a time-series knowledge graph of a complex equipment supply chain by integrating multi-source heterogeneous data and extracting entity relationships. It also ensures the temporal consistency and structural integrity of historical data through timestamp normalization and conflict item cleaning. Furthermore, it constructs a four-tuple of facts to be completed based on rules and statistical methods, providing a highly reliable input benchmark for dynamic completion tasks.
[0084] In this embodiment, the detailed implementation steps of step S120 include:
[0085] S121, see reference Figure 2The time-aware embedding module obtains data as follows: for any timestamp... entity and relationships Generate initial embedding vectors for each entity. Initial embedding vector of relations ,in For entities The initial state, For relationship Initial state, , For the embedded dimension;
[0086] Calculate timestamps For entities Time influence factor of each feature and timestamp Relationship Time influence factor of each feature :
[0087]
[0088]
[0089] in, , It is a learnable weight matrix. Normalize along the vector dimension, It's a timestamp. The initial embedding vectors, including the initial entity embedding vector and the initial relation embedding vector, are initialized using a Time2Vec variant based on supply chain cycle characteristics:
[0090]
[0091] in, These are the period frequency parameters of the original Time2Vec. This represents the phase offset of a periodic function. and subscript , The supply chain event attenuation coefficient is introduced for the non-periodic variation function. This is the supply chain time sparsity compensation coefficient (greater than 1 in sparse time periods and less than 1 in dense time periods). Let be the projection matrix of the linear terms;
[0092] Calculate the time scaling factor To model the time decay effect:
[0093]
[0094] in, For the current prediction timestamp With historical timestamps The absolute time difference As a smoothing coefficient, in this embodiment, let To avoid the denominator being zero, and to maintain the smoothness of the decay curve;
[0095] Through time influence factor and time scaling factor Integrate time information into timestamps From the initial entity embedding vector and the initial relation embedding vector, obtain the entity embedding vector containing time information. and relational embedding vectors containing time information :
[0096]
[0097]
[0098] ReLU is the modified linear unit activation function, used to filter negative temporal interference. and These represent scalar multiplication and Hadamard product, respectively.
[0099] Combined timestamps The entity embedding vectors containing time information and the relation embedding vectors containing time information are used to obtain the time-sensitive entity embedding matrix. Embedding matrix of time-sensitive relationships :
[0100]
[0101]
[0102] in, , It is the number of entities. , It represents the number of relationships.
[0103] S122, Graph Structure Aggregation Module: Embeds time-sensitive entities into a matrix. Input to the entity aggregator, embedding time-sensitive relationships into the matrix. The input is fed into the relation aggregator; the entity aggregator aggregates the structural information of neighboring entities based on a graph convolutional network, while the relation aggregator captures the semantic features of relations by combining multi-relation graph convolutional networks, generating a target entity aggregation embedding representation containing both structural and semantic information. Aggregation Embedding Representation with Target Relationship ;in, Represents timestamp Lower entity Aggregate embedding representation, Represents timestamp Relationship Aggregate embedding representation.
[0104] S123, Gated Temporal Evolution Module: Arranges the target entity aggregation embedding representation and target relation aggregation embedding representation output by the graph structure aggregation module into entity aggregation embedding sequences in chronological order. and relational aggregation embedding sequence ,in, Represents entity aggregation embedding sequence, Represents a relational aggregation embedding sequence. ;
[0105] Each GRU unit includes a reset gate. Update door Candidate hidden state and the current hidden state The system resets the degree of forgetting of historical information controlled by the gate, updates the proportion of new information integrated into the gate, adjusts historical information based on the candidate hidden state based on the reset gate, and balances the old and new information by combining the current hidden state with the updated gate.
[0106] Input entity aggregation embedding sequence Iterative calculations are performed using the first GRU unit:
[0107]
[0108]
[0109]
[0110]
[0111] in, For entity GRU at timestamp The reset door, For entity GRU at timestamp The update gate, For entity GRU at timestamp The candidate hidden state, For entity GRU at timestamp The current hidden state, For the Sigmoid function, , , For a learnable parameter matrix, For entity GRU at timestamp The hidden state is initially a zero vector;
[0112] Input relation aggregation embedding sequence Iterative calculations are performed using the second GRU unit:
[0113]
[0114]
[0115]
[0116]
[0117] in, For relational GRU in timestamp The reset door, For relational GRU in timestamp The update gate, For relational GRU in timestamp The candidate hidden state, For relational GRU in timestamp The current hidden state, For the Sigmoid function, , , For a learnable parameter matrix, For relational GRU in timestamp The hidden state is initially a zero vector;
[0118] The entity is encoded by the hidden state of the last time step of the entity GRU by iteratively calculating the hidden state of all timestamps within the time window. Temporal evolution representation The relation is encoded by the hidden state of the last time step of the relation GRU. Temporal evolution representation ,in, This represents the hidden state of the entity's GRU at the last time step. For the hidden state of the relation GRU at the last time step, , , For entity aggregation, embed sequence, For relation aggregation, embed sequences;
[0119] Will , The data are input into a pre-trained large language model to generate candidate entities or candidate relations. As described in steps S121-S123 above, this invention constructs a time-sensitive entity embedding matrix and a time-sensitive relation embedding matrix through the dynamic fusion of time influence factors and time scaling factors. Furthermore, through autoregressive temporal modeling using a graph structure aggregation module and gated recurrent units (GRUs), it ensures the ability to capture the dynamic evolution features of the supply chain temporal knowledge graph and accurately characterize long-term dependencies.
[0120] In this embodiment, see Figure 3 The detailed implementation steps of step S130 include:
[0121] S131, LoRA Fine-tuning: A low-rank adaptation matrix (LoRA) is introduced into the fully connected layer of the pre-trained large language model. The original parameters remain unchanged, and only the newly added low-rank matrix is trained to reduce training resource consumption and adapt to supply chain domain knowledge. A cross-entropy loss model is used for optimization, with the loss function as follows:
[0122]
[0123] in, , This represents a fact quadruple at a timestamp. authenticity, This indicates that the fact is true. This indicates that the fact is not established. and These represent the normalized scores of the negative and positive samples, respectively. This represents the ratio of positive to negative samples.
[0124] S132, Semantic Enhancement Description Generation: The entity temporal evolution representation and relation temporal evolution representation output by the gated temporal evolution module are converted into natural language descriptions through a text decoder to generate entity semantic enhancement descriptions and relation semantic enhancement descriptions, which serve as the input context for the pre-trained large language model;
[0125] S133. Negative Sample Generation: For a fact quadruple to be completed, if the tail entity is missing, then based on the known head entity and relation, extract the set of tail entities connected to the head entity under that relation, and randomly sample tail entities not in that set as negative samples; if the head entity is missing, then based on the known tail entity and relation, extract the set of head entities connected to the tail entity under that relation, and randomly sample head entities not in that set as negative samples; if the relation is missing, then based on the known head entity and tail entity, extract the set of relations connecting the head entity and tail entity, and randomly sample relations not in that set as negative samples.
[0126] S134, Neighbor Information Extraction: For a known entity in the fact quadruple to be completed, obtain the set of neighbors that are directly or indirectly connected to the entity in the historical subgraph, satisfying the custom path depth, and control the information scale through random sampling. In this example, the path depth is set to 2. If the content to be completed is a relation, obtain the set of neighbor entities of the known head entity and tail entity, and control the information scale through sampling in the same way.
[0127] S135. Prompt Template Construction: The knowledge graph completion task is transformed into a question-answering task. A prompt template, Prompt, is constructed by combining contextual information. The Prompt template is designed as follows:
[0128] (1) For the quadruple to be completed The template is: "Based on historical information: {entity}" Semantic description of entities The neighboring entities, and the relationships In the time window Evolutionary characteristics within {relationships} Semantic augmentation description}, predicting in time Time through relationships and What is the associated tail entity?
[0129] (2) For the quadruple to be completed The template is: "Based on historical information: {entity}" Semantic description of entities The neighboring entities, and the relationships In the time window Evolutionary characteristics within {relationships} Semantic augmentation description}, predicting in time Time and Through relationships What is the associated header entity?
[0130] (3) For the quadruplets to be completed The template is: "Based on historical information: {entity}" Semantic description of entities The neighboring entities}, and {entity} Semantic description of entities The neighboring entities, combined with the time window Internal entity interaction features, predicting in time hour and What is the most likely relationship between them?
[0131] S136. Candidate Generation and Verification: Generate and verify the fact quadruples to be completed under the current timestamp. , and Input a pre-trained large language model and decode it to generate a Top-K candidate set. Double-validate the candidate set generated by the pre-trained large language model. First, filter out predictions that conflict with the existing knowledge graph. Then, evaluate the rationality of the generated entities by assisting the pre-trained large language model. If the set threshold is met, it is determined to be a valid new fact and used to update the subgraph sequence of the current timestamp. In this example, the threshold is set to 0.7.
[0132] The above-disclosed embodiments are merely preferred embodiments of the present invention, but the present invention is not limited thereto. Other embodiments obtained by those skilled in the art based on the above description of the present invention without departing from the principles of the present invention should all fall within the scope of protection of the present invention.
Claims
1. A method for constructing a supply chain knowledge graph based on temporal dynamic perception and a large language model, characterized in that, Includes the following steps: Obtain the historical time-series knowledge graph of the complex equipment supply chain and represent it as a sequence of time-stamped subgraphs; based on the time-stamped subgraph sequence, determine the fact quadruple to be completed at the current time stamp, where the missing content is the head entity, tail entity, or relation; A time-series dynamic perception model is constructed to encode and learn the timestamped subgraph sequence; the time-series dynamic perception model includes a time-aware embedding module, a graph structure aggregation module, and a gated time-series evolution module; The time-aware embedding module generates a time-sensitive entity embedding matrix for entities in each subgraph within the historical time window, and generates a time-sensitive relationship embedding matrix for relationships in each subgraph within the historical time window. In the graph structure aggregation module, a time-sensitive entity embedding matrix is input to the entity aggregator to generate an aggregated embedding representation of the target entity; a time-sensitive relation embedding matrix is input to the relation aggregator to generate an aggregated embedding representation of the target relation. Both the aggregated embedding representation of the target entity and the aggregated embedding representation of the target relation are input into the gated temporal evolution module; The gated temporal evolution module uses a gated cyclic unit to establish an autoregressive model to learn the dependencies of subgraphs in the time series, generating entity temporal evolution representations and relational temporal evolution representations; The entity temporal evolution representation and the relation temporal evolution representation are input into the pre-trained large language model, and the pre-trained large language model generates candidate entities or candidate relations to complete the fact quadruples and update the subgraph sequence of the current timestamp. The historical time-series knowledge graph is specifically as follows: Historical time-series knowledge graphs are represented as sequences of timestamped subgraphs. ,in Indicates the current timestamp In the subgraph, E is the set of entities, and R is the set of relations. For a set of fact quadruples, The head entity representing the facts, The tail entity representing the facts, Representational relationship; for the current timestamp The construction task, its predecessor A historical subgraph sequence with timestamps is defined as Historical time window is defined as ,in, The preset time window length; The time-aware embedding module is specifically: For any timestamp entity and relationships Generate initial embedding vectors for each entity. Initial embedding vector of relations ,in, For entities The initial state, For relationship The initial state, , For the embedded dimension; Calculate timestamps For entities Time influence factor of each feature and timestamp Relationship Time influence factor of each feature : ; ; in, , It is a learnable weight matrix. Normalize along the vector dimension, It's a timestamp The initial embedding vectors, including the initial entity embedding vector and the initial relation embedding vector, are initialized using a Time2Vec variant based on supply chain cycle characteristics: ; in, These are the period frequency parameters of the original Time2Vec. This represents the phase offset of a periodic function. , The supply chain event attenuation coefficient is introduced for the non-periodic variation function. This is the supply chain time sparsity compensation coefficient. Let be the projection matrix of the linear terms; Calculate the time scaling factor To model the time decay effect: ; in, For the current prediction timestamp With historical timestamps The absolute time difference For smoothing coefficients; Through time influence factor and time scaling factor Integrate time information into timestamps From the initial entity embedding vector and the initial relation embedding vector, obtain the entity embedding vector containing time information. and relational embedding vectors containing time information : ; ; Where ReLU is the modified linear unit activation function. and These represent scalar multiplication and Hadamard product, respectively. Combined timestamps By analyzing all entity embedding vectors containing time information and relation embedding vectors containing time information, a time-sensitive entity embedding matrix is obtained. Embedding matrix of time-sensitive relationships : ; ; in, , It is the number of entities. , It represents the number of relationships.
2. The method for constructing a supply chain knowledge graph based on temporal dynamic perception and a large language model according to claim 1, characterized in that, The graph structure aggregation module is specifically as follows: The entity aggregator is a graph neural network model that receives time-sensitive entity embedding matrices. By aggregating the neighbor entity information of the target entity, an aggregated embedded representation of the target entity is generated. ; The relation aggregator is a graph neural network model that receives time-sensitive relation embedding matrices. By aggregating the neighbor entity information of the target relationship, an aggregated embedding representation of the target relationship is generated. ; in, Represents timestamp Lower entity Aggregate embedding representation, Represents timestamp Relationship Aggregate embedding representation, and As input to the gated temporal evolution module, it is used to model the temporal evolution representation of entities and the temporal evolution representation of relations.
3. The method for constructing a supply chain knowledge graph based on temporal dynamic perception and a large language model according to claim 2, characterized in that, The gated timing evolution module is specifically as follows: The target entity aggregation embedding representation and the target relation aggregation embedding representation output by the graph structure aggregation module are arranged in chronological order to form an entity aggregation embedding sequence. and relational aggregation embedding sequence , ; Each GRU unit includes a reset gate. Update door Candidate hidden state and the current hidden state The system resets the degree of forgetting of historical information controlled by the gate, updates the proportion of new information integrated into the gate, adjusts historical information based on the candidate hidden state based on the reset gate, and balances the old and new information by combining the current hidden state with the updated gate. Input entity aggregation embedding sequence Iterative calculations are performed using the first GRU unit: ; ; ; ; in, For entity GRU at timestamp The reset door, For entity GRU at timestamp The update gate, For entity GRU at timestamp The candidate hidden state, For entity GRU at timestamp The current hidden state, For the Sigmoid function, , , For a learnable parameter matrix, For entity GRU at timestamp The hidden state is initially a zero vector; Input relation aggregation embedding sequence Iterative calculations are performed using the second GRU unit: ; ; ; ; in, For relational GRU in timestamp The reset door, For relational GRU in timestamp The update gate, For relational GRU in timestamp The candidate hidden state, For relational GRU in timestamp The current hidden state, For the Sigmoid function, , , For a learnable parameter matrix, For relational GRU in timestamp The hidden state is initially a zero vector; The entity is encoded by the hidden state of the last time step of the entity GRU by iteratively calculating the hidden state of all timestamps within the time window. Temporal evolution representation The relation is encoded by the hidden state of the last time step of the relation GRU. Temporal evolution representation ,in, This represents the hidden state of the entity's GRU at the last time step. For the hidden state of the relation GRU at the last time step, , , For entity aggregation, embed sequence, Aggregate embedded sequences for relations; , They are input together into a pre-trained large language model to generate candidate entities or candidate relations.
4. The method for constructing a supply chain knowledge graph based on temporal dynamic perception and a large language model according to claim 1, characterized in that, The pre-trained large language model employs a LoRA fine-tuning strategy for domain adaptation, specifically: In the weight matrix of the pre-trained large language model Injecting low-rank parameter increments Update it to The low-rank parameter increment This can be represented by low-rank decomposition as follows: ; in, The left matrix of the low-rank decomposition. It is the right matrix of the low-rank decomposition. It is rank and satisfies , , Weight matrices The number of rows and columns.
5. The method for constructing a supply chain knowledge graph based on temporal dynamic perception and a large language model according to claim 1, characterized in that, The pre-trained large language model generates candidate entities or candidate relations to complete the fact quadruples, specifically: The entity temporal evolution representation and relational temporal evolution representation output by the gated temporal evolution module are converted into natural language descriptions through a text decoder to generate entity semantically enhanced descriptions and relational semantically enhanced descriptions. Obtain contextual information for a pre-trained large language model, wherein the contextual information is obtained based on historical subgraph sequences. The known fact quadruple Generate negative samples and extract neighbor information; The generation of negative samples is specifically as follows: For a fact quadruple to be completed, if the tail entity is missing, then based on the known head entity and relation, extract the set of tail entities connected to the head entity under the relation, and randomly sample tail entities not in the set as negative samples; if the head entity is missing, then based on the known tail entity and relation, extract the set of head entities connected to the tail entity under the relation, and randomly sample head entities not in the set as negative samples. If a relationship is missing, then based on the known head entity and tail entity, extract the set of relationships connecting the head entity and tail entity, and randomly sample relationships not in the set as negative samples; The extraction of neighbor information involves obtaining the set of neighbors that are directly or indirectly connected to the known entity in the historical subgraph of the fact quadruple to be completed, satisfying the custom path depth, and controlling the information scale through random sampling; if the content to be completed is a relation, then the set of neighbor entities of the known head entity and tail entity is obtained, and the information scale is also controlled through sampling. Transform the knowledge graph completion task into a question-answering task, and construct a prompt template based on contextual information; The fact quadruple to be completed at the current timestamp , and Input a pre-trained large language model and decode it to generate a candidate set; The candidate set generated by the pre-trained large language model is double-validated. First, predictions that conflict with the existing knowledge graph are filtered out. Then, the rationality of the generated entities is evaluated by the auxiliary large language model. If the set threshold is met, it is determined to be a valid new fact and used to update the subgraph sequence of the current timestamp.
Citation Information
Patent Citations
Human resource data analysis method and system based on time sequence knowledge graph
CN120235597A
Time sequence knowledge graph prediction method based on continuous features and large model
CN120408064A
Time-varying knowledge graph embedding characterization method based on lifelong learning
CN118861310A
Time sequence knowledge graph completion method based on large model guidance
CN120086591A