Graph data partitioning method for distributed dynamic graph neural network training
By employing a second-order construction count restoration and frequency-adaptive snapshot retention strategy, combined with existing static graph partitioning algorithms, the graph data partitioning of discrete-time dynamic graphs is optimized. This solves the problem of high communication overhead in existing methods during sliding window training, thereby improving training and computational efficiency.
Patent Information
- Application Number
- CN202411826335.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-12-12
AI Technical Summary
Existing static graph partitioning methods are poorly adapted to discrete-time dynamic graphs and cannot effectively reduce the communication overhead of large-scale discrete-time dynamic graphs in sliding window training, resulting in low training efficiency of distributed dynamic graph neural networks.
By considering edge lifecycle transformation techniques and sliding window factors, a second-order construction count restoration strategy and a frequency-based adaptive snapshot retention strategy are adopted to construct a weighted merged graph and use existing static graph partitioning algorithms to partition graph data, thereby reducing cross-node communication overhead.
It significantly reduces the total communication volume between sliding windows, improves the efficiency and computational efficiency of distributed dynamic graph neural network training, and enhances processing power and scalability, especially in high-frequency communication and large-scale distributed dynamic graph neural network training scenarios.
Smart Images

Figure CN119622043B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of distributed dynamic graph neural network training and graph partitioning, and particularly relates to a graph data partitioning method for distributed dynamic graph neural network training. Background Art
[0002] With the rapid development of the Internet and mobile communication, discrete-time dynamic graph (DTDG) data is generated in large quantities and collected in the form of regular snapshots, such as daily activities on social media, vehicle flow per minute of traffic sensors, and hourly data of weather stations. The edge-life technology enhances temporal smoothness and mitigates the instability of dynamic changes by extending the life cycle of edges, and has become an important means to optimize discrete-time dynamic graph modeling. Currently, the dynamic graph neural network (DGNN) is the state-of-the-art technology for processing discrete-time dynamic graphs. It combines the graph neural network (GNN) to capture graph structure changes and the recursive neural network (RNN) to model temporal dynamics, achieving efficient analysis of discrete-time dynamic graph data. Sliding-window-based DGNN training is a common training mode. By using N s (N s (N < T) snapshots to replace all T snapshots for training, the computational complexity is reduced and the sample diversity is enhanced, thereby improving the training efficiency and the generalization ability of the model. However, even with the use of sliding windows, the single-machine processing capacity is still difficult to meet the training requirements of large-scale discrete-time dynamic graphs. Therefore, distributed dynamic graph neural network training has become a current research hotspot, and graph partitioning, as the primary task of large-scale distributed dynamic graph neural network training, significantly affects the training efficiency of the system.
[0003] Graph partitioning techniques split large-scale graph data into multiple subgraphs, distributing them across different computing nodes or machines for parallel processing to optimize computational efficiency and reduce inter-node communication overhead. The quality of partitioning directly impacts the performance of distributed dynamic graph neural network (DGNN) training; a superior partitioning strategy can improve training efficiency, reduce memory usage, and accelerate the overall computation process. Existing static graph partitioning methods, including Hash, Metis, Scotch, SBV, and TopoX, perform well in static graph partitioning but are less adaptable to discrete-time dynamic graphs. This is because reducing communication within a single snapshot does not effectively reduce the communication overhead between snapshots of the entire discrete-time dynamic graph. Existing discrete-time dynamic graph partitioning strategies, such as DGC and DynaHB, are primarily designed for DGNN training with full snapshots and cannot meet the requirements of sliding window training. Furthermore, concatenating discrete-time dynamic graphs into a single graph incurs significant overhead. Therefore, a lightweight and efficient graph partitioning strategy is urgently needed to meet the requirements of sliding window DGNN training. Summary of the Invention
[0004] To address the shortcomings of the existing technologies, this invention proposes a graph data partitioning method for training distributed dynamic graph neural networks. This method considers factors such as edge-life transformation techniques and sliding windows, uses raw snapshot data before edge-life transformation with a smaller scale, and analyzes the communication frequency differences between different snapshots. The aim is to effectively and efficiently support high-quality, large-scale discrete-time dynamic graph data partitioning operations, thereby reducing cross-node communication overhead and further improving the training efficiency of large-scale distributed dynamic graph neural network systems.
[0005] This invention proposes a graph data partitioning method for training distributed dynamic graph neural networks, the method comprising:
[0006] Obtain several consecutive raw snapshots and construct a raw snapshot set R;
[0007] A second-order construction count restoration strategy is used to restore the original snapshot set R, and the total number of times each original snapshot in the original snapshot set R is calculated.
[0008] Based on the total number of times each original snapshot in the original snapshot set R is used, a frequency-based adaptive snapshot retention strategy is adopted to retain some original snapshots from the original snapshot set R. A weighted merged graph containing all edges in the retained original snapshots is constructed. Then, an existing static graph partitioning algorithm is used to partition the weighted merged graph to obtain the partitioning result of the original snapshot set R.
[0009] The method for restoring the original snapshot set R using the second-order reconstruction strategy is as follows: the original snapshot set R is converted into T snapshots G using edge-life conversion technology, a sliding window is set and the number of times each snapshot in the sliding window is used is calculated to construct a first-order reconstruction array, and then the number of times each original snapshot in any snapshot is used to calculate the number of times it is used and construct a second-order reconstruction matrix. By summing the columns of the second-order reconstruction matrix, the total number of times each original snapshot in the original snapshot set R is obtained.
[0010] The process of restoring the original snapshot set R using the second-order construction count restoration strategy includes the following steps:
[0011] Step I-1: Set the length N of the sliding window S s The time span z of the edge-life conversion technique is denoted as N, and the number of original snapshots in the original snapshot set R is denoted as N. r And use edge-life conversion technology to convert N r One original snapshot is converted into T snapshots G;
[0012] Step I-2: For any snapshot G t Calculate snapshot G within the sliding window S t Number of times UG is used t And construct a first-order number restoration array based on the number of times all snapshots are used; where t represents the index of the snapshot, and the value of t is any integer in the interval [0, T-1];
[0013] Step I-3: Restore the array based on the first-order order, for any snapshot G t Using the time span z of edge-life transformation technology, snapshot G is calculated respectively. t The number of times each original snapshot is used is calculated, and a second-order exponentiation matrix is constructed based on the number of times each original snapshot is used in all snapshots; the rows of the second-order exponentiation matrix are used to represent the number of times each original snapshot is used in a specific snapshot; the columns of the second-order exponentiation matrix are used to represent the number of times an original snapshot is used in each snapshot.
[0014] Step I-4: Sum the results of each column of the second-order restoration matrix to obtain the total number of uses (AR) for each original snapshot. r ;
[0015] The edge-life conversion technology described in step I-1 is used to convert N rThe method for converting one original snapshot into T snapshots G is as follows: based on the time span z of the set edge-life transformation technology, for any original snapshot, the edge-life transformation technology retains the edges of the original snapshot to the subsequent z original snapshots to form snapshot G; where each snapshot G consists of multiple original snapshots, and the sliding window S contains multiple snapshots G;
[0016] The snapshot G within the sliding window S described in step I-2 t Number of times UG is used t Represented as:
[0017] UG t =min(t+1, Tt, N) s )
[0018] Where min(·) represents the minimum value operation;
[0019] The first-order power restoration array is represented as follows:
[0020] {UG0, UG1, ..., UG T-1}
[0021] Where UG0 represents the number of times snapshot G0 was used in the first snapshot; UG1 represents the number of times snapshot G1 was used in the second snapshot; UG T-1 For the T-th snapshot G T-1 Number of times it is used;
[0022] The method for constructing the second-order restoration matrix in step I-3 is as follows: For snapshot G t Any original snapshot R r Calculate snapshot G t Internal original snapshot R r Number of times UR (t,r) Where r is the index of the original snapshot, and the value of r is in the range [0, N]. r Any integer within the range of -1;
[0023]
[0024] When the original snapshot R r Located in snapshot G t During the time span of the edge-life transition technology, a snapshot G within the sliding window S will be taken. t Number of times UG is used t As snapshot G t Internal original snapshot R r Number of times UR (t,r) When the original snapshot R r Not in snapshot G t During the time span of edge-life conversion technology, snapshot Gt Internal original snapshot R r Number of times UR (t,r) =0;
[0025] Based on the original snapshot R within snapshot Gt r Number of times UR (t,r) Construct a second-order restoration matrix, represented as:
[0026]
[0027] Among them UR (0,0) This indicates the number of times the first original snapshot within the first snapshot G0 has been used; Indicates the Nth snapshot within the first snapshot G0. r The number of times each original snapshot was used; UR (T-1,0) For the T-th snapshot G T-1 The number of times the first original snapshot was used; For the T-th snapshot G T-1 Inner Nth r The number of times each original snapshot was used;
[0028] The specific content of the frequency-based adaptive snapshot retention strategy is as follows: calculate the threshold δ by counting the highest number of times the original snapshots are used in the original snapshot set R, and use the threshold δ to divide the original snapshots that need to be retained from the original snapshot set R. Merge all edges in the retained original snapshots to construct a weighted merged graph containing all edges in the retained original snapshots. Then, use the existing static graph partitioning algorithm to partition the weighted merged graph to obtain the partitioning result of the original snapshot set R.
[0029] The frequency-based adaptive snapshot retention strategy includes the following steps:
[0030] Step II-1: Based on the total number of uses of each original snapshot in the original snapshot set R, count the highest number of uses of each original snapshot in the original snapshot set R and denote it as r. max And count the number of times it is used as r max Number of original snapshots Then according to and r max Calculate the threshold δ;
[0031] The threshold δ is represented as:
[0032]
[0033] Where δ represents the threshold used to filter the original snapshot; This indicates the rounding up operation;
[0034] Step II-2: Calculate the original snapshot retention interval [R] using the threshold δ. begin R end The start position (begin) and end position (end) of R; where R begin Represents the original snapshot located at the starting position; R end This represents the original snapshot located at the end position;
[0035] Step II-3: Based on the original snapshot retention range [R] begin R end From the original snapshot set R, select the original snapshots that need to be retained. Construct a weighted merged graph G containing all edges from the retained original snapshots by merging the edges in all the selected original snapshots. ret ;
[0036] Step II-4: Apply existing static graph partitioning algorithms to the weighted merged graph G ret Perform graph partitioning to obtain the partitioning results of the original snapshot;
[0037] The start position (begin) and end position (end) mentioned in step II-2 are represented as follows:
[0038]
[0039] end=N r -begin
[0040] AR i Represents the original snapshot R i Total number of uses; i is the index of the original snapshot; AR i ≥δ represents the filter condition for retaining the original snapshot, that is, filtering out the original snapshots whose usage count is greater than or equal to the threshold δ; {i|·} represents the set of indices of all original snapshots that meet the filter condition; This indicates the operation of finding the smallest index that meets the filter criteria;
[0041] Step II-3 describes constructing a weighted merged graph G containing all edges from the original snapshot that were preserved. ret The method is as follows: merge all the edges in the original snapshots to construct the edge set of the original snapshots. For any edge e in this edge set, count the edges of edge e within the original snapshot retention interval [R]. begin R end The number of occurrences of edge e in all original snapshots within the range is count(e) and used as the weight of edge e. The edge set E of the weighted merged graph is constructed using edge e and the weight count(e). ret , is represented as:
[0042]
[0043] Where E i Let represent the set of edges in the i-th original snapshot; This represents the union operation of edges from the index begin to end-1 in all the original snapshots.
[0044] Construct a vertex set V of the weighted merged graph from the vertices of all original snapshots in the original snapshot set R, and then use the edge set E of the weighted merged graph. ret Given the set of vertices V of the weighted merged graph, construct a weighted merged graph G containing all edges from the original snapshot that are preserved. ret , is represented as:
[0045] G ret =(V,E) ret ).
[0046] The beneficial effects of adopting the above technical solution are as follows:
[0047] The graph data partitioning method proposed in this invention for distributed dynamic graph neural network training is the first graph partitioning method specifically for discrete-time dynamic graphs, providing important technical support for future distributed training of discrete-time dynamic graphs. Considering the characteristics of edge-life transformation technology in discrete-time dynamic graphs and the ability to support sliding window-based DGNN training, this invention uses raw snapshot data before edge-life transformation, which is smaller in scale, by taking into account factors such as edge-life transformation technology and sliding windows. Furthermore, by analyzing the communication frequency differences between different raw snapshots, an optimized graph partitioning method is designed, reducing the total communication volume between sliding windows and lowering the cost of data partitioning.
[0048] The frequency-based adaptive snapshot retention strategy designed in this invention focuses on weighted edge merging of frequently and stably used original snapshots, achieving high-quality graph partitioning for discrete-time dynamic graphs, significantly reducing the communication overhead caused by graph partitioning, and maximizing the computational efficiency of partitioning preprocessing.
[0049] The method of this invention effectively optimizes the communication and computation bottlenecks in the distributed dynamic graph neural network training system, significantly improves the training efficiency of dynamic graph neural networks, especially in high-frequency communication and large-scale distributed dynamic graph neural network training scenarios, and significantly enhances the processing power and scalability of the distributed dynamic graph neural network training system.
[0050] This invention effectively improves the training speed of dynamic graph neural network models, thereby promoting research innovation and rapid implementation of practical projects in the field of dynamic graph neural network algorithms. For example, in the transportation sector, it can be applied to real-time traffic flow prediction and optimization of intelligent transportation systems; in the financial sector, it can assist in risk assessment and behavior prediction of dynamic trading networks; in social networks, it can support user behavior modeling and accurate recommendations; furthermore, this invention can also be applied to dynamic load prediction and scheduling optimization of power systems, as well as dynamic network analysis in bioinformatics. These applications demonstrate the broad value and potential of this invention across multiple industries. Attached Figure Description
[0051] Figure 1 This is a flowchart of a graph data partitioning method for training distributed dynamic graph neural networks in this embodiment;
[0052] Figure 2 This is an example diagram of the second-order construction count restoration strategy in this embodiment;
[0053] Figure 3 This is an example diagram of the frequency-based adaptive snapshot retention strategy in this embodiment. Detailed Implementation
[0054] To facilitate understanding of this application, specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and embodiments. The following embodiments are illustrative of the invention but are not intended to limit its scope. Rather, these embodiments are provided to provide a more thorough and complete understanding of the disclosure of this application.
[0055] This embodiment presents a graph data partitioning method for training distributed dynamic graph neural networks, such as... Figure 1 As shown, the method includes:
[0056] Obtain several consecutive raw snapshots and construct a raw snapshot set R.
[0057] In this implementation, real datasets such as Slashdot, Stackexch, Ratings, and Flickr are obtained from open-source websites. These datasets are also commonly used in current distributed dynamic graph neural network systems. Several consecutive original snapshot images are obtained from the aforementioned real datasets as the original discrete-time dynamic graphs.
[0058] A second-order construction count restoration strategy is used to restore the original snapshot set R, and the total number of times each original snapshot in the original snapshot set R is calculated.
[0059] The method for restoring the original snapshot set R using the second-order reconstruction strategy is as follows: the original snapshot set R is converted into T snapshots G using edge-life conversion technology, a sliding window is set and a first-order reconstruction array is constructed by calculating the number of times each snapshot in the sliding window is used, and then the number of times each original snapshot in any snapshot is used to calculate the number of times it is used and a second-order reconstruction matrix is constructed. By summing the columns of the second-order reconstruction matrix, the total number of times each original snapshot in the original snapshot set R is obtained.
[0060] In this embodiment, such as Figure 2 As shown, the second-order reconstruction strategy comprehensively considers the impact of edge-life transformation technology and sliding window mode on communication during the training process of dynamic graph neural networks. Combining the data characteristics and training mode of discrete-time dynamic graphs, it calculates the number of times the original snapshot is used in the training process of a sliding window-based distributed dynamic graph neural network (DGNN) by constructing a first-order reconstruction array and a second-order reconstruction matrix. The original snapshot refers to the state of the graph data at a specific point in time. In DGNN training, snapshots processed by edge-life transformation technology are typically used as the graph data representing a specific point in time for training. Under the sliding window mechanism, these snapshots are used to construct serialized discrete-time dynamic graph data so that the model can effectively capture the dynamic evolution of the graph data in the time dimension. Therefore, before DGNN training begins, it is necessary to determine the number of times each original snapshot appears in these sequences to construct corresponding training samples, ensuring data consistency and predictability during training, and optimizing the efficiency of the training process.
[0061] The process of restoring the original snapshot set R using the second-order construction count restoration strategy includes the following steps:
[0062] Step I-1: Set the length N of the sliding window S s The time span z of the edge-life conversion technique is denoted as N, and the number of original snapshots in the original snapshot set R is denoted as N. r And use edge-life conversion technology to convert N r One original snapshot is converted into T snapshots G;
[0063] The edge-life conversion technology is used to transform N rThe method for converting one original snapshot into T snapshots G is as follows: based on the time span z of the set edge-life transformation technology, for any original snapshot, the edge-life transformation technology retains the edges of the original snapshot to the subsequent z original snapshots to form snapshot G; where each snapshot G consists of multiple original snapshots, and the sliding window S contains multiple snapshots G.
[0064] In this embodiment, such as Figure 2 As shown, the input is the original snapshot set {R0, ..., R7}, and the hyperparameter is denoted as the number of original snapshots N. r Set the length N of the sliding window to 8. s Set the time span z of the edge-life transformation technique to 3, and generate T snapshots G using the edge-life transformation technique. The discrete-time dynamic graph, i.e., the continuous original snapshots, is naturally transformed into a new discrete-time dynamic graph, i.e., continuous snapshots, after the edge-life transformation. These continuous snapshots are then used for training the DGNN, where T can be obtained statistically from the dataset used for DGNN training, or it can be expressed by the expression T = N. r The total number of snapshots G T obtained by applying edge-life conversion technology in this embodiment is 6, calculated by -z+1.
[0065] Step I-2: For any snapshot G t Calculate snapshot G within the sliding window S t Number of times UG is used t And construct a first-order number restoration array based on the number of times all snapshots are used; where t represents the index of the snapshot, and the value of t is any integer in the interval [0, T-1].
[0066] The snapshot G within the sliding window S t Number of times UG is used t Represented as:
[0067] UG t =min(t+1, Tt, N) s (1)
[0068] min(·) represents the operation of finding the minimum value.
[0069] The first-order power restoration array is represented as follows:
[0070] {UG0, UG1, ..., UG T-1} (2)
[0071] Where UG0 represents the number of times snapshot G0 was used in the first snapshot; UG1 represents the number of times snapshot G1 was used in the second snapshot; UG T-1 For the T-th snapshot G T-1Number of times it is used.
[0072] In this embodiment, such as Figure 2 As shown, for T snapshots G0, G1, ..., G... T-1 Calculate each snapshot G in the sliding window S respectively t The number of times the snapshot is used is given, where the sliding window S0 contains G0 and G1, and S1 contains G1 and G2, and so on. Under the constraints of the sliding window length and the snapshot length, the number of snapshots G within the sliding window S is calculated according to formula (1). t Number of times UG is used t Taking G0 as an example, UG0 = min(0+1, 6-0, 2) = 1, thereby calculating the number of times all snapshots are used in the sliding window and constructing a first-order frequency restoration array.
[0073] Step I-3: Restore the array based on the first-order order, for any snapshot G t Using the time span z of edge-life transformation technology, snapshot G is calculated respectively. t The number of times each original snapshot is used is calculated, and a second-order exponentiation matrix is constructed based on the number of times each original snapshot is used in all snapshots. The rows of the second-order exponentiation matrix are used to represent the number of times each original snapshot is used in a specific snapshot. The columns of the second-order exponentiation matrix are used to represent the number of times an original snapshot is used in each snapshot.
[0074] The method for constructing the second-order restoration matrix is as follows: for snapshot G t Any original snapshot R r Calculate snapshot G t Internal original snapshot R r Number of times UR (t,r) Where r is the index of the original snapshot, and the value of r is in the range [0, N]. r Any integer within the range of -1;
[0075]
[0076] When the original snapshot R r Located in snapshot G t During the time span of the edge-life transition technology, a snapshot G within the sliding window S will be taken. t Number of times UG is used t As snapshot G t Internal original snapshot R r Number of times UR (t,r) When the original snapshot R r Not in snapshot G t During the time span of the edge-life conversion technology, the original snapshot R within snapshot Gt. rUsage count UR (t,r) is 0.
[0077] Based on the usage count UR r of the original snapshot R within the snapshot Gt (t,r) , construct a second-order degree reduction matrix, denoted as:
[0078]
[0079] where UR (0,0) represents the usage count of the first original snapshot within the first snapshot G0; represents the usage count of the N r th original snapshot within the first snapshot G0; UR (T-1,0) is the usage count of the first original snapshot within the Tth snapshot G T-1 ; is the usage count of the N T-1 th original snapshot within the Tth snapshot G r .
[0080] In this embodiment, as Figure 2 shown, for N r original snapshots , calculate the usage count of each original snapshot R t in the snapshot G using the time span z of the edge-life conversion technology respectively, and construct a second-order degree reduction matrix. For the original snapshots, G0 uses R0, R1, and R2, and G1 uses R1, R2, and R3. Combining the usage count UG r of each snapshot G within the sliding window S t , calculate the usage count of each original snapshot R t in the snapshot G t according to formula (3). When the original snapshot R r is within the time span z of the edge-life conversion technology of the snapshot G r , that is, when t ≤ r < t + z, the usage count UR t of the original snapshot R r in G t is equal to the usage count UG (t,r) of G t . If it is not within the valid range, that is, r < t or t + z ≤ r, UR t is 0. Taking R0 and R1 as an example, the usage count UR (t,r) of R0 under G0 is UR (0,0) = UG0 = 1, and the usage count UR (0,1) of R1 is UR (1,1)=UG1=2, thereby calculating the number of times each original snapshot is used in the snapshot, and constructing a second-order frequency restoration matrix.
[0081] Step I-4: Sum the results of each column of the second-order restoration matrix to obtain the total number of uses (AR) for each original snapshot. r .
[0082] The total number of times the original snapshot was used (AR) r for:
[0083]
[0084] in This represents the original snapshot R in the second-order order restoration matrix. r The usage counts across all snapshots are summed.
[0085] In this implementation, the number of times each original snapshot is used is the sum of its usage counts across all snapshots, combined with snapshot G. t Each original snapshot R r Number of times UR (t,r) The original snapshot R is calculated according to formula (5). r Total number of uses. Taking R1 as an example, the number of uses of R1 under G0 is UR. (0,1) =1, the number of times R1 is used under G1 UR (1,1) =2, sum them up to get the total number of times R1 is used AR r =UR (0,1) +UR (1,1) =3, from which the number of times all original snapshots were used is calculated.
[0086] Based on the total number of times each original snapshot in the original snapshot set R is used, a frequency-based adaptive snapshot retention strategy is adopted to retain a portion of the original snapshots from the original snapshot set R. A weighted merged graph containing all edges in the retained original snapshots is constructed. Then, an existing static graph partitioning algorithm is used to partition the weighted merged graph to obtain the partitioning result of the original snapshot set R.
[0087] The specific content of the frequency-based adaptive snapshot retention strategy is as follows: calculate the threshold δ by counting the highest number of times the original snapshots are used in the original snapshot set R, and use the threshold δ to divide the original snapshots that need to be retained from the original snapshot set R. Merge all edges in the retained original snapshots to construct a weighted merged graph containing all edges in the retained original snapshots. Then, use an existing static graph partitioning algorithm to partition the weighted merged graph to obtain the partitioning result of the original snapshot set R.
[0088] In this embodiment, such as Figure 3As shown, based on the symmetrical distribution and variation characteristics of snapshot usage frequency, a retention threshold is first calculated to filter high-frequency snapshots. A threshold δ is designed according to the data characteristics of snapshot usage frequency. Then, the original snapshot retention interval is calculated, and the original snapshots to be retained are selected from the original snapshot set. Based on the selection results, edges are merged to complete the construction of a weighted merged graph. Finally, the weighted merged graph is input into a static graph partitioning algorithm such as Metis to complete graph partitioning, obtaining the original snapshots, i.e., the graph partitioning result of the discrete-time dynamic graph. The frequency-based adaptive snapshot retention strategy significantly reduces partitioning preprocessing time while fully considering edge-life transformation technology and sliding window factors. This technique utilizes smaller-scale original snapshots for snapshot selection and weighted merged graph construction, combined with the characteristics of discrete-time dynamic graph edges and training modes, to achieve high-quality partitioning of discrete-time dynamic graphs, significantly reducing communication overhead and improving partitioning efficiency.
[0089] The process of constructing a weighted merged graph containing edges from all original snapshots using a frequency-based adaptive snapshot retention strategy includes the following steps:
[0090] Step II-1: Based on the total number of uses of each original snapshot in the original snapshot set R, count the highest number of uses of each original snapshot in the original snapshot set R and denote it as r. max And count the number of times it is used as r max Number of original snapshots Then according to and r max Calculate the threshold δ.
[0091] The threshold δ is represented as:
[0092]
[0093] Where δ represents the threshold used to filter the original snapshot; This indicates the rounding up operation.
[0094] In this embodiment, such as Figure 3 As shown, AR is based on the total number of times the original snapshot is used. r It can be seen that the frequency of use of original snapshots varies significantly during DGNN training; some original snapshots are repeated in multiple sliding windows, while others are almost never used. In Equation (6) This represents the proportion of snapshots with the highest number of uses among all original snapshots. This proportion is then multiplied by the maximum number of uses, r. max This yields an expected value based on actual usage. Finally, a rounding up operation ensures that δ is an integer, forming a threshold for filtering and retaining the original snapshots that are frequently used and stable. The original snapshot R is observed. rThe usage frequency exhibits a centrally symmetrical distribution, decreasing from the center outwards. Therefore, a formula can be designed to adaptively adjust the threshold δ based on the characteristics of different datasets. Since the threshold δ is calculated based on the snapshot usage frequency during actual training, the threshold δ possesses dynamic adaptability. In this embodiment...
[0095] Step II-2: Calculate the original snapshot retention interval [R] using the threshold δ. begin R end The start position (begin) and end position (end) of R; where R begin Represents the original snapshot located at the starting position; R end This indicates the original snapshot located at the end position.
[0096] The start position (begin) and end position (end) are represented as follows:
[0097]
[0098] end=N r -begin (8)
[0099] AR i Represents the original snapshot R i Total number of uses; i is the index of the original snapshot; AR i ≥δ represents the filter condition for retaining the original snapshot, that is, filtering out the original snapshots whose usage count is greater than or equal to the threshold δ; {i|·} represents the set of indices of all original snapshots that meet the filter condition; This indicates the operation of finding the smallest index that meets the filtering criteria.
[0100] In this embodiment, a portion of snapshots needs to be retained from the original snapshot set R for subsequent edge merging operations. The threshold δ represents the standard for high-frequency snapshot usage; only snapshots whose usage frequency reaches or exceeds the threshold δ will be retained for subsequent training. Since the usage frequency of the original snapshot R exhibits a centrally symmetrical distribution and decreases from the center to both sides, the starting position of the snapshot interval can be determined by identifying the first snapshot whose usage frequency reaches or exceeds the threshold δ. The ending position can be calculated by subtracting the starting position from the total number of snapshots, based on its symmetry. This embodiment uses formulas (7) and (8) to calculate the starting position of the original snapshot. end=N r -begin = 8 - 1 = 7. Therefore, the original snapshot that is preserved is [R1, R7) = {R1, R2, ..., R6}.
[0101] Step II-3: Based on the original snapshot retention range [R]begin R end From the original snapshot set R, select the original snapshots that need to be retained. Construct a weighted merged graph G containing all edges from the retained original snapshots by merging the edges in all the selected original snapshots. ret .
[0102] The construction includes a weighted merged graph G containing all edges from the original snapshot that are preserved. ret The method is as follows: merge all the edges in the original snapshots to construct the edge set of the original snapshots. For any edge e in this edge set, count the edges of edge e within the original snapshot retention interval [R]. begin R end The number of occurrences of edge e in all original snapshots within the range is count(e) and used as the weight of edge e. The edge set E of the weighted merged graph is constructed using edge e and the weight count(e). ret , is represented as:
[0103]
[0104] Where E i Let represent the set of edges in the i-th original snapshot; This represents the union operation of edges from the index begin to end-1 in all the original snapshots.
[0105] Construct a vertex set V of the weighted merged graph from the vertices of all original snapshots in the original snapshot set R, and then use the edge set E of the weighted merged graph. ret Given the set of vertices V of the weighted merged graph, construct a weighted merged graph G containing all edges from the original snapshot that are preserved. ret , is represented as:
[0106] G ret =(V, E) ret (10)
[0107] Step II-4: Apply existing static graph partitioning algorithms to the weighted merged graph G ret Perform graph partitioning to obtain the partitioning results of the original snapshot.
[0108] The weighted merge graph G is calculated. ret Then, the graph G is partitioned using existing static graph partitioning algorithms. ret The graph is partitioned, generating the partitioning result of the original snapshot, which is the final graph partitioning result PR for the discrete-time dynamic graph. Many existing static graph partitioning algorithms exist, such as Hash and Metis. This implementation uses Metis to partition the weighted merging graph G. ret Metis is an efficient graph partitioning algorithm that aims to partition a weighted merged graph G. retThe graph is divided into several subgraphs to minimize the number of edges while maintaining load balancing. Metis employs a multilevel partitioning strategy, first merging graph G by aggregating vertices and edge pairs using a weighted method. ret The process involves coarsening to generate a smaller approximate graph; then performing an initial partition on the approximate graph; finally, reverting to the original graph through layer-by-layer refinement while optimizing the partition quality. This method is widely used in graph partitioning tasks due to its efficiency and reliability.
[0109] This implementation employs two strategies: a second-order construction count restoration strategy and a frequency-based adaptive snapshot retention strategy. It utilizes a small amount of original snapshot data to construct a weighted merged graph and uses a static graph partitioning algorithm, such as Metis, to generate the partitioning results, thereby achieving an efficient and high-quality graph data partitioning method for discrete-time dynamic graphs.
[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope defined by the claims of the present invention.
Claims
1. A graph data partitioning method for training distributed dynamic graph neural networks, characterized in that, The method includes the following steps: Obtain several consecutive raw snapshots and construct a raw snapshot set. ; A second-order build-time restoration strategy is used to restore the original snapshot set. Perform restoration and calculate the original snapshot set. Total number of uses for each original snapshot; Step I-1: Set up a sliding window length The time span of edge-life conversion technology , the original snapshot set The number of original snapshots is denoted as And using edge-life conversion technology to Converting the original snapshot to A snapshot ; The aforementioned edge-life conversion technology will Converting the original snapshot to A snapshot The method is based on the time span of the pre-defined edge-life conversion technology. For any original snapshot, the edge-life transformation technique preserves the edges of the original snapshot in subsequent snapshots. A snapshot is formed from the original snapshot. ; each of these snapshots Composed of multiple original snapshots, sliding window Contains multiple snapshots ; Step I-2: For any snapshot Calculate the sliding window Internal snapshot Number of times of use And construct a first-order count restoration array based on the number of times all snapshots have been used; in Indicates the index of the snapshot, and The value can be taken from an interval. Any integer within; Step I-3: Restore the array based on the first order power, for any snapshot The time span of utilizing edge-life conversion technology Calculate snapshots separately The number of times each original snapshot is used is calculated, and a second-order exponentiation matrix is constructed based on the number of times each original snapshot is used in all snapshots; the rows of the second-order exponentiation matrix are used to represent the number of times each original snapshot is used in a specific snapshot; the columns of the second-order exponentiation matrix are used to represent the number of times an original snapshot is used in each snapshot. Step I-4: Sum the results of each column of the second-order restoration matrix to obtain the total number of times each original snapshot was used. ; Based on the original snapshot set The total number of uses for each original snapshot in the original snapshot set is used to retain the snapshots from the original snapshot collection using a frequency-based adaptive snapshot retention strategy. Retain a portion of the original snapshots and construct a weighted merged graph containing all edges from the retained original snapshots. Then, use a static graph partitioning algorithm to partition the weighted merged graph, obtaining the original snapshot set. The division results; Step II-1: Based on the original snapshot set The total number of times each original snapshot was used, and the statistics of the original snapshot set. The highest number of times the original snapshot was used is recorded as follows: And count the number of times it was used. Number of original snapshots And then according to and Calculate threshold ; The threshold Represented as: ; in This represents the threshold used to filter the original snapshot; This indicates the rounding up operation; Step II-2: Using a threshold Calculate the original snapshot retention period starting position and end position ;in Indicates the starting position The original snapshot; Indicates the end position The original snapshot; Step II-3: Retain the original snapshot range From the original snapshot collection The original snapshots that need to be retained are divided into segments. A weighted merged graph containing all edges from the retained original snapshots is constructed by merging the edges from all the original snapshots. ; Step II-4: Use a static graph partitioning algorithm to process the weighted merged graph. Perform graph partitioning to obtain the partitioning results of the original snapshot.
2. The graph data partitioning method for training distributed dynamic graph neural networks according to claim 1, characterized in that, The second-order construction count restoration strategy is used to restore the original snapshot set. The method for restoration is to use edge-life conversion technology to restore the original snapshot set. Convert to A snapshot A sliding window is set up, and a first-order exponentiation array is constructed by calculating the usage count of each snapshot in the sliding window. Then, the usage count of each original snapshot in any snapshot is calculated using the first-order exponentiation array, and a second-order exponentiation matrix is constructed. By summing the columns of the second-order exponentiation matrix, the original snapshot set is obtained. Total number of uses for each original snapshot.
3. The graph data partitioning method for training distributed dynamic graph neural networks according to claim 2, characterized in that, The sliding window described in step I-2 Internal snapshot Number of times of use Represented as: ; in This represents the operation of finding the minimum value; The first-order power restoration array is represented as follows: ; in For the first snapshot Number of times it is used; For the second snapshot Number of times it is used; For the first A snapshot Number of times it is used.
4. The graph data partitioning method for training distributed dynamic graph neural networks according to claim 3, characterized in that, The method for constructing the second-order restoration matrix in step I-3 is as follows: For snapshots Any original snapshot Calculate snapshot Internal original snapshot Number of times of use ;in The index of the original snapshot, and The value can be taken from an interval. Any integer within; ; When the original snapshot Located in snapshot During the time span of the edge-life transition technology, the sliding window will... Internal snapshot Number of times of use As a snapshot Internal original snapshot Number of times of use When the original snapshot Not in snapshot During the time span of edge-life conversion technology, snapshots Internal original snapshot Number of times of use =0; According to the snapshot Internal original snapshot Number of times of use Construct a second-order restoration matrix, represented as: ; in Indicates the first snapshot The number of times the first original snapshot was used; Indicates the first snapshot Inner The number of times each original snapshot was used; For the first A snapshot The number of times the first original snapshot was used; For the first A snapshot Inner The number of times the original snapshot was used.
5. The graph data partitioning method for training distributed dynamic graph neural networks according to claim 4, characterized in that, The specific content of the frequency-based adaptive snapshot retention strategy is as follows: by statistically analyzing the original snapshot set... The threshold is calculated based on the highest number of times the original snapshot is used. and using threshold From the original snapshot collection The original snapshots that need to be retained are partitioned, and all edges in the retained original snapshots are merged to construct a weighted merged graph containing all edges from the retained original snapshots. Then, a static graph partitioning algorithm is used to partition the weighted merged graph to obtain the set of original snapshots. The division results.
6. The graph data partitioning method for training distributed dynamic graph neural networks according to claim 5, characterized in that, The starting position described in step II-2 and end position Represented as: ; ; in Represents the original snapshot Total number of uses; An index for the original snapshot; This indicates the filter criteria for retaining the original snapshot, specifically filtering for snapshots with a usage count greater than or equal to a threshold. The original snapshot; This represents the set of indices of all original snapshots that meet the filtering criteria. This indicates the operation of finding the smallest index that meets the filtering criteria.
7. The graph data partitioning method for training distributed dynamic graph neural networks according to claim 6, characterized in that, Step II-3 describes constructing a weighted merged graph containing all edges from the preserved original snapshot. The method is as follows: merge all the edges in the original snapshots to construct the edge set of the original snapshots. For any edge in this edge set... Statistical edge In the original snapshot retention area Number of occurrences in all original snapshots within the range And as a side The weights, using the edges and edge weight Construct the edge set of the weighted merge graph , is represented as: ; in Indicates the first The set of edges in the original snapshot; Indicates from the index arrive Union operation on edges in all original snapshots within the range; Based on the original snapshot set The set of vertices in the weighted merged graph is constructed from the vertices of all the original snapshots. And utilize the edge set of the weighted merge graph The set of vertices in a weighted merged graph Construct a weighted merged graph containing all edges from the original snapshot that were preserved. , is represented as: 。
Citation Information
Patent Citations
Import and export behavior dynamic graph data anomaly detection method and system
CN115512133A
Method for solving heterogeneous graph neural network data division imbalance processing for mass data
CN116432738A