Edge optimization and enhanced vector embedding method of time-sensitive knowledge graph
By employing sliding time window aggregation and enhanced vector embedding methods, the problems of edge explosion and insufficient discriminative power of embedded vectors in time-sensitive knowledge graphs are solved, achieving efficient and accurate knowledge graph retrieval.
Patent Information
- Application Number
- CN202511694732.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-01-20
AI Technical Summary
Existing time-sensitive knowledge graphs face the "edge explosion" problem and insufficient discriminative power of embedded vectors under high-frequency data updates, resulting in high storage overhead, low retrieval efficiency and decreased accuracy.
By aggregating edges through a sliding time window and constructing enhanced vector embeddings, the number of edges and vector discriminability are optimized by combining multi-feature fusion and contrastive learning.
It effectively solves the "edge explosion" problem, reduces storage overhead by 60%~95%, improves retrieval accuracy by 35%~50%, recall rate by 25%~40%, and maintains time sensitivity.
Smart Images

Figure CN121365723A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of knowledge graph construction and intelligent information retrieval, and specifically refers to a time-sensitive knowledge graph edge optimization and enhanced vector embedding method, which contains edge number compression of time-sensitive knowledge graph (solving "edge explosion") and edge vector embedding optimization technology, and is especially suitable for knowledge graph scenarios that need to retain time dimension information (such as entity position, speed time sequence change), such as logistics track tracking, device state monitoring, dynamic scene decision-making, and knowledge graph construction and retrieval tasks in the fields of knowledge graph construction and retrieval. BACKGROUND
[0002] The existing time-sensitive knowledge graph technology mainly adds a timestamp to the edge between "entity node - entity node" and "entity node - attribute node" to realize the retention of time dimension information, and its core structure is "entity node - (relationship / numerical value, timestamp) - entity node / attribute node". However, this type of technology has two key problems:
[0003] "Edge explosion" problem: Due to the high frequency changes of time stamps (such as second-level, minute-level updates) and time-varying attribute values (such as real-time position, dynamic speed), the same entity pair (or entity - time-varying attribute pair) will generate a large number of edges with similar semantics but slightly different time / numerical value parameters. For example, a truck entity and a "speed" time-varying attribute node, which updates the speed value every 5 minutes, will generate 288 edges in 1 day, resulting in an exponential increase in the number of graph edges, significantly increasing the storage overhead and the computational complexity of retrieval.
[0004] The problem of insufficient distinction of edge embedding vectors: the existing technology directly maps the "relationship / numerical value + timestamp" of the edge into an embedding vector, but when the time stamp interval is very small (such as within 1 minute) or the time-varying attribute value changes slightly (such as the speed changes from 30km / h to 30.5km / h), the generated embedding vectors are highly similar, resulting in "false recall" (recalling irrelevant edges) or "missing recall" (not recalling target edges) during vector retrieval, and the retrieval accuracy and recall rate decrease significantly.
[0005] Currently, there is no technology that can simultaneously solve the "edge explosion" and "low distinction of embedding vectors" problems: simple edge deletion will lose time-sensitive information, and simple increase of embedding dimensions will further increase the computational overhead, which cannot meet the needs of efficient construction and accurate retrieval of time-sensitive knowledge graphs.
[0006] The time-sensitive knowledge graph is a graph that introduces an explicit time dimension on the basis of the entity and relationship representation of a traditional knowledge graph, and uses time-stamped edges to depict the time of occurrence of a fact and the dynamic change of an attribute. The core idea is to use a structured and computable graph model to express the evolution of the connection between entities and attributes over time, so that the downstream similarity retrieval, state identification and trend prediction have a consistent spatio-temporal semantic carrier. In typical scenarios such as logistics track tracking, equipment state monitoring and dynamic scene decision, time-varying elements such as location, speed, inventory, alarm and working condition are generated at a high frequency. If only tabular data is used for management, it is often difficult to retain the dependent structure and time evolution link between entities. If the data is organized in a time-sensitive knowledge graph, the semantic interpretability can be maintained, and the retrieval and reasoning across entities and time slices can be facilitated.
[0007] However, as the data refresh frequency increases to the minute level or even the second level, the time-sensitive knowledge graph faces two essential contradictions in engineering implementation. The first contradiction is the "edge explosion" problem caused by the rapid expansion of the edge scale. Because the same entity and target attribute are updated continuously in a short time, multiple edges with similar semantics but slightly different times or values will quickly accumulate. For example, a truck entity reports its speed and position every five minutes. Only the speed item may generate hundreds of time-stamped records in a day. If the position and oil quantity are added, the number of edges grows exponentially, directly increasing the storage and indexing costs, slowing down the vector retrieval and matching efficiency, and continuously putting pressure on the system throughput and delay indicators. The second contradiction is the insufficient discrimination of edge embedding representation. The mainstream approach is to jointly encode the "relationship or value and time" into a fixed-dimensional vector, but when the time interval is very short or the value fluctuates slightly, the obtained embedding vector is highly similar, resulting in false recall and missed recall in the nearest neighbor retrieval stage, and the accuracy and recall rate are simultaneously impaired. For online businesses that emphasize real-time and accuracy, this problem will directly translate into delay, false intervention or failure to timely handle the monitoring alarm.
[0008] The representative countermeasures of the prior art mainly come from two paths. The first type is edge reduction and offline compression for scale control, such as setting a fixed sampling rate, merging approximate edges according to a threshold rule, or periodically cleaning up early records. This path is easy to implement, but it is easy to lose time-sensitive key information, especially in scenarios with short-term mutations or slow drifts, where key behavior clues may be diluted too much. The second type is embedding enhancement for discrimination, such as increasing the vector dimension, introducing more complex time encoding, relationship encoding or stacking deeper neural network structures. This method can improve the discrimination to some extent, but it comes with a significant increase in model parameters and online comparison overhead, which is contrary to the engineering goal of low latency and high throughput. It can be seen that relying solely on edge deletion or solely on embedding enhancement cannot simultaneously meet the two core demands of "scale controllable" and "reliable retrieval". SUMMARY
[0009] The application provides a time-sensitive knowledge graph edge optimization and enhanced vector embedding method, which is applied to the field of graph calculation and includes the following steps:
[0010] Step one, realize sliding time window aggregation through edge optimization, and define a sliding time window , wherein is the window start time, is the window length, and the original edge that meets the following conditions is aggregated to generate an aggregated edge :
[0011] Condition 1: the starting node of the edge is the same entity node ;
[0012] Condition 2: the ending node of the edge is the same time-varying attribute node or the same entity node ;
[0013] Condition 3: the timestamp of the edge ;
[0014] Step two, realize multi-feature fusion and contrast learning through enhanced vector embedding, and for the aggregated edge , construct an enhanced embedding vector , including:
[0015] (1) feature extraction, extract five types of core feature vectors, namely entity semantic vector , relationship / numerical basis vector , time feature vector , time series fluctuation vector and time-varying attribute type vector ;
[0016] (2) attention weighted fusion, weight the above feature vectors through the attention mechanism to generate the final embedding vector, and the attention weight (meeting ) is calculated in the following manner:
[0017] wherein is a learnable attention parameter;
[0018] The final embedding vector is: ;
[0019] (3) contrast learning optimization, introduce an InfoNCE loss function to enlarge the distance between similar embedding vectors, and sample a positive example vector and a negative example vector to query the edge embedding .The loss function is:
[0020] ,
[0021] in For cosine similarity, For temperature parameters, This represents the number of negative examples.
[0022] 2. The edge optimization and enhanced vector embedding method for time-sensitive knowledge graphs according to claim 1, characterized in that step one, edge aggregation... The parameters are calculated using the following formula:
[0023] (1) Timestamp parameter: The time range is retained using an interval representation, i.e.
[0024] in For the window Original edge timestamp The mean;
[0025] (2) Time-varying attribute numerical parameters: If the termination node is Then the numerical parameters are statistical feature pairs. The numerical mean Numerical standard deviation ;
[0026] (3) Relationship parameters: If the terminating node is an entity node Then the original edge relation type is preserved. Only update timestamps Through this aggregation, within the same window Each original edge is replaced by a single aggregated edge, achieving an edge reduction ratio of up to [percentage missing]. To solve the problem of "side explosion".
[0027] Preferably, the entity semantic vector in step two above Entity nodes are processed using a pre-trained language model. The semantic description is encoded and has a dimension of .
[0028] Preferably, the relation / numerical basis vector in step two above Obtain it in the following way: If it is an "entity-entity" edge, That is, the relation vector, pre-trained from the TransE model; if it is an "entity-time-varying attribute" edge, That is, the numerical mean is encoded through a multilayer perceptron.
[0029] Preferably, the time feature vector in step two above The start / stop timestamp of is time-encoded, that is, . . .
[0030] Preferably, the time sequence fluctuation vector in the above step two is obtained by encoding the time change rate and the numerical fluctuation, wherein is the time window proportion, reflecting the time density; is the numerical fluctuation.
[0031] Preferably, the time-varying attribute type vector in the above step two is obtained by type encoding of the set of time-varying attribute nodes , and the dimension is .
[0032] Preferably, in the above step two, the sampling positive example vector is the aggregated edge of adjacent windows of the same entity-time-varying attribute pair, the negative example vector is the aggregated edge of different entity-time-varying attribute pairs; and the temperature parameter is set to 0.1-0.5.
[0033] The present application provides a device for implementing the above-mentioned edge optimization and enhanced vector embedding method of time-sensitive knowledge graph, comprising an edge optimization module and an enhanced vector embedding module,
[0034] The edge optimization module is used for aggregating a sliding time window, defining a sliding time window wherein is the window start time, is the window length, and aggregating the original edges satisfying the following conditions to generate an aggregated edge :
[0035] Condition 1: the start node of the edge is the same entity node ;
[0036] Condition 2: the end node of the edge is the same time-varying attribute node or the same entity node ;
[0037] Condition 3: the timestamp of the edge .
[0038] The parameters of the aggregated edge are calculated by the following formula:
[0039] (1) Timestamp parameter: interval representation is adopted to reserve the time range, that is,
[0040] wherein is the window is the mean of ;
[0041] (2) Time-varying attribute numerical parameter: if the termination node is , the numerical parameter is the statistical feature of , wherein (average value of numerical value), ;
[0042] (3) Relationship parameter: if the termination node is an entity node , the relationship type of the original edge is retained , and only the timestamp is updated to . Through this aggregation, the same window is replaced by 1 aggregated edge, and the edge compression ratio can reach ;
[0043] The enhanced vector embedding module is used for multi-feature fusion and contrast learning,
[0044] for the aggregated edge , to construct an enhanced embedding vector , the core formula is as follows:
[0045] (1) Feature extraction: extract 5 kinds of core feature vectors
[0046] Entity semantic vector : encoded by a pre-trained language model for semantic description of the entity node , the dimension is ; relationship / numerical basis vector : if it is an "entity - entity" edge, ; if it is an "entity - time-varying attribute" edge, ;
[0047] Time feature vector : time coding of the start / end timestamp of , that is ; time series fluctuation vector : encoding time change rate and numerical fluctuation, ; time-varying attribute type vector : encoded by the type of the time-varying attribute node , the dimension is ;
[0048] (2) Attention weighted fusion: the above feature vectors are weighted through an attention mechanism to generate the final embedding vector. The attention weight is defined as , the calculation mode is:
[0049] wherein is a learnable attention parameter, and the final embedding vector is:
[0050]
[0051] (3) contrastive learning optimization: introduce InfoNCE loss function, enlarge the distance of similar embedding vectors to query edge embedding , sample positive example vector and negative example vector , and the loss function is:
[0052] wherein is the cosine similarity, is the temperature parameter (set to 0.1~0.5), is the number of negative examples. Through the loss training, the discrimination of the embedding vector is improved.
[0053] The application provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to realize the above method.
[0054] The application forms a quantifiable, interpretable and landable effect closed loop around the collaborative mechanism of "edge optimization and enhanced vector embedding", and achieves significant benefits in edge scale control, retrieval accuracy improvement, time sensitivity reservation and engineering usability.
[0055] The application also has the following beneficial technical effects:
[0056] (1) solve the "edge explosion" problem: through sliding time window aggregation, the edge number compression ratio can reach (depending on the window length and update frequency), the storage cost is reduced by 60%~95%, the number of vector comparisons during retrieval is reduced, and the calculation efficiency is improved by more than 40%;
[0057] (2) improve the discrimination of embedding vectors: multi-feature fusion (time series fluctuation, attention weighting) reduces the cosine similarity of embedding vectors of similar edges from more than 0.95 to less than 0.7, contrastive learning further enlarges the difference, and the retrieval accuracy is improved by 35%~50%, and the recall rate is improved by 25%~40%;
[0058] (3) preserve time sensitivity: the time interval and the numerical fluctuation of the aggregated edge preserve the key information of the original time and value, and do not lose the time sensitive attribute, and are suitable for dynamic scenes (such as logistics track, equipment monitoring);
[0059] (4) Strong universality: window length , attention parameters Can be adjusted according to the scene, adapt to different time update frequency (second level, minute level, hour level) time sensitive knowledge graph. BRIEF DESCRIPTION OF DRAWINGS
[0060] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiments of the present application will be briefly introduced below. For those skilled in the art, without creative labor, other drawings can also be obtained according to these drawings.
[0061] Figure 1 The flow structure diagram of the edge optimization and enhanced vector embedding method of the time sensitive knowledge graph of the present application is shown;
[0062] Figure 2 The sliding time window edge aggregation flow diagram of the edge optimization and enhanced vector embedding method of the time sensitive knowledge graph of the present application is shown;
[0063] Figure 3 The enhanced vector embedding model structure diagram of the edge optimization and enhanced vector embedding method of the time sensitive knowledge graph of the present application is shown;
[0064] Figure 4 The retrieval flow diagram based on optimized embedding of the edge optimization and enhanced vector embedding method of the time sensitive knowledge graph of the present application is shown.
[0065] Reference signs: 1 - entity node (such as "truck A"); 2 - time-varying attribute node (such as "speed" "position"); 3 - original edge (with timestamp And numerical value ); 4 - "entity-entity" edge (with relationship And timestamp ); 5 - sliding time window ; 6 - original edge set; 7 - aggregation calculation module; 8 - aggregated edge (with time interval And numerical characteristics ); 9 - feature extraction layer (output ); 10 - attention weighting layer; 11 - contrast learning training layer; 12 - final embedding vector ; 13 - query input (entity + time-varying attribute + time range); 14 - query vector generation module; 15 - vector retrieval library (store aggregated edge embedding); 16 - retrieval result output (matching aggregated edge and original edge associated information). DETAILED DESCRIPTION
[0066] The features and exemplary embodiments of various aspects of the present application will be described below in detail, in order to make the purposes, technical solutions and advantages of the present application more clear and apparent, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are configured only to explain the present application and are not configured to limit the present application. The present application can be implemented without some of these specific details for those skilled in the art. The following description of the embodiments is only to provide a better understanding of the present application by showing examples of the present application.
[0067] The present application proposes a collaborative framework of "edge optimization and enhanced vector embedding". The general idea is: first, use a sliding time window to realize semantic aggregation of edges, and merge multiple original edges of the same entity and the same attribute or the same relationship within the window into an "aggregated edge". The aggregated edge replaces the single time stamp with a time interval, and describes the average level and fluctuation intensity of the numerical value within the window with statistical features, thereby significantly reducing the number of edges and the size of the vector library without sacrificing time sensitivity. Subsequently, an enhanced vector embedding is constructed around the aggregated edge, which significantly improves the separability between edges that should be similar, reduces neighbor mismatches, and improves retrieval quality through attention weighting and contrast learning.
[0068] In the "edge optimization" module, the key is to determine the window length and sliding step, and to give a stable and transferable aggregation criterion. For original edges that meet the same starting point entity, the same end point entity or the same time-varying attribute, and the time stamp falls within the same window, set aggregation is performed. The time characteristics of the aggregated edge are represented by the start and end time interval, which can serve time filtering and is convenient for backtracking; the numerical characteristics are expressed by the mean and standard deviation, the mean carries the trend information, and the standard deviation carries the fluctuation information; if it is an entity and entity relationship, the relationship type is retained and the time interval is updated. In this way, multiple edges with similar semantics within the same window are replaced by an aggregated edge, and the theoretical compression ratio has an interpretable relationship with the window length and the update frequency, which can significantly alleviate the storage and retrieval pressure.
[0069] In the "enhanced vector embedding" module, in addition to the traditional relationship or numerical basis representation, four types of complementary features are introduced. The first is the entity semantic representation, which uses a pre-trained language model to encode the entity description text, supplementing the semantic prior outside the structure. The second is the time position representation, which simultaneously encodes the start and end points of the time interval, making different aggregated edges comparable on the time axis. The third is the time series fluctuation representation, which explicitly quantifies the change rate and fluctuation intensity within the window, used to distinguish between stable states and rapid changes. The fourth is the attribute type representation, which reflects the differences in statistical physics between different time-varying attributes. The above features are adaptively weighted through attention mechanisms, highlighting the more discriminative components based on data distribution. In the training stage, a contrastive learning goal is introduced, selecting the same entity and the same attribute of adjacent windows as positive examples, and using aggregated edges of different entities or different attributes as negative examples. The temperature parameter is used to control the soft margin, widening the vector distance between easy-to-mix samples, and consolidating the encoding boundaries of semantic consistency and semantic difference.
[0070] The synergy framework has low coupling with existing composition and retrieval pipelines. The window and step size, attention and temperature, and other hyperparameters have clear physical meanings, making it easy to quickly calibrate with small samples during the gray period. Edge aggregation makes training samples more representative, alleviating overfitting caused by long-tail distribution; embedding enhancement also provides a quantitative basis for the pros and cons of window strategy, helping to make an interpretable compromise between time sensitivity and compression ratio. Ultimately, the system maintains the integrity of time links, supports traceability and explanation, while significantly reducing edge size and improving retrieval discrimination, meeting the engineering requirements of high concurrency and low latency.
[0071] As shown in Figure 1 , the present application provides an embodiment of a time-sensitive knowledge graph edge optimization and enhanced vector embedding method, applied in the field of graph computing, comprising the following steps:
[0072] Step one, as shown in Figure 2 , realize sliding time window aggregation through edge optimization, define the sliding time window , where is the window start time, is the window length, aggregate the original edges that meet the following conditions to generate aggregated edges :
[0073] Condition 1: the start node of the edge is the same entity node ;
[0074] Condition 2: the end node of the edge is the same time-varying attribute node or the same entity node ;
[0075] Condition 3: the timestamp of the edge ;
[0076] Step Two, as follows Figure 3 As shown, enhanced vector embedding is used to achieve multi-feature fusion and contrastive learning for aggregated edges. Constructing enhanced embedding vectors ,include:
[0077] (1) Feature extraction: extract entity semantic vectors Relational / Numerical Fundamental Vectors Time feature vector Time series fluctuation vector and time-varying attribute type vector Five types of core feature vectors;
[0078] (2) Attention-weighted fusion: The above feature vectors are weighted through an attention mechanism to generate the final embedding vector, and the attention weights are defined. (satisfy The calculation method is as follows:
[0079] in These are learnable attention parameters;
[0080] The final embedding vector is: ;
[0081] (3) Comparative learning optimization: Introduce the InfoNCE loss function to increase the distance between similar embedding vectors for query edge embedding. Sample positive vectors With negative instance vectors The loss function is:
[0082] ,
[0083] in For cosine similarity, For temperature parameters, This represents the number of negative examples.
[0084] In some embodiments, step one aggregates edges The parameters are calculated using the following formula:
[0085] (1) Timestamp parameter: The time range is retained using an interval representation, i.e.
[0086] in For the window Original edge timestamp The mean;
[0087] (2) Time-varying attribute numerical parameters: If the termination node is , the numerical parameter is the statistical feature of , wherein the numerical mean is , the numerical standard deviation is ;
[0088] (3) Relationship parameter: if the termination node is an entity node , the relationship type of the original edge is retained , and only the timestamp is updated to ; through this aggregation, the same window The original edge is replaced by 1 aggregated edge, and the edge compression ratio can reach , solving the "edge explosion" problem.
[0089] In some embodiments, the entity semantic vector in step two is obtained by encoding the semantic description of the entity node through a pre-trained language model, and has a dimension of .
[0090] In some embodiments, the relationship / numerical basis vector in step two is obtained in the following way: if it is an "entity - entity" edge, , the relationship vector is pre-trained from the TransE model; if it is an "entity - time-varying attribute" edge, , the numerical mean is encoded through a multi-layer perception machine.
[0091] In some embodiments, the time feature vector in step two is obtained in the following way: the start / end timestamp of is time-encoded, i.e. .
[0092] In some embodiments, the time series fluctuation vector in step two is obtained by encoding the time change rate and the numerical fluctuation, , wherein is the proportion of the time window, reflecting the time density; is the numerical fluctuation.
[0093] In some embodiments, the time-varying attribute type vector in step two is obtained by encoding the type of the time-varying attribute node , and has a dimension of .
[0094] In some embodiments, the sampled positive example vector in step two is the aggregated edge of the adjacent window of the same entity - time-varying attribute pair, and the negative example vector is the aggregated edge of different entity - time-varying attribute pairs; the temperature parameter is set to 0.1-0.5.
[0095] The application further provides a device embodiment of the edge optimization and enhanced vector embedding method of the time-sensitive knowledge graph.
[0096] The edge optimization module is configured to aggregate a sliding time window, define a sliding time window , and aggregate original edges that satisfy the following conditions to generate aggregated edges :
[0097] Condition 1: the starting node of the edge is the same entity node .
[0098] Condition 2: the ending node of the edge is the same time-varying attribute node or the same entity node .
[0099] Condition 3: the timestamp of the edge .
[0100] The parameters of the aggregated edge are calculated by the following formula:
[0101] (1) The timestamp parameter: the time range is represented by an interval, that is,
[0102] wherein is the mean value of the timestamps of the original edges in the window;
[0103] (2) The time-varying attribute value parameter: if the ending node is , the value parameter is the statistical feature , wherein is the value mean .
[0104] (3) The relationship parameter: if the ending node is the entity node , the relationship type of the original edge is retained , and only the timestamp is updated to . Through the aggregation, the original edges in the same window are replaced by one aggregated edge, and the edge compression ratio can reach .
[0105] The enhanced vector embedding module is configured to perform multi-feature fusion and contrast learning.
[0106] to the aggregated edge , construct enhanced embedding vectors , the core formula is as follows:
[0107] (1) Feature extraction: extract 5 kinds of core feature vectors
[0108] Entity semantic vector : encoded by pre-training language model for semantic description of entity node , dimension ; relationship / numerical basis vector : if it is an "entity - entity" edge, ; if it is an "entity - time-varying attribute" edge, ;
[0109] Time feature vector : time coding for the start / end timestamp of , that is ; timing fluctuation vector : encode time change rate and numerical fluctuation, ; time-varying attribute type vector : encoded by type for time-varying attribute node , dimension ;
[0110] (2) Attention weighted fusion: weight the above feature vectors through attention mechanism to generate the final embedding vector , which satisfies , the calculation method is:
[0111] where is the learnable attention parameter, and the final embedding vector is:
[0112]
[0113] (3) Contrastive learning optimization: introduce InfoNCE loss function to enlarge the distance of similar embedding vectors , sample positive example vector and negative example vector , the loss function is:
[0114] where is the cosine similarity, is the temperature parameter (set to 0.1~0.5), is the number of negative examples. Through this loss training, the discrimination of the embedding vector is improved;
[0115] Among them, the aggregation edge The parameters are calculated using the following formula:
[0116] (1) Timestamp parameter: The time range is retained using an interval representation, i.e.
[0117] in For the window Original edge timestamp The mean;
[0118] (2) Time-varying attribute numerical parameters: If the termination node is Then the numerical parameters are statistical feature pairs. The numerical mean Numerical standard deviation ;
[0119] (3) Relationship parameters: If the terminating node is an entity node Then the original edge relation type is preserved. Only update timestamps Through this aggregation, within the same window Each original edge is replaced by a single aggregated edge, achieving an edge reduction ratio of up to [percentage missing]. To solve the "side explosion" problem;
[0120] The entity semantic vector Entity nodes are processed using a pre-trained language model. The semantic description is encoded and has a dimension of ;
[0121] The relation / numerical basis vector Obtain it in the following way: If it is an "entity-entity" edge, That is, the relation vector, pre-trained from the TransE model; if it is an "entity-time-varying attribute" edge, That is, the mean value is encoded through a multilayer perceptron;
[0122] The time feature vector Obtained through the following methods: The start / end timestamps are time-encoded, that is... ;
[0123] The time-series fluctuation vector By encoding the rate of change over time and numerical fluctuations ,in The proportion of the time window reflects the time density; For numerical fluctuations;
[0124] The time-varying attribute type vector Set pair time-varying attribute node The type code is obtained, and the dimension is ;
[0125] The sampling positive example vector The negative example vector Is the aggregated edge of the same entity-time-varying attribute pair; the temperature parameter Is set to 0.1-0.5.
[0126] The application also provides an embodiment of a computer readable storage medium, which stores a computer program, and the program is executed by a processor to realize the above method.
[0127] The application provides an embodiment of an edge optimization and enhanced vector embedding method of a time-sensitive knowledge graph, comprising the following steps:
[0128] S1, sliding time window aggregation is realized by edge optimization, and a sliding time window is defined , wherein is the window start time, is the window length, and the original edge satisfying the following conditions is aggregated to generate an aggregated edge :
[0129] Condition 1: the starting node of the edge is the same entity node ;
[0130] Condition 2: the terminal node of the edge is the same time-varying attribute node or the same entity node ;
[0131] Condition 3: the timestamp of the edge ;
[0132] S2, multi-feature fusion and contrast learning are realized by enhanced vector embedding, for the aggregated edge , an enhanced embedding vector is constructed, comprising:
[0133] (1) feature extraction, five types of core feature vectors, including entity semantic vectors , relationship / numerical basis vectors , time feature vectors , time series fluctuation vectors and time-varying attribute type vectors are extracted;
[0134] (2) attention weighted fusion, the above feature vectors are weighted through an attention mechanism to generate a final embedding vector (satisfy ), the calculation method is:
[0135] wherein is a learnable attention parameter;
[0136] The final embedding vector is: ;
[0137] (3) Contrastive learning optimization, introduce InfoNCE loss function, enlarge the distance of similar embedding vectors to query edge embedding , sample positive example vector and negative example vector , the loss function is:
[0138] ,
[0139] wherein is the cosine similarity, is the temperature parameter, is the number of negative examples.
[0140] S3, feature vector extraction:
[0141] Entity semantic vector : adopt BERT-base model, output dimension vector;
[0142] Numerical basis vector : encode by 3-layer MLP;
[0143] Time feature vector : the start time (07:57:30) and the end time (08:12:30) of are subjected to Positional Encoding, outputting a vector of dimension 768;
[0144] Timing fluctuation vector : calculate , combine , and encode into a vector of dimension 768 by 1-layer MLP;
[0145] Time-varying attribute type vector : encode “speed: unit km / h, update frequency 5 minutes / time” by BERT, output a vector of dimension 768.
[0146] 3.2 Attention weighted fusion:
[0147] Initialize attention parameter For a random vector (dimension 768);
[0148] Calculate attention weight: , and similarly , , , ;
[0149] Generate embedding vector:
[0150] , dimension 768.
[0151] 3.3 Contrastive learning training:
[0152] Dataset construction: 1 query vector (as ), sample 1 positive vector and 10 negative vectors;
[0153] Training parameters: temperature , optimizer Adam, learning rate , iteration number 10000 times;
[0154] Loss convergence: after training, the InfoNCE loss decreases from the initial 2.3 to below 0.8, and the cosine similarity of similar embedding vectors decreases from 0.96 to 0.65.
[0155] S4, retrieval based on optimized embedding (as Figure 3 shown)
[0156] 4.1 Input query: user query target input;
[0157] 4.2 Generate query vector: encode the results in the query into a query vector according to the method of steps 3.1~3.2;
[0158] 4.3 Vector retrieval: in the aggregated edge embedding library, calculate the cosine similarity with all embedding vectors through the FAISS vector retrieval library, set the threshold value to 0.7, and filter out the vectors with similarity≥0.7;
[0159] 4.4 Result output: return the corresponding aggregated edge , and display the detailed time stamp and numerical value of the original edge .
[0160] S5, computer program implementation
[0161] The edge aggregation, vector embedding and retrieval functions of the application are realized through the following program modules:
[0162] Aggregation module: Implement sliding window computation based on Python-based Pandas library, handle timestamp and numerical statistics;
[0163] Embedding module: Implement BERT encoding, MLP and attention mechanism based on PyTorch framework, integrate contrastive learning training logic;
[0164] Retrieval module: Build vector index based on FAISS library, implement efficient approximate nearest neighbor search; Interaction module: Provide API interface, support query input, result return and original data traceability.
[0165] The program can be deployed on the server side, supporting 1000+ retrieval requests per second, response delay ≤100ms, meeting the retrieval requirements of real-time time-sensitive knowledge graph.
[0166] The present application takes "dynamic monitoring time-sensitive knowledge graph of logistics truck" as an example to illustrate the implementation steps of the present application:
[0167] Step 1: Initial construction of time-sensitive knowledge graph
[0168] 1.1 Define node type:
[0169] Entity node : Including "truck A", "truck B", "warehouse X", "warehouse Y", each entity node is associated with semantic description (such as "truck A: load 5 tons, used for city distribution"); Time-varying attribute node : Including "speed", "real-time location", "remaining oil quantity", each node is associated with type description (such as "speed: unit km / h, update frequency 5 minutes / time").
[0170] 1.2 Build original edge : For "truck A - speed": generate 1 edge every 5 minutes, such as
[0171] ,
[0172] ,
[0173] ; For "truck A - warehouse X": generate edge when truck arrives at warehouse, such as
[0174] .
[0175] Step 2: Sliding time window edge aggregation
[0176] 2.1 Setting aggregation parameters: sliding time window length Minutes (i.e., 900 seconds), the window sliding step size is
[0177] Minutes; Aggregation condition: Aggregate only for "entity-time-varying attribute" edges ("entity-entity" edges are aggregated based on update frequency).
[0178] Low yield, aggregation not yet permitted.
[0179] 2.2 Calculate the aggregation edge parameters:
[0180] For window Inside :
[0181] Average timestamp Aggregation time interval
[0182] Numerical mean Numerical standard deviation
[0183] ;
[0184] Generate aggregate edges .
[0185] 2.3 Storing Aggregated Edges: Establish an index for aggregated edges and associate it with their corresponding original edge IDs (e.g., ...). Related
[0186] This makes it easier to trace the original data after retrieval.
[0187] Step 3: Enhanced Vector Embedding Construction and Training
[0188] 3.1 Feature Vector Extraction:
[0189] Entity semantic vector The BERT-based model is used to encode "Truck A: 5-ton payload, used for urban delivery", and the output dimension is... ;
[0190] Numerical fundamental vectors : Using a 3-layer MLP (input dimension 1, output dimension 768) to coding;
[0191] Time feature vector :right The start time (07:57:30) and the end time (08:12:30) of the start time (07:57:30) and the end time (08:12:30) are subjected to Positional Encoding, outputting a vector of dimension 768;
[0192] Time-varying attribute type vector : Calculate , combined , encoded into a vector of dimension 768 by a 1-layer MLP;
[0193] Time-varying attribute type vector : Encode "Speed: unit km / h, update frequency 5 minutes / time" using BERT, output vector of dimension 768.
[0194] 3.2 Attention weighted fusion:
[0195] Initialize attention parameters to a random vector (dimension 768);
[0196] Calculate attention weight: , similarly calculated , , , ;
[0197] Generate embedding vector:
[0198] , dimension 768.
[0199] 3.3 Contrastive learning training:
[0200] Dataset construction: for every 1 query vector (as ), sample 1 positive vector (such as the next window aggregation edge embedding of "Truck A - speed" ) and 10 negative vectors (such as the aggregation edge embedding of "Truck B - speed" "Truck A - remaining fuel")
[0201] Training parameters: temperature , optimizer Adam, learning rate , number of iterations 10000 times;
[0202] Loss convergence: after training, the InfoNCE loss decreases from the initial 2.3 to below 0.8, and the cosine similarity of similar embedding vectors decreases from 0.96 to 0.65.
[0203] Step 4: Retrieval based on optimized embedding
[0204] 4.1 Input query: User query "2024-06-01 08:00-08:15, speed-related edges of truck A";
[0205] 4.2 Generate query vector: Encode "truck A", "speed", "08:00-08:15" in the query as a query vector according to the method in steps 3.1-3.2 ;
[0206] 4.3 Vector retrieval: In the aggregated edge embedding library, calculate the cosine similarity of all embedding vectors by the FAISS vector retrieval library Set the threshold value to 0.7, and filter out vectors with similarity ≥0.7 (such as );
[0207] 4.4 Result output: Return The corresponding aggregated edge , and display the detailed timestamps and values of the original edges .
[0208] Step 5: Computer program implementation
[0209] The edge aggregation, vector embedding, and retrieval functions of the present application are implemented through the following program modules:
[0210] Aggregation module: Implement sliding window calculation based on Python's Pandas library to process timestamp and value statistics;
[0211] Embedding module: Implement BERT encoding, MLP and attention mechanism based on PyTorch framework, and integrate contrastive learning training logic;
[0212] Retrieval module: Build vector index based on FAISS library to realize efficient approximate nearest neighbor retrieval; Interaction module: Provide API interface to support query input, result return and original data tracing.
[0213] The program can be deployed on the server side, supporting 1000+ retrieval requests per second, with a response delay ≤100ms, meeting the retrieval needs of real-time time-sensitive knowledge graphs.
[0214] To further illustrate the beneficial technical effects of the present application, two application scenarios are further described:
[0215] Example 1: Industrial equipment status monitoring scenario
[0216] (I) Scenario background
[0217] A chemical industrial park needs to monitor the temperature, pressure, vibration frequency, etc. of 500 devices such as reaction kettles and pump machines, with a data update frequency of 30 seconds per time. Each device generates 2880 edges per day, resulting in a sharp increase in graph storage pressure. At the same time, slight parameter fluctuations of the device may indicate a fault, and it is necessary to accurately distinguish between normal fluctuations and abnormal precursors. Existing technologies are prone to fault omission due to high vector similarity.
[0218] 1. Initial construction: Entity nodes include "Reaction Kettle E (Model R-100, used for synthesizing resin)" and "Pump Machine F (Model P-200, conveying raw materials)", time-varying attribute nodes include "Temperature (unit °C)" "Pressure (unit MPa)" "Vibration Frequency (unit Hz)", and original edges are generated at 30-second intervals, such as (Reaction Kettle E, Temperature, 85.2, 2024-08-01 09:00:00).
[0219] 2. Edge aggregation: Set the sliding time window ΔT = 10 minutes (balance device parameter stability and real-time performance), sliding step 5 minutes. Aggregate 20 original edges related to "Temperature" of Reaction Kettle E in the window [2024-08-01 09:00:00, 2024-08-01 09:10:00], timestamp mean μt = 09:05, aggregation time interval [08:55, 09:05]; numerical mean μv = 85.4, standard deviation σv = 0.3, generate aggregated edge (Reaction Kettle E, Temperature, (85.4, 0.3), [08:55, 09:05]).
[0220] 3. Vector embedding: Entity semantic vectors are encoded by BERT for device model and purpose description; numerical basis vectors are encoded by MLP for μv; time feature vectors encode the aggregation time interval; time-varying attribute type vectors encode attribute units, safety thresholds, etc. After training, the attention weights are α1 = 0.20, α2 = 0.33, α3 = 0.21, α4 = 0.18, α5 = 0.08, and the weighted 768-dimensional embedding vector is generated.
[0221] 4. Contrastive learning: Positive examples are selected from adjacent window aggregated edges of Reaction Kettle E and "Temperature", negative examples are selected from aggregated edges of other reaction kettles and "Temperature" or Reaction Kettle E and "Pressure", τ = 0.2, after training, the cosine similarity of similar vectors is reduced to 0.65.
[0222] 5. Retrieval application: The system queries "parameter fluctuation abnormal edge of each device in the last 1 hour" at regular intervals, retrieves the 09:00-09:10 aggregated edge of Reaction Kettle E, with σv = 0.3, combined with historical data (normal fluctuation σ ≤ 0.2), it is determined as an abnormal precursor, triggering a maintenance reminder.
[0223] (Three) Scene fine-tuning explanation
[0224] 1. The window length ΔT is set to 10 minutes, which is suitable for the characteristics of small fluctuations in industrial equipment parameters in a short period of time, while ensuring that the precursors of failure are not hidden.
[0225] 2. The time-varying attribute type vector adds a safety threshold code, as whether the parameters in the industrial scene exceed the safety range is the core basis for judgment, and the semantic relevance of the vector is enhanced.
[0226] 3. The number of negative examples N for contrastive learning is increased to 15, as the number of devices is large and the attribute types are rich, more negative examples are needed to enhance the distinction and reduce the probability of misjudgment.
[0227] Example Two: Urban Traffic Flow Monitoring Scene
[0228] (I) Scene Background
[0229] A city traffic management department needs to monitor the traffic flow, average speed, queue length, and other time-varying attributes of 200 intersections, with a data update frequency of 1 minute / second. The number of graph edges is large, which leads to retrieval delay. At the same time, the traffic state during peak hours and off-peak hours is significantly different, and it is necessary to accurately distinguish between normal flow fluctuations and abnormal congestion. The existing technology is prone to congestion misjudgment due to insufficient vector distinction.
[0230] (II) Implementation Process
[0231] 1. Initial construction: Entity nodes include "Intersection G (main road intersection, high traffic during peak hours)" and "Intersection H (secondary road intersection, stable traffic)", time-varying attribute nodes include "traffic flow (unit: vehicle / minute)", "average speed (unit: km / h)", and "queue length (unit: meters)", and original edges are generated at 1-minute intervals, such as (Intersection G, traffic flow, 85, 2024-09-01 07:30:00).
[0232] 2. Edge aggregation: Set the sliding time window ΔT = 15 minutes (adapt to the traffic flow state change period), and the sliding step is 7.5 minutes. Aggregate the 15 original edges related to "Intersection G" and "traffic flow" in the window [2024-09-01 07:30:00, 2024-09-01 07:45:00], the timestamp mean μt = 07:37:30, the aggregation time interval [07:30, 07:45], the numerical mean μv = 88, and the standard deviation σv = 6, generating the aggregated edge (Intersection G, traffic flow, (88, 6), [07:30, 07:45]).
[0233] 3. Vector embedding: Entity semantic vectors encode the intersection position, road level description through BERT; numerical basis vectors are encoded by MLP; time feature vectors encode aggregated time intervals (highlighting peak period features); time series fluctuation vectors combine time window proportion and sigma v (reflecting the degree of traffic fluctuation); time-varying attribute type vectors encode the association between attributes and traffic states (such as positive correlation between traffic flow and congestion). After attention weight training, the weighted embedding vector is generated with alpha1=0.23, alpha2=0.29, alpha3=0.25, alpha4=0.16, and alpha5=0.07.
[0234] 4. Contrastive learning: positive examples are selected from the aggregated edges of intersection G and "traffic flow", negative examples are selected from the aggregated edges of other intersections and "traffic flow" or intersection G and "average speed", tau=0.3, and after training, the cosine similarity of similar vectors is reduced to 0.70.
[0235] 5. Retrieval application: query "2024-09-01 07:30-08:30 traffic flow abnormal congestion intersection", generate query vector, retrieve, hit intersection G aggregated edge, muv=88, sigma v=6, combined with historical peak threshold (mu<=80), determine congestion, and push the guidance instruction.
[0236] (Three) Scene fine-tuning instructions
[0237] 1. The window length Delta T is set to 15 minutes, which adapts to the gradual transition period of traffic flow from smooth to congestion, avoiding the fragmentation of aggregation caused by short windows.
[0238] 2. Time feature vector strengthens peak period encoding by increasing time period weight in PositionalEncoding, highlighting the difference between morning and evening peak and flat peak.
[0239] 3. Time series fluctuation vector enhances time window proportion weight, as the time density of traffic flow varies significantly in different periods, highlighting the period feature.
[0240] Compared with the prior art, the present application has the following beneficial effects:
[0241] (One) Systematically alleviates edge explosion, effectively reduces overall cost
[0242] The sliding time window combines multiple original edges in the same window into an aggregated edge, achieving structured compression without losing the time dimension. The theory and sample verification show that the compression ratio is stable corresponding to the window length and data refresh frequency. In the common minute-level update scenario, the number of edges can be reduced by about 60%-95%, the size of the vector library is reduced, the index construction time is significantly shortened, and the online comparison scale is significantly reduced. Empirical results show that under the same hardware resources, the retrieval throughput can be improved by more than 40%, and the delay fluctuation of the long tail period is also reduced, providing stable support for real-time business. The above benefits come from the compact expression of time intervals and statistical characteristics, rather than brutal deletion, so as not to destroy the time-sensitive clues.
[0243] (II) Significantly improve embedding discrimination and retrieval quality
[0244] The multi-source feature representation constructed around the aggregated edge adaptively emphasizes the most discriminative feature components through the attention mechanism, and helps to pull apart the vector interval between similar samples through contrastive learning. Empirical results show that the cosine similarity of originally highly similar edge vectors can be reduced from more than 0.95 to less than 0.7, thereby reducing near neighbor mismatches. In standard query tasks, accuracy is usually improved by about 35%-50%, and recall is improved by about 25%-40%, and performs stably under different entity types and different attribute types. The root of this effect lies in: the aggregated edge improves the representativeness of the training sample, the attention fusion explicitly encodes the key differences into the vector space, and the contrastive learning consolidates the semantic boundary with structured positive and negative samples.
[0245] (III) Time sensitivity and traceability, supporting business explanation and compliance audit
[0246] The aggregated edge retains the start and end time intervals and numerical statistical features. In the query stage, the time interval can be directly used to filter the candidates, reducing invalid matches. In the result explanation stage, the aggregated edge of the retrieval hit can be traced back to its associated original edge set, showing the specific time point and original value, providing clear evidence chain for alarm review, event replay and causal analysis. For complex situations where short-term dramatic fluctuations and slow drifts coexist, the joint representation of numerical mean and volatility intensity can effectively distinguish between stable and unstable states, reducing false positives and false negatives caused by single-point anomalies.
[0247] (IV) Clear parameter meaning, mature deployment path, strong universality and easy landing
[0248] The window length, the step length, the attention weight and the temperature parameter can be quickly calibrated in small sample grayscale; the edge aggregation can be realized by a general data processing component, the embedded learning can be completed in a mainstream deep learning framework, and the approximate nearest neighbor search can be undertaken by a high-performance library. The method is compatible with existing composition, storage and retrieval service interfaces, and does not need to be restructured on a large scale, and can work in a multi-source and multi-frequency data environment. As the business expands and the scene evolves, the window and the attention can be adjusted online, the contrast learning can be incrementally trained on a weekly or monthly basis, and the retrieval performance can be continuously optimized without interrupting the service. Overall, the application forms a closed loop in four dimensions of 'controllable scale on the edge, more accurate retrieval, time-sensitive preservation and engineering landing', and effectively responds to the dual demands of faster and more accurate time-sensitive knowledge graph in real-world applications.
[0249] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.
[0250] The above only describes the embodiments of the present application and is not intended to limit the present application. Those skilled in the art can make various changes and modifications to the present application. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application shall be included in the scope of the claims of the present application.
Claims
1. A method for edge optimization and enhanced vector embedding of time-sensitive knowledge graphs, applied to the field of graph computing, characterized in that The method comprises the following steps: Step one, aggregate edges in sliding time window by edge optimization, define sliding time window wherein is the window start time, is the window length, aggregate the original edges that satisfy the following condition to generate aggregated edges : Condition 1: the start node of an edge is the same entity node ; Condition 2: the end node of the edge is the same time-varying attribute node or the same entity node ; Condition 3: Timestamp of edge ; Step two, multi-feature fusion and contrast learning are realized by enhanced vector embedding, for the aggregation edge , construct enhanced embedding vector , comprising: (1) Feature extraction, extracting entity semantic vector , relationship / numerical basis vector , time feature vector , timing fluctuation vector and time-varying attribute type vector Five types of core feature vectors; (2) Attention weighted fusion, the above feature vectors are weighted through the attention mechanism to generate the final embedding vector (satisfies ), the calculation method is: wherein are learnable attention parameters; The final embedding vector is: ; (3) Contrastive learning optimization, introduce InfoNCE loss function, pull apart the distance of similar embedding vectors to query edge embedding , sample positive example vectors and negative example vectors , the loss function is: , wherein is the cosine similarity, is the temperature parameter, is the number of negative examples.
2. The method of claim 1, wherein The step one polymerization edge The parameters are calculated by the following equations: (1) Time stamp parameter: interval representation of reserved time range, that is wherein is the mean of the strip original edge timestamp strip original edge timestamp (2) Time-varying attribute numerical parameter: if the termination node is , the numerical parameter is the statistical feature pair , wherein the numerical mean is , and the numerical standard deviation is ; (3) Relationship parameter: if the termination node is an entity node , the relationship type of the original edge is retained , and only the timestamp is updated ; through the aggregation, the same window is replaced by 1 original edge, and the edge compression ratio can reach , solving the "edge explosion" problem.
3. The edge optimization and enhanced vector embedding method of time-sensitive knowledge graph of claim 1, wherein The entity semantic vector in the second step Encoded by pre-training a language model on semantic descriptions of entity nodes , and the dimension is .
4. The edge optimization and enhanced vector embedding method of time-sensitive knowledge graph of claim 1, wherein The relationship / numerical basis vector in step two By the following way: if it is an "entity - entity" edge, That is, the relationship vector, pre-training self TransE model; if it is an "entity - time-varying attribute" edge, That is, the numerical mean is encoded by a multi-layer perceptron.
5. The edge optimization and enhanced vector embedding method of time-sensitive knowledge graph of claim 1, wherein The time feature vector in the step two By time encoding the start / stop timestamps of the . 6. The edge optimization and enhanced vector embedding method of time-sensitive knowledge graph of claim 1, wherein The step two timing fluctuation vector By encoding the time change rate and the numerical fluctuation, Wherein Is the time window proportion, reflecting the time density; Is the numerical fluctuation.
7. The edge optimization and enhanced vector embedding method of time-sensitive knowledge graph of claim 1, wherein The time-varying attribute type vector in the second step Set pair time-varying attribute node The type code is obtained, and the dimension is .
8. The edge optimization and enhanced vector embedding method of time-sensitive knowledge graph of claim 1, wherein In the step two, the sampling positive example vector is the aggregated edge of adjacent windows of the same entity-time-varying attribute pair, the negative example vector is the aggregated edge of different entity-time-varying attribute pairs; the temperature parameter is set to 0.1~0.
5.
9. A device for implementing the edge optimization and enhanced vector embedding method of the time-sensitive knowledge graph according to any one of claims 1-8, comprising an edge optimization module and an enhanced vector embedding module, characterized in that: The edge optimization module is configured to aggregate a sliding time window, define a sliding time window wherein is a window start time, is a window length, and aggregate an original edge that satisfies the following condition to generate an aggregated edge Condition 1: the start node of an edge is the same entity node ; Condition 2: the end node of the edge is the same time-varying attribute node or the same entity node ; Condition 3: Timestamp of edge . Polymeric edge The parameter of the is calculated by the following equation: (1) Time stamp parameter: interval representation of reserved time range, that is wherein is the mean of the strip original edge timestamp of the mean; (2) Time-varying attribute numerical parameter: if the termination node is , the numerical parameter is the statistical characteristic of , wherein (the numerical mean), ; (3) Relationship parameter: if the termination node is an entity node , the relationship type of the original edge is kept , and only the timestamp is updated . Through this aggregation, the same window The original edge is replaced by 1 aggregated edge, and the edge compression ratio can reach ; The enhanced vector embedding module is used for multi-feature fusion and contrast learning, to the aggregated edge , constructing enhanced embedding vectors , the core formula is as follows: (1) Feature extraction: extracting 5 types of core feature vectors Entity semantic vector : encoded by pre-training language model on semantic description of entity node , dimension is ; relation / numerical basis vector : if "entity - entity" edge, ; if "entity - time-varying attribute" edge, ; Time feature vector :right The start / end timestamps are time-encoded, that is... Time series fluctuation vector : Rate of change of encoding time and numerical fluctuation, Time-varying attribute type vector : For time-varying attribute nodes The type encoding is obtained, and the dimension is... ; (2) Attention weighted fusion: the above feature vectors are weighted through an attention mechanism to generate a final embedding vector , satisfying , the calculation method is: wherein are learnable attention parameters, and the final embedding vector is: (3) Contrastive learning optimization: Introducing the InfoNCE loss function, which enlarges the distance between similar embedding vectors to query edge embedding , sampling positive example vectors and negative example vectors , and the loss function is: wherein is the cosine similarity, is the temperature parameter (set to 0.1-0.5), is the number of negative examples. By training with this loss, the discriminativeness of the embedding vectors is improved; where the aggregated edges The parameters are calculated by the following equations: (1) Time stamp parameter: interval representation of reserved time range, that is wherein is the mean of the strip original edge timestamp of the window (2) Time-varying attribute numerical parameter: if the termination node is , the numerical parameter is the statistical feature pair , wherein the numerical mean is , and the numerical standard deviation is ; (3) Relationship parameter: if the termination node is an entity node , the relationship type of the original edge is retained , and only the timestamp is updated ; through this aggregation, the same window is replaced by 1 original edge, and the edge compression ratio can reach , solving the "edge explosion" problem; The entity semantic vector Encoded by pre-training a language model on semantic descriptions of entity nodes , and the dimension is ; the relation / numerical basis vector by encoding the numerical mean value through a multi-layer perceptron; if it is an "entity - time-varying attribute" edge, i.e. the relation vector, pre-train the self TransE model; if it is an "entity - time-varying attribute" edge, i.e. by encoding the numerical mean value through a multi-layer perceptron; the time feature vector by time-encoding the start / stop time-stamps of the ; The timing fluctuation vector By encoding the time change rate and the numerical fluctuation, Wherein Is the time window proportion, reflecting the time density; Is the numerical fluctuation; the time-varying attribute type vector set pair time-varying attribute node encoded by the type of ; the sampled positive vectors aggregated edges for adjacent windows of the same entity - time varying attribute pair, the negative vectors aggregated edges for different entities - time varying attribute pairs; the temperature parameter is set to 0.1~0.
5.
10. A computer readable storage medium having stored thereon a computer program, which, when executed by a processor, implements the method according to any one of claims 1-8.