Timing diagram embedding method and system
By dividing the time series graph into time periods, constructing a basic edge set and calculating time series weights, a high-quality graph embedding is generated, which solves the problem of insufficient time series information capture in the existing technology and achieves efficient graph embedding and updating.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-10
- Publication Date
- 2026-03-13
AI Technical Summary
Existing time sequence graph embedding schemes cannot effectively capture the correlation between two basic nodes within the same time period, resulting in insufficient time sequence information capture capability.
By dividing the time series graph into time periods, constructing a basic edge set, determining the time series weights based on the occurrence frequency of basic nodes, constructing the target matrix and performing singular value decomposition, a high-quality graph embedding is generated.
It improves the quality of graph embedding, can additionally preserve temporal distribution information, is suitable for large-scale time series graphs, and supports efficient embedding updates.
Smart Images

Figure CN119597982B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing, and in particular to a time series graph embedding method and system. Background Technology
[0002] Temporal Graph: A temporal graph is a complex graph in which each edge has a timestamp and the graph structure changes over time.
[0003] Graph embedding is a method for mapping graphs to a low-dimensional vector space, which plays a significant role in industrial applications such as recommender systems and community detection.
[0004] Existing sequence graph embedding schemes include:
[0005] This approach extends the traditional static graph embedding method based on random walks to time-series graphs, thereby improving the embedding quality by utilizing time-series information. In this approach, random walks must be performed in chronological order.
[0006] The above-mentioned time-series graph embedding scheme is optimized using graph neural networks, specifically by aggregating node features according to timestamps to generate graph embeddings that retain time-series information.
[0007] However, neither of the above two schemes can capture the timing information corresponding to "two basic nodes often act in the same time period", and their ability to capture timing information is insufficient. Summary of the Invention
[0008] This invention addresses the shortcomings of existing timing graph embedding schemes in capturing timing data by proposing a timing graph embedding method and system.
[0009] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0010] A time sequence graph embedding method generates a corresponding graph embedding based on a time sequence graph, wherein the time sequence graph includes basic nodes and basic edges with generation time;
[0011] Includes the following steps:
[0012] The time interval corresponding to the time sequence graph is divided into several time periods, and based on the generation time, a set of basic edges corresponding one-to-one with each time period is constructed;
[0013] Based on the occurrence frequency of each basic node in the basic edge set, the temporal weight of the basic node in the corresponding time period is determined;
[0014] Construct a target matrix that preserves both temporal and structural information based on each temporal weight;
[0015] Graph embedding is generated based on the target matrix.
[0016] The temporal weights are associated with the base nodes and time periods respectively. The target matrix is constructed based on the temporal weights, which can effectively preserve the temporal and structural information in the corresponding temporal graph. Compared with the existing technology, it can also additionally preserve temporal information about temporal distribution, such as "two base nodes that are active in multiple time periods are correlated".
[0017] Furthermore, after obtaining the basic edge set, the method for generating the temporal bipartite graph is also included, comprising the following steps:
[0018] Treat each set of basic edges as a time sequence node;
[0019] Connect the basic nodes that appear in the basic edge set with the corresponding temporal nodes through temporal edges, and use the occurrence frequency of the basic nodes as the temporal weight of the corresponding temporal edges to generate the corresponding temporal bipartite graph.
[0020] As one possible implementation, a similarity matrix is constructed based on temporal weights, and the similarity matrix is used as the target matrix for graph embedding generation. This specifically includes the following steps:
[0021] The basic nodes are combined in pairs to form several basic node pairs;
[0022] Calculate the similarity of each pair of basic nodes;
[0023] Construct a similarity matrix based on the obtained similarities;
[0024] The similarity matrix is decomposed to generate the corresponding graph embedding;
[0025] The method for calculating the similarity of target basic node pairs includes the following steps:
[0026] Calculate the product of the target base node with the corresponding temporal weight in each time period to obtain the local similarity that corresponds one-to-one with the time period;
[0027] By accumulating the local similarities, the similarity corresponding to the target basic node pair is obtained.
[0028] As one possible implementation, the similarity matrix is subjected to singular value decomposition or Cholesky decomposition to generate a graph embedding.
[0029] For example:
[0030] After performing singular value decomposition on the similarity matrix, the square root product of the resulting left singular matrix and singular value matrix is used as the graph embedding.
[0031] Perform Cholesky decomposition on the similarity matrix and directly use the resulting matrix as a graph embedding.
[0032] As one possible implementation, the time series matrix is directly used as the target matrix, omitting steps such as similarity calculation, similarity matrix construction, and similarity matrix decomposition. This improves embedding efficiency while ensuring graph embedding quality. Specifically:
[0033] A time series matrix is constructed based on time series weights, and the time series matrix is used as the target matrix;
[0034] The time series matrix is subjected to singular value decomposition, and the corresponding graph embedding is generated based on the decomposition results.
[0035] Furthermore:
[0036] The time series matrix is truncated singular value decomposition to obtain the corresponding left singular matrix, singular value matrix and right singular matrix;
[0037] Based on the left singular matrix and the singular value matrix, a corresponding graph embedding is generated.
[0038] Furthermore, based on the structure of the time series matrix, a graph embedding update method is provided, including the following steps:
[0039] The singular value decomposition results corresponding to the current target matrix are denoted as the first left singular matrix, the first singular value matrix, and the first right singular matrix;
[0040] When a new basic node is added or a corresponding time length is reached, the corresponding incremental time sequence diagram is obtained, and the corresponding incremental matrix is constructed based on the incremental time sequence diagram.
[0041] Based on the first left singular matrix, the first singular value matrix, the first right singular matrix, and the increment matrix, the corresponding second left singular matrix, the second singular value matrix, and the second right singular matrix are generated using the incremental singular value decomposition algorithm.
[0042] Generate and update the corresponding graph embedding based on the second left singular matrix and the second singular value matrix.
[0043] Furthermore:
[0044] A first matrix is constructed based on the first left singular matrix, the first singular value matrix, and the increment matrix;
[0045] Construct a second matrix based on the identity matrix and the first right singular matrix;
[0046] The product of the first matrix and the second matrix represents the target matrix after incremental update;
[0047] Perform QR decomposition on the first matrix to obtain the first orthogonal matrix and the first upper triangular matrix;
[0048] Perform QR decomposition on the second matrix to obtain the second orthogonal matrix and the second upper triangular matrix;
[0049] Construct a third matrix based on the transpose of the second upper triangular matrix and the first upper triangular matrix;
[0050] Perform singular value decomposition on the third matrix to obtain the corresponding third left singular matrix, third singular value matrix and third right singular matrix;
[0051] The second left singular matrix is generated based on the first orthogonal matrix and the third left singular matrix;
[0052] The third singular value matrix is used as the second singular value matrix;
[0053] The second right singular matrix is generated based on the second orthogonal matrix and the third right singular matrix.
[0054] Furthermore:
[0055] The incrementally updated target matrix, based on the first matrix and the second matrix, is as follows:
[0056]
[0057] in:
[0058] W new This represents the target matrix after incremental updates;
[0059] U represents the first left singular matrix;
[0060] ∑ denotes the first singular value matrix;
[0061] W' represents the increment matrix;
[0062] V represents the first right singular matrix;
[0063] I represents the identity matrix;
[0064] [U∑ W'] is the first matrix;
[0065] This is the second matrix.
[0066] The present invention also provides a timing graph embedding system for performing the timing graph embedding method described in any one of the above claims.
[0067] This invention, by adopting the above technical solutions, has significant technical effects:
[0068] This invention, through the design of a basic edge set and temporal weights, can reflect the activity level of the corresponding basic node in a given time period through temporal weights. Compared with existing technologies, it can additionally retain temporal information about temporal distribution, thereby effectively improving the quality of graph embedding. Attached Figure Description
[0069] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0070] Figure 1 This is a schematic diagram of the workflow of a timing diagram embedding method according to the present invention;
[0071] Figure 2 This is a schematic diagram of converting a timing diagram into a timing bipartite diagram;
[0072] Figure 3 This is a schematic diagram of the embedding generation process when the target matrix is a similarity matrix;
[0073] Figure 4 This is a schematic diagram of the embedding generation process when the target matrix is a time series matrix;
[0074] Figure 5 This is a schematic diagram of the embedding and update process when the target matrix is a time-series matrix. Detailed Implementation
[0075] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. In the following description relating to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements.
[0076] The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0077] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.
[0078] A time series graph embedding method generates a corresponding graph embedding based on a time series graph. The time series graph includes node data and edge data. The node data includes several basic nodes, and the edge data includes several basic edges and the generation time corresponding to each basic edge.
[0079] In this embodiment, by designing a temporal weight that indicates the activity level of the corresponding basic node in the corresponding time period, more temporal information can be retained, thereby improving the quality of graph embedding.
[0080] Reference Figure 1 The specific steps are as follows:
[0081] S100. Divide the time interval corresponding to the time sequence graph into several time periods, and construct a set of basic edges that correspond one-to-one with the time periods based on the generation time.
[0082] That is, each basic edge is assigned to a corresponding time period according to its generation time, forming a corresponding basic edge set, and the basic edge sets do not intersect each other.
[0083] Those skilled in the art can determine the time interval spanned by the timing graph according to the actual situation, for example, it can be determined based on the generation time corresponding to the basic edge. This embodiment does not limit it in detail.
[0084] The time periods obtained from the division are of equal length, and subsequent incremental updates of the graph embedding will be based on these time lengths.
[0085] S200. Based on the occurrence frequency of each basic node in the basic edge set, determine the temporal weight of the basic node in the corresponding time period.
[0086] As is known, an edge is represented by the two nodes it connects; that is, a basic edge corresponds to two basic nodes.
[0087] In this embodiment, the occurrence frequency is directly used as the corresponding time series weight.
[0088] As one possible implementation, the set of basic edges is used as time-series nodes, and a time-series bipartite graph is constructed based on the set of basic edges. The nodes of the time-series bipartite graph are basic nodes and time-series nodes, and the edges are time-series edges connecting the basic nodes and time-series nodes. The weights corresponding to the time-series edges are the time-series weights.
[0089] Specifically, the following steps are included:
[0090] S210. Treat each set of basic edges as a time-series node;
[0091] S220. Connect the basic nodes that appear in the basic edge set with the corresponding temporal nodes through temporal edges, and use the occurrence count of the basic nodes as the temporal weight of the corresponding temporal edges to generate the corresponding temporal bipartite graph.
[0092] In this embodiment, each basic edge in each basic edge set is traversed, the current corresponding basic edge is taken as the target edge, the two basic nodes corresponding to the target edge are taken as target nodes respectively, a time-series edge connecting the target node and the corresponding time-series node is constructed, and the time-series weight of the time-series edge is updated.
[0093] The specific method for generating a time-series bipartite graph is as follows:
[0094] Time series diagram G=(V,E) ,in V The first set of nodes includes several basic nodes. v ; E This represents the first set of edges, which includes several basic edges. e ;
[0095] Divide the entire time period spanned by the time series graph G into 10 parts. k Segment, and for each basic edge in the first edge set E e They are assigned to corresponding time periods based on their generation time, thus obtaining... k A subset of mutually disjoint basic edges E 1 ,E 2 ,…,E k That is, the set of basic edges; and the union of all basic edge sets is the first edge set. E That is, for any i≠j, E i ∩E j = ,and .
[0096] Will k The set of basic edges is considered as new nodes, i.e., time-series nodes. A second node set U containing these time-series nodes is constructed. In this case, the time-series nodes are labeled sequentially according to time order. u 1 ,u 2 ,…,u k ∈U ,in u l correspond E l .
[0097] Initialization timing bipartite graph G'=(V'=(V∪U),E'= ) ,in V' The third set of nodes includes the first set of nodes V and the second set of nodes U. That is, the nodes in the time-series bipartite graph include the basic nodes corresponding to the time-series graph. v and the time sequence nodes corresponding to the time period. u ; E' The second set of edges contains several connections to the basic nodes. v and timing nodes u The temporal edge.
[0098] Construct the second edge set E' The method is to traverse the set of all basic edges. E l Set the basic edges E l Each basic edge in the process is used as a target edge, and corresponding temporal edges are constructed based on the basic nodes connected by the target edges.
[0099] If the temporal edge does not exist in the second edge set, then the temporal edge is added to the second edge set and its temporal weight is set to 1.
[0100] If the second edge set contains the time-series edge, then the time-series weight of the time-series edge is increased by 1;
[0101] For example:
[0102] Set the basic edges E l Middle base edge (v i ,v j ) as the target edge, and the base edge ( v i ,v j The basic node corresponding to ) v i and base nodes v j As the target node, the target node v i The corresponding time-series edge is ( v i ,u l ), target node v j The corresponding time-series edge is ( v j ,u l ):
[0103] Time sequence bipartite graph G' The second side set E'There are no temporal edges in the middle. v i ,u l If ), then in the second edge set E' Add a time-series edge with a time-series weight of 1 to the middle. v i ,u l If the time-series edge ( v i ,u l If a time-series edge already exists, then that edge ( v i , u l The time-series weight is increased by 1;
[0104] Same as above, time-series bipartite graph G' The second side set E' There are no temporal edges in the middle. v j ,u l If ), then in the second edge set E' Add a time-series edge with a time-series weight of 1 to the middle. v j ,u l Otherwise, the time-series edge ( v j ,u l The time series weight is increased by 1.
[0105] Reference Figure 2 This paper introduces the generation of a corresponding temporal bipartite graph based on a specific case. The temporal graph G has 7 basic nodes and 6 basic edges. The first edge set E is divided into 3 basic edge sets according to the generation time of the basic edges. E 1 ={(1,2),(2,4)},E 2 ={(2,3),(4,6)},E 3 ={(2,5),(3,7)} ;
[0106] Based on the basic edge set E 1 ={(1,2),(2,4)} For example, in a time-series bipartite graph G' Three time-series edges are generated in the middle ( 1,u 1 ), ( 2,u 1 )and( 4,u 1 Because basic nodes 1 and 4 are inE 1 The middle element appears only once, and the time sequence edge ( 1,u 1 )and( 4,u 1 The time series weights corresponding to ) are all 1, while the basic node 2 is E 1 It appears in both of the basic edges, the time sequence edge ( 2,u 1 The weight of ) is 2.
[0107] Reference Figure 2 The temporal bipartite graph generated in this embodiment can explicitly contain additional temporal information about the temporal distribution through the relationship between the basic nodes and the temporal nodes. For example, it can show that "two basic nodes that are active in multiple time periods are correlated".
[0108] Reference Figure 2 The time-series bipartite graph generated in this embodiment can not only effectively preserve the time-series information in the corresponding time-series graph, but also utilize the second-order neighbors (i.e., v i →u l →v j Obtain the structural information of the corresponding timing diagram.
[0109] S300: Construct a target matrix that retains both temporal and structural information based on each temporal weight, and generate a graph embedding based on the target matrix;
[0110] The target matrix is a similarity matrix or a time series matrix, and the time series matrix is a sparse matrix.
[0111] That is, based on the mapping relationship between time sequence weights and base nodes and time sequence nodes (time periods), the time sequence information and structural information in the corresponding time sequence graph can be effectively preserved.
[0112] Reference Figure 3 As one possible implementation, the target matrix is a similarity matrix, a similarity matrix is constructed, and the similarity matrix is decomposed to obtain the corresponding graph embedding.
[0113] The specific steps are as follows:
[0114] S410. Calculate the similarity of each basic node pair;
[0115] The basic node pair includes a first basic node and a second basic node. The first basic node and the second basic node are two different basic nodes. In this embodiment, the basic nodes are pre-combined in pairs to form several basic node pairs.
[0116] Using the base node pairs whose similarity is to be calculated as target base node pairs, this embodiment obtains the corresponding local similarity by calculating the product of the temporal weights corresponding to the target base node pairs in each time period, and accumulates all local similarities to obtain the similarity;
[0117] The calculation formula is:
[0118]
[0119] in:
[0120] Sim( v i ,v j ) represents the basic node v i and base nodes v j Similarity;
[0121] w(v i ,u l ) Represents the basic node v i and timing nodes u l The corresponding time series weights;
[0122] w(v j ,u l ) Represents the basic node v j and timing nodes u l The corresponding time series weights.
[0123] This similarity definition takes into account the temporal distribution associated with nodes, where the more similar the generation time distribution of the edges around two nodes is, the more similar the two nodes are considered to be.
[0124] S420. Construct a similarity matrix based on the obtained similarity, and decompose the similarity matrix to generate the corresponding graph embedding;
[0125] Those skilled in the art, knowing the similarity of each basic node pair, can construct the corresponding similarity matrix based on existing technology, which will not be elaborated in this specification.
[0126] Those skilled in the art can generate graph embeddings by performing singular value decomposition or Cholesky decomposition (square root method) on the similarity matrix.
[0127] When using singular value decomposition, those skilled in the art can choose the singular value decomposition algorithm according to actual needs. For example, truncated singular value decomposition or fast randomized singular value decomposition can be used. The product of the square root result of the obtained left singular matrix and singular value matrix is used as the graph embedding. This embodiment does not limit it in detail.
[0128] In this embodiment, by designing the temporal weights and similarity algorithms, the resulting similarity matrix can fully retain the temporal and structural information of the original temporal graph. High-quality embedding representations can be obtained by performing singular value decomposition on the similarity matrix.
[0129] Reference Figure 4 As one possible implementation, the corresponding time series matrix is directly used as the target matrix, and singular value decomposition is performed on the target matrix. Based on the obtained left singular matrix and singular value matrix, a corresponding graph embedding is generated.
[0130] As one possible implementation, this embodiment directly uses the time series matrix as the target matrix, omitting steps such as similarity calculation, similarity matrix construction, and similarity matrix decomposition;
[0131] In this embodiment, a target matrix that retains both temporal and structural information is constructed based on each temporal weight. The specific steps for generating graph embedding based on the target matrix are as follows:
[0132] S510. Constructing a time series matrix based on time series weights;
[0133] The time series matrix is a sparse time series matrix.
[0134] The time series matrix consists of basic nodes for rows, time series nodes for columns, and corresponding time series weights for values.
[0135] That is, the i-th row and l-th column of the time series matrix is the corresponding time series weight w(v) i ,u l ).
[0136] S520. Perform singular value decomposition on the time series matrix, and generate corresponding graph embeddings based on the left singular matrix and singular value matrix obtained from the decomposition.
[0137] This embodiment employs truncated singular value decomposition;
[0138] The expression is:
[0139] W=U∑V T ;
[0140] in:
[0141] W is the target matrix, which is the time-order matrix;
[0142] U is the left singular matrix obtained by performing singular value decomposition on the target matrix W;
[0143] ∑ represents the singular value matrix obtained by performing singular value decomposition on the target matrix W;
[0144] V is the right singular matrix obtained by performing singular value decomposition on the target matrix W.
[0145] In this embodiment, the corresponding graph embedding Z, Z=U∑, is generated based on the left singular matrix and singular value matrix obtained from the decomposition.
[0146] In practical applications, those skilled in the art can determine the dimensions of the left singular matrix, singular value matrix, and right singular matrix according to the actual required embedding dimensions. This embodiment does not impose detailed limitations on them.
[0147] Performing Cholesky decomposition on the similarity matrix S yields a matrix whose structure is similar to that of the time series matrix W, thus obtaining S' = WW. T , where S' is an equivalent matrix that is highly similar to the similarity matrix S;
[0148] Substituting the singular value decomposition result of the target matrix W into the expression of the corresponding equivalent matrix S', we know that VV T =I, where I is the identity matrix, we can obtain:
[0149] S'=UΣV T V(UΣ) T =UΣ(UΣ) T ;
[0150] Therefore, it can be proven that the conversion of the decomposition of the similarity matrix S into the decomposition of the target matrix W in this embodiment has theoretical guarantee.
[0151] Taking the scheme of obtaining graph embedding by decomposing the similarity matrix S based on Fast Randomized Singular Value Decomposition (SVD) as an example, its time complexity and space complexity can be approximated as O(nonzero(S)), where nonzero(S) represents the number of nonzero elements in the similarity matrix S;
[0152] For general decomposition methods, the number of non-zero elements in the similarity matrix S is O(n^2). 2 ), where n is the number of basic nodes. It can be seen that for large-scale time series graphs with tens of millions of nodes, the scheme of decomposing the similarity matrix to obtain graph embedding is not practical in terms of efficiency or space consumption.
[0153] Existing solutions for embedding time series graphs using deep learning models or graph neural networks based on random walks only focus on the quality of the embedding and are difficult to handle large-scale time series graphs.
[0154] In this embodiment, when the time series matrix is used as the target matrix to obtain the graph embedding, its time complexity and space complexity can be approximated as O(nonzero(W)), where nonzero(W) represents the number of nonzero elements in the target matrix W;
[0155] In this embodiment, the number of non-zero elements in W is at most O(m), where m is the number of basic edges. It can be seen that the model has extremely high running efficiency and occupies only a small amount of computing space. It can handle large-scale time series graphs. In this embodiment, the corresponding graph embedding is generated by decomposing the time series matrix, which can generate high-quality embeddings for a time series graph of billions in a few hours.
[0156] In summary, this embodiment groups the basic edges according to their generation time. Based on the grouping results, i.e., the basic edge set, the temporal weights of each basic node in each time period are calculated. The temporal weights reflect the activity level of the corresponding basic node in the corresponding time period. The temporal matrix constructed based on the temporal weights can reflect the temporal and structural information of the temporal graph. Singular value decomposition is performed on the temporal matrix, and the corresponding graph embedding is generated based on the decomposition results. This not only results in high embedding quality but also high generation efficiency, enabling the generation of temporal graph embeddings with over 1 billion edges.
[0157] Existing technologies often only focus on the timing information in the timing graph, while ignoring the fact that the timing graph undergoes structural changes over time, making it impossible to efficiently update the embedding.
[0158] Reference Figure 5 To address the aforementioned shortcomings, when the target matrix is a time series matrix, the structure of the time series matrix can be utilized to perform rapid incremental updates on the current graph embedding based on the incremental time series graph.
[0159] When a new basic node is added or a corresponding time length is reached, the corresponding incremental time sequence graph is obtained, and the graph embedding is updated based on the incremental time sequence graph. The specific steps are as follows:
[0160] S610. Construct the corresponding incremental matrix based on the incremental time sequence diagram;
[0161] In this embodiment, an embedding update is performed when a new basic node is added or when the corresponding time length is reached (forming a new time sequence node). Based on the special properties of the time sequence matrix, the corresponding time sequence matrix can be incremented by column increments or row increments based on the incremental time sequence graph, which conforms to the definition of incremental singular value decomposition.
[0162] In this embodiment:
[0163] When adding a new basic node, determine the temporal weight of the new basic node under each time sequence node and generate the corresponding incremental matrix.
[0164] When the corresponding time length is reached, the set of basic edges corresponding to the newly added time period is determined based on the incremental time series graph, forming a new time series node. The time series weight of each basic node under the newly added time series node is determined, thereby generating the corresponding incremental matrix.
[0165] S620. Based on the first left singular matrix, the first singular value matrix, the first right singular matrix, and the increment matrix, and based on the incremental singular value decomposition algorithm, generate the corresponding second left singular matrix, the second singular value matrix, and the second right singular matrix.
[0166] The singular value decomposition results corresponding to the current target matrix (i.e., the time series matrix) are denoted as the first left singular matrix, the first singular value matrix, and the first right singular matrix;
[0167] The resulting second left singular matrix, second singular value matrix, and second right singular matrix correspond to the incremental target matrix.
[0168] In this embodiment, the specific steps of incremental singular value decomposition are as follows:
[0169] S621. The target matrix after the increment is represented by the first matrix and the second matrix.
[0170] In this embodiment:
[0171] A first matrix is constructed using the first left singular matrix, the first singular value matrix, and the increment matrix;
[0172] Construct the second matrix using the identity matrix and the first right singular matrix;
[0173] The product of the first matrix and the second matrix represents the target matrix after incremental update;
[0174] The expression is as follows:
[0175] W new =[W,W']=
[0176] in:
[0177] W new This represents the target matrix after incremental updates;
[0178] [U∑ W'] is the first matrix;
[0179] This is the second matrix.
[0180] U represents the first left singular matrix;
[0181] ∑ denotes the first singular value matrix;
[0182] W' represents the increment matrix;
[0183] V represents the first right singular matrix;
[0184] I represents the identity matrix.
[0185] S622. Perform QR decomposition on the first matrix to obtain the first orthogonal matrix Q1 and the first upper triangular matrix R1;
[0186] S623. Perform QR decomposition on the second matrix to obtain the second orthogonal matrix Q2 and the second upper triangular matrix R2.
[0187] S624, Based on the transpose R2 of the second upper triangular matrix T Construct a third matrix R1R2 with the first upper triangular matrix R1. T ;
[0188] S625, regarding the third matrix R1R2 T Perform singular value decomposition to obtain the corresponding third left singular matrix U. R The third singular value matrix ∑ R and the third right singular matrix V R ;
[0189] That is, R1R2 T =U R ∑ R V R T ;
[0190] S626, Based on the first orthogonal matrix Q1 and the third left singular matrix U R Generate the second left singular matrix U I U I =Q1U R ;
[0191] S627, the third singular value matrix ∑ R As the second singular value matrix ∑ I ;
[0192] S628, Based on the second orthogonal matrix Q2 and the third right singular matrix V R Generate the second right singular matrix V I V I T =V R T Q2 T .
[0193] S630. Generate and update the corresponding graph embedding based on the second left singular matrix and the second singular value matrix, i.e., Z new =U I ∑ I ;
[0194] Based on graph embedding Z new After completing the embedding update, use it as the current graph embedding, and then use the resulting second left singular matrix U. I The second singular value matrix ∑ I The second right singular matrix V I The singular value decomposition result corresponding to the current target matrix is used for the next embedding update.
[0195] The incremental update method proposed in this embodiment can perform embedded updates under the premise of theoretical error guarantee. The theoretical error guarantee is explained and proven below.
[0196] Let (M) d This is a d-rank approximation of matrix M;
[0197] Let X = W new We have X = [W, W'] and X' = [(W)] d ,(W') d The approximation (X') returned by the algorithm described above. d =U I ∑ I V I T satisfy:
[0198] ||(X') d - X|| F ≤3||(X) d - X| F
[0199] Among them, ||*|| F This represents the F-norm.
[0200] According to the triangle inequality of matrix norm, we can obtain:
[0201] ||(X') d - X|| F = ||(X') d - X'+ X'-X|| F
[0202] ≤||(X') d - X'|| F +||X'-X|| F。
[0203] On the one hand, due to (X') dIt is the d-rank approximation of X', therefore we can obtain:
[0204]
[0205] Where, σ i (X') is the i-th largest singular value of X'.
[0206] On the other hand, based on the definition of the F-norm (Frobenius matrix norm) ,available:
[0207]
[0208] in:
[0209] W[ i,j ] represents the first [value] of the target matrix W i Line number j Column elements;
[0210] n is the number of nodes;
[0211] k is the number of time periods divided;
[0212] d represents the embedding dimension;
[0213] β This represents the number of newly added time segments.
[0214] Furthermore, for two matrices A and B, there exists:
[0215] σ i ([A,B])≥max{σ i (A),σ i (B),σ i ([(A) d ,[(B) d ])};
[0216] Therefore, we can conclude that:
[0217] σ i (X)=σ i ([W,W'])≥max{σ i (W),σ i (W'),σ i (X')};
[0218] The final derivation yields:
[0219]
[0220] Similarly, it can also be obtained
[0221]
[0222] Based on the above derivation process, it can be proven that the graph embedding update based on the incremental singular value decomposition algorithm in this embodiment has a theoretical error guarantee.
[0223] The graph embedding generation and updating method disclosed in this embodiment can be applied to scenarios such as social network analysis and industrial equipment management;
[0224] Social network analysis:
[0225] In social networks, interactions between users often have temporal characteristics, and in real-world applications, new users are added. When new users are added, the graph structure of the corresponding time sequence diagram will change.
[0226] In this scenario, the basic node is the user node. Through the design of temporal weights and similarity, this invention can generate graph embeddings based on any target matrix that can activate the temporal information corresponding to user interactions, resulting in higher quality graph embeddings.
[0227] Meanwhile, for graph embedding schemes based on time series matrices as target matrices, when new user nodes are added or new time series nodes are generated, the embedding update can be completed efficiently and with high quality using the incremental singular value decomposition algorithm.
[0228] Industrial Equipment Management:
[0229] In specific industrial equipment management, equipment interaction includes temporal characteristics, and there are also situations where new equipment is added;
[0230] In this scenario, the basic node is the device node. This invention can effectively capture the relationship between each device and the active time period through the design of a temporal bipartite graph, thereby enabling the temporal information of the device to be embedded.
[0231] For graph embedding schemes based on time series matrices as target matrices, not only can they meet the embedding requirements of large-scale time series graphs in such scenarios, but they can also efficiently and with high quality complete the embedding update based on incremental singular value decomposition algorithm when new devices are added or new time series nodes are generated. This solves the shortcomings of current time series graph embedding schemes in the face of large-scale time series graph embedding scenarios, such as low embedding quality and slow embedding update time.
[0232] This specification also proposes a timing graph embedding system for executing the timing graph embedding method disclosed in any of the above embodiments. Since it is basically similar to the method embodiments, the description is relatively simple, and relevant parts can be referred to in the description of the method embodiments.
[0233] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0234] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0235] This invention is described with reference to flowchart illustrations and / or block diagrams of the method, terminal device (system), and computer program product according to the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0236] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0237] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0238] It should be noted that:
[0239] The phrase "an embodiment" or "an embodiment" used in this specification means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the invention. Therefore, the phrase "an embodiment" or "an embodiment" appearing in various places throughout the specification does not necessarily refer to the same embodiment.
[0240] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.
[0241] Furthermore, it should be noted that the shapes and names of the parts and components described in the specific embodiments described in this specification may differ. All equivalent or simple variations made to the structure, features, and principles described in this patent concept are included within the protection scope of this patent. Those skilled in the art to which this invention pertains may make various modifications or additions to the described specific embodiments or use similar methods to replace them, as long as they do not depart from the structure of this invention or exceed the scope defined in these claims, they should all fall within the protection scope of this invention.
Claims
1. A time series graph embedding method applied to industrial equipment management, generating a corresponding graph embedding based on a time series graph, the time series graph comprising base nodes and base edges with generation times; characterized in that comprising the following steps: dividing the time interval corresponding to the time series graph into a plurality of time periods, and based on the generation times, constructing a base edge set corresponding to each time period; determining the time series weight of the base node in the corresponding time period based on the number of occurrences of each base node in the base edge set, wherein the number of occurrences is taken as the corresponding time series weight; constructing a target matrix that preserves time series information and structural information based on each time series weight, and generating a graph embedding based on the target matrix; wherein: each base edge set is taken as a time series node; traversing each base edge in each base edge set, taking the current corresponding base edge as a target edge, and taking the two base nodes corresponding to the target edge as target nodes, respectively, constructing a time series edge connecting the target nodes and the corresponding time series nodes, and updating the time series weight of the time series edge, generating a corresponding time series bipartite graph, the nodes of the time series bipartite graph are base nodes and time series nodes, and the edges are time series edges connecting base nodes and time series nodes, the time series weight is used to indicate the activity degree of the corresponding base node in the time period corresponding to the corresponding time series node; constructing a time series matrix based on the time series weight, the rows of the time series matrix are base nodes, the columns are time series nodes, and the values are the corresponding time series weights; the target matrix is the time series matrix, and the singular value decomposition of the time series matrix generates the graph embedding; when applied to industrial equipment management, the base nodes are equipment nodes, the base edges are used to indicate the interaction between equipment, and the corresponding time series bipartite graph is used to indicate the relationship between each equipment and the active time period.
2. The time series graph embedding method of claim 1, wherein: performing truncated singular value decomposition on the time series matrix to obtain a corresponding left singular matrix, a singular value matrix, and a right singular matrix; generating a corresponding graph embedding based on the left singular matrix and the singular value matrix.
3. The method of Claim 2, wherein, Further comprising a method for updating the graph embedding, comprising the following steps: record the singular value decomposition result corresponding to the current target matrix as a first left singular matrix, a first singular value matrix, and a first right singular matrix; when a new base node is added or a corresponding time length is reached, obtain a corresponding incremental time series graph, and construct a corresponding incremental matrix based on the incremental time series graph; based on the first left singular matrix, the first singular value matrix, the first right singular matrix, and the incremental matrix, generate a second left singular matrix, a second singular value matrix, and a second right singular matrix based on an incremental singular value decomposition algorithm; generate a corresponding graph embedding based on the second left singular matrix and the second singular value matrix and update it.
4. The time series graph embedding method of claim 3, wherein: constructing a first matrix based on the first left singular matrix, the first singular value matrix, and the incremental matrix; constructing a second matrix based on the identity matrix and the first right singular matrix; the product of the first matrix and the second matrix represents the target matrix after incremental update. performing QR decomposition on the first matrix to obtain a first orthogonal matrix and a first upper triangular matrix; performing QR decomposition on the second matrix to obtain a second orthogonal matrix and a second upper triangular matrix; constructing a third matrix based on the transpose of the second upper triangular matrix and the first upper triangular matrix; performing singular value decomposition on the third matrix to obtain a corresponding third left singular matrix, a third singular value matrix and a third right singular matrix; generating the second left singular matrix based on the first orthogonal matrix and the third left singular matrix; taking the third singular value matrix as the second singular value matrix; generating the second right singular matrix based on the second orthogonal matrix and the third right singular matrix.
5. The method of Claim 4, wherein, a target matrix updated based on the first matrix and the second matrix is: ; wherein: W new denotes the target matrix after incremental update; U represents the first left singular matrix; ∑ represents the first singular value matrix; W' represents an incremental matrix; V represents the first right singular matrix; I represents an identity matrix; the first matrix is [U∑ W']; is a second matrix.
6. A system for temporal graph embedding, the system comprising: a method for performing the time series embedding method of any one of claims 1 to 5. a method for performing the time series embedding method of any one of claims 1 to 5.
Citation Information
Patent Citations
Abnormal behavior detection method based on optimized graph embedding representation
CN118820877A