Network topology reasoning method, system, equipment and medium
By building a network topology inference model in a dynamic communication network, extracting node features, spatial evolution information and timing information, and using deep learning methods to perform topology inference, the problems of poor accuracy of topology inference and high consumption of computing resources in a dynamic network are solved, and efficient and real-time topology inference effect are achieved.
Patent Information
- Application Number
- CN202510503167.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2045-04-22
AI Technical Summary
The accuracy of topological inference in dynamic communication networks is poor, which increases computing overhead and cost, and cannot meet the real-time and effectiveness requirements of topological inference in dynamic networks.
By obtaining dynamic network data, extracting node features, spatial evolution information and timing information, a network topology inference model is constructed, including node feature extraction module, spatial evolution information extraction module, fusion module, timing information extraction module and output layer, and topology inference is performed using deep learning methods.
Improves the accuracy of topological inference, reduces labor costs, improves the real-timeness of inference, and reduces the amount of data and hardware resources required.
Smart Images

Figure CN120034443A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of communication network topology perception, and in particular relates to an end-to-end network topology reasoning method, system, device and medium for realizing the inference of topology structure in a dynamic communication network. Background Art
[0002] The research on topology inference in communication networks has attracted significant attention and achieved remarkable success. For example, topology inference can be used to infer the topology of the physical layer of the network, thereby optimizing resource allocation, improving traffic prediction and fault detection capabilities, and identifying key nodes. However, topology inference in dynamic communication networks still faces two key challenges:
[0003] (1) Frequent topology shifts caused by node mobility: Network topology is not static. The mobility of network nodes causes the network topology to change over time, which may affect the accuracy of traditional topology reasoning methods.
[0004] (2) Traditional statistical methods depend on manual calibration: Most topological inference methods are based on statistical analysis and require manual intervention, making them unsuitable for practical applications. These dynamic changes increase computational overhead and labor costs, because frequent manual adjustments not only place high demands on human expertise, but also increase the burden on hardware resources.
[0005] Therefore, the change of network topology over time not only affects the inference accuracy, but also leads to excessive consumption of human and computing resources.
[0006] Topological reasoning refers to the process of inferring the topological relationship between nodes through data analysis based on the collected observation data. Existing topological reasoning methods are mainly based on time series analysis techniques of statistical tools, such as transfer entropy, Granger causality, and Hawkes processes. However, these methods are too dependent on the collected data and are therefore not suitable for topological reasoning in dynamic communication networks.
[0007] With the rapid development of dynamic network link prediction, it has shown great potential in the topological reasoning problem in dynamic communication networks. Dynamic network link prediction involves analyzing and modeling historical interaction data between network nodes to predict potential future links or relationships. By capturing the temporal dependencies between network nodes, it can more accurately reflect the evolution of node connection relationships over time, thus providing strong help in solving the topological reasoning challenges in dynamic networks. Summary of the invention
[0008] The purpose of the present invention is to provide a network topology reasoning method, system, device and medium to solve the problem that network nodes change over time, resulting in poor topology reasoning accuracy, increased computing overhead and cost, and the inability to meet the real-time and effectiveness requirements of dynamic network topology reasoning.
[0009] The present invention solves the above technical problems through the following technical solutions: a network topology reasoning method, comprising:
[0010] Get dynamic network data;
[0011] All links in the dynamic network data are sorted by time, and all links after time sorting are divided by windows to generate continuous snapshots; wherein the link refers to an edge between two nodes;
[0012] A sample dataset is constructed with Q consecutive snapshots as a sample. The first Q-1 snapshots and their adjacency matrices in each sample are input, and the adjacency matrix of the last snapshot is the expected label.
[0013] Constructing a network topology reasoning model; wherein the network topology reasoning model includes a node feature extraction module, a spatial evolution information extraction module, a fusion module, a time series information extraction module and an output layer; the node feature extraction module is used to extract node features from each input snapshot to obtain a node feature matrix of each snapshot; the spatial evolution information extraction module is used to extract spatial evolution information from the node feature matrix and adjacency matrix of each snapshot to obtain a spatial evolution feature sequence of each snapshot; the fusion module is used to fuse the spatial evolution feature sequences of consecutive Q-1 snapshots to obtain a fused feature matrix; the time series information extraction module is used to extract time series information from the fused feature matrix to obtain an intermediate feature matrix; the output layer is used to predict the intermediate feature matrix to obtain a predicted adjacency matrix;
[0014] Using the sample data set to train and test the network topology reasoning model to obtain a target network topology reasoning model;
[0015] The target network topology reasoning model is used to perform network topology reasoning.
[0016] Furthermore, the node feature extraction module is used to extract node features from each input snapshot, specifically including:
[0017] Use the Node2Vec algorithm to extract node features from each input snapshot. The specific formula is:
[0018] ;
[0019] ;
[0020] ;
[0021] ;
[0022] in, represents the probability of walking between the i-th node and the j-th node in the snapshot; represents the number of links experienced between the i-th node and the j-th node in the snapshot; p and q represent parameters that control the number of exploration steps; Indicates the number of nodes is And the number of links is A snapshot of; RandomWalk represents the random walk algorithm; Represents a node is the walking sequence of the starting node, ; Word2vec represents word embedding algorithm; Represents the word embedding vector; Concat represents concatenating the word embedding vectors row by row; C represents the node feature matrix of the snapshot.
[0023] Furthermore, the spatial evolution information extraction module includes a plurality of multi-head graph attention networks connected in sequence and an ordinary differential equation module provided at the output ends of the plurality of multi-head graph attention networks;
[0024] Each multi-head graph attention network is used to extract features from the discrete space feature matrix output by the previous multi-head graph attention network and the adjacency matrix of the snapshot to obtain the discrete space feature matrix of the multi-head graph attention network; wherein, the first multi-head graph attention network is used to extract features from the node feature matrix and adjacency matrix of each snapshot to obtain the discrete space feature matrix of the first multi-head graph attention network;
[0025] The ordinary differential equation module is used to perform continuous spatial feature extraction on discrete spatial feature matrices output by multiple multi-head graph attention networks to obtain a spatial evolution feature sequence.
[0026] Furthermore, each multi-head graph attention network is used to extract features from the discrete space feature matrix output by the previous multi-head graph attention network and the adjacency matrix of the snapshot. The specific formula is:
[0027] , ;
[0028] ;
[0029] ;
[0030] ;
[0031] ;
[0032] in, represents the matrix obtained by linearly transforming the discrete spatial feature matrix output by the m-1th multi-head graph attention network; C represents the node feature matrix of the snapshot; Represents trainable weight parameters; represents the attention coefficient of the kth attention head; LeakyReLU represents the leaky rectified linear unit; Represents the adjacency matrix of the snapshot; the superscript T represents the matrix transpose; Representation Matrix The feature vector of the i-th node in; Representation Matrix The feature vector of the jth node in; Indicates the splicing symbol; represents the normalized attention coefficient of the kth attention head; N i Representation Matrix The set of neighbor nodes of the i-th node; represents the feature matrix updated by the kth attention head; ELU represents the exponential linear unit; represents the discrete spatial feature matrix output by the m-th multi-head graph attention network; K represents the number of attention heads in each multi-head graph attention network.
[0033] Furthermore, the ordinary differential equation module is used to extract continuous spatial features from the discrete spatial feature matrices output by multiple multi-head graph attention networks. The specific formula is:
[0034] ;
[0035] ;
[0036] ;
[0037] in, represents the attention calculation function of the m-th multi-head graph attention network; K represents the number of attention heads in the m-th multi-head graph attention network; N i Representation Matrix The set of neighbor nodes of the i-th node; represents the matrix obtained by linearly transforming the discrete spatial feature matrix output by the m-1th multi-head graph attention network; represents the normalized attention coefficient of the kth attention head in the mth multi-head graph attention network; Represents the discrete spatial feature matrix output by the m-1th multi-head graph attention network; Represents a trainable parameter tensor; Represents the discrete spatial feature matrix output by the m-th multi-head graph attention network; represents an ordinary differential equation; M represents the number of multi-head graph attention networks; Represents a compound operator; represents a nonlinear activation function; A sequence of spatially evolving features representing snapshots; represents the initial eigenvector; represents the granularity of solving ordinary differential equations; represents the granularity variable; Indicates The discrete spatial feature matrix output by a multi-head graph attention network.
[0038] Furthermore, the time series information extraction module includes a plurality of LSTM units, each LSTM unit is used to perform feature extraction on the normalized result of the hidden state at the current moment output by the previous LSTM unit to obtain the hidden state at the current moment of the LSTM unit; the first LSTM unit is used to perform feature extraction on the fusion feature matrix to obtain the hidden state at the current moment of the first LSTM unit; the hidden state at the current moment output by the last LSTM unit is the intermediate feature matrix;
[0039] Among them, the specific calculation formula for the normalized result of the hidden state output by each LSTM unit at the current moment is:
[0040] ;
[0041] in, Represents the current hidden state of the LSTM unit output; Represents the normalized result of the hidden state output by the LSTM unit at the current moment; and denote the scaling factor and the offset factor respectively; and Respectively represent the current hidden state The mean and variance of Represents a constant used to prevent division by zero errors.
[0042] Further, the network topology reasoning model is trained using the sample data set, specifically including:
[0043] Inputting the first Q-1 snapshots of each sample and its adjacency matrix into the network topology reasoning model to obtain a predicted adjacency matrix of the network topology reasoning model;
[0044] The loss error between the predicted adjacency matrix and the expected label of the sample is calculated. The specific calculation formula is:
[0045] ;
[0046] in, Represents loss error; N e represents the number of links in the predicted adjacency matrix or expected label, including existing and non-existing links; V represents the set of nodes in the predicted adjacency matrix or expected label; represents the probability that there is a link between the i-th node and the j-th node in the expected label; Represents the probability of a link between the i-th node and the j-th node in the predicted adjacency matrix;
[0047] Adjusting the parameters of the network topology reasoning model according to the loss error to implement the training of the network topology reasoning model;
[0048] Iterate the training until the training termination condition is reached.
[0049] Based on the same concept, the present invention also provides a network topology reasoning system, including:
[0050] an acquisition unit, configured to acquire dynamic network data;
[0051] A snapshot generation unit is configured to sort all the links in the dynamic network data according to time, and divide all the links after time sorting by using windows to generate continuous snapshots; wherein the link refers to an edge between two nodes;
[0052] The data set construction unit is configured to construct a sample data set with consecutive Q snapshots as a sample; wherein the first Q-1 snapshots and their adjacency matrices in each sample are input, and the adjacency matrix of the last snapshot is the expected label;
[0053] A model building unit is configured to build a network topology reasoning model; wherein the network topology reasoning model includes a node feature extraction module, a spatial evolution information extraction module, a fusion module, a time series information extraction module and an output layer; the node feature extraction module is used to extract node features from each input snapshot to obtain a node feature matrix of each snapshot; the spatial evolution information extraction module is used to extract spatial evolution information from the node feature matrix and adjacency matrix of each snapshot to obtain a spatial evolution feature sequence of each snapshot; the fusion module is used to fuse the spatial evolution feature sequences of consecutive Q-1 snapshots to obtain a fused feature matrix; the time series information extraction module is used to extract time series information from the fused feature matrix to obtain an intermediate feature matrix; the output layer is used to predict the intermediate feature matrix to obtain a predicted adjacency matrix;
[0054] A training unit is configured to train and test the network topology reasoning model using the sample data set to obtain a target network topology reasoning model;
[0055] The reasoning unit is configured to perform network topology reasoning using the target network topology reasoning model.
[0056] Based on the same concept, the present invention also provides an electronic device, including a memory, a processor, and a computer program / instruction stored in the memory, wherein the processor executes the computer program / instruction to implement the network topology reasoning method as described above.
[0057] Based on the same concept, the present invention also provides a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the network topology reasoning method as described above is implemented.
[0058] Compared with the prior art, the advantages of the present invention are:
[0059] The present invention firstly captures the structural semantics of the network topology by extracting node features from snapshots, then uses a spatial evolution information extraction module to capture fine-grained spatial evolution features, and finally uses a temporal information extraction module to learn the long-term dependencies between network topologies, thereby realizing topological reasoning in dynamic communication networks and improving the accuracy of topological reasoning. The present invention does not require manual intervention, reduces labor costs, and improves the real-time performance of topological reasoning.
[0060] Compared with traditional statistical analysis methods, the present invention uses deep learning methods for topological reasoning, and the required amount of data and hardware resources are relatively small; at the same time, the present invention uses a graph embedding algorithm to convert high-dimensional graph structure data into a low-dimensional embedding vector and makes full use of the normalization layer in the time series information extraction module to further reduce the computational complexity and reduce computing resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only one embodiment of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0062] Figure 1 is a flow chart of a network topology reasoning method according to an embodiment of the present invention;
[0063] Figure 2 is a schematic diagram of continuous snapshot generation in an embodiment of the present invention;
[0064] Figure 3It is an overall architecture diagram of the network topology reasoning model in an embodiment of the present invention;
[0065] Figure 4 is an ER performance fluctuation curve of the inference results of different models on the Contact data set in the embodiment of the present invention;
[0066] Figure 5 is an ER performance fluctuation curve of the inference results of different models on the Hypertext09 dataset in the embodiment of the present invention;
[0067] Figure 6 is an ER performance fluctuation curve of the inference results of different models on the Radoslaw dataset in an embodiment of the present invention;
[0068] Figure 7 It is the ER performance fluctuation curve of the inference results of different models on the Fbforum dataset in the embodiment of the present invention. DETAILED DESCRIPTION
[0069] The following is a clear and complete description of the technical solutions in the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0070] The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0071] Embodiment 1
[0072] In a complex network topology, network nodes may be mobile, causing the network topology to change over time. Most topology reasoning methods are mainly based on statistical analysis, involving multiple threshold decisions that require manual intervention (such as F-test thresholds, adjacency matrices, and Neyman-Pearson criteria). However, due to the temporal variability of network topology, manual threshold adjustment becomes tricky in dynamic networks, affecting not only the accuracy of network topology reasoning, but also the reasoning efficiency. Based on the above technical problems, the present invention provides a network topology reasoning method, which realizes the reasoning of network topology through node feature extraction, spatial evolution feature extraction, and timing information extraction, thereby improving the reasoning accuracy and reasoning efficiency.
[0073] Figure 1 The flowchart of the network topology reasoning method provided by the present invention is shown. Figure 1 As shown, the network topology reasoning method of the present invention comprises the following steps:
[0074] Step S1: Acquire dynamic network data.
[0075] Publicly available data sets are used as dynamic network data in an embodiment of the present invention. The data sets of this embodiment include Contact, Hypertext09, Radoslaw and Fbforum. These data sets use different ways of communication, such as mobile phones, emails, etc. The detailed information of each data set is shown in Table 1.
[0076] In Table 1, represents the number of nodes, V represents the node set, represents the number of links, E represents the link set, represents the average degree of the nodes, Represents the maximum degree of a node. A link is an edge between two nodes.
[0077] Step S2: sort all the links in the dynamic network data by time, and use windows to divide all the links after time sorting to generate continuous snapshots.
[0078] For each data set, all links in the data set are arranged in chronological order, and all links in chronological order are divided using time windows to generate a series of continuous snapshots, such as Figure 2 shown.
[0079] Step S3: Construct a sample data set by taking Q consecutive snapshots as a sample.
[0080] In order to obtain enough samples, the present invention takes Q consecutive snapshots as a sample, wherein the first Q-1 snapshots and their adjacency matrices in each sample are input, and the adjacency matrix of the last snapshot is the expected label. The adjacency matrix of a snapshot is a matrix representing the adjacent relationship between nodes in the snapshot. When there is a link between two nodes, the corresponding element in the adjacency matrix is 1; when there is no link between two nodes, the corresponding element in the adjacency matrix is 0. In this embodiment, Q is set to 11, that is, the first 10 snapshots of each sample and their adjacency matrices are used as input, and the adjacency matrix of the 11th snapshot of each sample is used as the expected label.
[0081] The sample data set is divided into a training set and a test set in a ratio of 3:1. The training set is used to train the network topology reasoning model, and the test set is used to test the trained network topology reasoning model.
[0082] Step S4: Construct a network topology reasoning model.
[0083] like Figure 3As shown, the network topology reasoning model includes a node feature extraction module, a spatial evolution information extraction module, a fusion module, a time series information extraction module and an output layer. The node feature extraction module is used to extract node features from each input snapshot to obtain a node feature matrix of each snapshot; the spatial evolution information extraction module is used to extract spatial evolution information from the node feature matrix and adjacency matrix of each snapshot to obtain a spatial evolution feature sequence of each snapshot; the fusion module is used to fuse the spatial evolution feature sequences of consecutive Q-1 snapshots to obtain a fused feature matrix; the time series information extraction module is used to extract time series information from the fused feature matrix to obtain an intermediate feature matrix; the output layer is used to predict the intermediate feature matrix to obtain a predicted adjacency matrix. Figure 3 In, G 1 ,G 2 ,…,G Q-1 represents the first Q-1 snapshots of each sample, A 1 ,A 2 ,…,A Q-1 represents the adjacency matrix of the first Q-1 snapshots of each sample, y 1 ,y 2 ,…,y Q-1 represents the spatial evolution feature sequence of the first Q-1 snapshots of each sample, represents the predicted adjacency matrix, Represents a forecast snapshot.
[0084] In order to effectively extract spatial evolution information from each snapshot, the node feature extraction module is first used to extract node features from each snapshot, that is, the embedded expression of the node. In a specific embodiment of the present invention, the Node2Vec algorithm is used to embed the node of each snapshot. The Node2Vec algorithm is a graph embedding technology that fully combines the random walk algorithm (RandomWalk) and the word embedding algorithm (Word2vec), and can effectively express the semantic structure within the network topology. In particular, the random walk algorithm in the Node2Vec algorithm also introduces breadth-first sampling (Broad-first Sampling) and depth-first sampling (Depth-first Dampling) to achieve a more flexible walking strategy. For a node number of And the number of links is Snapshot For a pair of nodes i and j in the example, the specific calculation process of feature extraction is:
[0085] (1)
[0086] (2)
[0087] (3)
[0088] (4)
[0089] in, represents the probability of walking between the i-th node and the j-th node in the snapshot; represents the number of links experienced between the i-th node and the j-th node in the snapshot; p and q represent parameters that control the number of exploration steps; Represents a node is the walking sequence of the starting node, ; Word2vec represents word embedding algorithm; Represents the word embedding vector; Concat represents concatenating the word embedding vectors row by row; C represents the node feature matrix of the snapshot; Represents the number of nodes in the snapshot. Each node in the snapshot can be used as the starting node, so the number of walk sequences is equal to the number of nodes in the snapshot, and the number of word embedding vectors is equal to the number of nodes in the snapshot.
[0090] The parameters p and q are determined according to the network scale. For example, for a small-scale network (e.g., the number of nodes is less than or equal to 1000), p is set to 0.5 and q is set to 2; for a large-scale network (e.g., the number of nodes is greater than 1000), p is set to 1 and q is set to 1.5.
[0091] In order to further learn the local and global dependencies between nodes, the spatial evolution information extraction module extracts spatial evolution information from the node feature matrix and adjacency matrix of each snapshot to obtain a spatial evolution feature sequence for each snapshot. In a specific embodiment of the present invention, the spatial evolution information extraction module includes a plurality of multi-head graph attention networks (Graph Attention Networks, GAT) connected in sequence and an ordinary differential equation module (Ordinary Differential Equations, ODE) provided at the output end of the plurality of multi-head graph attention networks, which aggregates neighbor information by attention weighting, gradually optimizes node features, and introduces ODE to improve GAT so that it can capture fine-grained spatial evolution features.
[0092] Each multi-head graph attention network performs feature extraction on the discrete space feature matrix output by the previous multi-head graph attention network and the adjacency matrix of the snapshot to obtain the discrete space feature matrix of the multi-head graph attention network; the first multi-head graph attention network performs feature extraction on the node feature matrix and adjacency matrix of each snapshot to obtain the discrete space feature matrix of the first multi-head graph attention network; the ordinary differential equation module performs continuous space feature extraction on the discrete space feature matrices output by multiple multi-head graph attention networks to obtain a spatial evolution feature sequence.
[0093] In each multi-head graph attention network, the discrete space feature matrix (or node feature matrix) is first linearly transformed, and then the attention mechanism is applied to calculate the attention coefficient between each pair of nodes and normalized to ensure that the model can selectively focus on the important information between nodes. Finally, the coefficients obtained from the multi-head attention mechanism are nonlinearly activated and averaged to obtain the final discrete space feature matrix. The specific calculation process includes:
[0094] , (5)
[0095] (6)
[0096] (7)
[0097] (8)
[0098] (9)
[0099] in, represents the matrix obtained by linearly transforming the discrete spatial feature matrix output by the m-1th multi-head graph attention network; Represents trainable weight parameters; represents the attention coefficient of the kth attention head; LeakyReLU represents the leaky rectified linear unit; Represents the adjacency matrix of the snapshot; the superscript T represents the matrix transpose; Representation Matrix The eigenvector of the ith node in ith row in ); Representation Matrix The feature vector of the jth node in; Indicates the splicing symbol; represents the normalized attention coefficient of the kth attention head; N i Representation Matrix The set of neighbor nodes of the i-th node; represents the feature matrix updated by the kth attention head; ELU represents the exponential linear unit; represents the discrete spatial feature matrix output by the m-th multi-head graph attention network; K represents the number of attention heads in each multi-head graph attention network.
[0100] Similar to traditional neural network architectures, graph attention networks propagate hidden layer states through discrete computational steps. This discrete propagation method essentially limits the extraction of continuous spatial features and makes it difficult to capture the continuous evolution of node interactions in dynamic networks. Therefore, the present invention also introduces ordinary differential equations, which use their continuous characteristics to improve graph attention networks, so that they can track the dynamic evolution process and capture fine-grained spatial evolution features in snapshots. Through the ordinary differential equation module, spatial evolution feature representations can be obtained at any granularity, thereby ensuring the continuity of the node hidden layer state.
[0101] The ordinary differential equation module extracts continuous spatial features from the discrete spatial feature matrices output by multiple multi-head graph attention networks. The specific formula is:
[0102] (10)
[0103] (11)
[0104] (12)
[0105] in, represents the attention calculation function of the m-th multi-head graph attention network; Represents the discrete spatial feature matrix output by the m-1th multi-head graph attention network; Represents a trainable parameter tensor; Represents the discrete spatial feature matrix output by the m-th multi-head graph attention network; represents an ordinary differential equation; M represents the number of multi-head graph attention networks; Represents a compound operator; represents a nonlinear activation function; A sequence of spatially evolving features representing snapshots; represents the initial eigenvector; represents the granularity of solving ordinary differential equations; represents the granularity variable; Indicates The discrete spatial feature matrix output by a multi-head graph attention network.
[0106] In order to fuse the evolution information from different snapshots, the fusion module is used to perform element-by-element addition on the spatial evolution feature sequence of the first Q-1 snapshots of each sample. The specific formula is:
[0107] (13)
[0108] in, represents the fusion feature matrix, Represents the spatially evolving feature sequence of the kth snapshot.
[0109] Taking into account the time dependency between network topologies, the present invention uses a timing information extraction module to extract timing information from the fused feature matrix to obtain an intermediate feature matrix. In a specific embodiment of the present invention, the timing information extraction module uses a stacked LSTM module (stacked Long Short-Term Memory, LSTMs), which specifically includes multiple LSTM units, each LSTM unit extracts features from the normalized result of the hidden state at the current moment output by the previous LSTM unit to obtain the hidden state at the current moment of the LSTM unit; the first LSTM unit extracts features from the fused feature matrix to obtain the hidden state at the current moment of the first LSTM unit; the hidden state at the current moment output by the last LSTM unit is the intermediate feature matrix.
[0110] As a variant of RNN, LSTM is specially designed to capture long-term dependencies across snapshots, thereby achieving effective modeling of time-varying features. Each LSTM unit is mainly composed of a forget gate, an input gate, and an output gate. The specific calculation process of the first LSTM unit includes:
[0111] (14)
[0112] (15)
[0113] (16)
[0114] (17)
[0115] (18)
[0116] (19)
[0117] in, and represents the learnable weight parameters, and Indicates bias; and They represent the forget gate, input gate and output gate respectively. and Respectively represent the hidden state at the previous moment and the hidden state at the current moment, represents the candidate cell state, and Respectively represent the cell state at the previous moment and the cell state at the current moment, and Represent the Sigmoid and hyperbolic tangent activation functions respectively.
[0118] In order to prevent overfitting during training and improve the convergence speed of the model, the hidden state of each LSTM unit output at the current moment is normalized and then input into the next LSTM unit. The specific formula of the normalization process is:
[0119] (20)
[0120] in, Represents the normalized result of the hidden state output by the LSTM unit at the current moment; and denote the scaling factor and the offset factor respectively; and Respectively represent the current hidden state The mean and variance of Represents a constant used to prevent division by zero errors. For the second to last LSTM unit, the specific calculation process is similar to the first LSTM unit, only the fusion feature matrix Replace it with the normalized result of the hidden state at the current moment output by the previous LSTM unit .
[0121] In a specific embodiment of the present invention, the output layer adopts two layers of MLP (Multilayer Perceptron), the first layer uses the ReLU activation function to accelerate the convergence of the model, and the second layer uses the Sigmoid activation function to derive the network connection state matrix of the next snapshot, that is, the predicted adjacency matrix.
[0122] The specific calculation formula of the output layer is:
[0123] (twenty one)
[0124] (twenty two)
[0125] in, Represents the normalized result of the hidden state output by the last LSTM unit at the current moment; and represents the weight parameter; and Indicates bias; Indicates the hidden state at the next moment; Represents the predicted adjacency matrix.
[0126] Step S5: Use the sample data set to train and test the network topology reasoning model to obtain the target network topology reasoning model.
[0127] In a specific embodiment of the present invention, the network topology inference model is trained using a sample data set, specifically including:
[0128] Step S5.1: Input the first Q-1 snapshots of each sample and its adjacency matrix into the network topology reasoning model to obtain the predicted adjacency matrix of the network topology reasoning model.
[0129] Specifically, the node feature extraction module extracts node features from each of the first Q-1 snapshots to obtain a node feature matrix for each snapshot; the spatial evolution information extraction module extracts spatial evolution information from the node feature matrix and adjacency matrix of each snapshot to obtain a spatial evolution feature sequence for each snapshot; the fusion module fuses the spatial evolution feature sequences of the first Q-1 snapshots to obtain a fused feature matrix; the timing information extraction module extracts timing information from the fused feature matrix to obtain an intermediate feature matrix; the output layer predicts the intermediate feature matrix to obtain a predicted adjacency matrix.
[0130] Step S5.2: Calculate the loss error between the predicted adjacency matrix and the expected label of the sample. The specific calculation formula is:
[0131] (twenty three)
[0132] in, Represents loss error; N e Represents the predicted adjacency matrix Or the number of links with the expected label, including existing and non-existing links (or edges); V represents the predicted adjacency matrix or a collection of nodes with desired labels; represents the probability that there is a link between the i-th node and the j-th node in the expected label. When there is a link between the i-th node and the j-th node in the expected label, The value is 1, otherwise it is 0; It indicates the probability that there is a link between the i-th node and the j-th node in the predicted adjacency matrix.
[0133] Step S5.3: Based on the loss error Adjust the parameters of the network topology inference model (i.e. weight parameters, parameter tensors, biases, etc.) to implement the training of the network topology inference model.
[0134] Step S5.4: Determine whether the training termination condition is met. If so, stop the training; otherwise, repeat steps S5.1 to S5.4.
[0135] In this embodiment, the training termination condition is that the number of iterations reaches a set maximum number of iterations.
[0136] The samples in the test set are input into the trained network topology inference model for network topology inference, and the inference results are output. Then, the various evaluation indicators in the inference results are analyzed by comparing with the baseline method.
[0137] The evaluation indicators of this embodiment include AUC (area under the curve), GMAUC and error rate (ER). The error rate (ER) can intuitively reflect the accuracy of topology inference. For AUC and GMAUC, higher values indicate better performance, while for ER, lower values indicate better performance.
[0138] GMAUC combines PRAUC (Precision-Recall AUC) and AUC to calculate in geometric mean mode. The specific calculation formula is:
[0139] (twenty four)
[0140] Among them, L A and L R Respectively represent the number of newly added links and the number of removed links; Represents the PRAUC value calculated for the newly added links. Represents the AUC value of the observed link.
[0141] ER fully combines network size and SHD to measure the inference accuracy of different network topologies. SHD stands for Hamming distance, which is a commonly used evaluation indicator in causal models. The specific calculation formula is:
[0142] (25)
[0143] Among them, N e represents the number of links in the network topology, Indicates true positivity, Indicates a false positive. Considering the interactivity between nodes in the communication network, when calculating SHD, the expected label and the predicted adjacency matrix are first symmetrized. Therefore, the calculation formula of ER is:
[0144] (26)
[0145] in, Indicates the number of nodes in the network topology.
[0146] In order to verify the superiority of the target network topology inference model (i.e., GAE-LSTMs model) of the present invention, it is compared with a series of advanced dynamic link prediction methods, including matrix decomposition-based methods and deep learning methods. Specifically, there are mainly the following five baseline methods.
[0147] (1) GrNMF is a temporal link prediction algorithm that combines graph structure with non-negative matrix factorization to achieve link prediction;
[0148] (2) GCN-GAN combines the generative adversarial network (GAN) with the graph convolutional network (GCN), using the generative ability of GAN to generate new graph structures, while GCN is used to extract effective representations from the graph structure;
[0149] (3) Dyngraph2vec uses a fully connected encoder before the LSTM network to obtain a low-dimensional hidden representation, thereby reducing model parameters and achieving more efficient temporal link learning;
[0150] (4) STGSN is designed for dynamic graphs and combines graph convolutional networks with temporal networks to effectively process spatiotemporal information.
[0151] (5) T-SIRGN is a deep learning model for temporal link prediction that combines temporal modeling to capture the characteristics of graph structures that change over time.
[0152] To ensure a fair comparison, the data processing and training methods involved in all baseline methods are consistent with the GAE-LSTMs model. Since the evolution pattern of dynamic networks may change over time, the present invention divides the test set into the first 25% of samples and the entire 100% of samples to verify the short-term (timeliness) and long-term (scalability) reasoning performance of the model, respectively, and reports the average results respectively. All baseline methods select the recommended parameter settings. In particular, for GrNMF, the latent space sizes corresponding to the Contact, Fbforum, Hypertext09, and Radoslaw datasets are set to 128, 256, 128, and 128, respectively. For GAE-LSTMs, a rolling test procedure was adopted during the experiment, which means that training and testing are performed alternately. In addition, GAE-LSTMs uses a grid search algorithm to automatically select parameters. The detailed parameter settings are shown in Table 2, where, represents the hidden layer settings in GAT, represents the hidden layer settings of LSTMs, It indicates the output layer size setting.
[0153] GrNMF is implemented in Python. Other methods are implemented in PyTorch. All experiments are performed on a workstation equipped with an Intel Xeon Gold-6326 @ 2.90 GHz CPU, 512 GB memory, and an NVIDIA A100 GPU (with 80 GB memory).
[0154] On the first 25% and the entire 100% test set, the present invention takes the average results of 10 random runs as the final experimental results, as shown in Table 3, Table 4 and Table 5. It can be observed from Table 3 to Table 5 that the present invention performs best on most data sets and achieves the second best results on the remaining data sets.
[0155] The GAE-LSTMs model performed best on most evaluation indicators of the four datasets. In addition to the GAE-LSTMs model, Dyngraph2vec achieved the second best results on most datasets according to the AUC score, especially on the Contact dataset, significantly outperforming the other four baseline methods and slightly exceeding the method of the present invention. This shows that the structural information of the graph can be effectively captured using a fully connected encoder. At the same time, T-SIRGN performed competitively in GMAUC scores and ER, which may be because T-SIRGN focuses more on capturing the temporal information between graphs. However, the present invention achieved the best results on most indicators, which shows that from the perspective of spatial evolution, the present invention can effectively learn dynamic changes in the process of structural learning and capture sufficient potential evolution information.
[0156] Compared with other methods, the GAE-LSTMs model shows strong stability and generalization ability. By comparing the performance of the first 25% of the data in the test set with the entire 100% of the data, it can be found that the performance of the GAE-LSTMs model has small fluctuations and has achieved good results, which shows that the present invention has excellent and stable reasoning ability. In addition, it can be found that the performance of short-term reasoning is slightly higher than that of long-term reasoning. In contrast, the results of other methods did not follow the same trend. For example, compared with the performance on the first 25% of the test set, the AUC score of Dyngraph2vec on the entire Fbforum test set decreased by 5.01%, indicating that the model performs well in short-term predictions, but its generalization ability is weak due to overfitting problems. In contrast, the AUC score of STGSN on the entire Hypertext09 test set is 3.13% higher than that on the first 25% of the test set, which may be due to underfitting problems during the training process. Therefore, the GAE-LSTMs model has a low deviation while maintaining high accuracy, further proving its stability.
[0157] The number of nodes in the network topology affects the difficulty of extracting potential features from link information. For example, Dyngraph2vec has an AUC score of 97.83% on the Contact dataset (containing 274 nodes), but drops to 82.59% on the Fbforum dataset (containing 899 nodes). This shows that as the size of the network grows, it becomes increasingly difficult to extract potential features and maintain satisfactory performance. However, the present invention consistently shows stable performance, with AUC scores of no less than 94% on most datasets, and even reaching 94.09% on the Fbforum dataset. This further demonstrates the superiority of the present invention.
[0158] In order to study the impact of network change frequency on model prediction performance, the present invention divides the four data sets into snapshots according to different time windows to simulate different network change frequencies, and selects T-SIRGN and STGSN as comparison methods. In order to ensure the reliability of the experimental results, the present invention performs 10 independent runs for each time window and takes the average value as the final result. Figures 4 to 7 The performance fluctuation curve of ER corresponding to each dataset is plotted in . The results show that the performance of the GAE-LSTMs model is better than the baseline method, and the performance on the four datasets is more stable, which also verifies the robustness of the GAE-LSTMs model of the present invention. Specifically, on the Contact dataset, the ER fluctuation range of the GAE-LSTMs model is 2% to 3%, while the performance on other datasets is still excellent, with a fluctuation range of 4% to 6%. In contrast, among the four datasets, especially the Fbforum dataset, the fluctuation range of T-SIRGN and STGSN is relatively large, reaching 11% to 16%. The root cause of this phenomenon may be that the size of the time window affects the amount of information in each snapshot. However, GAE-LSTMs can still capture more subtle features, thereby effectively reducing the impact of the time window on model performance.
[0159] Step S6: Perform network topology reasoning using the target network topology reasoning model.
[0160] Embodiment 2
[0161] The network reasoning system provided by the embodiment of the present invention includes an acquisition unit, a snapshot generation unit, a data set construction unit, a model construction unit, a training unit and a reasoning unit.
[0162] The acquisition unit is configured to acquire dynamic network data.
[0163] The snapshot generation unit is configured to sort all links in the dynamic network data by time, and use windows to divide all the links after time sorting to generate continuous snapshots; wherein, the link refers to the edge between two nodes.
[0164] The data set construction unit is configured to construct a sample data set using Q consecutive snapshots as a sample; wherein the first Q-1 snapshots and their adjacency matrices in each sample are input, and the adjacency matrix of the last snapshot is the expected label.
[0165] The model building unit is configured to build a network topology reasoning model; wherein the network topology reasoning model includes a node feature extraction module, a spatial evolution information extraction module, a fusion module, a timing information extraction module and an output layer; the node feature extraction module is used to extract node features from each input snapshot to obtain a node feature matrix of each snapshot; the spatial evolution information extraction module is used to extract spatial evolution information from the node feature matrix and adjacency matrix of each snapshot to obtain a spatial evolution feature sequence of each snapshot; the fusion module is used to fuse the spatial evolution feature sequences of consecutive Q-1 snapshots to obtain a fused feature matrix; the timing information extraction module is used to extract timing information from the fused feature matrix to obtain an intermediate feature matrix; the output layer is used to predict the intermediate feature matrix to obtain a predicted adjacency matrix.
[0166] The training unit is configured to train and test the network topology reasoning model using the sample data set to obtain a target network topology reasoning model.
[0167] The reasoning unit is configured to perform network topology reasoning using a target network topology reasoning model.
[0168] In some embodiments, the network topology reasoning system may be combined with features of the network topology reasoning method in the first embodiment of the present application, and vice versa, which will not be elaborated here.
[0169] Embodiment 3
[0170] An embodiment of the present invention further provides an electronic device, which includes: a memory, a processor, and a computer program / instructions stored in the memory, and the processor executes the computer program / instructions to implement the network topology reasoning method in the embodiment of the present application.
[0171] Although not shown, the electronic device includes a processor that can perform various appropriate operations and processes according to the programs and / or data stored in the read-only memory (ROM) or the programs and / or data loaded from the storage part into the random access memory (RAM). The processor can be a multi-core processor or can include multiple processors. In some embodiments, the processor can include a general-purpose main processor and one or more special coprocessors, such as a central processing unit, a graphics processing unit (GPU), a neural network processor (NPU), a digital signal processor (DSP), etc. In RAM, various programs and data required for device operation are also stored. The processor, ROM, and RAM are connected to each other via a bus. The input / output (I / O) interface is also connected to the bus.
[0172] The processor and memory are used together to execute the program / instructions stored in the memory. When the program / instructions are executed by the computer, the methods, steps or functions described in the above embodiments can be implemented.
[0173] Although not shown, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the network topology reasoning method in the embodiment of the present application is implemented.
[0174] Readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0175] What is disclosed above is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or modifications within the technical scope disclosed in the present invention, which should be covered within the protection scope of the present invention.
Claims
1. A network topology reasoning method, characterized in that: The reasoning method includes: Get dynamic network data; All links in the dynamic network data are sorted by time, and all links after time sorting are divided by windows to generate continuous snapshots; wherein the link refers to an edge between two nodes; A sample dataset is constructed with Q consecutive snapshots as a sample. The first Q-1 snapshots and their adjacency matrices in each sample are input, and the adjacency matrix of the last snapshot is the expected label. Constructing a network topology reasoning model; wherein the network topology reasoning model includes a node feature extraction module, a spatial evolution information extraction module, a fusion module, a time series information extraction module and an output layer; the node feature extraction module is used to extract node features from each input snapshot to obtain a node feature matrix of each snapshot; the spatial evolution information extraction module is used to extract spatial evolution information from the node feature matrix and adjacency matrix of each snapshot to obtain a spatial evolution feature sequence of each snapshot; the fusion module is used to fuse the spatial evolution feature sequences of consecutive Q-1 snapshots to obtain a fused feature matrix; the time series information extraction module is used to extract time series information from the fused feature matrix to obtain an intermediate feature matrix; the output layer is used to predict the intermediate feature matrix to obtain a predicted adjacency matrix; Using the sample data set to train and test the network topology reasoning model to obtain a target network topology reasoning model; The target network topology reasoning model is used to perform network topology reasoning.
2. The network topology reasoning method according to claim 1, characterized in that: The node feature extraction module is used to extract node features from each input snapshot, specifically including: Use the Node2Vec algorithm to extract node features from each input snapshot. The specific formula is: ; ; ; ; in, represents the probability of walking between the i-th node and the j-th node in the snapshot; represents the number of links experienced between the i-th node and the j-th node in the snapshot; p and q represent parameters that control the number of exploration steps; Indicates the number of nodes is And the number of links is A snapshot of; RandomWalk represents the random walk algorithm; Represents a node is the walking sequence of the starting node, ; Word2vec represents word embedding algorithm; Represents the word embedding vector; Concat means concatenating the word embedding vectors row by row; C represents the node feature matrix of the snapshot.
3. The network topology reasoning method according to claim 1, characterized in that: The spatial evolution information extraction module includes a plurality of multi-head graph attention networks connected in sequence and an ordinary differential equation module provided at the output ends of the plurality of multi-head graph attention networks; Each multi-head graph attention network is used to extract features from the discrete space feature matrix output by the previous multi-head graph attention network and the adjacency matrix of the snapshot to obtain the discrete space feature matrix of the multi-head graph attention network; wherein, the first multi-head graph attention network is used to extract features from the node feature matrix and adjacency matrix of each snapshot to obtain the discrete space feature matrix of the first multi-head graph attention network; The ordinary differential equation module is used to perform continuous spatial feature extraction on discrete spatial feature matrices output by multiple multi-head graph attention networks to obtain a spatial evolution feature sequence.
4. The network topology reasoning method according to claim 3, characterized in that: Each multi-head graph attention network is used to extract features from the discrete space feature matrix output by the previous multi-head graph attention network and the adjacency matrix of the snapshot. The specific formula is: , ; ; ; ; ; in, represents the matrix obtained by linearly transforming the discrete spatial feature matrix output by the m-1th multi-head graph attention network; C represents the node feature matrix of the snapshot; Represents trainable weight parameters; represents the attention coefficient of the kth attention head; LeakyReLU represents the leaky rectified linear unit; Represents the adjacency matrix of the snapshot; the superscript T represents the matrix transpose; Representation Matrix The feature vector of the i-th node in; Representation Matrix The feature vector of the jth node in; Indicates the splicing symbol; represents the normalized attention coefficient of the kth attention head; N i Representation Matrix The set of neighbor nodes of the i-th node; represents the feature matrix updated by the kth attention head; ELU represents the exponential linear unit; represents the discrete spatial feature matrix output by the m-th multi-head graph attention network; K represents the number of attention heads in each multi-head graph attention network.
5. The network topology reasoning method according to claim 3, characterized in that: The ordinary differential equation module is used to extract continuous spatial features from the discrete spatial feature matrices output by multiple multi-head graph attention networks. The specific formula is: ; ; ; in, represents the attention calculation function of the m-th multi-head graph attention network; K represents the number of attention heads in the m-th multi-head graph attention network; N i Representation Matrix The set of neighbor nodes of the i-th node; represents the matrix obtained by linearly transforming the discrete spatial feature matrix output by the m-1th multi-head graph attention network; represents the normalized attention coefficient of the kth attention head in the mth multi-head graph attention network; Represents the discrete spatial feature matrix output by the m-1th multi-head graph attention network; Represents a trainable parameter tensor; Represents the discrete spatial feature matrix output by the m-th multi-head graph attention network; represents an ordinary differential equation; M represents the number of multi-head graph attention networks; Represents a compound operator; represents a nonlinear activation function; A sequence of spatially evolving features representing snapshots; represents the initial eigenvector; represents the granularity of solving ordinary differential equations; represents the granularity variable; Indicates The discrete spatial feature matrix output by a multi-head graph attention network.
6. The network topology reasoning method according to claim 1, characterized in that: The time series information extraction module includes a plurality of LSTM units, each LSTM unit is used to extract features from the normalized result of the hidden state at the current moment output by the previous LSTM unit, so as to obtain the hidden state at the current moment of the LSTM unit; The first LSTM unit is used to extract features from the fused feature matrix to obtain the current hidden state of the first LSTM unit; the current hidden state output by the last LSTM unit is the intermediate feature matrix; Among them, the specific calculation formula for the normalized result of the hidden state at the current moment output by each LSTM unit is: ; in, Represents the current hidden state of the LSTM unit output; Represents the normalized result of the hidden state output by the LSTM unit at the current moment; and denote the scaling factor and the offset factor respectively; and Respectively represent the current hidden state The mean and variance of Represents a constant used to prevent division by zero errors.
7. The network topology reasoning method according to any one of claims 1 to 6, characterized in that: Using the sample data set to train the network topology reasoning model specifically includes: Inputting the first Q-1 snapshots of each sample and its adjacency matrix into the network topology reasoning model to obtain a predicted adjacency matrix of the network topology reasoning model; The loss error between the predicted adjacency matrix and the expected label of the sample is calculated. The specific calculation formula is: ; in, Represents loss error; N e represents the number of links in the predicted adjacency matrix or expected label, including existing and non-existing links; V represents the set of nodes in the predicted adjacency matrix or expected label; represents the probability that there is a link between the i-th node and the j-th node in the expected label; Represents the probability of a link between the i-th node and the j-th node in the predicted adjacency matrix; Adjusting the parameters of the network topology reasoning model according to the loss error to implement the training of the network topology reasoning model; Iterate the training until the training termination condition is reached.
8. A network topology reasoning system, characterized in that: The reasoning system comprises: an acquisition unit, configured to acquire dynamic network data; A snapshot generation unit is configured to sort all the links in the dynamic network data according to time, and divide all the links after time sorting by using windows to generate continuous snapshots; wherein the link refers to an edge between two nodes; The data set construction unit is configured to construct a sample data set with consecutive Q snapshots as a sample; wherein the first Q-1 snapshots and their adjacency matrices in each sample are input, and the adjacency matrix of the last snapshot is the expected label; A model building unit is configured to build a network topology reasoning model; wherein the network topology reasoning model includes a node feature extraction module, a spatial evolution information extraction module, a fusion module, a time series information extraction module and an output layer; the node feature extraction module is used to extract node features from each input snapshot to obtain a node feature matrix of each snapshot; the spatial evolution information extraction module is used to extract spatial evolution information from the node feature matrix and adjacency matrix of each snapshot to obtain a spatial evolution feature sequence of each snapshot; the fusion module is used to fuse the spatial evolution feature sequences of consecutive Q-1 snapshots to obtain a fused feature matrix; the time series information extraction module is used to extract time series information from the fused feature matrix to obtain an intermediate feature matrix; the output layer is used to predict the intermediate feature matrix to obtain a predicted adjacency matrix; A training unit is configured to train and test the network topology reasoning model using the sample data set to obtain a target network topology reasoning model; The reasoning unit is configured to perform network topology reasoning using the target network topology reasoning model.
9. An electronic device comprising a memory, a processor, and a computer program / instruction stored in the memory, characterized in that: The processor executes the computer program / instructions to implement the network topology reasoning method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instruction is executed by a processor, the network topology reasoning method as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method for predicting dynamic network link by using spiking neural network
CN117035013A
Dynamic network topology change detection method and system based on edge tight structure embedding
CN117478361A
Method for predicting social network link by using spiking neural network
CN118134017A
Adaptive neural networks for node classification in dynamic networks
US20200366690A1